TinyPortal

Development => Support => Topic started by: Meow Doom on October 23, 2008, 06:26:04 PM

Title: Odd error...
Post by: Meow Doom on October 23, 2008, 06:26:04 PM
Good afternoon, I hope I'm posting this in the right place!

I'm getting this:

8: Use of undefined constant any - assumed 'any'
File: /homepages/36/d262088157/htdocs/forum/Themes/default/TPortal.template.php (eval?)
Line: 43

only when visiting the front page, forums and admin section of my site. (At least I know its one of those places!) Any idea what might be causing it or how to fix it. I searched, but all I found was mention of a hack from 2006. lol

Thanks for help in advance!

P.S. No I haven't edited any coding at all. :)
Title: Re: Odd error...
Post by: Meow Doom on October 23, 2008, 07:04:34 PM
quite a bit of views and no one?  :o
Title: Re: Odd error...
Post by: G6Cad on October 23, 2008, 09:47:23 PM
Do you have any block or article with custom code or adds  showing on only those pages ?
Title: Re: Odd error...
Post by: Meow Doom on October 24, 2008, 01:38:26 AM
Yes, I do.

//***********TP: WOW RECRUITMENT BLOCK BY MOOCAT****************
//Version 0.1                                                  *
//                                                             *
//Requires wz_tooltip on your server inside folder "wz_tooltip"*
//in your forum directory.                                     *
//wz_tooltip can be found at:                                  *
//http://www.walterzorn.com/tooltip/tooltip_e.htm              *
//                                                             *
//Enjoy. Modify the code as you see fit.                       *
//**************************************************************
global $user_info;
//*******************CONFIGURATION SECTION*********************
//--Individual Class Need Rating--//
//Place the need for each class to the right of the equals sign.
//0 = closed
//1 = low
//2 = med
//3 = high
//4 = open (just in case people still like the open/closed wording)
$druid_need = 1;
$hunter_need = 2;
$mage_need = 2;
$paladin_need = 0;
$priest_need = 1;
$rogue_need = 1;
$shaman_need = 3;
$warlock_need = 1;
$warrior_need = 0;


//--Quantity needed of each spec!--//
//To the right of the = sign, type the # you need of that spec!
//Here you can be much more specific than simply "High," "Medium," or "Low."
//Druid
$feral_druid = 0;
$resto_druid = 1;
$balance_druid = 1;
//Hunter
$needed_hunter = 2;
//Mage
$needed_mage = 2;
$arcane_mage = any;
$fire_mage = any;
$frost_mage = any;

//Paladin
$holy_paladin = 0;
$prot_paladin = 0;
$ret_paladin =  0;
//Priest
$holy_priest = 1;
$shad_priest = 1;
//Rogue
$needed_rogue = 1;
//Shaman
$resto_sham = 1;
$enhance_sham = 1;
$elemental_sham = 1;
//Warlock
$needed_warlock = 1;
//Warrior
$prot_war = 0;
$arms_war = 0;
$fury_war = 0;
//--COLORS--//
/*
$closed_color = 'red';
$low_color = 'green';
$medium_color = 'orange';
$high_color = 'red';
$open_color = 'green';
*/


//--LOCALIZATION--//
//LANGUAGE VARIABLES FOR EACH SPEC
$feral_spec = 'Feral:';
$resto_spec = 'Restoration:';
$balance_spec = 'Balance:';
$hunter_spec = 'Needed:';
$mage_spec = 'Needed:';
$arcane_spec = 'Arcane:';
$fire_spec = 'Fire:';
$frost_spec = 'Frost:';
$holy_spec = 'Holy:';
$shadow_spec = 'Shadow:';
$prot_spec = 'Protection:';
$ret_spec = 'Retribution:';
$rogue_spec = 'Needed:';
$enhance_spec = 'Enhancement:';
$elemental_spec = 'Elemental:';
$warlock_spec = 'Needed:';
$arms_spec = 'Arms:';
$fury_spec = 'Fury:';

//************************END CONFIG****************************


//*************************FUCNTIONS****************************

function printClassStatus($className)
{
switch($className)
{
  case 0: return '<font color="red">Closed</font>';
  case 1: return '<font color="green">Low</font>';
  case 2: return '<font color="orange">Medium</font>';
  case 3: return '<font color="red">High</font>';
  case 4: return '<font color="green">Open</font>';
}
}
function displayTT($class="",$specName1="",$spec1="",$specName2="",$spec2="",$specName3="",$spec3="",$specName4="",$spec4="")
{
return '
<script type="text/javascript" src="./wz_tooltip/wz_tooltip.js"></script>
<a href="javascript:void(0);" onmouseover="Tip(\'<table width=100%><tr><td><font color=black>' .$specName1 .  '</font></td><td><font color=black>' . $spec1 . '</font></td></tr><tr><td><font color=black>' . $specName2 . '</font></td><td><font color=black>' . $spec2 . '</font></td></tr><tr><td><font color=black>' . $specName3 . '</font></td><td><font color=black>' . $spec3 . '</font></td></tr><tr><td><font color=black>' . $specName4 . '</font></td><td><font color=black>' . $spec4 . '</font></td></tr></table>\')" onmouseout="UnTip()">' . printClassStatus($class) . '</a>';
}

//**********************END FUNCTIONS****************************


echo'
<center>Hover over the recruitment level for details</center>

<table width="100%" border="0" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/druid_icon.gif" /></td>
     <td class="tbcphp">Druid</font></td>
            <td align ="right" valign="center"><strong>' . displayTT($druid_need,$resto_spec,$resto_druid,$feral_spec,$feral_druid,$balance_spec,$balance_druid) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/hunter_icon.gif" /></td>
      <td class="tbcphp">Hunter</td>
            <td align ="right" valign="center"><strong>' . displayTT($hunter_need,$hunter_spec,$needed_hunter) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/mage_icon.gif" /></td>
     <td class="tbcphp">Mage</td>
            <td align ="right" valign="center"><strong>' . displayTT($mage_need,$mage_spec,$needed_mage,$arcane_spec,$arcane_mage,$fire_spec,$fire_mage,$frost_spec,$frost_mage) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/paladin_icon.gif" /></td>
     <td class="tbcphp">Paladin</td>
            <td align ="right" valign="center"><strong>' . displayTT($paladin_need,$holy_spec,$holy_paladin,$prot_spec,$prot_paladin,$ret_spec,$ret_paladin) . '</a></strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/priest_icon.gif" /></td>
     <td class="tbcphp">Priest</td>
            <td align ="right" valign="center"><strong>' . displayTT($priest_need,$holy_spec,$holy_priest,$shadow_spec,$shad_priest) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/rogue_icon.gif" /></td>
     <td class="tbcphp">Rogue</td>
            <td align ="right" valign="center"><strong>' . displayTT($rogue_need,$rogue_spec,$needed_rogue) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/shaman_icon.gif" /></td>
     <td class="tbcphp">Shaman</td>
            <td align ="right" valign="center"><strong>' . displayTT($shaman_need,$resto_spec,$resto_sham,$elemental_spec,$elemental_sham,$enhance_spec,$enhance_sham) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/warlock_icon.gif" /></td>
     <td class="tbcphp">Warlock</td>
            <td align ="right" valign="center"><strong>' . displayTT($warlock_need,$warlock_spec,$needed_warlock) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
            <td width="10%" class="tbcphp"><img alt="" src="wow/warrior_icon.gif" /></td>
     <td class="tbcphp">Warrior</td>
            <td align ="right" valign="center"><strong>' . displayTT($warrior_need,$prot_spec,$prot_war,$arms_spec,$arms_war,$fury_spec,$fury_war) . '</strong></td>
        </tr>
    </tbody>
</table>
<table width="100%" height="8">
    <tbody>
        <tr>
             <td class="tbcphp"><center>Please register on the forums before applying.</center>
             </td>
        </tr>
        <tr>';
if($user_info['is_guest'])
{
echo'
            <td class="tbcphp"><br />
            <div align="center"><a href="/index.php?action=register">Please Register before Applying</a><br />
            </div>
            </td>';
}
else
{
echo'
            <td> <br />
            <div align="center"><a href="http://*********">Apply Here</a><br />
            </div>
            </td>';
}
echo'
        </tr>
    </tbody>
</table>
</font>
';
Title: Re: Odd error...
Post by: Meow Doom on October 24, 2008, 01:42:27 AM
I haven't finished adding the links in, could that be it?
Title: Re: Odd error...
Post by: IchBin on October 24, 2008, 01:49:14 AM
$arcane_mage = any;
$fire_mage = any;
$frost_mage = any;

Anytime you put alpha characters in PHP variables, its considered a string. In PHP, strings must have quotes around them or will error just like you are pointing out. Its your code above that is at fault. Any quotes around "any" to make it go away.
Title: Re: Odd error...
Post by: Meow Doom on October 24, 2008, 01:55:06 AM
Ahh...that sounds...obvious. I'm sorry for my newbish mistake. I'm sure you guys get that alot. But just so I don't have to do that again turn the above into:

$arcane_mage = "any";
$fire_mage = "any";
$frost_mage = "any";


like that?

And thank you very much for both of your help in pin-pointing this!  ;D
Title: Re: Odd error...
Post by: IchBin on October 24, 2008, 02:06:46 AM
Yep. If your'e not using those yet, you can just leave them blank as well. $variable_name="";
Title: Re: Odd error...
Post by: Meow Doom on October 24, 2008, 03:16:14 AM
Thank you very much again! It worked like a charm, of course.
Title: Re: Odd error...
Post by: Ianedres on October 24, 2008, 04:00:48 AM
$ichFoo++;  :buck2:
Title: Re: Odd error...
Post by: G6Cad on October 24, 2008, 07:59:07 AM
A good morning laugh, thank you ianedres  :2funny:  :up:
Title: Re: Odd error...
Post by: Meow Doom on October 24, 2008, 03:04:04 PM
Quote from: Ianedres on October 24, 2008, 04:00:48 AM
$ichFoo++;  :buck2:

The support here is so kind. :)
Title: Re: Odd error...
Post by: IchBin on October 24, 2008, 06:20:35 PM
Quote from: Meow Doom on October 24, 2008, 03:04:04 PM
Quote from: Ianedres on October 24, 2008, 04:00:48 AM
$ichFoo++;  :buck2:

The support here is so kind. :)
He's just being nice to me. He really knows that $hisfoo > $myfoo :D
Title: Re: Odd error...
Post by: Ianedres on October 24, 2008, 06:23:10 PM
 :laugh: I just like having a good time with it all.
Title: Re: Odd error...
Post by: Meow Doom on October 24, 2008, 08:21:49 PM
As long as fun is had!  ;D