consolegaming |
06-14-2008 08:57 PM |
@ lucky try the following (not tested but just fixing some bugs I noticed in your supplied code samples:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <product productid="rjs_split_online" active="1">
<title>Split Useronline</title>
<description>Splits the online user listing in FORUMHOME. vBulletin 3.7 Compatible.</description>
<version>2.0.0</version>
- <url>
- <![CDATA[ https://vborg.vbsupport.ru/misc.php?do=producthelp&pid=rjs_split_online
]]>
</url>
- <versioncheckurl>
- <![CDATA[ https://vborg.vbsupport.ru/misc.php?do=productcheck&pid=rjs_split_online
]]>
</versioncheckurl>
- <dependencies>
<dependency dependencytype="vbulletin" minversion="3.7" maxversion="" />
</dependencies>
- <codes>
- <code version="2.0.0">
- <installcode>
- <![CDATA[
$db->hide_errors();
$db->query("ALTER TABLE " . TABLE_PREFIX . "usergroup ADD split_useronline_permissions INT UNSIGNED NOT NULL DEFAULT 0");
$db->show_errors();
]]>
</installcode>
- <uninstallcode>
- <![CDATA[
$db->hide_errors();
$db->query("ALTER TABLE ". TABLE_PREFIX . "usergroup DROP split_useronline_permissions");
$db->show_errors();
]]>
</uninstallcode>
</code>
</codes>
<templates />
- <plugins>
- <plugin active="1" executionorder="5">
<title>Display</title>
<hookname>forumhome_complete</hookname>
- <phpcode>
- <![CDATA[
if(($activeonlineusers['team'] OR $activeonlineusers['programmers'] OR $activeonlineusers['members'] OR $activeonlineusers['premiummembers'] OR $activeonlineusers['vips']) AND $vbulletin->options['split_useronline_active'])
{
unset($activeusers);
if($activeonlineusers['team'])
{
$activeonlineusers['team'] = substr($activeonlineusers['team'], 2);
$activeusers .= "<b>".$vbphrase['team'].":</b> ".$activeonlineusers['team']."<br /><br />";
}
if($activeonlineusers['programmers'])
{
$activeonlineusers['programmers'] = substr($activeonlineusers['programmers'], 0);
$activeusers .= "<b>".$vbphrase['programmers'].":</b> ".$activeonlineusers['programmers']."<br /><br />";
}
if($activeonlineusers['vips'])
{
$activeonlineusers['vips'] = substr($activeonlineusers['vips'], 2);
$activeusers .= "<b>".$vbphrase['vips'].":</b> ".$activeonlineusers['vips']."<br /><br />";
}
if($activeonlineusers['premiummembers'])
{
$activeonlineusers['premiummembers'] = substr($activeonlineusers['premiummembers'], 2);
$activeusers .= "<b>".$vbphrase['premiummembers'].":</b> ".$activeonlineusers['premiummembers']."<br /><br />";
}
if($activeonlineusers['members'])
{
iif(!$activeonlineusers['team'] AND !$activeonlineusers['premiummembers'], $activeonlineusers['members'] = substr($activeonlineusers['members'], 2));
$activeusers .= iif($show['othergroups'], "<b>".$vbphrase['members'].":</b> ").$activeonlineusers['members']."<br />";
}
}
]]>
</phpcode>
</plugin>
- <plugin active="1" executionorder="5">
<title>Split</title>
<hookname>forumhome_loggedinuser</hookname>
- <phpcode>
- <![CDATA[
if($vbulletin->options['split_useronline_active'])
{
$split = $vbulletin->bf_ugp_split_useronline_permissions;
$bit = $vbulletin->usergroupcache[$loggedin['displaygroupid']]['split_useronline_permissions'];
if ($bit & $split['split_useronline_team'] AND fetch_online_status($loggedin))
{
eval('$activeonlineusers[\'team\'] .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
$numbervisible++;
$show['othergroups'] = true;
}
elseif ($bit & $split['split_useronline_programmers'] AND fetch_online_status($loggedin))
{
eval('$activeonlineusers[\'programmers\'] .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
$numbervisible++;
$show['othergroups'] = true;
}
elseif ($bit & $split['split_useronline_vip'] AND fetch_online_status($loggedin))
{
eval('$activeonlineusers[\'vips\'] .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
$numbervisible++;
$show['othergroups'] = true;
}
elseif ($bit & $split['split_useronline_premium'] AND fetch_online_status($loggedin))
{
eval('$activeonlineusers[\'premiummembers\'] .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
$numbervisible++;
$show['othergroups'] = true;
}
elseif (fetch_online_status($loggedin))
{
eval('$activeonlineusers[\'members\'] .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
$numbervisible++;
}
return;
}
]]>
</phpcode>
</plugin>
</plugins>
- <phrases>
- <phrasetype name="Permissions" fieldname="cppermission">
- <phrase name="setting_split_useronline_premiumusers_title" date="1212283503" username="Rjs37" version="2.0.0">
- <![CDATA[ This is a Premium Usergroup
]]>
</phrase>
- <phrase name="setting_split_useronline_teamusers_title" date="1212283535" username="Rjs37" version="2.0.0">
- <![CDATA[ This is a Team Usergroup
]]>
</phrase>
- <phrase name="setting_split_useronline_programmers_title" date="1212283543" username="Rjs37" version="2.0.0">
- <![CDATA[ This is a programmers and Crackers Usergroup
]]>
</phrase>
- <phrase name="setting_split_useronline_vipusers_title" date="1212283556" username="Rjs37" version="2.0.0">
- <![CDATA[ This is a VIP Usergroup
]]>
</phrase>
- <phrase name="split_useronline_permissions" date="1212283584" username="Rjs37" version="2.0.0">
- <![CDATA[ Split Useronline
]]>
</phrase>
</phrasetype>
- <phrasetype name="GLOBAL" fieldname="global">
- <phrase name="premiummembers" date="1212285962" username="Rjs37" version="2.0.0">
- <![CDATA[ Members
]]>
</phrase>
- <phrase name="team" date="1212285847" username="Rjs37" version="2.0.0">
- <![CDATA[ Staff
]]>
</phrase>
- <phrase name="programmers and Crackers" date="1212285843" username="Rjs37" version="2.0.0">
- <![CDATA[ programmers and Crackers
]]>
</phrase>
- <phrase name="vips" date="1212285904" username="Rjs37" version="2.0.0">
- <![CDATA[ VIPs and Contributors
]]>
</phrase>
</phrasetype>
- <phrasetype name="vBulletin Settings" fieldname="vbsettings">
- <phrase name="setting_split_useronline_active_desc" date="1212283388" username="Rjs37" version="2.0.0">
- <![CDATA[ Activate the splitting of usergroups on forumhome ?
]]>
</phrase>
- <phrase name="setting_split_useronline_active_title" date="1212283388" username="Rjs37" version="2.0.0">
- <![CDATA[ Split Useronline
]]>
</phrase>
</phrasetype>
</phrases>
- <options>
- <settinggroup name="forumhome" displayorder="400">
- <setting varname="split_useronline_active" displayorder="90">
<datatype>free</datatype>
<optioncode>yesno</optioncode>
<defaultvalue>1</defaultvalue>
</setting>
</settinggroup>
</options>
<helptopics />
<cronentries />
<faqentries />
</product>
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <bitfields product="rjs_split_online">
- <bitfielddefs>
- <group name="ugp">
- <group name="split_useronline_permissions">
<bitfield name="split_useronline_team" group="split_useronline_permissions" phrase="setting_split_useronline_teamusers_title" install="">1</bitfield>
<bitfield name="split_useronline_programmers" group="split_useronline_permissions" phrase="setting_split_useronline_programmersusers_title" install="">2</bitfield>
<bitfield name="split_useronline_premium" group="split_useronline_permissions" phrase="setting_split_useronline_premiumusers_title" install="">4</bitfield>
<bitfield name="split_useronline_vip" group="split_useronline_permissions" phrase="setting_split_useronline_vipusers_title" install="">8</bitfield>
</group>
</group>
</bitfielddefs>
</bitfields>
I've put the changes from your code in red so you can see what I've changed (just adding an OR into the first sample and changing the bitfield values so they are correct. Values need to go up in powers of 2: 1,2,4,8,16,32 etc. That's how binary works as you can represent numbers 0-63 with just 6 bits. This attachment may help:
https://vborg.vbsupport.ru/attachmen...7&d=1199470611
Also I'm not sure what the -'s are in front of the lines though unless they were added by your editor? If so remember to just make the alterations I've highlighted into your own code rather than copying and pasting it.
@anantthakor: "UFN DeV Team" certainly wasn't in my plugin, it sounds like the phrases are possibly conflicting with another plugin that is attempting to use a phrase of the same name? In any case try searching the phrases (found in the admincp menu) for that and if you don't mind changing where else that phrase is used then feel free to change it. Just surprised about it really. I used the same phrases as the original mod to try and avoid this exact problem lol.
@Nemesis: Nice to see a friendly face around here lol. The main reason I did this modification was because I wanted it myself on 3.7 and saw no reason why I shouldn't release it for everyone else too. And the ladder system isn't a vB mod :P.
Sorry guys about not doing an update as I had originally planned, gt quite a few projects going on (mainly on doing a new site design) so I haven;t had as much spare time as I had expected. The main two updates I want to do would be firstly to fix the bug on not checking additional usergroups and at some point as I said on the first page I would like to give the admins the choice of how many groups to have and what they are called though at the moment that's a bit above my level. So let me get the bug fixxed first and then I can start looking into the expansion ;).
|