Fix some unquoted array keys

This commit is contained in:
Xkeeper 2018-01-24 18:57:20 -08:00
parent 776472e122
commit 1348561401
4 changed files with 35 additions and 36 deletions

View File

@ -153,7 +153,7 @@
<td colspan=7 class='tbl tdbgh center fonts'>Announcements</td>
</tr><tr>
$tccell2>". ($loguser['lastannouncement'] < $annc['aid'] && $loguser['id'] ? $newpic : "&nbsp;") ."</td>
$tccell1l colspan=6><a href=announcement.php>$annc[title]</a> -- Posted by {$userlink} on ".date($dateformat,$annc[date]+$tzoff)."</td>
$tccell1l colspan=6><a href=announcement.php>$annc[title]</a> -- Posted by {$userlink} on ".date($dateformat,$annc['date']+$tzoff)."</td>
</tr>";
}
if($annc = $sql->fetchq("SELECT user id,date,announcements.title,name,sex,powerlevel FROM announcements,users WHERE forum=$id AND user=users.id ORDER BY date DESC LIMIT 1")) {

View File

@ -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])

View File

@ -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
*/

View File

@ -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;
@ -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<br>EXP: $exp (for next level: $expleft)";
if($user['posts'] > 0) $expstatus.="<br>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.="<br>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="<img src=images/$numdir"."bar-on.gif width=$barwidth height=8>";
if($barwidth<$totalwidth) $baroff="<img src=images/$numdir"."bar-off.gif width=".($totalwidth-$barwidth)." height=8>";
@ -181,9 +181,9 @@ $tblstart
$tccell1l width=150><b>Total threads</td> $tccell2l>$threadsposted<tr>
$tccell1l width=150><b>EXP</td> $tccell2l>$expstatus<tr>
". (false ? " $tccell1l width=150><b>User rating</td> $tccell2l>$ratingstatus<tr>" : "") ."
$tccell1l width=150><b>Registered on</td> $tccell2l>".@date($dateformat,$user[regdate]+$tzoff)." (".floor((ctime()-$user[regdate])/86400)." days ago)<tr>
$tccell1l width=150><b>Registered on</td> $tccell2l>".@date($dateformat,$user['regdate']+$tzoff)." (".floor((ctime()-$user['regdate'])/86400)." days ago)<tr>
$tccell1l width=150><b>Last post</td> $tccell2l>$lastpostdate$lastpostlink<tr>
$tccell1l width=150><b>Last activity</td> $tccell2l>".date($dateformat,$user[lastactivity]+$tzoff)."$lastip<tr>
$tccell1l width=150><b>Last activity</td> $tccell2l>".date($dateformat,$user['lastactivity']+$tzoff)."$lastip<tr>
$tblend
<br>$tblstart
$tccellh colspan=2><center>Contact information<tr>