vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Adding Banned Members to Forum Statistics (https://vborg.vbsupport.ru/showthread.php?t=270807)

Savage Circuits 09-23-2011 07:24 PM

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?

Savage Circuits 10-12-2011 06:36 PM

Does anyone know how this might be accomplished?

kh99 10-12-2011 09:07 PM

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).

Savage Circuits 10-14-2011 12:39 AM

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!

kh99 10-14-2011 12:00 PM

Quote:

Originally Posted by Savage Circuits (Post 2256960)
Kevin, I appreciate your reply...could you please point me to a resource that describes adding a hook to the forumhome_complete?

Here's a link to the manual that describes the product/plugin system: https://www.vbulletin.com/docs/html/plugin_system . If you're not interested in reading it all then click on "Plugin Manager" then "Add a new plugin".

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.

Savage Circuits 11-11-2011 06:01 AM

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.


All times are GMT. The time now is 08:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01005 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete