2006-01-09, 01:34 PM
There are some problems with the recent threads in profile plugin. You get a sql error when there are unviewable forums.
I changed the queries a little bit so that the plugin is working correctly.
Search for:
I changed the queries a little bit so that the plugin is working correctly.
Search for:
$unviewableforums = '';
$unviewableforums = getunviewableforums();
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE uid='$uid' AND fid NOT IN ('$unviewableforums')");
Replace with: $unviewableforums = getunviewableforums();
if($unviewableforums)
{
$unviewwhere = "AND fid NOT IN ($unviewableforums)";
}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE uid='$uid' $unviewwhere");
Search for: $query = $db->query("SELECT t.*, f.name, i.path FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid) LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid=t.icon) WHERE t.uid='$uid' AND t.fid NOT IN ('$unviewableforums') ORDER BY t.dateline DESC LIMIT $settings[recentthreadsno]");
Replace with: if($unviewableforums)
{
$unviewwhere = "AND t.fid NOT IN ($unviewableforums)";
}
$query = $db->query("SELECT t.*, f.name, i.path FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid) LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid=t.icon) WHERE t.uid='$uid' $unviewwhere ORDER BY t.dateline DESC LIMIT $settings[recentthreadsno]");