here it is kura, from my file the code that works (thanks PPN):
Code:
// latest threads ***************************
$doperms=$DB_site->query("SELECT canview,forumid FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'");
while ($doperm = $DB_site->fetch_array($doperms)) {
$perms["$doperm[forumid]"] = $doperm;
}
$DB_site->free_result($doperms);
unset($doperm);
$forum=$DB_site->query("SELECT forumid FROM forum");
while ($forums=$DB_site->fetch_array($forum)) {
if($perms["$forums[forumid]"]["canview"] == 1 || !isset($perms["$forums[forumid]"]["canview"])) {
$forumperms[]=$forums["forumid"];
}
}
$DB_site->free_result($forum);
unset($forums);
if(!empty($forumperms)) {
$forumperms='AND forumid='.implode(' OR forumid=',$forumperms);
}
$dothreads=$DB_site->query("SELECT * FROM thread WHERE open=1 AND open<>10 $forumperms ORDER BY lastpost DESC LIMIT 10");
while ($dothread=$DB_site->fetch_array($dothreads)) {
$dots='';
if (strlen($dothread[title])>29) {
$dots='...';
}
$forumid=$dothread[forumid];
$threadid=$dothread[threadid];
$threadtitle=substr($dothread[title], 0, 32);
$lastthreadbits .= '<a href="showthread.php?s='.$session[sessionhash].'&forumid='.$forumid.'&threadid='.$threadid.'">'.$threadtitle.$dots.'</a><br>';
}
unset($dothread);
i use this code in corelation with a higly modified forumdisplay.php file. it involved several mods to the tables. but the result is nice, i think:
https://vborg.vbsupport.ru/attachmen...&postid=249059
try the code and let me know what you think. i will update my vbHome hack also. later on today...