• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Adding custom atribute into XML

Adorius Black

Advanced OT User
Joined
Mar 31, 2020
Messages
304
Solutions
3
Reaction score
180
Hi OTlanders. I would like to ask if its safe to add into XML custom atribute. Here is example:

data/spells/spells.xml
XML:
<instant group="healing" webpageid="1" image="images/spells/magic_patch.png" spellid="172" name="Magic Patch" words="exura infir" lvl="1" mana="6" aggressive="0" prem="0" selftarget="1" exhaustion="1000" groupcooldown="1000" needlearn="0" script="healing/magic patch.lua">

I added these atributes:
webpageid="1"
image="images/spells/magic_patch.png"


It looks like no error in server console and also when i use this spell ingame no error in console. I want these atributes for my webpage, where I read data from this document. Here is example what I mean:

pages/spells.php

PHP:
$stages = new DOMDocument();
    if($stages->load($config['site']['serverPath'] . 'data/spells/spells.xml'))
    {
    foreach($stages->getElementsByTagName('instant') as $stage)
    {  
        if($stage->hasAttribute('group'))
        {
            $main_content .= '
    <div class="flex-item">
        <a>'.$stage->getAttribute('name').'</a><br>
        <a>'.$stage->getAttribute('webpageid').'</a><br>
        <img scr="'.$stage->getAttribute('image').'">
       ...
    }


I just want to know if this can't have an unexpected effect on server. If I must add these atributes also in source or its not necessary. I am not editing source so for is source one big unknown. possibly what do I need to add and where in the source if its necessary.
 
Last edited:
Back
Top