Jump to content

Recommended Posts

hello im working on a community webpage can anyone help me with this error when i access it on my browser this shows up "Fatal error: Cannot re-assign $this in /home/content/t/h/i/thingjimenez/html/root/global.php on line 356" whats wrong with my code? help guys

here is the global.php line 356 is highlighted

 

[php<?php

error_reporting(7);

$t=gettimeofday();
$startload=$t['usec']/1000000+$t['sec'];

set_magic_quotes_runtime(0);

$numqueries=0;
$switch=1;

require('functions.php');

if (function_exists('get_cfg_var')) {
$reg_globals=get_cfg_var('register_globals');
} else {
$reg_globals=ini_get('register_globals');
}

if ($reg_globals!=1) {
extract($HTTP_POST_VARS, EXTR_OVERWRITE);
extract($HTTP_SERVER_VARS, EXTR_OVERWRITE);
extract($HTTP_ENV_VARS, EXTR_OVERWRITE);
}

$db=new dbcontrol;

$db->host=$dbhost;
$db->name=$dbname;
$db->user=$dbuser;
$db->pass=$dbpass;
$dbr->error_reporting=0;

$db->connect();
$db->select();

$dbr=new dbresults;

if (isset($HTTP_GET_VARS['bug']))
$dbr->troubleshooting=1;

$misc=$dbr->query('SELECT * FROM arc_misc');
$misc=$dbr->getarray($misc);

// CHECK BANNED
if(isset($REMOTE_ADDR)) {
$banned=explode(',' , $misc['banned_ips']);
foreach ($banned as $value) {
if ($value==$REMOTE_ADDR) {
header('Location: banned.php');
}
}
} else {
showmsg('no_ip');
exit();
}

$safe[]='userid';
$safe[]='isadmin';
$safe[]='ismod';
$safe[]='loggedin';
$safe[]='u_userid';

foreach ($safe as $var) {
if (isset($HTTP_GET_VARS[$var])) {
echo 'I sincerely hope you die a slow and horrible death.<br /><br /><br />Loser.';
exit();
}
}

if (isset($HTTP_GET_VARS['offset'])) { // get offset for page number links
$offset=$HTTP_GET_VARS['offset'];
} else {
$offset=0;
}

if (empty($settings))
$settings='';
$settings.='sitetimeoffset,deletevisitors,donotes,doquotes,adminshowonlineusers,default_colorset,webroot,sitename,notesperpage,noteoldestfirst,notetimestamp,addnocacheheaders,gzcompress,logging_enabled,showlatestuser,dopms,noteboxsize,logouttime,timeoffset,show_latest_posts,';
setcache($settings, 'setting');

if (empty($wordbits))
$wordbits='';
$wordbits.='nousersonline,oldnestnotesfirst,newestnotesfirst,nonotesyet,submitnote,cantpostnote,newpms,latestuser,';
setcache($wordbits, 'wordbit');



// GET USER DATA
$REMOTE_ADDR=(isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) ? $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'] : $HTTP_SERVER_VARS['REMOTE_ADDR'];
if (empty($REMOTE_HOST))
$REMOTE_HOST='hostnotfound';
if (empty($REMOTE_ADDR))
$REMOTE_ADDR='10.0.0.1';

$admin=$misc['adminname'];
$mod=$misc['modname'];
if (isset($HTTP_COOKIE_VARS['arcuserid']) || isset($arcuserid)) {
if (isset($HTTP_COOKIE_VARS['arcuserid'])) {
$arcuserid=$HTTP_COOKIE_VARS['arcuserid'];
$arcpass=$HTTP_COOKIE_VARS['arcpass'];
}

$passhash=$dbr->result("SELECT password FROM arc_user WHERE userid=$arcuserid");
if ($dbr->troubleshooting==1)
echo "passhash = $passhash<br />arcpass = $arcpass";

if ($passhash==$arcpass) {
$userquery=$dbr->query("SELECT * FROM arc_user WHERE userid='$arcuserid'");
$userinfo=$dbr->getarray($userquery, MYSQL_ASSOC);
extract($userinfo, EXTR_SKIP);
$loggedin='1';
$updateuser=$dbr->query("UPDATE arc_user SET last_page='$REQUEST_URI', last_active='" .time(). "', user_ip='$REMOTE_ADDR' WHERE userid=$userid AND password='$arcpass'");
if ($access==3) {
$isadmin=1;
$ismod=1;
} elseif ($access==2) {
$isadmin=0;
$ismod=1;
} else {
$isadmin=0;
$ismod=0;
}
} elseif ($passhash!=$arcpass && $arcpass!='') {
setcookie('arcuserid', $userid, time()-9999999, $cookiepath);
setcookie('arcpass', $password, time()-9999999, $cookiepath);
$userid=0;
$showonlineusers=1;
$shownotes=getSetting('donotes');
$showquotes=getSetting('doquotes');
echo getwordbit('badcookie');
}
} else { // do visitors
// $feedback.="neither /$HTTP_COOKIE_VARS[arcuserid] nor arcuserid was set.<br />";
$v=$dbr->result("SELECT visitorid FROM arc_visitor WHERE visitorip='$REMOTE_ADDR'");
if (!is_numeric($v)) {
$dbr->query("INSERT INTO arc_visitor SET
visitorip='$REMOTE_ADDR',
visitorhost='$REMOTE_HOST',
visitorlastpage='$REQUEST_URI',
visitortimestamp='" .time(). "'");
}
$visitor=$dbr->query("SELECT * FROM arc_visitor WHERE visitorip='$REMOTE_ADDR'");
$vinfo=$dbr->getarray($visitor, MYSQL_ASSOC);
$dbr->query("UPDATE arc_visitor SET
            visitorlastpage='$REQUEST_URI',
            visitortimestamp='" .time(). "'
            WHERE visitorip='$REMOTE_ADDR'");
$isadmin=0;
$ismod=0;
$loggedin=0;
$userid=0;
$viewposttemps=1;
$layout=getSetting('default_templateset');
$rank=$dbr->result("SELECT rank FROM arc_rank WHERE minlvl=0");
$showonlineusers=getSetting('adminshowonlineusers');
$shownotes=getSetting('donotes');
$showquotes=getSetting('doquotes');
}
if (empty($level))
$level=1;

if (isset($colorset)) {
if(is_numeric($colorset)) {
$colorset=$colorset;
} else {
$colorset=getSetting('default_colorset');
}
} else {
$colorset=getSetting('default_colorset');
}

if (empty($loggedin))
$loggedin=0;

////////////////////////////////////////////////// TEMPLATES
if (empty($templates))
$templates='';

if (empty($layout))
$layout=getSetting('default_templateset');

$templates .='top1,top2,header,footer,noterow,notetable,onlinetable,onlinerow,adminmenu,usermenu,privatemsgmenu,onlinedisplay,';
$tmplt=explode(',',$templates);
$tempname='';
$c=count($tmplt);
$n=0;
foreach ($tmplt as $val) { // form sql query
    $tempname .= " templatename='$val' AND templategroup='$layout'";
    $n++;
    if ($n<$c) $tempname .= ' OR';
}
$tcall=$dbr->query("SELECT DISTINCT(templatename),templatevalue FROM arc_template WHERE$tempname");

$stylequery=$dbr->query("SELECT * FROM arc_styleset WHERE stylesetid='$colorset'");
$styles=$dbr->getarray($stylequery, MYSQL_ASSOC);
$styles['webroot']=getSetting('webroot');
$styles['sitename']=getSetting('sitename');
$styles['version']=getSetting('version');

while ($row=$dbr->getarray($tcall, MYSQL_ASSOC)) {
$$row['templatename']=$row['templatevalue'];
foreach($styles as $n => $v) $$row['templatename']=str_replace("<$n>", $v, $$row['templatename']);
}

extract($styles, EXTR_OVERWRITE);

$top1=getTemplate('top1');
$top2=getTemplate('top2');
$header=getTemplate('header');
$footer=getTemplate('footer');

if (isset($HTTP_GET_VARS['action'])) {
$action=urlencode(strtolower($HTTP_GET_VARS['action']));
$actn=avatardecode($HTTP_GET_VARS['action']);
} elseif (empty($action)) {
$actn='News';
$action=strtolower($actn);
} elseif (isset($HTTP_POST_VARS['action'])) {
$action=urlencode(strtolower($HTTP_POST_VARS['action']));
$actn=avatardecode($HTTP_POST_VARS['action']);
}

$feedback='';

// clean visitors
$t=getSetting('logouttime');
$logouttime=intval(60 * $t);
if ($deletevisitors==1) {
$dbr->query("DELETE FROM arc_visitor WHERE visitortimestamp < " .(time() - $logouttime));
}
if (empty($isforum))
$isforum=0;

////////////////////////////////////////////////// HITS
$views=$misc['pageviews']+1;
$updateviews=$dbr->query("UPDATE arc_misc SET pageviews=$views");
$views=number_format($views);
$header=str_replace('<pageviews>', $views, $header);
$footer=str_replace('<pageviews>', $views, $footer);

////////////////////////////////////////////////// WHOS ONLINE
$adminshowonlineusers=getSetting('adminshowonlineusers');
if ($showonlineusers==1 && $adminshowonlineusers==1) {
$onlineusers='';
$result=$dbr->query("SELECT userid,displayname FROM arc_user WHERE last_active > " .(time() - $logouttime). ' LIMIT 0, ' .getSetting('maxusersonline'));
$onlinecount=number_format(mysql_num_rows($result));
$whilecount='1';
if ($onlinecount>0) {
while ($row=$dbr->getarray($result, MYSQL_ASSOC)) {
$onlineusers .= "<a href=\"user.php?action=profile&id=$row[userid]\">" .stripslashes($row['displayname']). "</a>";
if ($whilecount < $onlinecount) {
$onlineusers .= ", ";
} else {
$onlineusers .= ".";
}
$whilecount=$whilecount + 1;
}
}
} else {
$onlineusers="";
}

$totals=$dbr->query("SELECT numusers,numtopics,numposts FROM arc_misc");
$numbers=$dbr->getarray($totals);
$numusers=$numbers['numusers'];
$header=str_replace('<numusers>', $numusers, $header);
$footer=str_replace('<numusers>', $numusers, $footer);
$header=str_replace('<numposts>', number_format($numbers['numposts']), $header);
$footer=str_replace('<numposts>', number_format($numbers['numposts']), $footer);
$header=str_replace('<numtopics>', number_format($numbers['numtopics']), $header);
$footer=str_replace('<numtopics>', number_format($numbers['numtopics']), $footer);

if ($showonlineusers==1 && $adminshowonlineusers==1) {
$no_users_online=getwordbit('nousersonline');
if (!$onlineusers) $onlineusers="$smallfont$no_users_online$cs";

$visitorcount=$dbr->result("SELECT COUNT(visitorid) FROM arc_visitor WHERE visitortimestamp > " .(time() - $logouttime));
$header=str_replace('<visitorcount>', $visitorcount, $header);
$footer=str_replace('<visitorcount>', $visitorcount, $footer);

$onlinecount=$dbr->result("SELECT COUNT(userid) AS onlinecount FROM arc_user WHERE  last_active > " .(time() - $logouttime));
$onlinedisplay=getTemplate('onlinedisplay');
$onlinedisplay=str_replace('<users_online>', $onlineusers, $onlinedisplay);
$onlinedisplay=str_replace('<onlinecount>', $onlinecount, $onlinedisplay);
$onlinedisplay=str_replace('<visitorcount>', $visitorcount, $onlinedisplay);

if ($SCRIPT_NAME=='/forums.php' or $SCRIPT_NAME=='/post.php' or $SCRIPT_NAME=='/topic.php' or $SCRIPT_NAME=='/note.php' or $showonlineusers==0 or $adminshowonlineusers==0) {
$fonlinedisplay=$onlinedisplay;
$onlinedisplay="";
} elseif($showonlineusers==0 || $adminshowonlineusers==0) {
$fonlinedisplay='';
$onlinedisplay='';
} else {
$fonlinedisplay="";
}
$header=str_replace('<onlinedisplay>', $onlinedisplay, $header);
$header=str_replace('<fonlinedisplay>', $fonlinedisplay, $header);
$header=str_replace('<onlinecount>', $onlinecount, $header);
$footer=str_replace('<onlinedisplay>', $onlinedisplay, $footer);
$footer=str_replace('<fonlinedisplay>', $fonlinedisplay, $footer);
$footer=str_replace('<onlinecount>', $onlinecount, $footer);
}

////////////////////////////////////////////////// QUOTES
$admindoquotes=getSetting('doquotes');
if ($admindoquotes==1 && $showquotes==1) {
$upper=$dbr->result("SELECT MAX(quoteid) AS ubound FROM arc_quote");
$random=mt_rand(0, $upper);
$number=$dbr->result("SELECT MIN(quoteid) AS number FROM arc_quote WHERE quoteid >= $random");
$randomquote=$dbr->result("SELECT quote FROM arc_quote WHERE quoteid=$number");
$header=str_replace('<randomquote>', nl2br($randomquote), $header);
$footer=str_replace('<randomquote>', nl2br($randomquote), $footer);
}

////////////////////////////////////////////////// NOTES
if ($SCRIPT_NAME=='/note.php') {
$adminshownotes=0;
} else {
$adminshownotes=getSetting('donotes');
}
if ($adminshownotes==1 and $shownotes==1 and $SCRIPT_NAME!='/forums.php' and $SCRIPT_NAME!='/post.php' and $SCRIPT_NAME!='/topic.php') {
$totalnotes=$dbr->result("SELECT COUNT(noteid) AS allnotes FROM arc_note");
$notesperpage=getSetting('notesperpage');
$nod=getsetting('notesoldestfirst');
if ($nod==1) {
if ($totalnotes>$notesperpage) {
$first=$totalnotes - $notesperpage;
$last=$totalnotes;
} else {
$first=0;
$last=$notesperpage;
}
$sort='ASC';
$status=getwordbit('oldestnotemessage');
} else {
if ($totalnotes>$notesperpage) {
$first=0;
$last=$first + $notesperpage;
} else {
$first=0;
$last=$totalnotes;
}
$sort='DESC';
$status=getwordbit('newestnotemessage');
}

if ($totalnotes>0) {
$phlegm=$dbr->query("SELECT noteusername,noteuserid,notemessage,ntimestamp,noteid FROM arc_note ORDER BY noteid $sort LIMIT $first, $last");
$ntimestamp=getSetting('note_timestamp');
$thenotes=str_replace("<status>", $status, str_replace('<notesperpage>', $notesperpage, getTemplate('notes')));
$ntemp='';
$thenoterow=getTemplate('noterow');

      while ($this=$dbr->getarray($phlegm)) {
$nnoterow=str_replace('<username>', "<a href=\"$webroot/user.php?action=profile&id=$this[noteuserid]\">". dehtml($this['noteusername']). "</a>", $thenoterow);
$nnoterow=str_replace('<noteid>', $this['noteid'], $nnoterow);
$nnoterow=str_replace('<timestamp>', formdate($this['ntimestamp'], $ntimestamp), $nnoterow);
$nnoterow=str_replace('<content>', unfilter(parseurl(bbcode_replace(dehtml($this['notemessage'])))), $nnoterow);
$ntemp.=$nnoterow;
}

if ($loggedin==1) {
$nbs=getSetting('noteboxsize');
$bile="<form name=\"postnote\" action=\"post.php?action=postnote\" method=\"post\"><input type=\"hidden\" name=\"saction\" value=\"$HTTP_REFERER\" /><input type=\"text\" name=\"notemsg\" value=\"\" size=\"$nbs\" maxlength=\"150\" /><input type=\"submit\" value=\"" .getwordbit('submitnote'). "\" name=\"postnote\" /></form>";
} else {
$cpn=getwordbit('cantpostnote');
$bile="$smallfont$cpn$cs";
}

$thenotes=str_replace('<bottomsubmitbutton>', $bile, $thenotes);
$thenotes=str_replace('<noterow>', $ntemp, $thenotes);
} elseif ($totalnotes==0 && $loggedin==1) {
$nonotesyet=getwordbit('nonotesyet');
$thenotes="$top1<form name=\"postnote\" action=\"post.php?action=postnote\" method=\"post\"><input type=\"hidden\" name=\"saction\" value=\"$HTTP_REFERER\" /><input type=\"text\" name=\"notemsg\" value=\"\" size=\"" .getSetting('noteboxsize'). "\" maxlength=\"150\" /><input type=\"submit\" value=\"" .getwordbit('submitnote'). "\" name=\"postnote\" /></form>$nonotesyet$top2";
} else {
$thenotes=$normalfont . getwordbit('nonotesyet') . $cn;
}
$header=str_replace('<notes>', $thenotes, $header);
$footer=str_replace('<notes>', $thenotes, $footer);
}

////////////////////////////////////////////////// CHECK PM
if ($loggedin==1 && getSetting('dopms')==1) {
$totalpms=$dbr->result("SELECT COUNT(privatemsgid) AS totalmsgs FROM arc_privatemsg WHERE recipientid=$userid");
$numunread=$dbr->result("SELECT COUNT(privatemsgid) AS nummsgs FROM arc_privatemsg WHERE recipientid=$userid AND isread=0");
if ($numunread>0) {
$newpms=getwordbit('newpms');
$newpms=str_replace('<numunread>', $numunread, $newpms);
$newpms=str_replace('<totalpms>', $totalpms, $newpms);
} else {
$newpms='';
}
} else {
$newpms='';
}

////////////////////////////////////////////////// LATEST USER
$slu=getSetting('showlatestuser');
if ($slu==1) {
$lu=getwordbit('latestuser');
$thislink="<a href=\"user.php?action=profile&id=$misc[lastuserid]\">" .stripslashes(htmlspecialchars($misc['lastusername'])). '</a>';
$lu=str_replace('<link>', $thislink, $lu);
$header=str_replace('<latestuser>', $lu, $header);
$footer=str_replace('<latestuser>', $lu, $footer);
}

////////////////////////////////////////////////// LOGGED IN MENU
if ($loggedin==1) {
$um=getTemplate('usermenu');
$um=str_replace('<userid>', $userid, $um);
$um=str_replace('<newpms>', $newpms, $um);
$header=str_replace('<usermenu>', $um, $header);
$footer=str_replace('<usermenu>', $um, $footer);
if ($isadmin==1) {
$am=str_replace('<userid>', $userid, getTemplate('adminmenu'));
$header=str_replace('<adminmenu>', $am, $header);
$um=str_replace('<adminmenu>', $am, $um);
}
$ns=$dbr->result("SELECT COUNT(shrineid) AS numshrines FROM arc_shrine WHERE suserid=$userid");
if ($ns>=1)
$header=str_replace('<stafflink>', getwordbit('stafflink'), $header);
} else {
$um=getTemplate('guestmenu');
$header=str_replace('<usermenu>', $um, $header);
$footer=str_replace('<usermenu>', $um, $footer);
}
$sitetime=formdate(time(), getSetting('header_timestamp'));
$header=str_replace('<datetime>', $sitetime, $header);
$footer=str_replace('<datetime>', $sitetime, $footer);

////////////////////////////////////////////////// LATEST POSTS
if ($loggedin==1 || getSetting('guestscanviewforums')==1) {
if (getSetting('show_latest_posts')==1) {
$latestpost=$dbr->query("SELECT arc_post.postid,
  arc_post.parentid,
  arc_post.parentident,
  arc_post.postdate,
  arc_post.postusername,
  arc_post.postuserid,
  arc_topic.topicid,
  arc_topic.ttitle,
  arc_user.userid,
  arc_user.usertext
  FROM arc_post,
  arc_topic,
  arc_user
  WHERE arc_user.userid=arc_post.postuserid
  AND arc_topic.topicid=arc_post.parentid
  ORDER BY arc_post.postdate DESC LIMIT 0," .getSetting('number_latest_posts'));

$lp_html=str_replace('<number_latest_posts>', getSetting('number_latest_posts'), getTemplate('latestposts'));
$lp_temp='';
$lprow=getTemplate('latestpostrow');
while ($lp=$dbr->getarray($latestpost)) {

// uncomment these lines if you want to eliminate multiple posts in the same thread/profile/pagebit
// $beendone="$lp[parentident]$lp[topicid]";

// if (empty($$beendone)) {
$lrow=str_replace('<postid>', $lp['postid'], $lprow);

if ($lp['parentident']=='pagebit') {
$pagebit_title=$dbr->result("SELECT ptitle FROM arc_pagebit WHERE pagebitid=$lp[parentid]");
$lrow=str_replace('<ttitle>', htmlspecialchars(unfilter(stripslashes($pagebit_title))), $lrow);
$lrow=str_replace('<ident>', 'pagebit', $lrow);
} elseif ($lp['parentident']=='topic') {
$lrow=str_replace('<ttitle>', htmlspecialchars(unfilter(stripslashes($lp['ttitle']))), $lrow);
$lrow=str_replace('<ident>', 'topic', $lrow);
} elseif ($lp['parentident']=='profile') {
$lrow=str_replace('<ttitle>', htmlspecialchars(unfilter(stripslashes(getdisplayname($lp['topicid'])))), $lrow);
$lrow=str_replace('<ident>', 'profile', $lrow);
}

// $$beendone=1;

$lrow=str_replace('<postuserid>', $lp['postuserid'], $lrow);
$lrow=str_replace('<postusername>', htmlspecialchars(stripslashes($lp['postusername'])), $lrow);
$lrow=str_replace('<usertext>', htmlspecialchars(stripslashes($lp['usertext'])), $lrow);
$lrow=str_replace('<postdate>', formdate($lp['postdate'], getSetting('latest_post_timestamp')), $lrow);
$lrow=str_replace('<topicid>', $lp['topicid'], $lrow);
$lp_temp.=$lrow;
// }
}
$lp_html=str_replace('<latestpostrow>', $lp_temp, $lp_html);
$header=str_replace('<latest_posts>', $lp_html, $header);
$footer=str_replace('<latest_posts>', $lp_html, $footer);
}
}


$mylovelytrout=$header;
$myspiffytrout=$footer;

if (getSetting('gzcompress')==1)
ob_start('ob_gzhandler');

if (getSetting('addnocacheheaders')==1) {
header("HTTP/1.0 200 OK");
header("HTTP/1.1 200 OK");
header("Content-type: text/html");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
}

?>[/code]

Link to comment
https://forums.phpfreaks.com/topic/195809-community-site-help/
Share on other sites

Submitted on: 1/5/2003 6:23:25 AM

....

Compatibility:PHP 4.0

 

That code is way out of date and should have been updated or removed from distribution long ago. It will likely have other issues running on current versions of php.

 

For your present problem, just change all the occurrences of $this to a different name.

Link to comment
https://forums.phpfreaks.com/topic/195809-community-site-help/#findComment-1028679
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.