To Include the Accepted Rules on the Profile Statistics, (would be a nice addition on your next Update Cybernetec

):
Create a Plugin:
Product:
vBulletin (I select this so that on an Update the Plugin don't get Deleted)
Hook Location:
member_profileblock_fetch_unwrapped
Title/Name:
Cyb - Advanced Forum Rules - MI - Accepted Rules in Profile Profile Statistics (or the name you want)
Execution Order:
5
Plugin Active:
Yes
Quote:
Note to the PHP Code: (Choose the Usergroups you don't want the Accepted Rules to be Diplayed to, currently '1,8', simply separate them with commas)
|
PHP Code:
Code:
if (!is_member_of($vbulletin->userinfo, explode(',','1,8')))
{
$cyb_frules_readsets_2 = $userinfo['cybfrules_sets'];
if ($userinfo['cybfrules_sets']!='0')
{
$cybfr_getrulesets_2 = $vbulletin->db->query_read("
SELECT id, name
FROM " . TABLE_PREFIX . "cyb_frules AS cyb_frules
WHERE id IN ($cyb_frules_readsets_2)
ORDER BY id ASC
");
while ($cybfr_ruleset_2 = $this->registry->db->fetch_array($cybfr_getrulesets_2))
{
$cyb_frules_readitem_2 .= "<tr><td class=\"statistics_group\"><b>".$cybfr_ruleset_2['id'].":</b> ".$cybfr_ruleset_2['name']."</td></tr>";
}
$cyb_frules_force_2 = ' <fieldset class="statistics_group">
<legend>Accepted Rules</legend>
<span class="shade"><table cellpadding="0" cellspacing="0" border="0" width="100%">'.$cyb_frules_readitem_2.'</table></span>
</fieldset>';
eval('$template_hook[\'profile_stats_last\'] .= "$cyb_frules_force_2";');
}
}
Option 2:
If you want the Accepted Rules to be Displayed to All Usergroups, simply Choose the following code:
PHP Code:
Code:
$cyb_frules_readsets_2 = $userinfo['cybfrules_sets'];
if ($userinfo['cybfrules_sets']!='0')
{
$cybfr_getrulesets_2 = $vbulletin->db->query_read("
SELECT id, name
FROM " . TABLE_PREFIX . "cyb_frules AS cyb_frules
WHERE id IN ($cyb_frules_readsets_2)
ORDER BY id ASC
");
while ($cybfr_ruleset_2 = $this->registry->db->fetch_array($cybfr_getrulesets_2))
{
$cyb_frules_readitem_2 .= "<tr><td class=\"statistics_group\"><b>".$cybfr_ruleset_2['id'].":</b> ".$cybfr_ruleset_2['name']."</td></tr>";
}
$cyb_frules_force_2 = ' <fieldset class="statistics_group">
<legend>Accepted Rules</legend>
<span class="shade"><table cellpadding="0" cellspacing="0" border="0" width="100%">'.$cyb_frules_readitem_2.'</table></span>
</fieldset>';
eval('$template_hook[\'profile_stats_last\'] .= "$cyb_frules_force_2";');
}
My Best Regards.