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! 
|
i've change too but get:
Database error in vBulletin 3.5.2:
Invalid SQL:
SELECT post_thanks.* FROM vb_post_thanks, vb_post WHERE post.postid = post_thanks.postid AND post.threadid = '43120';
MySQL Error : Unknown table 'post_thanks'
Error Number : 1051