$numguests guest".($numguests>1?"s":"");
$onlineusersa = array();
for ($numon=0; $onuser = $sql->fetch($onusers);$numon++) {
-
+
//$namecolor=explode("=", getnamecolor($onuser['sex'],$onuser['powerlevel']));
//$namecolor=$namecolor[1];
//$namelink="$onuser[name]";
@@ -89,7 +89,7 @@
if($onuser['lastactivity']<=$onlinetime) {
$namelink="($namelink)";
}
-
+
$onlineusersa[]="$onuser[minipic]$namelink";
}
@@ -112,7 +112,7 @@
$count = $sql->fetchq('SELECT (SELECT COUNT( * ) FROM users) AS u, (SELECT COUNT(*) FROM threads) as t, (SELECT COUNT(*) FROM posts) as p');
$misc = $sql->fetchq('SELECT * FROM misc');
-
+
if($posts['d']>$misc['maxpostsday']) $sql->query("UPDATE misc SET maxpostsday=$posts[d],maxpostsdaydate=".ctime());
if($posts['h']>$misc['maxpostshour']) $sql->query("UPDATE misc SET maxpostshour=$posts[h],maxpostshourdate=".ctime());
if($numonline>$misc['maxusers']) $sql->query("UPDATE misc SET maxusers=$numonline,maxusersdate=".ctime().",maxuserstext='".addslashes($onlineusers)."'");
@@ -120,7 +120,7 @@
/*// index sparkline
$sprkq = mysql_query('SELECT COUNT(id),date FROM posts WHERE date >="'.(time()-3600).'" GROUP BY (date % 60) ORDER BY date');
$sprk = array();
-
+
while ($r = mysql_fetch_row($sprkq)) {
array_push($sprk,$r[0]);
}
@@ -204,7 +204,7 @@
// Quicker (?) new posts calculation that's hopefully accurate v.v
if ($log) {
$qadd = array();
- foreach ($forums as $forum) $qadd[] = "(lastpostdate > '{$postread[$forum[id]]}' AND forum = '$forum[id]')\r\n";
+ foreach ($forums as $forum) $qadd[] = "(lastpostdate > '{$postread[$forum['id']]}' AND forum = '{$forum['id']}')\r\n";
$qadd = implode(' OR ', $qadd);
$forumnew = $sql->getresultsbykey("SELECT forum, COUNT(*) AS unread FROM threads t LEFT JOIN threadsread tr ON (tr.tid = t.id AND tr.uid = $loguser[id])
@@ -279,7 +279,7 @@
}
print "$tblend
$privatebox
-
+
". adbox() ."
$tblstart$forumlist$tblend$footer";
diff --git a/lib/rpg.php b/lib/rpg.php
index d3ab067..562d537 100644
--- a/lib/rpg.php
+++ b/lib/rpg.php
@@ -20,8 +20,8 @@
function getstats($u, $items=0, $class = 0){
$stat=array('HP','MP','Atk','Def','Int','MDf','Dex','Lck','Spd');
- $p=$u[posts];
- $d=(ctime()-$u[regdate])/86400;
+ $p=$u['posts'];
+ $d=(ctime()-$u['regdate'])/86400;
for($i=0;$i<9;$i++) {
$m[$i]=1;
}
@@ -29,7 +29,7 @@
$item=$items[$u['eq'.$i]];
for($k=0;$k<9;$k++){
$is=$item['s'.$stat[$k]];
- if(substr($item[stype],$k,1)=='m') $m[$k]*=$is/100;
+ if(substr($item['stype'],$k,1)=='m') $m[$k]*=$is/100;
else $a[$k]+=$is;
}
}
@@ -44,9 +44,9 @@
}
}
- $stats[GP]=coins($p,$d)-$u[spent];
- $stats[exp]=calcexp($p,$d);
- $stats[lvl]=calclvl($stats[exp]);
+ $stats['GP']=coins($p,$d)-$u['spent'];
+ $stats['exp']=calcexp($p,$d);
+ $stats['lvl']=calclvl($stats['exp']);
return $stats;
}
function coins($p,$d){
@@ -66,4 +66,3 @@
case 7: return (pow($p,0.07) * pow($d,0.20) * pow($l,1.09) * 0.29) + 1; //Int
case 8: return (pow($p,0.19) * pow($d,0.07) * pow($l,1.09) * 0.25) + 1; //Spd
*/
-
diff --git a/profile.php b/profile.php
index ad689b8..b5cd5f3 100644
--- a/profile.php
+++ b/profile.php
@@ -37,7 +37,7 @@
$numvotes=mysql_num_rows($ratings);
if($ratetotal) {
$ratingstatus=(floor($ratescore*1000/$ratetotal)/100)." ($ratescore/$ratetotal, $numvotes votes)";
- } else {
+ } else {
$ratingstatus="None";
}
if($loguserid and $logpwenc and $loguserid!=$id)
@@ -77,7 +77,7 @@
}
}
- $aim=str_replace(" ","+",$user[aim]);
+ $aim=str_replace(" ","+",$user['aim']);
$schname=$sql->resultq("SELECT name FROM schemes WHERE id=$user[scheme]");
$numdays=(ctime()-$user['regdate'])/86400;
@@ -85,17 +85,17 @@
// $user['signature']=doreplace2($user['signature'],$user['posts'],$numdays,$user['name']);
$user['postheader']=doreplace($user['postheader'],$user['posts'],$numdays,$user['name']);
// $user['postheader']=doreplace2($user['postheader'],$user['posts'],$numdays,$user['name']);
-
+
if ($user['picture']) $picture = "
";
if ($user['moodurl']) $moodavatar = " | Preview mood avatar";
-
+
$icqicon="
";
-
+
if(!$user['icq']){
$user['icq']="";
$icqicon="";
}
-
+
$tccellha="$fonthead";
@@ -107,9 +107,9 @@
$tzoffset=$user['timezone'];
$tzoffrel=$tzoffset-$loguser['timezone'];
$tzdate=date($dateformat,ctime()+$tzoffset*3600);
- if($user[birthday]){
- $birthday=date("l, F j, Y",$user[birthday]);
- $age="(".floor((ctime()-$user[birthday])/86400/365.2425)." years old)";
+ if($user['birthday']){
+ $birthday=date("l, F j, Y",$user['birthday']);
+ $age="(".floor((ctime()-$user['birthday'])/86400/365.2425)." years old)";
}
// RPG fun shit
@@ -117,10 +117,10 @@
$lvl=calclvl($exp);
$expleft=calcexpleft($exp);
$expstatus="Level: $lvl EXP: $exp (for next level: $expleft)";
- if($user['posts'] > 0) $expstatus.=" Gain: ".calcexpgainpost($user['posts'],(ctime()-$user['regdate'])/86400)." EXP per post, ".calcexpgaintime($user[posts],(ctime()-$user[regdate])/86400)." seconds to gain 1 EXP when idle";
- $postavg=sprintf("%01.2f",$user[posts]/(ctime()-$user[regdate])*86400);
+ if($user['posts'] > 0) $expstatus.=" Gain: ".calcexpgainpost($user['posts'],(ctime()-$user['regdate'])/86400)." EXP per post, ".calcexpgaintime($user['posts'],(ctime()-$user['regdate'])/86400)." seconds to gain 1 EXP when idle";
+ $postavg=sprintf("%01.2f",$user['posts']/(ctime()-$user['regdate'])*86400);
$totalwidth=116;
- $barwidth=@floor(($user[posts]/$maxposts)*$totalwidth);
+ $barwidth=@floor(($user['posts']/$maxposts)*$totalwidth);
if($barwidth<0) $barwidth=0;
if($barwidth) $baron=" ";
if($barwidth<$totalwidth) $baroff=" ";
@@ -181,9 +181,9 @@ $tblstart
$tccell1l width=150>Total threads | $tccell2l>$threadsposted
$tccell1l width=150>EXP $tccell2l>$expstatus
". (false ? " $tccell1l width=150>User rating $tccell2l>$ratingstatus" : "") ."
- $tccell1l width=150>Registered on $tccell2l>".@date($dateformat,$user[regdate]+$tzoff)." (".floor((ctime()-$user[regdate])/86400)." days ago)
+ $tccell1l width=150>Registered on $tccell2l>".@date($dateformat,$user['regdate']+$tzoff)." (".floor((ctime()-$user['regdate'])/86400)." days ago)
$tccell1l width=150>Last post $tccell2l>$lastpostdate$lastpostlink
- $tccell1l width=150>Last activity $tccell2l>".date($dateformat,$user[lastactivity]+$tzoff)."$lastip
+ $tccell1l width=150>Last activity $tccell2l>".date($dateformat,$user['lastactivity']+$tzoff)."$lastip
$tblend
$tblstart
$tccellh colspan=2>Contact information
@@ -222,7 +222,7 @@ $tblend
$tblstart
$tccellhs colspan=2>Options
$tccell2s colspan=2>
- Show posts |
+ Show posts |
View threads by this user
$sendpmsg
$ratelink
@@ -231,7 +231,7 @@ $tblend
$tccell2s colspan=2>
List posts by this user |
Posts by time of day |
- Posts by thread |
+ Posts by thread |
Posts by forum$sneek
$tblend$footer
";