• 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!

[Znote AAC] Advanced Spells v2

Having the same issue.
Parse error: syntax error, unexpected ',' in C:\xampp1\htdocs\spell.php on line 7
 
TFS 1.0 fix
after:
Code:
if(config('TFSVersion') == 'TFS_03')
            {
                $string .= (($value['value'] == 'conjureRune') ? '\'Rune\'' : '\'Instant\'');
            }
add:
Code:
            if(config('TFSVersion') == 'TFS_10') {
                $string .= "'{$key}'";
            }

Hate to bump, but since no one decided to be helpful, I'll go ahead and state that this right here fixes the line 7 error. This needs to be added in general.php and then you need re-run the spell.xml upload in admin control panel, it will fix the bug.
 
PHP:
 <?php
require_once 'engine/init.php'; include 'layout/overall/header.php'; echo '<h1>Spells</h1>';
if(file_exists('spell.php')) { require_once 'spell.php'; ?>

<form action='spells.php' method='post'>
    <table>
        <tr class="yellow">
            <td colspan=4><b>Spell Search</b></td></tr>
            <tr class="yellow">
                <?php if($show_spells_groups) {
                echo'<td width=25%><b>vocation</b></td>
                    <td width=25%><b>group</b></td>
                    <td width=25%><b>type</b></td>
                    <td width=25%><b>premium</b></td>';}
                else {
                echo'<td width=40%><b>vocation</b></td>
                    <td width=30%><b>type</b></td>
                    <td width=30%><b>premium</b></td>';}?>
            </tr>
            <tr>
                <td valign='top'>
                    <input type='radio' name='vocation' value='vall' checked> all<br>
                    <?php
                    foreach(config('vocations') as $id => $vocation)
                    {
                        if($id > 0)
                        {
                            echo "<input type='radio' name='vocation' value='".$vocation."'> ".$vocation."<br>";
                        }
                    }
                    ?>
                </td>
                <?php
                if($show_spells_groups) echo"
                    <td valign='top'>
                        <input type='radio' name='_group' value='gall' checked> all<br>
                        <input type='radio' name='_group' value='Attack'> attack<br>
                        <input type='radio' name='_group' value='Healing'> healing<br>
                        <input type='radio' name='_group' value='Support'> support</td>"; ?>
                <td valign='top'>
                    <input type='radio' name='_type' value='tall' checked> all<br>
                    <input type='radio' name='_type' value='Instant'> instant<br>
                    <input type='radio' name='_type' value='Rune'> rune
                </td>
                <td valign='top'>
                    <input type='radio' name='_premium' value='pall' checked> all<br>
                    <input type='radio' name='_premium' value='no'> no<br>
                    <input type='radio' name='_premium' value='yes'> yes
                </td>
            </tr>
            <tr>
                <td>sort by:
                    <select name='sort'>
                        <option value='name' selected>name
                        <option value='words'>words
                        <?php if($show_spells_groups) echo "<option value='group' >group"; ?>
                        <option value='type' >type
                        <option value='level' >exp lvl
                        <option value='mana' >mana
                        <option value='premium' >premium
                    </select>
                </td>
                <td colspan='3'>
                    <input type='submit' name='submit'>
                </td>
            </tr>
    </table>
</form>
<table>
    <tr class="yellow">
        <td><b>Name</b></td>
        <?php if($show_spells_groups) echo '<td><b>Group</b></td>'; ?>
        <td><b>Type</b></td>
        <td><b>Exp Lvl</b></td>
        <td><b>Mana</b></td>
        <td><b>Premium</b></td>
        </span>
    </tr>

<?php
    @$sort = $_REQUEST['sort'];
    if(!isset($sort)) $sort = 'name';
   
    @$vocation = $_REQUEST['vocation'];
    if(!isset($vocation)) $vocation = 'vall';
   
    if($show_spells_groups)
    {
        @$group = $_REQUEST['_group'];
        if(!isset($group)) $group = 'gall';
    }
   
    @$type = $_REQUEST['_type'];
    if(!isset($type)) $type = 'tall';
   
    @$premium = $_REQUEST['_premium'];
    if(!isset($premium)) $premium = 'pall';
   
    $order = array();
    foreach($spells as $key => $row)
    {
        $order[$key] = $row[$sort];
    }
    array_multisort($order, SORT_ASC, $spells);
   
    foreach($spells as $spell) {
        if($vocation != 'vall')
        {
            if(!in_array($vocation, $spell['vocation'])) continue;
        }
        if($show_spells_groups && $group != 'gall')
        {
            if($spell['group'] != $group) continue;
        }
        if($type != 'tall')
        {
            if($spell['type'] != $type) continue;
        }
        if($premium != 'pall')
        {
            if($spell['premium'] != $premium) continue;
        }
    ?>
    <tr>
        <td><?php echo '<b>'.$spell['name'].'</b> ('.$spell['words'].')'; ?></td>
        <?php if($show_spells_groups) echo '<td>'.$spell['group'].'</td>'; ?>
        <td><?php echo $spell['type']; ?></td>
        <td><?php echo $spell['level']; ?></td>
        <td><?php echo $spell['mana']; ?></td>
        <td><?php echo $spell['premium']; ?></td>
    </tr>
<?php } echo '</table>'; ?>
<?php } else { echo 'This page has not been configured yet.'; };
include 'layout/overall/footer.php'; ?>

This is an updated Spells.php code for those of you who would like the search function at the top. Makes more sense to me.
 
After uploading the spells, the Spells Menu (left side) doesn't show up on the website.

I'm using tibiaCom layout, anyway to fix this?

Thank you! :)
 
There still seems to be a bug with this. When you hit a certain vocation, it will load all spells, and not just those of selected vocation. Has anyone found a solution to this?
 
now I get this error on line 7
Parse error: syntax error, unexpected ',' in C:\xampp\htdocs\spell.php on line 7

and on line 7 is written
Code:
<?php if($show_spells_groups) echo '<td><b>Group</b></td>'; ?>

Now I am using TFS 1.2
any idea why get this error?
thanks and regards
 
im trying to update the spells but i get these errors im using znote 1.5


Notice
: Undefined index: from in C:\xampp\htdocs\admin.php on line 111


Update spells from file:
Successfully fetched spells.xml!
Temporal used file: C:\xampp\tmp\phpA8AA.tmp
Old spells were truncated!

Fatal error: Cannot redeclare getClock() (previously declared in C:\xampp\htdocs\config.php:45) in C:\xampp\htdocs\config.php on line 53
 
Damn it didnt worked for me, maybe you need some kind of permission in order to let it write (linux)?
 
error on website pls help
Code:
Notice: Array to string conversion in C:\xampp\htdocs\spells.php on line 92
Array

Notice: Array to string conversion in C:\xampp\htdocs\spells.php on line 92


spells.php

Code:
<td valign='top'>
                    <input type='radio' name='vocation' value='vall' checked> all<br>
                    <?php
                    foreach(config('vocations') as $id => $vocation)
                    {
                        if($id > 0)
                        {
                            echo "<input type='radio' name='vocation' value='".$vocation."'> ".$vocation."<br>";
                        }
 
  1. <td valign='top'>
  2. <input type='radio' name='vocation' value='vall' checked> all<br>
  3. <?php
  4. foreach(config('vocations') as $id => $vocation)
  5. {
  6. if($id > 0)
  7. {
  8. line92 echo "<input type='radio' name='vocation' value='".$vocation."'> ".$vocation."<br>"; line92
  9. }
 
Back
Top