Exclamation HELP To speedup this!
SOMEONE HELP to speed up "View category" func?it very slow to open this...this is code what I using now
	SOMEONE HELP to speed up "View category" func?it very slow to open this...this is code what I using now

PHP Code:
	
	
if(canaccess(getuid_sid($sid), $forum[0]))
{
   $notp = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$forum[0]."' LIMIT 0,1"));
// $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts, ibwf_topics WHERE ibwf_posts.tid = ibwf_topics.id AND ibwf_topics.fid = '".$forum[0]."' LIMIT 0,1"));
// $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id WHERE b.fid='".$forum[0]."'"));
$iml = "<img src=\"images/1.gif\" alt=\"*\"/>";
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$forum[0]\">$iml$forum[1] ($notp[0] topika)</a><br/>";
$lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_topics WHERE fid='".$forum[0]."' ORDER BY lastpost DESC LIMIT 0,1"));
      $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$lpt[0]."' LIMIT 1"));
      if($nops[0]==0)
      {
      $pinfo = mysql_fetch_array(mysql_query("SELECT authorid FROM ibwf_topics WHERE id='".$lpt[0]."' LIMIT 0,1"));
      $tluid = $pinfo[0];
      }else{
      $pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_posts WHERE tid='".$lpt[0]."' ORDER BY dtpost DESC LIMIT 0,1"));
      $tluid = $pinfo[0];
      }      
      $tlnm = htmlspecialchars($lpt[1]);
      $tlnick = getnick_uid($tluid);
      $tpclnk = "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$lpt[0]&go=last\">$tlnm</a>";
      $vulnk = "<a href=\"index.php?action=viewuser&sid=$sid&who=$tluid\">$tlnick</a>";
      echo "Zadnji post: $tpclnk, od: $vulnk<br/><br/>";
  } 


							
						


Comment