Jump to content

Elite Gaming Ladder v2


dizeazed

Recommended Posts

here is my problem: http://sheergaming.exofire.net/Forums/

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 61

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 79

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 87

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 96

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 170

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 575

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 579

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 587

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 591

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 625

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/diseased/public_html/Forums/index.php on line 645

 

here is my index.php file

 

<?
/*======================================================================*\
|| #################################################################### ||
|| # Elite Gaming Ladder v2
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2007-2008 Elite Gaming Ladder Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ------------------- EGL IS NOT FREE SOFTWARE ------------------- # ||
|| #                   http://www.eliteladders.com                    # ||
|| #################################################################### ||
\*======================================================================*/
define("sub", "level");
include("../includes/incglobal.php");
include("./theme/default/styleinfo.php");


switch($action){

case "mark_read":
mark_read();
break;

case "add_shout":
add_shout($shout);
break;

default:
showforums();
break;
}


function showforums(){
global $config;

if(!$_COOKIE['tid']){
$guestip=getenv("REMOTE_ADDR");

$guest=mysql_query("SELECT * FROM active_guests WHERE ipaddress='$guestip'");
$guest=mysql_fetch_array($guest);

if($guest){

mysql_query("UPDATE active_guests SET 
ipaddress='$guestip' WHERE ipaddress='$guestip'");
}

if(!$guest){

mysql_query("INSERT INTO active_guests VALUES (
NULL, 
'$guestip',
NULL)");
}
}

if($_COOKIE['tid']){


$auser=mysql_query("SELECT * FROM active_users WHERE userid='{$_COOKIE['tid']}'");
$auser=mysql_fetch_array($auser);

if($auser){

mysql_query("UPDATE active_users SET 
userid='{$_COOKIE['tid']}' WHERE userid='{$_COOKIE['tid']}'");
}


if(!$auser){
mysql_query("INSERT INTO active_users VALUES (
NULL, 
'{$_COOKIE['tid']}',
NULL)");
}
}

$iguests=mysql_query("SELECT id,ipaddress,active FROM active_guests");
while(list($id,$ipaddress,$active)=mysql_fetch_row($iguests)){

//DELETE INACTIVE GUESTS

$deleteiguests=date("Y-m-d H:i:s",time()-60*1);
mysql_query("DELETE FROM active_guests WHERE active < '$deleteiguests'");
}
$iusers=mysql_query("SELECT id,userid,active FROM active_users");
while(list($id,$userid,$active)=mysql_fetch_row($iusers)){

//DELETE INACTIVE USERS

$deleteiusers=date("Y-m-d H:i:s",time()-60*5);
mysql_query("DELETE FROM active_users WHERE active < '$deleteiusers'");
}

$fsettings=mysql_query("SELECT * FROM forums_settings");
$fsettings=mysql_fetch_array($fsettings);

if($fsettings[shoutbox]==yes){

$out[body].="
<center><br><form method='post' style='margin-bottom: 0'  onsubmit='return checkForm(this)' name='editform'>
<div style='background-image:url($config[bg]);border: 1px solid rgb(0, 0, 0);width:90%;' class='headertext'><b>Shout Box</b></div>
<iframe src='shoutbox.php' height='150' width='90%' name='tagit' marginheight='0' marginwidth='0'>Browser Does Not Support I-Frames</iframe>
<br>";

if($_COOKIE['tid']){

$out[body].="<script src=\"./editor/editor.js\"></script>
        <script type=\"text/javascript\">
            function roll(obj, highlightcolor, textcolor){
                obj.style.backgroundColor = highlightcolor;
                obj.style.color = textcolor;
            }
        </script>
<div style='background-color:$config[altcolora];border: 1px solid rgb(0, 0, 0);width:90%;' align='left'>

<input type='text' name='shout[message]' id='post' class='button' type='text' size='80'/>
<input type='hidden' name='shout[shouter]' value='{$_COOKIE['tid']}'>
<input type='hidden' name='action' value='add_shout'>
<input type='submit' name='submit' class='button' value='Shout' />      
<a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_smile.gif' border='0' alt='smile' title='smile' /></a>
                <a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_frown.gif' border='0' alt='big grin' title='big grin'/></a>
                 <a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_wink.gif' border='0' alt='big grin' title='big grin'/></a>
                <a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_razz.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_biggrin.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_cry.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_eek.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie('')\">
                        <img src='editor/smilies/yellow/icon_lol.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie(':mad:')\">
                        <img src='editor/smilies/yellow/icon_mad.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie(':green:')\">
                        <img src='editor/smilies/yellow/icon_mrgreen.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie(':|')\">
                        <img src='editor/smilies/yellow/icon_neutral.gif' border='0' alt='razz' title='razz' /></a>
                <a href=\"javascript:smilie(':roll:')\">
                        <img src='editor/smilies/yellow/icon_rolleyes.gif' border='0' alt='razz' title='razz' /></a>

</form></div></center>";
}
}
$out[body].="<br><center><form method='post' style='margin-bottom: 0'>
<table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#000000' cellpadding='1' cellspacing='1'>
<tr bgcolor='$config[altcolor]'>
<td width='100%' valign='center' background='$config[bg]' colspan='5'><b> Search Forums</b></td>
</tr>
<tr bgcolor='$config[altcolorb]'>
<td valign='center' align='center'>Search by 
<select name='search[by]' class='button'>
<option value=''>User</option>
<option value=''>All Posts</option>
<option value=''>All Threads</option>
</select> in <select name='search[in]' class='button'>
<option value=''>All Forums</option>
</select> and is like <input type='text' name='search[string]' class='button'>
<input type='submit' name='submit' value='Search' class='button'></form>
</td>
</tr></table><br>
<table width='90%' border='0' cellspacing='1' cellpadding='1' cellpadding='1' cellspacing='1'><div align='right'>
<a href='./index.php?action=mark_read'>Mark Forums Read</a> <b>|</b> <a href='./search.php?action=newposts'>View New Posts</a></div></table>";

$category=mysql_query("SELECT id,name,private,privateusers FROM forums_category ORDER BY priority ASC");
while(list($id,$name,$private,$privateusers)=mysql_fetch_row($category)){

$forums=mysql_query("SELECT COUNT(*) FROM forums_forums WHERE category='$id'");
$forums=mysql_fetch_array($forums);
$forums="$forums[0]";


if($private==yes){

$privateusers = explode(", ",$privateusers);  
$youprivate="{$_COOKIE['tid']}";


if (in_array($youprivate, $privateusers))
	{

$out[body].="<center>
<table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#000000' cellpadding='1' cellspacing='1'>
<tr bgcolor='$config[altcolor]'>
<td width='100%' valign='center' background='$config[bg]' colspan='5'><b> $name</b></td>
</tr>
<tr bgcolor='$config[altcolorb]'>
<td width='5%' valign='center' background='$config[bg2]' align='center'><b></b></td>
<td width='45%' valign='center' background='$config[bg2]' align='center'><b>Forum</b></td>
<td width='25%' valign='center' background='$config[bg2]' align='center'><b>Last Post</b></td>
<td width='7%' valign='center' background='$config[bg2]' align='center'><b>Threads</b></td>
<td width='7%' valign='center' background='$config[bg2]' align='center'><b>Posts</b></td>
</tr>";



$cforums=mysql_query("SELECT id,name,details,private,privateusers FROM forums_forums WHERE category='$id' AND subforum='' ORDER BY priority ASC");
while(list($id,$name,$details,$private,$privateusers)=mysql_fetch_row($cforums)){

$forumname="$name";
$forumid="$id";
$forumprivate="$private";

$fprivateusers = explode(", ",$privateusers);  
$fyouprivate="{$_COOKIE['tid']}";


if($config[altcolorx]==$config[altcolora]){
$config[altcolorx]="$config[altcolorb]";
}else{
$config[altcolorx]="$config[altcolora]";
}


$thread=mysql_query("SELECT *,DATE_FORMAT(posted,'%M %d at %l:%i %p')as 'lastposted' FROM forums_posts WHERE forum='$id' ORDER BY posted DESC LIMIT 0,1");
$thread=mysql_fetch_array($thread);

$tpinfo=mysql_query("SELECT * FROM members WHERE id='$thread[user]'");
$tpinfo=mysql_fetch_array($tpinfo);

$tinfo=mysql_query("SELECT * FROM forums_threads WHERE id='$thread[thread]'");
$tinfo=mysql_fetch_array($tinfo);

$tactive=mysql_query("SELECT *,DATE_FORMAT(posted,'%m/%d/%Y') as 'lastposted' FROM forums_posts WHERE forum='$id' ORDER BY posted DESC LIMIT 0,1");
$tactive=mysql_fetch_array($tactive);

$threads=mysql_query("SELECT COUNT(*) FROM forums_threads WHERE forum='$id'");
$threads=mysql_fetch_array($threads);
$threads="$threads[0]";

$totalviewed=mysql_query("SELECT COUNT(*) FROM forums_read WHERE forum='$id' AND user='{$_COOKIE['tid']}'");
$totalviewed=mysql_fetch_array($totalviewed);
$totalviewed="$totalviewed[0]";

if($threads=="0"){
$active="<img src='./images/forum_old.gif'>";
} else {
if("{$_COOKIE['tid']}"){
if($totalviewed=="$threads"){
$active="<img src='./images/forum_old.gif'>";
} else {
$active="<img src='./images/forum_new.gif'>";
}
} else {
$active="<img src='./images/forum_old.gif'>";
}
}


if($locked==yes){
$active="<img src='./images/forum_locked.gif'>";
}

$posts=mysql_query("SELECT COUNT(*) FROM forums_posts WHERE forum='$id'");
$posts=mysql_fetch_array($posts);
$posts="$posts[0]";

$sforum=mysql_query("SELECT * FROM forums_forums WHERE subforum='$forumid'");
$sforum=mysql_fetch_array($sforum);

$search[by]="";

if($sforum[id]){

$slastposts=mysql_query("SELECT id FROM forums_forums WHERE subforum='$forumid'");
while(list($id)=mysql_fetch_row($slastposts)){
$search[by].="OR forum='$id'";

}}
else {
$search[by]="";
}


$slp=mysql_query("SELECT *,DATE_FORMAT(posted,'%M %d at %l:%i %p')as 'lastposted' FROM forums_posts WHERE forum='$forumid' $search[by] ORDER BY posted DESC LIMIT 0,1");
$slp=mysql_fetch_array($slp);

$stpinfo=mysql_query("SELECT * FROM members WHERE id='$slp[user]'");
$stpinfo=mysql_fetch_array($stpinfo);

$stinfo=mysql_query("SELECT * FROM forums_threads WHERE id='$slp[thread]'");
$stinfo=mysql_fetch_array($stinfo);

$ifadmin ="$fsettings[admins]";
$ifadmin = explode(", ",$ifadmin);  

if (in_array($thread[user], $ifadmin)){
$color="<font color='red'><b>";
$color2="</b></font>";
}else{
$color="";
$color2="";
}


$lastpost="<a href='./viewthread.php?id=$slp[thread]#$slp[id]'>$stinfo[name]</a> by <a href='../profile.php?account=$thread[user]'>$color$stpinfo[name]$color2</a><br /> on $slp[lastposted]";


if(!$slp[id]){
$lastpost="Never";
}

if(!$sforum[id]){
$subforumstitle="";
$subforums="";
} else {

$subforumstitle="<br>Subforums: ";


$subcforums=mysql_query("SELECT id,name FROM forums_forums WHERE subforum='$forumid' ORDER BY priority ASC");
while(list($id,$name)=mysql_fetch_row($subcforums)){

$subforums.="<a href='./viewforum.php?id=$id'>$name</a>, ";
}

  $subforums=substr($subforums,0,-2);
  $subforums.= ""; 


}

if($forumprivate=="yes"){

if (in_array($fyouprivate, $fprivateusers))
	{

$out[body].="
<tr bgcolor='$config[altcolorx]'  onmouseover=\"this.style.backgroundColor='$config[roll]'\" onmouseout=\"this.style.backgroundColor='$config[altcolorx]'\">
<td width='5%' valign='center' align='center' background='$config[cellbgx]'>$active</td>
<td width='45%' valign='center' align='left' background='$config[cellbgx]' style=\"cursor:hand\" onclick=\"window.location.href = './viewforum.php?id=$forumid'\">
<a href='./viewforum.php?id=$forumid'>$forumname</font></a><br>$details $subforumstitle $subforums</td>
<td width='25%' valign='center' align='center' background='$config[cellbgx]'>$lastpost</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$threads</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$posts</a></td>
</tr>";
} 

if (in_array(!$fyouprivate, $fprivateusers))
	 {

$out[body].="
<tr bgcolor='$config[altcolorx]'  onmouseover=\"this.style.backgroundColor='$config[roll]'\" onmouseout=\"this.style.backgroundColor='$config[altcolorx]'\">
<td width='5%' valign='center' align='center' background='$config[cellbgx]'>$active</td>
<td width='45%' valign='center' align='center' background='$config[cellbgx]'>Private</td>
<td width='25%' valign='center' align='center' background='$config[cellbgx]'>Private</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>Private</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>Private</a></td>
</tr>";

}}

if($forumprivate==no) {
$out[body].="
<tr bgcolor='$config[altcolorx]'  onmouseover=\"this.style.backgroundColor='$config[roll]'\" onmouseout=\"this.style.backgroundColor='$config[altcolorx]'\">
<td width='5%' valign='center' align='center' background='$config[cellbgx]'>$active</td>
<td width='45%' valign='center' align='left' background='$config[cellbgx]' style=\"cursor:hand\" onclick=\"window.location.href = './viewforum.php?id=$forumid'\">
<a href='./viewforum.php?id=$forumid'>$forumname</font></a><br>$details $subforumstitle $subforums</td>
<td width='25%' valign='center' align='center' background='$config[cellbgx]'>$lastpost</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$threads</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$posts</a></td>
</tr>";
}


if($forums==0){
$out[body].="
<tr bgcolor='$config[altcolora]'>
<td valign='center' align='center' background='$config[altcolorx]' colspan='5'>There is no forums in this category.</td>
</tr>";

}

}
$out[body].="</table><br>";

}}



if($private==no){

$out[body].="<center>
<table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#000000' cellpadding='1' cellspacing='1'>
<tr bgcolor='$config[altcolor]'>
<td width='100%' valign='center' background='$config[bg]' colspan='5'><b> $name</b></td>
</tr>
<tr bgcolor='$config[altcolorb]'>
<td width='5%' valign='center' background='$config[bg2]' align='center'><b></b></td>
<td width='45%' valign='center' background='$config[bg2]' align='center'><b>Forum</b></td>
<td width='25%' valign='center' background='$config[bg2]' align='center'><b>Last Post</b></td>
<td width='7%' valign='center' background='$config[bg2]' align='center'><b>Threads</b></td>
<td width='7%' valign='center' background='$config[bg2]' align='center'><b>Posts</b></td>
</tr>";


$cforums=mysql_query("SELECT id,name,details,private,locked FROM forums_forums WHERE category='$id' AND subforum='' ORDER BY priority ASC");
while(list($id,$name,$details,$private,$locked)=mysql_fetch_row($cforums)){

$forumname="$name";
$forumid="$id";
$forumprivate="$private";

$pusers=mysql_query("SELECT * FROM forums_privateusers WHERE user='{$_COOKIE['tid']}' AND forum='$id'");
$pusers=mysql_fetch_array($pusers);

if($config[altcolorx]==$config[altcolora]){
$config[altcolorx]="$config[altcolorb]";
}else{
$config[altcolorx]="$config[altcolora]";
}

$thread=mysql_query("SELECT *,DATE_FORMAT(posted,'%M %d at %l:%i %p')as 'lastposted' FROM forums_posts WHERE forum='$id' ORDER BY posted DESC LIMIT 0,1");
$thread=mysql_fetch_array($thread);

$tpinfo=mysql_query("SELECT * FROM members WHERE id='$thread[user]'");
$tpinfo=mysql_fetch_array($tpinfo);

$tinfo=mysql_query("SELECT * FROM forums_threads WHERE id='$thread[thread]'");
$tinfo=mysql_fetch_array($tinfo);

$tactive=mysql_query("SELECT *,DATE_FORMAT(posted,'%m/%d/%Y') as 'lastposted' FROM forums_posts WHERE forum='$id' ORDER BY posted DESC LIMIT 0,1");
$tactive=mysql_fetch_array($tactive);

$threads=mysql_query("SELECT COUNT(*) FROM forums_threads WHERE forum='$id'");
$threads=mysql_fetch_array($threads);
$threads="$threads[0]";


$totalviewed=mysql_query("SELECT COUNT(*) FROM forums_read WHERE forum='$id' AND user='{$_COOKIE['tid']}'");
$totalviewed=mysql_fetch_array($totalviewed);
$totalviewed="$totalviewed[0]";

if($threads=="0"){
$active="<img src='./images/forum_old.gif'>";
} else {
if("{$_COOKIE['tid']}"){
if($totalviewed=="$threads"){
$active="<img src='./images/forum_old.gif'>";
} else {
$active="<img src='./images/forum_new.gif'>";
}
} else {
$active="<img src='./images/forum_old.gif'>";
}
}


if($locked==yes){
$active="<img src='./images/forum_locked.gif'>";
}

$posts=mysql_query("SELECT COUNT(*) FROM forums_posts WHERE forum='$id'");
$posts=mysql_fetch_array($posts);
$posts="$posts[0]";

$sforum=mysql_query("SELECT * FROM forums_forums WHERE subforum='$forumid'");
$sforum=mysql_fetch_array($sforum);

$search[by]="";

if($sforum[id]){

$slastposts=mysql_query("SELECT id FROM forums_forums WHERE subforum='$forumid'");
while(list($id)=mysql_fetch_row($slastposts)){
$search[by].="OR forum='$id'";

}}
else {
$search[by]="";
}


$slp=mysql_query("SELECT *,DATE_FORMAT(posted,'%M %d at %l:%i %p')as 'lastposted' FROM forums_posts WHERE forum='$forumid' $search[by] ORDER BY posted DESC LIMIT 0,1");
$slp=mysql_fetch_array($slp);

$stpinfo=mysql_query("SELECT * FROM members WHERE id='$slp[user]'");
$stpinfo=mysql_fetch_array($stpinfo);

$stinfo=mysql_query("SELECT * FROM forums_threads WHERE id='$slp[thread]'");
$stinfo=mysql_fetch_array($stinfo);

$ifadmin ="$fsettings[admins]";
$ifadmin = explode(", ",$ifadmin);  

if (in_array($thread[user], $ifadmin)){
$color="<font color='red'><b>";
$color2="</b></font>";
}else{
$color="";
$color2="";
}

$lastpost="<a href='./viewthread.php?id=$slp[thread]#$slp[id]'>$stinfo[name]</a> by <a href='../profile.php?account=$thread[user]'>$color$stpinfo[name]$color2</a><br /> on $slp[lastposted]";


if(!$slp[id]){
$lastpost="Never";
}

if(!$sforum[id]){
$subforumstitle="";
$subforums="";
} else {

$subforumstitle="<br>Subforums: ";


$subcforums=mysql_query("SELECT id,name FROM forums_forums WHERE subforum='$forumid' ORDER BY priority ASC");
while(list($id,$name)=mysql_fetch_row($subcforums)){

$subforums.="<a href='./viewforum.php?id=$id'>$name</a>, ";
}

  $subforums=substr($subforums,0,-2);
  $subforums.= ""; 


}

if($forumprivate=="yes" && $pusers[id]){

$out[body].="
<tr bgcolor='$config[altcolorx]'  onmouseover=\"this.style.backgroundColor='$config[roll]'\" onmouseout=\"this.style.backgroundColor='$config[altcolorx]'\">
<td width='5%' valign='center' align='center' background='$config[cellbgx]'>$active</td>
<td width='45%' valign='center' align='left' background='$config[cellbgx]' style=\"cursor:hand\" onclick=\"window.location.href = './viewforum.php?id=$forumid'\">
<a href='./viewforum.php?id=$forumid'>$forumname</font></a><br>$details $subforumstitle $subforums</td>
<td width='25%' valign='center' align='center' background='$config[cellbgx]'>$lastpost</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$threads</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$posts</a></td>
</tr>";
}

if($forumprivate==no) {
$out[body].="
<tr bgcolor='$config[altcolorx]'  onmouseover=\"this.style.backgroundColor='$config[roll]'\" onmouseout=\"this.style.backgroundColor='$config[altcolorx]'\">
<td width='5%' valign='center' align='center'>$active</td>
<td width='45%' valign='center' align='left' style=\"cursor:hand\" onclick=\"window.location.href = './viewforum.php?id=$forumid'\">
<a href='./viewforum.php?id=$forumid'>$forumname</font></a><br>$details $subforumstitle $subforums</td>
<td width='25%' valign='center' align='center' background='$config[cellbgx]'>$lastpost</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$threads</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>$posts</a></td>
</tr>";
}

if($forumprivate=="yes" && !$pusers[id]){
$out[body].="
<tr bgcolor='$config[altcolorx]' onmouseover=\"this.style.backgroundColor='$config[roll]'\" onmouseout=\"this.style.backgroundColor='$config[altcolorx]'\">
<td width='5%' valign='center' align='center' background='$config[cellbgx]'>$active</td>
<td width='45%' valign='center' align='center' background='$config[cellbgx]'>Private</td>
<td width='25%' valign='center' align='center' background='$config[cellbgx]'>Private</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>Private</td>
<td width='7%' valign='center' align='center' background='$config[cellbgx]'>Private</a></td>
</tr>";
}
}


if($forums==0){
$out[body].="
<tr bgcolor='$config[altcolora]'>
<td valign='center' align='center' background='$config[altcolorx]' colspan='5'>There is no forums in this category.</td>
</tr>";

}

$out[body].="</table><br />";
}}

$totalthreads=mysql_query("SELECT COUNT(*) FROM forums_threads");
$totalthreads=mysql_fetch_array($totalthreads);
$totalthreads="$totalthreads[0]";

$totalposts=mysql_query("SELECT COUNT(*) FROM forums_posts");
$totalposts=mysql_fetch_array($totalposts);
$totalposts="$totalposts[0]";

$totalmembers=mysql_query("SELECT COUNT(*) FROM members");
$totalmembers=mysql_fetch_array($totalmembers);
$totalmembers="$totalmembers[0]";

$totalguests=mysql_query("SELECT COUNT(*) FROM active_guests");
$totalguests=mysql_fetch_array($totalguests);
$totalguests="$totalguests[0]";

$totalusers=mysql_query("SELECT COUNT(*) FROM active_users");
$totalusers=mysql_fetch_array($totalusers);
$totalusers="$totalusers[0]";

if($totalguests!=0){

if($totalguests==1){
$guestafter="guest";
} else {
$guestafter="guests";
}

$totalaguests="$totalguests $guestafter";
}
if($totalusers!=0){

if($totalusers==1){
$userafter="member";
} else {
$userafter="members";
}
$totalausers="$totalusers $userafter";
}
if($totalguests!=0 AND $totalusers!=0){
$totalaboth=" and ";
}

if($totalguests==0 AND $totalusers==0){
$allusers="";
} else {
$allusers="($totalausers$totalaboth$totalaguests)";
}
$totalactive=($totalusers+$totalaguests);

$activemembers=mysql_query("SELECT id,userid,active FROM active_users");
while(list($id,$userid,$active)=mysql_fetch_row($activemembers)){

$meminfo=mysql_query("SELECT * FROM members WHERE id='$userid'");
$meminfo=mysql_fetch_array($meminfo);

$ifadmin = explode(", ",$fsettings[admins]);  

if (in_array($userid, $ifadmin))
	{
$allactivemembers.="<a href='../profile.php?account=$userid'><b><font color='red'>$meminfo[name]</font></b></a> ";
} else
	{
$allactivemembers.="<a href='../profile.php?account=$userid'>$meminfo[name]</a> ";
}
}
$newestmember=mysql_query("SELECT * FROM members ORDER BY id DESC LIMIT 0,1");
$newestmember=mysql_fetch_array($newestmember);


$tuonline=mysql_query("SELECT *,DATE_FORMAT(date,'%M %d at %l:%i %p')as 'lastonline' FROM mostonline");
$tuonline=mysql_fetch_array($tuonline);

$out[body].="<center>
<table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#000000' cellpadding='1' cellspacing='1'>
<tr bgcolor='$config[altcolor]'>
<td width='100%' valign='center' background='$config[bg]' colspan='2'><b> What's Going On?</b></td>
</tr>

<tr bgcolor='$config[altcolorb]'>
<td width='10%' valign='center' background='$config[bg2]' align='left' colspan='2'>Currently Active Users: $totalactive $allusers</td>
</tr>
<tr bgcolor='$config[altcolorx]'>
<td valign='center' align='center' background='$config[cellbgx]'>
<img src='./images/whos_online.gif'> 
</td>
<td valign='center' align='left' background='$config[cellbgx]'>
Most users ever online was $tuonline[amount] On $tuonline[lastonline]<br>
$allactivemembers
</tr>
<tr bgcolor='$config[altcolorb]'>
<td width='10%' valign='center' background='$config[bg2]' align='left' colspan='2'>$config[sitename] Forums Statistics</td>
</tr>
<tr bgcolor='$config[altcolorx]'>
<td valign='center' align='center' background='$config[cellbgx]'>
<img src='./images/stats.gif'> 
</td>
<td valign='center' align='left' background='$config[cellbgx]'>
Threads: $totalthreads, Posts: $totalposts, Members: $totalmembers<br>
Welcome to our newest member <a href='../profile.php?account=$newestmember[id]'>$newestmember[name]</a><br>
</td>
</tr>
</table><br>

<table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#000000' cellpadding='1' cellspacing='1'>
<tr bgcolor='$config[altcolorx]'>
<td width='33%' valign='center' align='center' background='$config[cellbgx]'>
<img src='./images/forum_new.gif'> Forum Contains New Posts
</td>
<td width='33%' valign='center' align='center' background='$config[cellbgx]'>
<img src='./images/forum_old.gif'> Forum Contains No New Posts
</td>
<td width='33%' valign='center' align='center' background='$config[cellbgx]'>
<img src='./images/forum_locked.gif'> Forum Is Locked
</td>
</tr>
</table>";

$out[body].="<br /><br /><br /><br />";
include("$config[html]");
}


function add_shout($shout){
global $config;


$fsettings=mysql_query("SELECT * FROM forums_settings");
$fsettings=mysql_fetch_array($fsettings);

$adminusers ="$fsettings[sbadmins]";
$adminusers = explode(", ",$adminusers);  
$youadmin="{$_COOKIE['tid']}";

$bannedusers ="$fsettings[banned]";
$bannedusers = explode(", ",$bannedusers);  
$youbanned="{$_COOKIE['tid']}";

if (in_array($youbanned, $bannedusers))
	{


showforums();
exit;


} 

$notice="$shout[message]";
$notice=substr($notice,0,7);

$banning="$shout[message]";
$banning=substr($banning,0,4);


if (in_array($youadmin, $adminusers))
	{

if($notice=="/notice"){

$newnotice="$shout[message]";
$newnotice=substr($newnotice,8,100);


mysql_query("UPDATE forums_settings SET
notice='$newnotice'");

showforums();
exit;
}

$unbanning="$shout[message]";
$unbanning=substr($unbanning,0,6);

if($unbanning=="/unban"){

$unban="$shout[message]";
$unban=substr($unban,7,100);

$isuser=mysql_query("SELECT * FROM members WHERE id='$unban' OR name='$unban'");
$isuser=mysql_fetch_array($isuser);

if(!$isuser[id]){

showforums();
exit;
}
$unban="$isuser[id]";

    $newban = str_replace(", $unban", "", "$fsettings[banned]");
$newban = str_replace("$unban, ", "", "$newban");    
       $newban = str_replace("$unban", "", "$newban"); 
       $newban = str_replace(", ,", ",", "$newban");  

mysql_query("UPDATE forums_settings SET
banned='$newban'");

mysql_query("INSERT INTO shoutbox VALUES (
NULL,
'$isuser[id]',
NULL,
'/unban')");


showforums();
exit;
}
if($banning=="/ban"){

$ban="$shout[message]";
$ban=substr($ban,5,100);

$allbannedusers=mysql_query("SELECT * FROM forums_settings");
$allbannedusers=mysql_fetch_array($allbannedusers);

$isuser=mysql_query("SELECT * FROM members WHERE id='$ban' OR name='$ban'");
$isuser=mysql_fetch_array($isuser);

if(!$isuser[id]){

showforums();
exit;
}

mysql_query("INSERT INTO shoutbox VALUES (
NULL,
'$isuser[id]',
NULL,
'/ban')");

if($allbannedusers[banned]==""){

mysql_query("UPDATE forums_settings SET
banned='$isuser[id]'");
} else {

mysql_query("UPDATE forums_settings SET
banned='$allbannedusers[banned], $isuser[id]'
WHERE name='banned'");
}
showforums();
exit;
}
if($shout[message]=="/prune"){


mysql_query("DELETE FROM shoutbox");


}
}
else {

if($banning=="/ban"){

showforums();
exit;
}
if($unbanning=="/unban"){

showforums();
exit;
}

if($shout[message]=="/prune"){

showforums();
exit;
}
if($shout[message]=="/notice"){

showforums();
exit;
}
}
if($shout[message]==""){

showforums();
exit;
}

mysql_query("INSERT INTO shoutbox VALUES (
NULL,
'$shout[shouter]',
NULL,
'$shout[message]')");

showforums();

}


function mark_read(){
global $config;

if("{$_COOKIE['tid']}"){

$cforums=mysql_query("SELECT id,forum FROM forums_threads");
while(list($id,$forum)=mysql_fetch_row($cforums)){

$ifviewed=mysql_query("SELECT * FROM forums_read WHERE forum='$forum' AND thread='$id' AND user='{$_COOKIE['tid']}'");
$ifviewed=mysql_fetch_array($ifviewed);

if($ifviewed[id]){

} else {

mysql_query("INSERT INTO forums_read VALUES (
NULL,
'{$_COOKIE['tid']}',
'$forum',
'$id')");
}
}
showforums();
exit;

} else {

showforums();
exit;

}
}

?>

Link to comment
Share on other sites

here are the lines that have warnings if it helps.

line 61      $auser=mysql_fetch_array($auser);
line 79      while(list($id,$ipaddress,$active)=mysql_fetch_row($iguests)){
line 87      while(list($id,$userid,$active)=mysql_fetch_row($iusers)){
line 96      $fsettings=mysql_fetch_array($fsettings);
line 170     while(list($id,$name,$private,$privateusers)=mysql_fetch_row($category)){
line 575     $totalthreads=mysql_fetch_array($totalthreads);
line 579     $totalposts=mysql_fetch_array($totalposts);         
line 587     $totalguests=mysql_fetch_array($totalguests);
line 591     $totalusers=mysql_fetch_array($totalusers);
line 625     while(list($id,$userid,$active)=mysql_fetch_row($activemembers)){
line 645     uonline=mysql_fetch_array($tuonline);

Link to comment
Share on other sites

hmm have you made sure you got proper connection to mysql db and the tables are created?

that many errors could suggest the script is having problem with the database, and its not a php code error.

 

i get the same errors if i spell the name of the mysql table wrong.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.