In your ubbttopthreads.php addon find this:
code:
// -----------------------------
// End of the variables section
require("$path/main.inc.php");
and change it to this:
code:
// -----------------------------
// End of the variables section
require_once("/ubbthreads/main.inc.php");
$userob = new user;
$user = $userob -> authenticate("U_Groups");
if ($user['U_Username']) {
$Grouparray = split("-",$user['U_Groups']);
$gsize = sizeof($Grouparray);
$groupquery = "(";
$g = 0;
for ($i=0; $i<$gsize;$i++) {
if (!preg_match("/[0-9]/",$Grouparray[$i])) { continue; };
$g++;
if ($g > 1) {
$groupquery .= " OR ";
}
$groupquery .= "Bo_Read_Perm LIKE '%-$Grouparray[$i]-%'";
}
$groupquery .= ")";
}
else {
$groupquery = "Bo_Read_Perm LIKE '%-4-%'";
}
$query = "
SELECT Bo_Keyword
FROM w3t_Boards
WHERE $groupquery
";
$sth = $dbh -> do_query($query);
$boardquery = "AND (";
$g = 0;
while (list ($BKeyword) = $dbh -> fetch_array($sth)) {
$g++;
if ($g > 1) {
$boardquery .= " OR ";
}
$boardquery .= "B_Board = '$BKeyword'";
}
$dbh -> finish_sth($sth);
$boardquery .= ")";
if (!$g) {
$boardquery = "";
}
Then find this:
code:
$query = "
SELECT B_Number,B_Posted,B_Last_Post,B_Username,B_Subject,B_Body,B_Main,B_Replies,B_Counter,B_Board
FROM w3t_Posts
WHERE B_Number = B_Main
AND B_Last_Post > '$date'
ORDER BY $sort DESC
LIMIT $totalthreads
";
and change it to this:
code:
$query = "
SELECT B_Number,B_Posted,B_Last_Post,B_Username,B_Subject,B_Body,B_Main,B_Replies,B_Counter,B_Board
FROM w3t_Posts
WHERE B_Number = B_Main
AND B_Last_Post > '$date'
$boardquery
ORDER BY $sort DESC
LIMIT $totalthreads
";
Ok, I just tested this on my local webserver and it worked fine. Hope it does for everyone else
