Quote:
Originally Posted by Nick0r
There is definitely a permissions issue with this hack, it seems to totally ignore any permissions given - guests/regular members can see restricted forums.
|
As I use the original hack from NTLDR for my vb 3.0.x, I ported it today to the new 3.6.0 version on my own because of many changes and additions.
For the permission issue please try to change the following lines in the .xml file to their original syntax an try if the issue is gone. For me it works fine with this lines!
find in product-chrism_latestthreads.xml
PHP Code:
$forumperms[$forum["forumid"]] = fetch_permissions($forum['forumid']);
// ## HIDE FORUMS WITHOUT THE CANVIEW PERMISSION ##
if (!($forumperms[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) {
$limitfids .= ','.$forum['forumid'];
}
}
Replace it with
PHP Code:
$forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']);
// ## HIDE FORUMS WITHOUT THE CANVIEW PERMISSION ##
if (!($forumperms["$forum[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) {
$limitfids .= ','.$forum['forumid'];
}
}
If you want to exclude some Usergroups from viewing the latest threads:
search for:
PHP Code:
if ($threads) {
$show['latestthreads'] = true;
}
Add after:
PHP Code:
$grouparray = array ( 1,3,4,8);
if (in_array($vbulletin->userinfo['usergroupid'],$grouparray) OR $vbulletin->userinfo['userid'] == 0 )
{
$show['latestthreads'] = false;
}
@ dodjer42
If you want to change the thread title truncation edit the number 22 at the end of this line:
PHP Code:
$thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22));
e.g. to 50 to truncate at 50 characters.
Don't forget to upload/install the changed file!