DragonBlade
10-24-2008, 06:13 PM
In order to "stack" the HTML markups for User Groups, you need to do the following:
Create a new TINYINT(1) field on your usergroup table
Add the following plugin for the "fetch_musername" hook:$gids = explode(',', $user['membergroupids']);
foreach ($gids AS $gid)
{
$info = $vbulletin->db->query_first(sprintf("SELECT stack_markup FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid='%s'", $vbulletin->db->escape_string($gid)));
if ($info['stack_markup'] == '1')
{
$user['musername'] = $vbulletin->usergroupcache["$gid"]['opentag'] . $user['musername'] . $vbulletin->usergroupcache["$gid"]['closetag'];
}
}
For the "admin_usergroup_edit" hook, add the following plugin (so you can change the value via AdminCP and not have to do it manually in your SQL)print_table_header('Stack HTML Markup?');
print_yes_no_row('Would you like to stack the Usergroup markup for this group?', 'usergroup[stack_markup]', $usergroup['stack_markup']);
print_table_break();NOTE: Change stack_markup to whatever you named the table field in Step 1.
Hey, all. I'm programming a "shop" system, and I was wondering, is there a way to "stack" the username markup from usergroups?
For example, if a user was part of the "Items -- Bold", "Items -- Italic", and "Items -- Color: red" usergroups, can I combine those markups?
Create a new TINYINT(1) field on your usergroup table
Add the following plugin for the "fetch_musername" hook:$gids = explode(',', $user['membergroupids']);
foreach ($gids AS $gid)
{
$info = $vbulletin->db->query_first(sprintf("SELECT stack_markup FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid='%s'", $vbulletin->db->escape_string($gid)));
if ($info['stack_markup'] == '1')
{
$user['musername'] = $vbulletin->usergroupcache["$gid"]['opentag'] . $user['musername'] . $vbulletin->usergroupcache["$gid"]['closetag'];
}
}
For the "admin_usergroup_edit" hook, add the following plugin (so you can change the value via AdminCP and not have to do it manually in your SQL)print_table_header('Stack HTML Markup?');
print_yes_no_row('Would you like to stack the Usergroup markup for this group?', 'usergroup[stack_markup]', $usergroup['stack_markup']);
print_table_break();NOTE: Change stack_markup to whatever you named the table field in Step 1.
Hey, all. I'm programming a "shop" system, and I was wondering, is there a way to "stack" the username markup from usergroups?
For example, if a user was part of the "Items -- Bold", "Items -- Italic", and "Items -- Color: red" usergroups, can I combine those markups?