Fixing *all* visible errors on index.php

This commit is contained in:
Xkeeper 2015-08-08 23:54:10 -07:00
parent 8e0584fb3c
commit 562a7f3379
3 changed files with 26 additions and 41 deletions

View File

@ -83,7 +83,7 @@
$namelink = getuserlink($onuser); $namelink = getuserlink($onuser);
if($onuser['minipic']) { if($onuser['minipic']) {
$onuser['minipic']='<img width="16" height="16" src="'.str_replace('"','%22',$onuser[minipic]).'" align="absmiddle"> '; $onuser['minipic']='<img width="16" height="16" src="'.str_replace('"','%22',$onuser['minipic']).'" align="absmiddle"> ';
} }
if($onuser['lastactivity']<=$onlinetime) { if($onuser['lastactivity']<=$onlinetime) {
@ -186,9 +186,9 @@
</tr> </tr>
"; ";
$forumquery = $sql->query("SELECT f.*,u.id AS uid,name,sex,powerlevel,aka FROM forums f LEFT JOIN users u ON f.lastpostuser=u.id WHERE (!minpower OR minpower<=$power) AND f.hidden = '0' ORDER BY catid,forder"); $forumquery = $sql->query("SELECT f.*,u.id AS uid,name,sex,powerlevel,aka,birthday FROM forums f LEFT JOIN users u ON f.lastpostuser=u.id WHERE (!minpower OR minpower<=$power) AND f.hidden = '0' ORDER BY catid,forder");
$catquery = $sql->query("SELECT id,name FROM categories WHERE (!minpower OR minpower<=$power) ORDER BY id"); $catquery = $sql->query("SELECT id,name FROM categories WHERE (!minpower OR minpower<=$power) ORDER BY id");
$modquery = $sql->query("SELECT u.id id,name,sex,powerlevel,aka,forum FROM users u INNER JOIN forummods m ON u.id=m.user ORDER BY name"); $modquery = $sql->query("SELECT u.id id,name,sex,powerlevel,aka,forum,birthday FROM users u INNER JOIN forummods m ON u.id=m.user ORDER BY name");
$categories = array(); $categories = array();
$forums = array(); $forums = array();
@ -211,6 +211,7 @@
WHERE (`read` IS NULL OR `read` != 1) AND ($qadd) GROUP BY forum", 'forum', 'unread'); WHERE (`read` IS NULL OR `read` != 1) AND ($qadd) GROUP BY forum", 'forum', 'unread');
} }
$cat = filter_int($_GET['cat']);
foreach ($categories as $category) { foreach ($categories as $category) {
$forumlist.="<tr><td class='tbl tdbgc center font' colspan=5><a href=index.php?cat=$category[id]>$category[name]</a></td></tr>"; $forumlist.="<tr><td class='tbl tdbgc center font' colspan=5><a href=index.php?cat=$category[id]>$category[name]</a></td></tr>";
if($cat && $cat != $category['id']) if($cat && $cat != $category['id'])
@ -243,11 +244,6 @@
$by=''; $by='';
} }
if($forum['lastpostdate']>$category['lastpostdate']){
$category['lastpostdate']=$forum['lastpostdate'];
$category['l']=$forumlastpost.$by;
}
$new='&nbsp;'; $new='&nbsp;';
if ($forum['numposts']) { if ($forum['numposts']) {
@ -274,7 +270,7 @@
$smallfont$forum[description]<br>$modlist</td> $smallfont$forum[description]<br>$modlist</td>
$tccell1>$forum[numthreads]</td> $tccell1>$forum[numthreads]</td>
$tccell1>$forum[numposts]</td> $tccell1>$forum[numposts]</td>
$tccell2><span class='lastpost'>$forumlastpost</span>$by$forumlastuser $tccell2><span class='lastpost'>$forumlastpost</span> $by
</tr> </tr>
"; ";

View File

@ -1,5 +1,7 @@
<?php <?php
$startingtime = microtime(true);
$id = filter_int($_GET['id']); // Awful old legacy thing.
// Wait for the midnight backup to finish... // Wait for the midnight backup to finish...
if ((int)date("Gi") < 5) { if ((int)date("Gi") < 5) {
@ -1510,7 +1512,7 @@ function gethttpheaders() {
} }
function printtimedif($timestart){ function printtimedif($timestart){
global $x_hacks, $sql, $sqldebuggers; global $x_hacks, $sql, $sqldebuggers, $smallfont;
$exectime = microtime(true) - $timestart; $exectime = microtime(true) - $timestart;
@ -1532,12 +1534,14 @@ function printtimedif($timestart){
<tr><td align=right>Total render time:&nbsp;</td><td>{$tseconds} seconds</td></tr> <tr><td align=right>Total render time:&nbsp;</td><td>{$tseconds} seconds</td></tr>
</table>"; </table>";
/*
if (in_array($_SERVER['REMOTE_ADDR'], $sqldebuggers)) { if (in_array($_SERVER['REMOTE_ADDR'], $sqldebuggers)) {
if (!mysql::$debug_on && $_SERVER['REQUEST_METHOD'] != 'POST') if (!mysql::$debug_on && $_SERVER['REQUEST_METHOD'] != 'POST')
print "<br><a href=".$_SERVER['REQUEST_URI'].(($_SERVER['QUERY_STRING']) ? "&" : "?")."debugsql>Useless mySQL query debugging shit</a>"; print "<br><a href=".$_SERVER['REQUEST_URI'].(($_SERVER['QUERY_STRING']) ? "&" : "?")."debugsql>Useless mySQL query debugging shit</a>";
else else
print mysql::debugprinter(); print mysql::debugprinter();
} }
*/
if (!$x_hacks['host']) { if (!$x_hacks['host']) {
$pages = array( $pages = array(

View File

@ -241,20 +241,20 @@
} }
$headlinks2=" $headlinks2="
<a href='/index.php'>Main</a> <a href='index.php'>Main</a>
- <a href='/memberlist.php'>Memberlist</a> - <a href='memberlist.php'>Memberlist</a>
- <a href='/activeusers.php'>Active users</a> - <a href='activeusers.php'>Active users</a>
- <a href='/calendar.php'>Calendar</a> - <a href='calendar.php'>Calendar</a>
- <a href='http://tcrf.net'>Wiki</a> - <a href='http://tcrf.net'>Wiki</a>
- <a href='/irc.php'>IRC Chat</a> - <a href='irc.php'>IRC Chat</a>
- <a href='/online.php'>Online users</a><br> - <a href='online.php'>Online users</a><br>
<a href='/ranks.php'>Ranks</a> <a href='ranks.php'>Ranks</a>
- <a href='/faq.php'>Rules/FAQ</a> - <a href='faq.php'>Rules/FAQ</a>
- <a href='/acs.php'>JCS</a> - <a href='acs.php'>JCS</a>
- <a href='/stats.php'>Stats</a> - <a href='stats.php'>Stats</a>
- <a href='/latestposts.php'>Latest Posts</a> - <a href='latestposts.php'>Latest Posts</a>
- <a href='/hex.php' title='Color Chart' class='popout' target='_blank'>Color Chart</a> - <a href='hex.php' title='Color Chart' class='popout' target='_blank'>Color Chart</a>
- <a href='/smilies.php' title='Smilies' class='popout' target='_blank'>Smilies</a> - <a href='smilies.php' title='Smilies' class='popout' target='_blank'>Smilies</a>
"; ";
@ -414,7 +414,7 @@
function makeheader($header1,$headlinks,$header2) { function makeheader($header1,$headlinks,$header2) {
global $loguser, $PHP_SELF; global $loguser, $PHP_SELF;
$header = $header1.$headlinks.$header2; $header = $header1.$headlinks.$header2;
if (!$loguser['id'] && strpos($PHP_SELF, "index.php") === false) { if (!$loguser['id'] && strpos($PHP_SELF, "index.php") !== false) {
$header .= adbox() ."<br>"; $header .= adbox() ."<br>";
} }
return $header; return $header;
@ -503,26 +503,11 @@
<br>". ($loguser['id'] && strpos($PHP_SELF, "index.php") === false ? adbox() ."<br>" : "") ." <br>". ($loguser['id'] && strpos($PHP_SELF, "index.php") === false ? adbox() ."<br>" : "") ."
<center> <center>
<!--
<img src='adnonsense.php?m=d' title='generous donations to the first national bank of bad jokes and other dumb crap people post' style='margin-left: 44px;'><br> <img src='adnonsense.php?m=d' title='generous donations to the first national bank of bad jokes and other dumb crap people post' style='margin-left: 44px;'><br>
<img src='adnonsense.php' title='hotpod fund' style='margin: 0 22px;'><br> <img src='adnonsense.php' title='hotpod fund' style='margin: 0 22px;'><br>
<img src='adnonsense.php?m=v' title='VPS slushie fund' style='margin-right: 44px;'> <img src='adnonsense.php?m=v' title='VPS slushie fund' style='margin-right: 44px;'>
" -->
.
/* "
<br><img src='http://valkyrie.rustedlogic.net/h/' style='padding: 8px;' alt='' title='YOU ARE NOW HALF-ASSEDLY TESTING OUR NEW SERVER.'>
"
. */
/* "<script type=\"text/javascript\">
var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");
document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));
</script>
<script type=\"text/javascript\">
try {
var pageTracker = _gat._getTracker(\"UA-9215725-1\");
pageTracker._trackPageview();
} catch(err) {}</script>"
. */
"
<br> <br>
$smallfont $smallfont
<br><br><a href=$siteurl>$sitename</a> <br><br><a href=$siteurl>$sitename</a>