@Trana: That's an awful lot of posts for this mod to handle. Untested, but try replacing:
Code:
$smilie_infos = $db->query_read("SELECT COUNT(t1.postid) AS smiliecount,
t2.smilietext, t2.smiliepath, t2.title AS smilietitle
FROM " . TABLE_PREFIX . "post AS t1, " . TABLE_PREFIX . "smilie AS t2
WHERE t1.allowsmilie = 1
AND BINARY t1.pagetext LIKE CONCAT('%',REPLACE(REPLACE(t2.smilietext,'%','\%'),'_','\_'),'%')
GROUP BY BINARY t2.smilietext
ORDER BY smiliecount DESC
");
With the following to get a measure of the smilies used in about the last 1000 threads.
Code:
cache_ordered_forums(1);
$smilie_numthreads = 0;
if (is_array($vbulletin->forumcache))
{
foreach ($vbulletin->forumcache AS $smilie_foruminfo)
{
$smilie_numthreads += $smilie_foruminfo['threadcount'];
}
}
// change 1000 in this line to 500 if 1000 is too many
$smilie_cutpoint = max(0, $smilie_numthreads - 1000);
$smilie_infos = $db->query_read("SELECT COUNT(t1.postid) AS smiliecount,
t2.smilietext, t2.smiliepath, t2.title AS smilietitle
FROM " . TABLE_PREFIX . "post AS t1, " . TABLE_PREFIX . "smilie AS t2
WHERE t1.threadid > " . intval($smilie_cutpoint) . "
AND t1.allowsmilie = 1
AND BINARY t1.pagetext LIKE CONCAT('%',REPLACE(REPLACE(t2.smilietext,'%','\%'),'_','\_'),'%')
GROUP BY BINARY t2.smilietext
ORDER BY smiliecount DESC
");