SOMEONE HELP to speed up "View category" func?it very slow to open this...this is code what I using now
Just exclude some stuff like i have done, and add in every mysql select at the end LIMIT 1 or LIMIT 0,1 except you have a while loop, then that would be a bad idea 🙂
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/>";
}
kafa wrote:
Just exclude some stuff like i have done, and add in every mysql select at the end LIMIT 1 or LIMIT 0,1 except you have a while loop, then that would be a bad idea 🙂
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=\"http://coding-talk.com/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/>";
}
I have long time ago added everywhere LIMIT 0.1 , but all categories is very slow to open....
srecnica wrote:
I have long time ago added everywhere LIMIT 0.1 , but all categories is very slow to open....
Go to phpmyadmin, select all tables and do "repair tables", this could do some speed-up 🙂
Also delete often all PM's cus inbox.php is a big CPU eater.
Delete old topics and big topics with few thousand posts and open new ones.
Also delete all unnecessary stuff from big tables like sellecting number of posts where"somestuff"="something" or number of PM's, cus every MYSQL SELECT uses CPU time and if you have 10 or 20 mysql requests on one page, then you have as result a very slow page.
Do so much as possible to put all mysql reqs into one request.
kafa wrote:
Go to phpmyadmin, select all tables and do "repair tables", this could do some speed-up 🙂
Also delete often all PM's cus inbox.php is a big CPU eater.
Delete old topics and big topics with few thousand posts and open new ones.
Also delete all unnecessary stuff from big tables like sellecting number of posts where"somestuff"="something" or number of PM's, cus every MYSQL SELECT uses CPU time and if you have 10 or 20 mysql requests on one page, then you have as result a very slow page.
Do so much as possible to put all mysql reqs into one request.
I hope this could help you to do some speed-up :)
yes, thank you. Although often do everything that you said, clean the old threads, inbox ... but I think the problem with opening speed categories in fact the number of links in the category itself. I noticed when I cut down the number one category subforum it to be opened more quickly .. The problem is that our forums crowded subforum :)( mnogo podforuma u kategoriji.... previse linkova 😉 )
srecnica wrote:
yes, thank you. Although often do everything that you said, clean the old threads, inbox ... but I think the problem with opening speed categories in fact the number of links in the category itself. I noticed when I cut down the number one category subforum it to be opened more quickly .. The problem is that our forums crowded subforum :)( mnogo podforuma u kategoriji.... previse linkova 😉 )
so cut it off, delete some subcategories 🙂
for real speed just delete every mysql SELECT FROM ibwf_posts. You will have top speed, but you will not be able to see the last post.
Does someone knows why i cant load bg image i put background-image: url("bg.jpg");
background-repeat: repeat;
width: 10px;
height: 10px;
but it dosent load on my site
stefan998 wrote:
Does someone knows why i cant load bg image i put background-image: url("bg.jpg");
background-repeat: repeat;
width: 10px;
height: 10px;
but it dosent load on my site
body {
background-image: url(bg.jpg);
background-repeat:repeat;
width: 10px;
height: 10px;
}
stefan998 wrote:
It worked. Now when i try to register I click register button and I get nothing and in database also nothing it wont register me at all
Normally its because of missing $_POST's on the registration page, but without seeing the registration page you are using then this might not be the case.