I just now installed it on my own board and realized there was no way to simply tell it to display to all usergroups so I made that change and, while I was doing that, I saw how it looks with multiple games and didn't like having multiple headers so I changed that too. If you set the "usergroups allowed" option to 0, and it has to ONLY be 0, then it will show to all. Here are my versions of the template edits and the plugin code:
Code:
<if condition="is_member_of($vbulletin->userinfo, $gm_user_groups_allowed) || $vbulletin->gm_user_groups_allowed == 0">
<div id="GuildMate_$post[postid]" class="vbmenu_control">
<a class="smallfont" href="#">$vbphrase[gm_postbit_text]</a>
<script type="text/javascript">
vbmenu_register("GuildMate_$post[postid]");
</script>
</div>
<div class="vbmenu_popup" id="GuildMate_$post[postid]_menu" style="display:none">
<table>$gm_char_data</table>
</div>
</if>
Code:
global $vbulletin,$userinfo;
$user_chars = $vbulletin->db->query("select vbg.game_name as CharGame, vbs.server_name CharServer, vbc.character_name as CharName FROM " . TABLE_PREFIX . "vbguild_Game as vbg, " . TABLE_PREFIX . "vbguild_Server as vbs, " . TABLE_PREFIX . "vbguild_Character as vbc
WHERE vbc.user_id = '$post[userid]'
AND vbc.server_id = vbs.server_id
AND vbs.game_id = vbg.game_id
ORDER BY vbg.game_name, vbs.server_name, vbc.character_name
");
eval('$gm_header .= "' . fetch_template('gm_char_postbit_header') . '";');
$gm_char_data .= $gm_header;
while($CharData = $vbulletin->db->fetch_array($user_chars))
{
$char_game = $CharData['CharGame'];
$char_server = $CharData['CharServer'];
$char_name = $CharData['CharName'];
$gm_user_groups_allowed = explode(',',$vbulletin->options['gm_ugl_view_chars']);
eval('$gm_char_data .= "' . fetch_template('gm_postbit_char_bit') . '";');
}
// If there's no character data
if ($gm_char_data == "") {
eval('$gm_char_data .= "' . fetch_template('gm_postbit_char_none') . '";');
}
Here's an
example post. Thanks again for making this.