more 8.0 tweaks/fixes. hopefully. bluh

This commit is contained in:
Xkeeper 2024-09-17 04:29:34 -07:00
parent d88a9c339b
commit fd31686316
No known key found for this signature in database
GPG Key ID: 397C04773ABE4045
5 changed files with 165 additions and 137 deletions

View File

@ -360,16 +360,18 @@ function calclvlexp($lvl){
function calcexp($posts,$days){ function calcexp($posts,$days){
if(@($posts/$days)>0) return floor($posts*pow($posts*$days,0.5)); if(@($posts/$days)>0) return floor($posts*pow($posts*$days,0.5));
elseif($posts==0) return 0; elseif($posts==0) return 0;
else return 'NaN'; else return -1; // 'NaN';
} }
function calclvl($exp){ function calclvl($exp){
if($exp>=0){ if (is_string($exp) && $exp === 'NaN') return 'NaN';
$lvl=floor(@pow($exp,2/7)); if ($exp >= 0) {
if(calclvlexp($lvl+1)==$exp) $lvl++; $lvl = floor(@pow($exp, 2/7));
if(!$lvl) $lvl=1; if (calclvlexp($lvl + 1) == $exp) $lvl++;
}else $lvl=-floor(pow(-$exp,2/7)); if (!$lvl) $lvl = 1;
if(is_string($exp) && $exp=='NaN') $lvl='NaN'; } else {
return $lvl; $lvl = -floor(pow(-$exp,2/7));
}
return $lvl;
} }
function generatenumbergfx($num,$minlen=0,$double=false){ function generatenumbergfx($num,$minlen=0,$double=false){
@ -516,10 +518,10 @@ function doreplace2($msg, $options = null, $mood = 0) {
if (!$smiliesoff) { if (!$smiliesoff) {
global $smilies; global $smilies;
if(!$smilies) $smilies=readsmilies(); if (!$smilies) $smilies = readsmilies();
for($s=0;$smilies[$s][0];$s++){ for ($s = 0; $smilies[$s]; $s++) {
$smilie=$smilies[$s]; $smilie = $smilies[$s];
$msg=str_replace($smilie[0],"<img src=$smilie[1] align=absmiddle>",$msg); $msg = str_replace($smilie[0], "<img src=$smilie[1] align=absmiddle>", $msg);
} }
} }

View File

@ -22,15 +22,24 @@
$stat=array('HP','MP','Atk','Def','Int','MDf','Dex','Lck','Spd'); $stat=array('HP','MP','Atk','Def','Int','MDf','Dex','Lck','Spd');
$p=$u['posts']; $p=$u['posts'];
$d=(ctime()-$u['regdate'])/86400; $d=(ctime()-$u['regdate'])/86400;
$a=[];
$m=[];
for($i=0;$i<9;$i++) { for($i=0;$i<9;$i++) {
$m[$i]=1; $m[$i]=1;
$a[$i]=0;
} }
for($i=1;$i<7;$i++){ for($i=1;$i<7;$i++){
if (!$u['eq'.$i]) {
continue;
}
$item=$items[$u['eq'.$i]]; $item=$items[$u['eq'.$i]];
for($k=0;$k<9;$k++){ for($k=0;$k<9;$k++){
$is=$item['s'.$stat[$k]]; $is=$item['s'.$stat[$k]];
if(substr($item['stype'],$k,1)=='m') $m[$k]*=$is/100; if (substr($item['stype'],$k,1)=='m') {
else $a[$k]+=$is; $m[$k]*=$is/100;
} else {
$a[$k] = ($a[$k] ?? 0) + $is;
}
} }
} }
for($i=0;$i<9;$i++){ for($i=0;$i<9;$i++){

View File

@ -10,24 +10,36 @@
return $cmpb-$cmpa; return $cmpb-$cmpa;
} }
if($sex) $qsex="&sex=$sex"; $sex = $_GET['sex'] ?? null;
if($pow) $qpow="&pow=$pow"; $qsex = ($sex !== null ? "&sex=$sex" : "");
if($ppp) $qppp="&ppp=$ppp";
if($rpg) $qrpg="&rpg=1";
$q = $qppp.$qrpg;
if(!$ppp) $ppp=50; $pow = null;
if(!$page) $page=0; $qpow = "";
if (isset($_GET['pow'])) {
$pow = intval($_GET['pow']);
$qpow = "&pow=$pow";
}
$qrpg = "";
$rpg = intval($_GET['rpg'] ?? 0);
$qrpg = "&rpg=$rpg";
$lnk='<a href=memberlist.php?sort'; $sort = $_GET['sort'] ?? "posts";
if (!in_array($sort, array('name','reg','exp','age','posts', 'act')))
$sort = 'posts';
$qwhere = array();
$page = intval($_GET['page'] ?? 0);
$ppp = intval($_GET['ppp'] ?? 50);
$qppp = ($ppp !== 50) ? "&ppp=$ppp" : "";
$qwhere = [];
if($sex=='m') $qwhere[] = '(sex=0)'; if($sex=='m') $qwhere[] = '(sex=0)';
if($sex=='f') $qwhere[] = '(sex=1)'; if($sex=='f') $qwhere[] = '(sex=1)';
if($sex=='n') $qwhere[] = '(sex=2)'; if($sex=='n') $qwhere[] = '(sex=2)';
if($pow!='') { if ($pow !== null) {
$pow = intval($pow);
if (($pow == 1 || $pow == 0) && $loguser['powerlevel'] <= 0) if (($pow == 1 || $pow == 0) && $loguser['powerlevel'] <= 0)
$pow = "IN (0, 1)"; $pow = "IN (0, 1)";
elseif ($pow == 3 || $pow == 4) // merge admin + sysadmin (they appear the same) elseif ($pow == 3 || $pow == 4) // merge admin + sysadmin (they appear the same)
@ -42,8 +54,6 @@
$where = 'WHERE '.((empty($qwhere)) ? '1' : implode(' AND ', $qwhere)); $where = 'WHERE '.((empty($qwhere)) ? '1' : implode(' AND ', $qwhere));
if (!in_array($sort, array('name','reg','exp','age','posts', 'act')))
$sort = 'posts';
$query='SELECT id,posts,regdate,lastactivity,name,minipic,sex,powerlevel,aka,r.* FROM users LEFT JOIN users_rpg r ON id=uid '; $query='SELECT id,posts,regdate,lastactivity,name,minipic,sex,powerlevel,aka,r.* FROM users LEFT JOIN users_rpg r ON id=uid ';
if($sort=='name') $users1=$sql->query("$query$where ORDER BY name", MYSQL_ASSOC); if($sort=='name') $users1=$sql->query("$query$where ORDER BY name", MYSQL_ASSOC);
@ -55,9 +65,9 @@
$numusers=mysql_num_rows($users1); $numusers=mysql_num_rows($users1);
for($i=0;$user = $sql->fetch($users1);$i++){ for ($i = 0; $user = $sql->fetch($users1); $i++) {
$user['days'] = (ctime()-$user['regdate'])/86400; $user['days'] = (ctime() - $user['regdate']) / 86400;
$user['exp'] = calcexp($user['posts'],$user['days']); $user['exp'] = calcexp($user['posts'], $user['days']);
$user['lvl'] = calclvl($user['exp']); $user['lvl'] = calclvl($user['exp']);
$users[] = $user; $users[] = $user;
} }
@ -69,36 +79,37 @@
for($i=0;$i<($numusers/$ppp);$i++) for($i=0;$i<($numusers/$ppp);$i++)
$pagelinks.=($i==$page?' '.($i+1):" <a href=memberlist.php?sort=$sort$qsex$qpow$qrpg$qppp&page=$i>".($i+1).'</a>'); $pagelinks.=($i==$page?' '.($i+1):" <a href=memberlist.php?sort=$sort$qsex$qpow$qrpg$qppp&page=$i>".($i+1).'</a>');
if($numusers>1) $s="s"; $lnk='<a href=memberlist.php?sort';
print " print "
$header<br>$tblstart $header<br>$tblstart
<tr> <tr>
$tccellh colspan=2>$numusers user$s found. $tccellh colspan=2>$numusers user". ($numusers != 1 ? "s" : "") ." found.
</tr><tr> </tr><tr>
$tccell1s> Sort by: $tccell1s> Sort by:
$tccell2s> $tccell2s>
$lnk=posts$q$qpow$qsex>Total posts</a> | $lnk=posts$qpow$qsex>Total posts</a> |
$lnk=exp$q$qpow$qsex>EXP</a> | $lnk=exp$qpow$qsex>EXP</a> |
$lnk=name$q$qpow$qsex>User name</a> | $lnk=name$qpow$qsex>User name</a> |
$lnk=reg$q$qpow$qsex>Registration date</a> | $lnk=reg$qpow$qsex>Registration date</a> |
$lnk=act$q$qpow$qsex>Last activity</a> | $lnk=act$qpow$qsex>Last activity</a> |
$lnk=age$q$qpow$qsex>Age</a> $lnk=age$qpow$qsex>Age</a>
</tr><tr> </tr><tr>
$tccell1s> Sex: $tccell1s> Sex:
$tccell2s> $tccell2s>
$lnk=$sort$q$qpow&sex=m>Male</a> | $lnk=$sort$qpow&sex=m>Male</a> |
$lnk=$sort$q$qpow&sex=f>Female</a> | $lnk=$sort$qpow&sex=f>Female</a> |
$lnk=$sort$q$qpow&sex=n>N/A</a> | $lnk=$sort$qpow&sex=n>N/A</a> |
$lnk=$sort$q$qpow>All</a><tr> $lnk=$sort$qpow>All</a><tr>
</tr><tr> </tr><tr>
$tccell1s> Powerlevel: $tccell1s> Powerlevel:
$tccell2s> $tccell2s>
$lnk=$sort$q$qsex&pow=-1>Banned</a> | $lnk=$sort$qsex&pow=-1>Banned</a> |
$lnk=$sort$q$qsex&pow=0>Normal</a> | $lnk=$sort$qsex&pow=0>Normal</a> |
". ($loguser['powerlevel'] >= 1 ? "$lnk=$sort$q$qsex&pow=1>Normal +</a> | " : "") ." ". ($loguser['powerlevel'] >= 1 ? "$lnk=$sort$qsex&pow=1>Normal +</a> | " : "") ."
$lnk=$sort$q$qsex&pow=2>Moderator</a> | $lnk=$sort$qsex&pow=2>Moderator</a> |
$lnk=$sort$q$qsex&pow=3>Administrator</a> | $lnk=$sort$qsex&pow=3>Administrator</a> |
$lnk=$sort$q$qsex>All</a> $lnk=$sort$qsex>All</a>
</tr>$tblend<br>$tblstart </tr>$tblend<br>$tblstart
<tr> <tr>
$tccellh width=30>#</td> $tccellh width=30>#</td>
@ -106,7 +117,7 @@
$tccellh>Username</td> $tccellh>Username</td>
"; ";
if(!$rpg) { if (!$rpg) {
print " print "
$tccellh width=200>Registered on</td> $tccellh width=200>Registered on</td>
$tccellh width=200>Last active</td> $tccellh width=200>Last active</td>
@ -114,10 +125,9 @@
$tccellh width=35>Level</td> $tccellh width=35>Level</td>
$tccellh width=100>EXP</td></tr> $tccellh width=100>EXP</td></tr>
"; ";
} } else {
else {
$items = $sql->getarraybykey("SELECT * FROM items", 'id'); $items = $sql->getarraybykey("SELECT * FROM items", 'id');
$classes = $sql->getarraybykey("SELECT * FROM rpg_classes", 'id'); $classes = $sql->getarraybykey("SELECT * FROM rpg_classes", 'id');
print "$tccellh width=35>Level</td>"; print "$tccellh width=35>Level</td>";
print "$tccellh width=90>Class</td>"; print "$tccellh width=90>Class</td>";
@ -128,9 +138,10 @@
} }
$s = $ppp*$page; $s = $ppp*$page;
$ulist = "";
for($u=0;$u < $ppp;$u++) { for($u=0;$u < $ppp;$u++) {
$i = $s + $u; $i = $s + $u;
$user = $users[$i]; $user = $users[$i] ?? null;
if (!$user) break; if (!$user) break;
$ulist.="<tr style=\"height:24px;\">"; $ulist.="<tr style=\"height:24px;\">";
@ -155,7 +166,7 @@
"; ";
} }
else { else {
if (!($class = $classes[$user['class']])) if (!($class = ($classes[$user['class']] ?? null)))
$class = array('name'=>'None'); $class = array('name'=>'None');
$stats=getstats($user,$items,$class); $stats=getstats($user,$items,$class);

View File

@ -8,15 +8,18 @@
$p = $user['posts']; $p = $user['posts'];
$d = (ctime()-$user['regdate'])/86400; $d = (ctime()-$user['regdate'])/86400;
if(!$it) $it = intval($_GET['it'] ?? 0);
$it=0; $ne = intval($_GET['ne'] ?? 0);
$nc = intval($_GET['nc'] ?? 0);
$ct = intval($_GET['ct'] ?? 0);
if(!$ne) if(!$ne)
$items = $sql->getarraybykey("SELECT * FROM items WHERE id=$user[eq1] OR id=$user[eq2] OR id=$user[eq3] OR id=$user[eq4] OR id=$user[eq5] OR id=$user[eq6] OR id=$it", 'id'); $items = $sql->getarraybykey("SELECT * FROM items WHERE id=$user[eq1] OR id=$user[eq2] OR id=$user[eq3] OR id=$user[eq4] OR id=$user[eq5] OR id=$user[eq6] OR id=$it", 'id');
if(!$nc) if(!$nc)
$class = $sql->fetchq("SELECT * FROM `rpg_classes` WHERE `id` = '". $user['class'] ."'"); $class = $sql->fetchq("SELECT * FROM `rpg_classes` WHERE `id` = '". $user['class'] ."'");
$GPdif = 0;
if($ct) { if($ct) {
$GPdif=floor($items[$user['eq'.$ct]][coins]*0.6)-$items[$it][coins]; $GPdif=floor($items[$user['eq'.$ct]]['coins']*0.6)-$items[$it]['coins'];
$user['eq'.$ct]=$it; $user['eq'.$ct]=$it;
} }
@ -28,41 +31,41 @@
$class['name'] = "None"; $class['name'] = "None";
} }
$img=ImageCreate(256,224 - (8 * 0)); $img=imagecreate(256,224 - (8 * 0));
imagesavealpha($img, true); imagesavealpha($img, true);
imagealphablending($img, false); imagealphablending($img, false);
$c['bg']= ImageColorAllocatealpha($img, 40, 40, 90, 127); $c['bg']= imagecolorallocatealpha($img, 40, 40, 90, 127);
$c['bxb0']=ImageColorAllocate($img, 0, 0, 0); $c['bxb0']=imagecolorallocate($img, 0, 0, 0);
// $c['bxb1']=ImageColorAllocate($img,225,200,180); // $c['bxb1']=imagecolorallocate($img,225,200,180);
// $c['bxb2']=ImageColorAllocate($img,190,160,130); // $c['bxb2']=imagecolorallocate($img,190,160,130);
// $c['bxb3']=ImageColorAllocate($img,130,110, 90); // $c['bxb3']=imagecolorallocate($img,130,110, 90);
$c['bxb1']=ImageColorAllocate($img, 200, 180, 225); $c['bxb1']=imagecolorallocate($img, 200, 180, 225);
$c['bxb2']=ImageColorAllocate($img, 160, 130, 190); $c['bxb2']=imagecolorallocate($img, 160, 130, 190);
$c['bxb3']=ImageColorAllocate($img, 90, 110, 130); $c['bxb3']=imagecolorallocate($img, 90, 110, 130);
for($i=0;$i<100;$i++) for($i=0;$i<100;$i++)
$c[$i]=ImageColorAllocate($img, 15+$i/1.5, 8, 20+$i); $c[$i]=imagecolorallocate($img, 15+$i/1.5, 8, 20+$i);
$c['barE1']=ImageColorAllocate($img,120,150,180); $c['barE1']=imagecolorallocate($img,120,150,180);
$c['barE2']=ImageColorAllocate($img, 30, 60, 90); $c['barE2']=imagecolorallocate($img, 30, 60, 90);
$c['bar1'][ 1] = ImageColorAllocate($img, 215, 91, 129); $c['bar1'][ 1] = imagecolorallocate($img, 215, 91, 129);
$c['bar1'][ 2] = ImageColorAllocate($img, 255, 136, 154); $c['bar1'][ 2] = imagecolorallocate($img, 255, 136, 154);
$c['bar1'][ 3] = ImageColorAllocate($img, 255, 139, 89); $c['bar1'][ 3] = imagecolorallocate($img, 255, 139, 89);
$c['bar1'][ 4] = ImageColorAllocate($img, 255, 251, 89); $c['bar1'][ 4] = imagecolorallocate($img, 255, 251, 89);
$c['bar1'][ 5] = ImageColorAllocate($img, 89, 255, 139); $c['bar1'][ 5] = imagecolorallocate($img, 89, 255, 139);
$c['bar1'][ 6] = ImageColorAllocate($img, 89, 213, 255); $c['bar1'][ 6] = imagecolorallocate($img, 89, 213, 255);
$c['bar1'][ 7] = ImageColorAllocate($img, 196, 33, 33); $c['bar1'][ 7] = imagecolorallocate($img, 196, 33, 33);
$c['bar1'][ 8] = ImageColorAllocate($img, 196, 66, 196); $c['bar1'][ 8] = imagecolorallocate($img, 196, 66, 196);
$c['bar1'][ 9] = ImageColorAllocate($img, 100, 0, 155); $c['bar1'][ 9] = imagecolorallocate($img, 100, 0, 155);
$c['bar1'][10] = ImageColorAllocate($img, 88, 0, 121); $c['bar1'][10] = imagecolorallocate($img, 88, 0, 121);
$c['bar1'][11] = ImageColorAllocate($img, 0, 174, 215); $c['bar1'][11] = imagecolorallocate($img, 0, 174, 215);
$c['bar1'][12] = ImageColorAllocate($img, 0, 99, 151); $c['bar1'][12] = imagecolorallocate($img, 0, 99, 151);
$c['bar1'][13] = ImageColorAllocate($img, 175, 175, 175); $c['bar1'][13] = imagecolorallocate($img, 175, 175, 175);
$c['bar1'][14] = ImageColorAllocate($img, 222, 222, 222); $c['bar1'][14] = imagecolorallocate($img, 222, 222, 222);
$c['bar1'][15] = ImageColorAllocate($img, 255, 255, 255); $c['bar1'][15] = imagecolorallocate($img, 255, 255, 255);
$st['CHP'] = max($st['HP'] - $user['damage'], 0); $st['CHP'] = max($st['HP'] - $user['damage'], 0);
if ($st['CHP'] <= 0) if ($st['CHP'] <= 0)
@ -137,8 +140,8 @@
bars(); bars();
header('Content-type:image/png'); header('Content-type:image/png');
ImagePNG($img); imagepng($img);
ImageDestroy($img); imagedestroy($img);
@ -152,17 +155,17 @@ function twrite($font,$x,$y,$l,$text){
$x+=($l-strlen($text))*8; $x+=($l-strlen($text))*8;
for($i=0;$i<strlen($text);$i++) for($i=0;$i<strlen($text);$i++)
ImageCopy($img,$font,$i*8+$x,$y,(ord($text[$i])%16)*8,floor(ord($text[$i])/16)*8,8,8); imagecopy($img,$font,$i*8+$x,$y,(ord($text[$i])%16)*8,floor(ord($text[$i])/16)*8,8,8);
} }
function fontc($r1,$g1,$b1,$r2,$g2,$b2,$r3,$g3,$b3){ function fontc($r1,$g1,$b1,$r2,$g2,$b2,$r3,$g3,$b3){
$font=ImageCreateFromPNG('images/rpg/font.png'); $font=imagecreatefrompng('images/rpg/font.png');
ImageColorTransparent($font,1); imagecolortransparent($font,1);
ImageColorSet($font,6,$r1,$g1,$b1); imagecolorset($font,6,$r1,$g1,$b1);
ImageColorSet($font,5,($r1*2+$r2)/3,($g1*2+$g2)/3,($b1*2+$b2)/3); imagecolorset($font,5,($r1*2+$r2)/3,($g1*2+$g2)/3,($b1*2+$b2)/3);
ImageColorSet($font,4,($r1+$r2*2)/3,($g1+$g2*2)/3,($b1+$b2*2)/3); imagecolorset($font,4,($r1+$r2*2)/3,($g1+$g2*2)/3,($b1+$b2*2)/3);
ImageColorSet($font,3,$r2,$g2,$b2); imagecolorset($font,3,$r2,$g2,$b2);
ImageColorSet($font,0,$r3,$g3,$b3); imagecolorset($font,0,$r3,$g3,$b3);
return $font; return $font;
} }
@ -174,15 +177,15 @@ function box($x,$y,$w,$h){
$w*=8; $w*=8;
$h*=8; $h*=8;
ImageRectangle($img,$x+0,$y+0,$x+$w-1,$y+$h-1,$c['bxb0']); imagerectangle($img,$x+0,$y+0,$x+$w-1,$y+$h-1,$c['bxb0']);
ImageRectangle($img,$x+1,$y+1,$x+$w-2,$y+$h-2,$c['bxb3']); imagerectangle($img,$x+1,$y+1,$x+$w-2,$y+$h-2,$c['bxb3']);
ImageRectangle($img,$x+2,$y+2,$x+$w-3,$y+$h-3,$c['bxb1']); imagerectangle($img,$x+2,$y+2,$x+$w-3,$y+$h-3,$c['bxb1']);
ImageRectangle($img,$x+3,$y+3,$x+$w-4,$y+$h-4,$c['bxb2']); imagerectangle($img,$x+3,$y+3,$x+$w-4,$y+$h-4,$c['bxb2']);
ImageRectangle($img,$x+4,$y+4,$x+$w-5,$y+$h-5,$c['bxb0']); imagerectangle($img,$x+4,$y+4,$x+$w-5,$y+$h-5,$c['bxb0']);
for($i=5;$i<$h-5;$i++) { for($i=5;$i<$h-5;$i++) {
$n=(1-$i/$h)*100; $n=(1-$i/$h)*100;
ImageLine($img,$x+5,$y+$i,$x+$w-6,$y+$i,$c[$n]); imageline($img,$x+5,$y+$i,$x+$w-6,$y+$i,$c[$n]);
} }
} }
@ -193,19 +196,19 @@ function bars(){
if(!$sc[$s]) $sc[$s]=1; if(!$sc[$s]) $sc[$s]=1;
if ($st['HP'] > 0) { if ($st['HP'] > 0) {
ImageFilledRectangle($img,137,41+24,136+$st['HP']/$sc[$s],47+24,$c['bxb0']); imagefilledrectangle($img,137,41+24,136+$st['HP']/$sc[$s],47+24,$c['bxb0']);
ImageFilledRectangle($img,136,40+24,135+$st['HP']/$sc[$s],46+24,$c['bar1'][$s]); imagefilledrectangle($img,136,40+24,135+$st['HP']/$sc[$s],46+24,$c['bar1'][$s]);
if ($user['damage'] > 0) { if ($user['damage'] > 0) {
$dmg = max($st[HP] - $user['damage'], 0) / $sc[$s]; $dmg = max($st[HP] - $user['damage'], 0) / $sc[$s];
$ctemp = imagecolorsforindex($img, $c['bar1'][$s]); $ctemp = imagecolorsforindex($img, $c['bar1'][$s]);
$df = 0.6; $df = 0.6;
ImageFilledRectangle($img,135 + $st['HP']/$sc[$s],40+24,135+$dmg,46+24,imagecolorallocate($img, $ctemp['red'] * $df, $ctemp['green'] * $df, $ctemp['blue'] * $df)); imagefilledrectangle($img,135 + $st['HP']/$sc[$s],40+24,135+$dmg,46+24,imagecolorallocate($img, $ctemp['red'] * $df, $ctemp['green'] * $df, $ctemp['blue'] * $df));
} }
} }
if ($st['MP'] > 0) { if ($st['MP'] > 0) {
ImageFilledRectangle($img,137,49+24,136+$st['MP']/$sc[$s],55+24,$c['bxb0']); imagefilledrectangle($img,137,49+24,136+$st['MP']/$sc[$s],55+24,$c['bxb0']);
ImageFilledRectangle($img,136,48+24,135+$st['MP']/$sc[$s],54+24,$c['bar1'][$s]); imagefilledrectangle($img,136,48+24,135+$st['MP']/$sc[$s],54+24,$c['bar1'][$s]);
} }
for($i=2;$i<9;$i++) $st2[$i]=$st[$stat[$i]]; for($i=2;$i<9;$i++) $st2[$i]=$st[$stat[$i]];
@ -213,17 +216,17 @@ function bars(){
if(!$sc[$s]) $sc[$s]=1; if(!$sc[$s]) $sc[$s]=1;
for($i=2;$i<9;$i++){ for($i=2;$i<9;$i++){
if (floor($st[$stat[$i]]/$sc[$s]) > 0) { if (floor($st[$stat[$i]]/$sc[$s]) > 0) {
ImageFilledRectangle($img,89,65+$i*8+24,89+$st[$stat[$i]]/$sc[$s], 71+$i*8+24,$c['bxb0']); imagefilledrectangle($img,89,65+$i*8+24,89+$st[$stat[$i]]/$sc[$s], 71+$i*8+24,$c['bxb0']);
ImageFilledRectangle($img,88,64+$i*8+24,88+$st[$stat[$i]]/$sc[$s], 70+$i*8+24,$c['bar1'][$s]); imagefilledrectangle($img,88,64+$i*8+24,88+$st[$stat[$i]]/$sc[$s], 70+$i*8+24,$c['bar1'][$s]);
} }
} }
$e2 = 16 * 8; // width of bar $e2 = 16 * 8; // width of bar
$e1 = $e2 * $pct; $e1 = $e2 * $pct;
$y = 168+1+24; $y = 168+1+24;
ImageFilledRectangle($img,9,$y + 1, 8 + $e2, $y + 4, $c['bxb0']); imagefilledrectangle($img,9,$y + 1, 8 + $e2, $y + 4, $c['bxb0']);
ImageFilledRectangle($img,8,$y , 7 + $e2, $y + 3, $c['barE2']); imagefilledrectangle($img,8,$y , 7 + $e2, $y + 3, $c['barE2']);
ImageFilledRectangle($img,8,$y , 7 + $e1, $y + 3, $c['barE1']); imagefilledrectangle($img,8,$y , 7 + $e1, $y + 3, $c['barE1']);
} }
function nlimiter($n) { function nlimiter($n) {

View File

@ -12,6 +12,8 @@
$exp = calcexp($post['posts'],(ctime()-$post['regdate']) / 86400); $exp = calcexp($post['posts'],(ctime()-$post['regdate']) / 86400);
$lvl = calclvl($exp); $lvl = calclvl($exp);
$expleft = calcexpleft($exp); $expleft = calcexpleft($exp);
$set['userpic'] = $set['userpic'] ?? ""; // please stop being undefined
if ($tlayout == 1) { if ($tlayout == 1) {
$level = "Level: $lvl"; $level = "Level: $lvl";
@ -24,6 +26,8 @@
if ($barwidth < 1) $barwidth=0; if ($barwidth < 1) $barwidth=0;
$baron = "";
$baroff = "";
if ($barwidth > 0) $baron="<img src=images/$numdir"."bar-on.gif width=$barwidth height=8>"; if ($barwidth > 0) $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>'; if ($barwidth < $totalwidth) $baroff="<img src=images/$numdir".'bar-off.gif width='.($totalwidth-$barwidth).' height=8>';
@ -338,7 +342,7 @@
$fcol3 = "#f0f8ff"; $fcol3 = "#f0f8ff";
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post['lastactivity']) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
if(!$post['num']) { if(!$post['num']) {
@ -346,7 +350,7 @@
$postss = "s:"; $postss = "s:";
} }
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('valign=top', 'valign=top', $set[tdbg]) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\"> ". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\">
&mdash; $set[userlink] &mdash; &mdash; $set[userlink] &mdash;
$smallfont $smallfont
". ($set['userrank'] ? "<br>". $set['userrank'] : "") ." ". ($set['userrank'] ? "<br>". $set['userrank'] : "") ."
@ -379,7 +383,7 @@
$fcol3 = "#000000"; $fcol3 = "#000000";
} }
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post['lastactivity']) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
if(!$post['num']) { if(!$post['num']) {
@ -387,7 +391,7 @@
$postss = "s:"; $postss = "s:";
} }
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('valign=top', 'valign=top', $set[tdbg]) ." rowspan=2 align=center style=\"background: $fcol3". ($post['posts'] >= 20000 ? " url('http://www.ffalexandria.com/orlandu/anya/side_bg.jpg'); background-position:bottom left" : "") ."; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\"> ". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"background: $fcol3". ($post['posts'] >= 20000 ? " url('http://www.ffalexandria.com/orlandu/anya/side_bg.jpg'); background-position:bottom left" : "") ."; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\">
&mdash; $set[userlink] &mdash; &mdash; $set[userlink] &mdash;
<br>$smallfont <br>$smallfont
". ($set['userrank'] ? "<br>". $set['userrank'] : "") ." ". ($set['userrank'] ? "<br>". $set['userrank'] : "") ."
@ -435,7 +439,7 @@
$fcol3 = "#fff0f8"; $fcol3 = "#fff0f8";
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post['lastactivity']) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
if(!$post['num']) { if(!$post['num']) {
@ -443,7 +447,7 @@
$postss = "s:"; $postss = "s:";
} }
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('valign=top', 'valign=top', $set[tdbg]) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\"> ". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\">
&mdash; $set[userlink] &mdash; &mdash; $set[userlink] &mdash;
$smallfont $smallfont
". ($set['userrank'] ? "<br>". $set['userrank'] : "") ." ". ($set['userrank'] ? "<br>". $set['userrank'] : "") ."
@ -483,7 +487,7 @@
$fcol3 = "#000000"; $fcol3 = "#000000";
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post['lastactivity']) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
if(!$post['num']) { if(!$post['num']) {
@ -491,7 +495,7 @@
$postss = "s:"; $postss = "s:";
} }
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('valign=top', 'valign=top', $set[tdbg]) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\"> ". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\">
&mdash; $set[userlink] &mdash; &mdash; $set[userlink] &mdash;
$smallfont $smallfont
". ($set['userrank'] ? "<br>". $set['userrank'] : "") ." ". ($set['userrank'] ? "<br>". $set['userrank'] : "") ."
@ -513,8 +517,8 @@
$fcol1 = "#bbbbeb"; $fcol1 = "#bbbbeb";
$fcol2 = "#8888a8"; $fcol2 = "#8888a8";
$fcol3 = "#080818 url('http://bloodstar.rustedlogic.net/layout/background.png')"; $fcol3 = "#080818 url('http://bloodstar.rustedlogic.net/layout/background.png')";
$lastactivity = 'Active </font>'. timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>'. timeunits(ctime()-$post['lastactivity']) ."<font color=$fcol2> ago";
$joindate = 'Joined </font>'. date($dateshort,$post[regdate]+$tzoff) ."<font color=$fcol2>"; $joindate = 'Joined </font>'. date($dateshort,$post['regdate']+$tzoff) ."<font color=$fcol2>";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
if(!$post['num']) { if(!$post['num']) {
@ -522,7 +526,7 @@
$postss = "s:"; $postss = "s:";
} }
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('valign=top', 'valign=top', $set[tdbg]) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\"> ". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\">
&mdash; $set[userlink] &mdash; &mdash; $set[userlink] &mdash;
$smallfont $smallfont
". ($set['userrank'] ? "<br>". $set['userrank'] ."<br>" : "") ." ". ($set['userrank'] ? "<br>". $set['userrank'] ."<br>" : "") ."
@ -546,8 +550,8 @@
$fcol1 = "#9999cc"; $fcol1 = "#9999cc";
$fcol2 = "#7777aa"; $fcol2 = "#7777aa";
$fcol3 = "#000011"; $fcol3 = "#000011";
$lastactivity = 'Active </font>'. timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>'. timeunits(ctime()-$post['lastactivity']) ."<font color=$fcol2> ago";
$joindate = 'Joined </font>'. date($dateshort,$post[regdate]+$tzoff) ."<font color=$fcol2>"; $joindate = 'Joined </font>'. date($dateshort,$post['regdate']+$tzoff) ."<font color=$fcol2>";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
if(!$post['num']) { if(!$post['num']) {
@ -586,11 +590,11 @@
$postss = "s:"; $postss = "s:";
} }
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('\' valign=top', ' a1\' valign=top', $set[tdbg]) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\"> ". str_replace('\' valign=top', ' a1\' valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 12px; color: $fcol1; font-family: Verdana, sans-serif;\">
$css $css
<div class=a2> <div class=a2>
Post$postss <span><b>$postnum</b></span><span><b>$posttotal</b></span> (<span>". timeunits(ctime()-$post[lastposttime]) ."</span>), Post$postss <span><b>$postnum</b></span><span><b>$posttotal</b></span> (<span>". timeunits(ctime()-$post['lastposttime']) ."</span>),
online <span>". timeunits(ctime()-$post[lastactivity]) ."</span> ago online <span>". timeunits(ctime()-$post['lastactivity']) ."</span> ago
<a href=//jul.rustedlogic.net/profile.php?id=387> <a href=//jul.rustedlogic.net/profile.php?id=387>
". (strpos($_SERVER['USER_AGENT'], "MSIE 6.0") ? "<img src=_.png style=filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://acmlm.rustedlogic.net/etc/nismilly/stat.php)>" : "<img src=http://acmlm.rustedlogic.net/etc/nismilly/stat.php>") ." ". (strpos($_SERVER['USER_AGENT'], "MSIE 6.0") ? "<img src=_.png style=filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://acmlm.rustedlogic.net/etc/nismilly/stat.php)>" : "<img src=http://acmlm.rustedlogic.net/etc/nismilly/stat.php>") ."
</a> </a>
@ -612,7 +616,7 @@
$fcol3 = "#181818"; $fcol3 = "#181818";
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('valign=top', 'valign=top', $set[tdbg]) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 14px; color: $fcol1; font-family: Verdana, sans-serif; padding-top: .5em;\"> ". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 align=center style=\"background: $fcol3; font-size: 14px; color: $fcol1; font-family: Verdana, sans-serif; padding-top: .5em;\">
$set[userlink] $set[userlink]
<br><span style=\"letter-spacing: 0px; color: $fcol2; font-size: 10px;\">Collection of nobodies</span> <br><span style=\"letter-spacing: 0px; color: $fcol2; font-size: 10px;\">Collection of nobodies</span>
<br><img src=images/_.gif width=200 height=200> <br><img src=images/_.gif width=200 height=200>
@ -647,20 +651,20 @@
'6' => "<center style=\"text-align: center; color: #b09080;\">(Acc.)</center>", '6' => "<center style=\"text-align: center; color: #b09080;\">(Acc.)</center>",
); );
$user=mysql_fetch_array(mysql_query("SELECT name,posts,regdate,users_rpg.* FROM users,users_rpg WHERE id='". $post['uid'] ."' AND uid=id")); $user=mysql_fetch_array(mysql_query("SELECT name,posts,regdate,users_rpg.* FROM users,users_rpg WHERE id='". $post['uid'] ."' AND uid=id"));
$d=(ctime()-$user[regdate])/86400; $d=(ctime()-$user['regdate'])/86400;
$eqitems=mysql_query("SELECT * FROM items WHERE id=$user[eq1] OR id=$user[eq2] OR id=$user[eq3] OR id=$user[eq4] OR id=$user[eq5] OR id=$user[eq6]") or print mysql_error(); $eqitems=mysql_query("SELECT * FROM items WHERE id=$user[eq1] OR id=$user[eq2] OR id=$user[eq3] OR id=$user[eq4] OR id=$user[eq5] OR id=$user[eq6]") or print mysql_error();
while($item=mysql_fetch_array($eqitems)) { while($item=mysql_fetch_array($eqitems)) {
$items[$item[id]]=$item; $items[$item[id]]=$item;
$eq[$item['cat']] = $item['name']; $eq[$item['cat']] = $item['name'];
} }
if($ct){ if($ct){
$GPdif=floor($items[$user['eq'.$ct]][coins]*0.6)-$items[$it][coins]; $GPdif=floor($items[$user['eq'.$ct]]['coins']*0.6)-$items[$it]['coins'];
$user['eq'.$ct]=$it; $user['eq'.$ct]=$it;
} }
$st=getstats($user,$items); $st=getstats($user,$items);
$st[GP]+=$GPdif; $st['GP']+=$GPdif;
if($st[lvl]>0) $pct=1-calcexpleft($st[exp])/totallvlexp($st[lvl]); if($st['lvl']>0) $pct=1-calcexpleft($st['exp'])/totallvlexp($st['lvl']);
$st['expn'] = calcexpleft($st[exp]); $st['expn'] = calcexpleft($st['exp']);
$st['eq'] = $eq; $st['eq'] = $eq;
$x_hacks['rpgstats'][$post['uid']] = $st; $x_hacks['rpgstats'][$post['uid']] = $st;
@ -668,8 +672,8 @@
$st = $x_hacks['rpgstats'][$post['uid']]; $st = $x_hacks['rpgstats'][$post['uid']];
} }
$lastactivity = 'Active '. timeunits(ctime()-$post[lastactivity]) ." ago"; $lastactivity = 'Active '. timeunits(ctime()-$post['lastactivity']) ." ago";
$joindate = 'Joined '. date($dateshort,$post[regdate]+$tzoff); $joindate = 'Joined '. date($dateshort,$post['regdate']+$tzoff);
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
if(!$post['num']) { if(!$post['num']) {
@ -685,7 +689,7 @@
return "<div class='post'>$tblstart return "<div class='post'>$tblstart
". str_replace('valign=top', 'valign=top', $set[tdbg]) ." rowspan=2 width=200> ". str_replace('valign=top', 'valign=top', $set['tdbg']) ." rowspan=2 width=200>
<table style=\"font-family: Tahoma; font-size: 12px; color: #000; background: #e1cfb6;\" width=100% cellspacing=0> <table style=\"font-family: Tahoma; font-size: 12px; color: #000; background: #e1cfb6;\" width=100% cellspacing=0>
<tr> <tr>
<td style=\"background: #614735; text-align: left; padding: 2px 0px 2px 15px; font-size: 14px; letter-spacing: 1px; border: 2px outset #614735;\" colspan=4>$set[userlink]</td> <td style=\"background: #614735; text-align: left; padding: 2px 0px 2px 15px; font-size: 14px; letter-spacing: 1px; border: 2px outset #614735;\" colspan=4>$set[userlink]</td>
@ -851,4 +855,3 @@
} }
//End random shit for Inu's layout //End random shit for Inu's layout
?>