Jump to content
MakeWebGames

[SOLVED] Header error


War_Hero

Recommended Posts

 

Hi all. Hope you're all OK.

I'm trying to get a new layout to work, and not succeeding. "/ I downloaded a new layout (legally, I might add, haha) from http://www.senkouryu.net/index.php?id=1. I then tried implementing that as my layout. I didn't know how to do properly, but gave it a go. I've not done any sort of templates, etc before, so I did it wrong. Below is the header script:

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 ('Your Account May Be Broken. Please Contact Your E-Mail Stating Your Username And User ID.');exit;}if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])){print "You Lost All Your EXP For Running From A Fight Like A Coward.";$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='';$_GET['ID'] = abs(@intval($_GET['ID']));$_GET['viewforum'] = abs(@intval($_GET['viewforum']));$_GET['viewtopic'] = abs(@intval($_GET['viewtopic']));$stmr='';$u=$ir['username'];if($ir['user_level'] > 1) { $stmr=""; };if($ir['donatordays']) { $u = "{$ir['username']}';$d='"; }
$gn=''; global $staffpage;if($ir['fedjail']){$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");$r=$db->fetch_row($q);die("You Have Been Dragged Off To {$set['game_name']} Federal Prision For {$r['fed_days']} Day(s).
Reason: {$r['fed_reason']}");}print <<";}
function endpage() {global $db;print <
function menuarea() {include "mainmenu.php";global $ir, $c;print "Nav Bar";}
function smenuarea() {include "smenu.php";global $ir, $c;print "Staff Bar";}
function maincontent() {global $ir, $c, $db; print "Layout Info         Layout Name: Desert Storm V1
       Type: Tables, Div
       Iframes: NO
       Download Requirements:
        - No requirments needed.
       Features:
- A Desert theme
       Description:
        This simple layout is practice for me, a practice with color combinations that I haven\'t use, like this, a yellow-brownish-sand-like, for a desert theme :)Copyright & Final CommentsThis layout is copyrighted by SenkouRyu, don\'t edit the copyright info anywhere!
Be sure to check http:\//www.senkouryu.net for more layouts like this or even better ones!    OUT1;}?>

When I log into my site, I then get this error:

Fatal error: Call to undefined method headers::userdata() in /usr/home/******/domains/**********/public_html/globals.php on line 86

These are the lines above and below line 86 in globals:

check_level();$h = new headers;$h->startheaders();$fm=money_formatter($ir['money']);$cm=money_formatter($ir['crystals'],'');$lv=date('F j, Y, g:i a',$ir['laston']);global $atkpage;if($atkpage){$h->userdata($ir,$lv,$fm,$cm,0);}else{$h->userdata($ir,$lv,$fm,$cm);}global $menuhide;if(!$menuhide){$h->menuarea();}$h->maincontent();
?>

Could someone please explain to me why this error is occurring and how I can fix it? Any help will be highly appreciated.

Thank you,

Emlyn

EDIT: I apologise for the way in which the code has been presented, that isn't my fault. "/

Link to comment
Share on other sites

I can see a fair few errors with this But like Alabamahit said its hard to read as its all bunched up try turning WRAP off on your text editor...

from what i can see your errors are

Reason: {$r['fed_reason']}");}print <<";}

change to

Reason: {$r['fed_reason']}");

}

and

function endpage() {global $db;print <

change to

function endpage()

{

global $db;

Thats all i can see at moment

also change

$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])

? $_SERVER['HTTP_X_FORWARDED_FOR']

: $_SERVER['REMOTE_ADDR'];

to

$IP = $_SERVER['REMOTE_ADDR'];

Link to comment
Share on other sites

<?PHP
EOF;}} // <<< NOT SURE IF THIS IS PART OF YOUR SCRIPT BUT IF NOT JUST REMOVE IT..
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = $_SERVER['REMOTE_ADDR'];
$db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid");
if(!$ir['email'])
{
global $domain;
die ("Your account may be broken. Please mail help@{$domain} stating your username and player ID.");
}
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="";
$_GET['ID'] = abs(@intval($_GET['ID']));
$_GET['viewforum'] = abs(@intval($_GET['viewforum']));
$_GET['viewtopic'] = abs(@intval($_GET['viewtopic']));
$stmr='';
$u=$ir['username'];
if($ir['user_level'] > 1) 
{ 
$stmr=""; 
};
if($ir['donatordays']) { $u = "{$ir['username']}';
$d='"; }
$gn=''; 
global $staffpage;
if($ir['fedjail'])
{
$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");
$r=$db->fetch_row($q);
die("You Have Been Dragged Off To {$set['game_name']} Federal Prision For {$r['fed_days']} Day(s).
Reason: {$r['fed_reason']}");
}
function endpage() 
{
global $db;
function menuarea() 
{include "mainmenu.php";
global $ir, $c;
print "Nav Bar";
}
function smenuarea() 
{include "smenu.php";
global $ir, $c;
print "Staff Bar";
}
function maincontent() 
{
global $ir, $c, $db; 
print "Layout Info         Layout Name: Desert Storm V1
       Type: Tables, Div
       Iframes: NO
       Download Requirements:
        - No requirments needed.
       Features:
- A Desert theme
       Description:
        This simple layout is practice for me, a practice with color combinations that I havent use, like this, a yellow-brownish-sand-like, for a desert theme :)Copyright & Final CommentsThis layout is copyrighted by SenkouRyu, dont edit the copyright info anywhere!
Be sure to check [url]http://www.senkouryu.net[/url] for more layouts like this or even better ones "
}
?>
Link to comment
Share on other sites

Thank you guys for your help. :) I really appreciate it. I've managed to get it to work...well, sort of. The template is visible, but the content of the page is not displayed where I would like it to go. "/

This is what it looks like: layoutgc.jpg

I don't know how to get the info above and below main area actually into the area that says Layout Info, etc.

Styling and all that is not my forte, as you can probably guess. :P So any tips, advice and/or help will be highly appreciated.

Thank you,

Emlyn :)

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...