MyBB Community Forums

Full Version: Make this update auto
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Okay, so I am making changes to the staff page, to show the userbar and avatar etc instead of the standard staff page which is boring.

What I want to know however, is how to make it update automatically if one of the staff changes avatar, usertitles or userbar?

I have all the html stuff ready, just don't know what php hooks i will need

I will be adding this as a completely new page, if that helps.
bumping this cos i need an answer.
bumping this again as i need an asnwer.
You'll need to edit a few templates:
* showteam_moderators - add columns for what you what to include
* showteam_usergroup_user - this is for each row in the table. You can use the $user variable to get at additional information about the team member.

If you want to get fancier than that, you will need to create a plugin and populate variables you can then reference in these templates.
Basically the page I want to create is like this (use your imagination)

Username Avatar
userbar
usertitle
userstars

pm


So to make the variables change i can simply include them in a new page as common hooks?
bumping as i need an answer.
(2014-04-13, 11:51 PM)Charisma Wrote: [ -> ]bumping as i need an answer.

write the plugin
(2014-04-14, 04:44 PM)JimR Wrote: [ -> ]
(2014-04-13, 11:51 PM)Charisma Wrote: [ -> ]bumping as i need an answer.

write the plugin

What kind of idiot are you.
You need to edit showteam.php query so that it actually gets the userbar and avatar values from the db and then create variables based on the query result. You can then refer to the new variables in the templates already mentioned. Then you style the templates.

Example that will add the avatar attached. Use the below code in the showteam_usergroup_user template.
<tr>
<td width="80%" class="{$bgcolor}"><div class="float_left">{$user['avatar']}</div><a href="{$user['profilelink']}"><strong>{$user['username']}</strong></a><br/>{$usergroup['usertitle']}</td>
<td width="10%" class="{$bgcolor}">{$emailcode}</td>
<td width="10%" class="{$bgcolor}">{$pmcode}</td>
</tr>

You can see the file in use on leefish here: http://www.leefish.nl/mybb/showteam.php Obviously its not the template as outlined in the above codeblock.
(2014-04-15, 12:38 AM)Leefish Wrote: [ -> ]You need to edit showteam.php query so that it actually gets the userbar and avatar values from the db and then create variables based on the query result. You can then refer to the new variables in the templates already mentioned. Then you style the templates.

Example that will add the avatar attached. Use the below code in the showteam_usergroup_user template.
<tr>
<td width="80%" class="{$bgcolor}"><div class="float_left">{$user['avatar']}</div><a href="{$user['profilelink']}"><strong>{$user['username']}</strong></a><br/>{$usergroup['usertitle']}</td>
<td width="10%" class="{$bgcolor}">{$emailcode}</td>
<td width="10%" class="{$bgcolor}">{$pmcode}</td>
</tr>

You can see the file in use on leefish here: http://www.leefish.nl/mybb/showteam.php Obviously its not the template as outlined in the above codeblock.

Thing is, I was planning on creating a whole new page for this, so that I don't need to edit multiple templates, I can then make all necessary changes from one global template.
Pages: 1 2