Jump to content
MakeWebGames

Fatal error: Call to undefined method headers::menuarea()


ChrisRowe

Recommended Posts

Fatal error: Call to undefined method headers::menuarea() in /home2/rulethes/public_html/globals.php on line 112

I've made a new layout for my game, and exported it, wrote the XHTML, and now im trying to implement MCCodes into it.

Problem is, i'm getting that error, in my navigation menu when i upload.

Can anyone help me please?

 


<?php

class headers {
function startheaders() {
global $ir, $set, $c;

echo <<<EOF

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{$set['game_name']} - Massive Multiplayer Online Role Playing Game </title>
<link rel="stylesheet" href="css/mainstyles.css" type="text/css" />

</head>
<body>
   <div id="container"> <!-- whole site wrap-->
	<div id="header"> <!-- header // banner -->

	</div>

       <div id="infofeeds">
           <table id="Table_01" width="231" border="0" cellpadding="0" cellspacing="0">
           <tr>
           <td colspan="5">
           <img id="infofeed_01" src="images/infofeed_01.png" width="231" height="38" alt="" /></td>
           </tr>
           <tr>
           <td rowspan="2">
           <img id="infofeed_02" src="images/infofeed_02.png" width="84" height="96" alt="" /></td>
           <td>
           <img id="infofeed_03" src="images/infofeed_03.png" width="46" height="55" alt="" /></td>
           <td rowspan="2">
           <img id="infofeed_04" src="images/infofeed_04.png" width="22" height="96" alt="" /></td>
           <td>
           <img id="infofeed_05" src="images/infofeed_05.png" width="48" height="55" alt="" /></td>
           <td rowspan="2">
           <img id="infofeed_06" src="images/infofeed_06.png" width="31" height="96" alt="" /></td>
           </tr>
           <tr>
           <td>
           <img id="infofeed_07" src="images/infofeed_07.png" width="46" height="41" alt="" /></td>
           <td>
           <img id="infofeed_08" src="images/infofeed_08.png" width="48" height="41" alt="" /></td>
           </tr>
           </table>

       </div>


	<div id="userstats"> <!-- user stats box -->

       <ul>
EOF;
}

function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ?  $_SERVER['HTTP_X_FORWARDED_FOR'] :  $_SERVER['REMOTE_ADDR'];
$db->query("UPDATE `users` SET `laston` = unix_timestamp(), `lastip` = '$IP' WHERE `userid` = $userid");
if(!$ir['email'])
{
global $domain;
die ("<div id='mainContentParent'>Your account may be broken. Please mail help@{$domain} stating your username and player ID.</div>");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
print "You lost all your EXP for running from the fight.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
$d="";
$u=$ir['username'];
if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; }
$gn=""; 
global $staffpage;


echo <<<OUT

             <li><b>Name: </b> $gn{$u} [{$ir['userid']}] $d</li>
             <li><b>Money:</b> {$fm} </li>
             <li><b>Level:</b> {$ir['level']} </li>
             <li><b>{$set['game_currency']}:</b> {$ir['crystals']}</b> </li>
             <hr />

		  <li><b>Energy:</b> {$ir['energy']}/{$ir['maxenergy']} <br /><img src=greenbar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10></li>
             <li><b>Will:</b> {$ir['will']}/{$ir['maxwill']} <br /><img src=bluebar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10></li>
             <li><b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']} <br /><img src=yellowbar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10></li>
             <li><b>Experience: {$experc}% </b><br /><img src=navybar.png width=$experc height=10><img src=redbar.png width=$exopp height=10></li>
             <li><b>Health:</b> {$hpperc}% <br /><img src=greenbar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10></li>
		  <br />
		  <li><b><a href="logout.php">Logout</a></b></li>

       </ul>


	</div>


<div id="nav">   <!-- navigation bar on left side -->

OUT;

function menuarea()
{
global $db,$c,$userid, $set;
include "mainmenu.php";
global $ir,$c;
if($ir['hospital'])
{
print "<div id='ContentMainParent'><font color='red'><b>NOTE:</b></font> You are currently in hospital for {$ir['hospital']} minutes.</div><br/><br />";
}
if($ir['jail'])
{
print "<div id='ContentMainParent'><font color='red'><b>NOTE:</b></font> You are currently in jail for {$ir['jail']} minutes.</div><br/><br />";
}
{
print "</div><div id='mainContentParent'>";
}
}
function smenuarea()
{
global $db,$c,$userid, $set;
include "smenu.php";
global $ir,$c;
print "</div><div id='mainContentParent'>";
}
function endpage()
{
echo <<<OUT

							<div id="mainFooter">
							</div> <!-- footer and copywrite -->








</div>  <!-- end of container div-->




</body>




</html>

OUT;
}
}
}
?>

Edited by ChrisRowe
Adding the full error
Link to comment
Share on other sites

on line 116 add } and delete the } from line 170

You was nearly there you just forgot to close out the userdata function...

also on line 61 change

$IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];

to

$IP = $_SERVER['REMOTE_ADDR'];

This should prevent Firefox scripting

Edited by illusions
Link to comment
Share on other sites

on line 116 add } and delete the } from line 170

You was nearly there you just forgot to close out the userdata function...

also on line 61 change

$IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];

to

$IP = $_SERVER['REMOTE_ADDR'];

This should prevent Firefox scripting

 

I COULD KISS YOU ILLUSIONS!

Been ripping my hair out for days! i hate PHP lol

Link to comment
Share on other sites

function menuarea()
{
global $db,$c,$userid, $set;
include "mainmenu.php";
global $ir,$c;
if($ir['hospital'])
{
print "<div id='ContentMainParent'><font color='red'><b>NOTE:</b></font> You are currently in hospital for {$ir['hospital']} minutes.</div>";
}
if($ir['jail'])
{
print "<div id='ContentMainParent'><font color='red'><b>NOTE:</b></font> You are currently in jail for {$ir['jail']} minutes.</div>";
}
{
print "</div><div id='mainContentParent'>";
}
}

 

That function seems wrong to me, try adding an else before if($ir['jail']) and an else before the { print "</div><div id='mainContentParent'>"; } }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...