The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Adding Banned Members to Forum Statistics
I've been pouring through the forums and even used Google bu can't seem to find details of what I want to do. On my website the only banned members are spammers. I wanted to add to the Forum Statistics the number of Spammers Banned by displaying the number of banned members, however there doesn't seem to be a variable for that available. Could anyone point me in the direction of resources showing how I can get that value?
|
#2
|
||||
|
||||
Does anyone know how this might be accomplished?
|
#3
|
|||
|
|||
You could create a plugin using hook forumhome_complete and this code:
Code:
$res = $vbulletin->db->query_first("SELECT COUNT(*) AS numberbanned FROM user WHERE usergroupid = 8"); $numberbanned = vb_number_format($res['numberbanned']); vB_Template::preRegister('FORUMHOME', array('numberbanned' => $numberbanned)); and then in the FORUMHOME template use {vb:raw numberbanned}. This does add one query to that page. You could eliminate that by calculating it once every so often and putting it in the datastore, but I think that would require editing forum.php to add it to the $specialtemplates array (unless someone else knows a way around that). |
#4
|
||||
|
||||
Kevin, I appreciate your reply...could you please point me to a resource that describes adding a hook to the forumhome_complete?
I have made many modifications to my website templates, usually by seeing how othershad done it. I have created custom user fields and included those into custom pages, such as an achievement system on my site, however some things in this PHP code still remain a mystery to me. I appreciate your help! |
#5
|
|||
|
|||
Quote:
forumhome_complete is what you want to select from the hook location dropdown menu, and you can paste the code from above in the large text area. Enter a title so that later you'll remember what this does, then click the "Yes" radio button at the bottom to activate the plugin. Now you can click the save button and the plugin will be active. |
#6
|
||||
|
||||
Kevin, thanks again for your help. I am looking at implementing this once the patches slow down a bit. Each patch it seems I have to redo all my mods.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|