Description:
This is a template edit that I made for my minecraft server so that my users can feel more involved with the site. Almost all of this is configurable and usable on any site or forums software with a database.
To-do's:
- allow secondary groups
- have a script to remove the steve face
- more customization other than members.css
Core Installation
- Copy the included zip into your root directory. Extract it there and make sure it ectracts to it's own folder or it will overright your index.php file for xenforo.
- Open the index.php file in your favorite php/txt editor. I use Notepad++.
- If it is configured properly you should be able to see it working at http://www.yourforum.com/XenforoMembers/index.php. You may need to add a second XenforoMembers because it might have nested it.
- Change the Config section so it will work for you.
PHP:
// Database Connection Settigns$server = '24.196.115.77'; // If index.php is in a folder named "XenforoMembers" in the root directory on the same server use localhost$username = 'test'; // Database user$password = 'JCjfpbtAnwZM5aRM'; // database password - the one entered is Read-only...$database = 'xf'; // Enter the name you specified for the Xenforo installation.$memberURL = 'http://www.divinedynasty.net/members/'; // This is for makeing the images clickable.$hideBanned = true; // This will hide the banned users on your forum. - If it is configured properly you should be able to see your gammers by repeating step 3.
- Login to your ACP and go to the applications tab
- click on Create Node and choose page.
- Code:
URL Portion: Members
Title: Members
Description: Members from the DivineDynasty Minecraft server.
Uncheck --> Display in the node list
I recommend you use an addon called "Nodes as Tabs" to create the tab and set it to display and change the tab title to members. - Click on Page Options tab
Template HTML:
HTML:
<div>
<iframe src="http://www.divinedynasty.net/XenforoMembers/XenforoMembers/index.php" frameborder='0' width='100%' height='500px' >
<p>Your browser does not support iframes.</p>
</iframe>
</div> - and save the page and go to your homepage and there should be a members tab.
- Open the index.php file.
- Around line 64 there should be a if statement like this
PHP:
if($row['user_group_id'] == 2)
{
echo "<a href=" . $memberURL . $row['username'] . "." . $row['user_id'] . "/ ><img width='32px' height='32px' src='https://minotar.net/avatar/" . $row['username'];
echo "/63' alt='" . $row['username'] . "'>";
}
Line 69 should look simular but with else if instead. The first must be the only if. - You can change the size by changing two numbers.
PHP:
if($row['user_group_id'] == [B]2[/B])
...
echo "/63' alt='" . $row['username'] . "'>";
}
Change the two to the usergroup which you can find by editing the group and the URL will say .../Administrators.3/ so the number to put is 3.
The 63 is for the size of the image. I used 63 to accomidate the 1px padding. I recommend going in powers of two such as 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, etc.