=$dd AND p.date<$dd2 AND u.powerlevel >= 0 GROUP BY u.id ORDER BY cnt DESC"); $i=0; if(!$u) $u=1; if($u==1) $n = $loguser[name]; if($u==2) $n = $user; if(!$view || $view <= 0 || $view > 2) $view=0; $ch1[$v] = 'checked'; $ch2[$u] = 'checked'; $ch3[$view] = 'checked'; $tposts = mysql_result(mysql_query("SELECT COUNT(*) AS cnt FROM posts WHERE posts.date>$dd AND posts.date<$dd2"),0,'cnt'); $rcount = ($tposts >= 400 ? 10 : 5); $spoints = ($tposts >= 400 ? 11 : 8); $desc="
$smallfont"; print " $header
$tblstart $tccellh colspan=2>Currently viewing ".date('m-d-y',$dd)." $tccell1>Day:$desc Select the day to view rankings from. (mm-dd-yy format) $tccell2l>$radio=v value=0 $ch1[0]> Today   $radio=v value=1 $ch1[1]> Other: $inpt=m VALUE=\"$m\" SIZE=2 MAXLENGTH=2>-$inpt=d VALUE=\"$d\" SIZE=2 MAXLENGTH=2>-$inpt=y VALUE=\"$y\" SIZE=2 MAXLENGTH=2> $tccell1>User:$desc This user will be highlighted. $tccell2l>$radio=u value=0 $ch2[0]> None   $radio=u value=1 $ch2[1]> You   $radio=u value=2 $ch2[2]> Other: $inpt=user VALUE=\"$user\" SIZE=25 MAXLENGTH=25> $tccell1>View format: $tccell2l>$radio=view value=0 $ch3[0]> Full rankings   $radio=view value=1 $ch3[1]> Rankers   $radio=view value=2 $ch3[2]> JCS form $tccell1>  $tccell2l> $tblend $tblstart "; $max=1; if($view<2){ print " $tccellh width=30># $tccellh>Name $tccellh width=50>Posts $tccellh>Total: $tposts "; while($user=mysql_fetch_array($users)){ if($user[cnt]>$max) $max=$user[cnt]; $i++; if($rp!=$user[cnt]) $r=$i; $rp=$user[cnt]; if($rr<=$rcount && $r>$rcount && $view==0) print "$tccellc colspan=4>"; $rr=$r; $b=''; $td=$tccell1; if($r>$rcount) $td=$tccell2; if($user[name]==$n){ $td=$tccellc; $b=''; } $tdl=str_replace(' center','',$td); if($view==0 or ($view==1 and ($r<=$rcount or $n==$user[name]))) { print " $td>$b$r $tdl>". (!$_GET['dur'] ? $user[name] : "DU". str_repeat("R", mt_rand(1,25))) ." $td>$b$user[cnt] $tdl> "; } } } else { $usersy=mysql_query("SELECT users.id,users.name,users.sex,users.powerlevel,COUNT(posts.id) AS cnt FROM users,posts WHERE posts.user=users.id AND posts.date>".($dd-86400)." AND posts.date<$dd GROUP BY users.id ORDER BY cnt DESC"); $i=0; while($user=mysql_fetch_array($usersy) and $r <= $rcount ) { $i++; if($rp!=$user[cnt]) $r=$i; $rp=$user[cnt]; if($r<=5) $ranky[$user[id]]=$r; } $i=0; $rp=0; $r=0; while($user=mysql_fetch_array($users) and $r <= $rcount){ $i++; if($rp!=$user[cnt]){ $r=$i; if($tend) $tie=''; if($tie) $tend=1; }else{ $tie='T'; $tend=0; } $posts[$user[id]]=$user[cnt]; $ry=$ranky[$user[id]]; if(!$ry) $ry='NR'; $rp=$user[cnt]; $dailyposts .= $tie . $ndailyposts; $dailypoints .= $tie . $ndailypoints; // $ndailyposts = "$tie$r) ". $user['name'] ." - ". $user['cnt'] ." - ". ($spoints - $r) ."
"; // $ndailyposts = "$tie$r) ". $user['name'] ." - ". $user['cnt'] ." - ". ($spoints - $r) ."
"; $ndailyposts = "$r) ". $user['name'] ." - ". $user['cnt'] ."
"; $ndailypoints = "$r) ". $user['name'] ." - ". ($spoints - $r) ."
"; } if($r<=$rcount){ if($tend) $tie=''; // $dailyposts.=$tie.$ndailyposts; // $dailypoints.=$tie.$ndailypoints; } $lose=$user[cnt]; @mysql_data_seek($usersy,0); $i=0; $rp=0; $r=0; while($user=mysql_fetch_array($usersy) and $r<=$rcount){ $i++; if($rp!=$user[cnt]) $r=$i; $rp=$user[cnt]; if($posts[$user[id]]<=$lose && $r<=$rcount) $offcharts.=($offcharts?', ':'OFF THE CHARTS: ')."$user[name] ($r)"; } print " $tccell1l> ". strtoupper(date('F j',$dd)) ."
". "---------

". "TOTAL NUMBER OF POSTS: $tposts

". "$dailyposts

". "DAILY POINTS
". "--------------------
". "$dailypoints"; } print $tblend.$footer; printtimedif($startingtime);