
12-20-2005, 04:31 PM
|
 |
|
|
Join Date: Jun 2004
Location: Chicago
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by AnhTuanCool
Hey, nice hack there you made Abe1. /me clicked installed.
I made a modification to optimize the querying part of the hack as follow:
In plugin Post Thank You Hack at postbit_display_start, I'd changed:
PHP Code:
$post_thanks_querys = $db->query("SELECT postid FROM ". TABLE_PREFIX ."post WHERE threadid = '$post[threadid]'");
$post_thanks_postids = 0;
while ($post_thanks_query = $db->fetch_array($post_thanks_querys))
{
$post_thanks_postids .= ",$post_thanks_query[postid]";
}
$post_thanks_cashe = $db->query("SELECT * FROM " .TABLE_PREFIX. "post_thanks WHERE postid IN ($post_thanks_postids) ORDER BY username ASC");
Into
PHP Code:
$post_thanks_cashe = $db->query("SELECT post_thanks.* FROM " . TABLE_PREFIX . "post_thanks, " . TABLE_PREFIX . "post WHERE post.postid = post_thanks.postid AND post.threadid = '$post[threadid]'");
It shortened the querying by one query, for some small or moderate boards, it doesn't make any noticeable different. But in any large board, it does help a lot.
You can include the mod if you want. Thanks for great hack! 
|
changed mine over, thanks
|