Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 09-23-2011, 07:24 PM
Savage Circuits's Avatar
Savage Circuits Savage Circuits is offline
 
Join Date: Jan 2010
Location: Plumas Lake, CA
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 10-12-2011, 06:36 PM
Savage Circuits's Avatar
Savage Circuits Savage Circuits is offline
 
Join Date: Jan 2010
Location: Plumas Lake, CA
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone know how this might be accomplished?
Reply With Quote
  #3  
Old 10-12-2011, 09:07 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #4  
Old 10-14-2011, 12:39 AM
Savage Circuits's Avatar
Savage Circuits Savage Circuits is offline
 
Join Date: Jan 2010
Location: Plumas Lake, CA
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #5  
Old 10-14-2011, 12:00 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Savage Circuits View Post
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.
Reply With Quote
  #6  
Old 11-11-2011, 06:01 AM
Savage Circuits's Avatar
Savage Circuits Savage Circuits is offline
 
Join Date: Jan 2010
Location: Plumas Lake, CA
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07395 seconds
  • Memory Usage 2,205KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete