2014-06-25, 04:20 AM
Like you've probably seen on popular forums they may have a custom page to show all the custom groups. Well, here's how it is done.
First make showgroups.php and upload to root. Place the following code in it:
Once that is done go to ACP > Themes > Templates > Global Templates > New template and make a template called 'showgroups' Place the following code inside making the needed edits for each user group:
If you want to add more than one usergroup, then copy and paste the usergroup box, and paste it and add a line break every time you have two usergroups on the same page. Example coding below
DEMO: http://www.glitchers.net/showgroupsmybbtut.php
First make showgroups.php and upload to root. Place the following code in it:
<?php
define('IN_MYBB', 1); require "./global.php";
add_breadcrumb("Custom Usergroups", "showgroups.php");
eval("\$html = \"".$templates->get("showgroups")."\";");
output_page($html);
?>
Once that is done go to ACP > Themes > Templates > Global Templates > New template and make a template called 'showgroups' Place the following code inside making the needed edits for each user group:
<html>
<head>
<title>Current Usergroups</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><span class="smalltext"><strong>Current Custom Usergroups</strong></span></td>
</tr>
<tr>
<td class="trow1">
<div style="width: 48%; min-height:120px; border: 1px #0E8104 solid; margin: 4px; padding: 2px; border-radius: 5px; float:left;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr class="trow1">
<td width="75%" border="0">
<span><b>Usergroup</b></span><br />
<span class="smalltext"><b>Leaders: </b>
<a href="profile.php"><span style="color: white;">Add username(s) here</span></a><br /><a href="usercp.php?action=usergroups&joingroup=8&my_post_key={$mybb->post_code}">(Join Group)</a><br /><br />Description.</span>
</td>
<td width="25%" align="right" valign="middle">
<img src="http://resources.mybb.com/images/badges/oct_13/support.png" /><br />
</td>
</tr>
</table>
</div>
</td></tr></table>
{$footer}
</body>
</html>
If you want to add more than one usergroup, then copy and paste the usergroup box, and paste it and add a line break every time you have two usergroups on the same page. Example coding below
</style>
<html>
<head>
<title>Current Usergroups</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><span class="smalltext"><strong>Current Custom Usergroups</strong></span></td>
</tr>
<tr>
<td class="trow1">
<div style="width: 48%; min-height:120px; border: 1px #0E8104 solid; margin: 4px; padding: 2px; border-radius: 5px; float:left;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr class="trow1">
<td width="75%" border="0">
<span><b>Usergroup</b></span><br />
<span class="smalltext"><b>Leaders: </b>
<a href="profile.php"><span style="color: white;">Add username(s) here</span></a><br /><a href="usercp.php?action=usergroups&joingroup=8&my_post_key={$mybb->post_code}">(Join Group)</a><br /><br />Description.</span>
</td>
<td width="25%" align="right" valign="middle">
<img src="http://resources.mybb.com/images/badges/oct_13/support.png" /><br />
</td>
</tr>
</table>
</div>
<div style="width: 48%; min-height:120px; border: 1px #0E8104 solid; margin: 4px; padding: 2px; border-radius: 5px; float:left;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr class="trow1">
<td width="75%" border="0">
<span><b>Usergroup</b></span><br />
<span class="smalltext"><b>Leaders: </b>
<a href="profile.php"><span style="color: white;">Add username(s) here</span></a><br /><a href="usercp.php?action=usergroups&joingroup=8&my_post_key={$mybb->post_code}">(Join Group)</a><br /><br />Description.</span>
</td>
<td width="25%" align="right" valign="middle">
<img src="http://resources.mybb.com/images/badges/oct_13/support.png" /><br />
</td>
</tr>
</table>
</div>
<br>
<div style="width: 48%; min-height:120px; border: 1px #0E8104 solid; margin: 4px; padding: 2px; border-radius: 5px; float:left;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr class="trow1">
<td width="75%" border="0">
<span><b>Usergroup</b></span><br />
<span class="smalltext"><b>Leaders: </b>
<a href="profile.php"><span style="color: white;">Add username(s) here</span></a><br /><a href="usercp.php?action=usergroups&joingroup=8&my_post_key={$mybb->post_code}">(Join Group)</a><br /><br />Description.</span>
</td>
<td width="25%" align="right" valign="middle">
<img src="http://resources.mybb.com/images/badges/oct_13/support.png" /><br />
</td>
</tr>
</table>
</div>
<div style="width: 48%; min-height:120px; border: 1px #0E8104 solid; margin: 4px; padding: 2px; border-radius: 5px; float:left;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr class="trow1">
<td width="75%" border="0">
<span><b>Usergroup</b></span><br />
<span class="smalltext"><b>Leaders: </b>
<a href="profile.php"><span style="color: white;">Add username(s) here</span></a><br /><a href="usercp.php?action=usergroups&joingroup=8&my_post_key={$mybb->post_code}">(Join Group)</a><br /><br />Description.</span>
</td>
<td width="25%" align="right" valign="middle">
<img src="http://resources.mybb.com/images/badges/oct_13/support.png" /><br />
</td>
</tr>
</table>
</div>
<br>
<div style="width: 48%; min-height:120px; border: 1px #0E8104 solid; margin: 4px; padding: 2px; border-radius: 5px; float:left;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr class="trow1">
<td width="75%" border="0">
<span><b>Usergroup</b></span><br />
<span class="smalltext"><b>Leaders: </b>
<a href="profile.php"><span style="color: white;">Add username(s) here</span></a><br /><a href="usercp.php?action=usergroups&joingroup=8&my_post_key={$mybb->post_code}">(Join Group)</a><br /><br />Description.</span>
</td>
<td width="25%" align="right" valign="middle">
<img src="http://resources.mybb.com/images/badges/oct_13/support.png" /><br />
</td>
</tr>
</table>
</div>
<div style="width: 48%; min-height:120px; border: 1px #0E8104 solid; margin: 4px; padding: 2px; border-radius: 5px; float:left;">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr class="trow1">
<td width="75%" border="0">
<span><b>Usergroup</b></span><br />
<span class="smalltext"><b>Leaders: </b>
<a href="profile.php"><span style="color: white;">Add username(s) here</span></a><br /><a href="usercp.php?action=usergroups&joingroup=8&my_post_key={$mybb->post_code}">(Join Group)</a><br /><br />Description.</span>
</td>
<td width="25%" align="right" valign="middle">
<img src="http://resources.mybb.com/images/badges/oct_13/support.png" /><br />
</td>
</tr>
</table>
</div>
<br>
</td></tr></table>
{$footer}
</body>
</html>
Make sure you update the join group link. DEMO: http://www.glitchers.net/showgroupsmybbtut.php