10-24-2008, 06:13 PM
|
|
|
|
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Stack Username markup from usergroups?
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:
PHP Code:
$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)
PHP Code:
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.
Quote:
Originally Posted by Original Post
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?
|
|