Quote:
Originally Posted by rmxs
if the usergoup its for example 25 doesnt appeard
I remove from template this code
|
Considering this hack doesn't use bitfields for Usergroup Permissions, you should do the following.
Create a new plugin.
Product: Latest News
Hook Location: parse_templates
Title: Latest News Usergroup Perms
Execution Order: 5
Plugin PHP Code:
PHP Code:
if ((THIS_SCRIPT == 'index') AND $vbulletin->options['enable_ltnews'])
{
$augs = explode(',', $vbulletin->options['ugroups_lt']);
$mgs = explode(',', $vbulletin->userinfo['membergroupids']);
if (is_array($augs))
{
foreach ($augs AS $aug)
{
if (is_array($mgs))
{
foreach ($mgs AS $mg)
{
$news_allow = (trim($aug) == $mg) ? true : $news_allow;
}
unset($mg, $mgs);
}
$news_allow = (trim($aug) == $vbulletin->userinfo['usergroupid']) ? true : $news_allow;
}
unset($aug);
}
unset($augs);
}
Then edit your template
latest_news.
Find:
PHP Code:
<if condition="$bbuserinfo[usergroupid]== $vboptions['ugroups_lt']{0} OR $bbuserinfo[usergroupid]== $vboptions['ugroups_lt']{2} OR $bbuserinfo[usergroupid]== $vboptions['ugroups_lt']{4} OR $bbuserinfo[usergroupid]== $vboptions['ugroups_lt']{6} OR $bbuserinfo[usergroupid]== $vboptions['ugroups_lt']{8} OR $bbuserinfo[usergroupid]== $vboptions['ugroups_lt']{10}">
Replace with:
PHP Code:
<if condition="$news_allow">