Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
HITCounter - Link Forum Counter Details »»
HITCounter - Link Forum Counter
Version: 1.3, by b6gm6n b6gm6n is offline
Developer Last Online: Aug 2014 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 08-04-2005 Last Update: 10-11-2005 Installs: 88
DB Changes Uses Plugins Template Edits
Additional Files  
No support by the author.

This is a port originally By Zajako and Mone.

With kind permission i've updated the mod for vBulletin 3.5, this version comes with an enhancement, i.e via your ACP (forum manager) you can adjust the starting value for any counter.

Installation is done easily via the importing of an xml file.

See screenshots!

Enjoy!

Update : Huge Respect to KirbyDE who really is the genius behind this mod, cheers dude.

Update 1.3 : optimized code - (no more updates to totals) - Thanx KirbyDE

If you use this mod please click Install - cheers!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-05-2005, 12:28 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't you do the file edit via a plug-in?
Reply With Quote
  #3  
Old 08-05-2005, 12:37 AM
b6gm6n's Avatar
b6gm6n b6gm6n is offline
 
Join Date: Aug 2002
Location: UK
Posts: 691
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
Can't you do the file edit via a plug-in?
would be nice yeah... but how does one edit the forum home template on the fly via a plugin..? - stumped me for now anyways...

-b6
Reply With Quote
  #4  
Old 08-05-2005, 12:51 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by b6gm6n
would be nice yeah... but how does one edit the forum home template on the fly via a plugin..? - stumped me for now anyways...

-b6
Oh, template edit. I thought it was a file edit. My mistake, sorry.

Shouldn't this be in plug-ins then?
Reply With Quote
  #5  
Old 08-05-2005, 12:59 AM
b6gm6n's Avatar
b6gm6n b6gm6n is offline
 
Join Date: Aug 2002
Location: UK
Posts: 691
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No need to be sorry your right, there is a file edit in three places within "functions_forumlist.php", everything else gets automagically installed via the xml file settings, template, queries etc...

The file edit merges the new 'linkhits' template into the forum home display, maybe the next version will be free of file edits... which would be great!

-b6
Reply With Quote
  #6  
Old 08-05-2005, 01:01 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There should be some hooks you can use for the file edits, though, shouldn't there?
Reply With Quote
  #7  
Old 08-05-2005, 01:39 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The Template is not the Problem, can be done with a Plugin.

Hook: forumbit_display
PHP Code:
if ($forum['link'])
{
    
$forum['replycount'] = '';
    
$forum['threadcount'] = '';
    eval(
'$forum[\'lastpostinfo\']  = "' fetch_template('linkhits') . '";');

This kicks off 1 File edit.

However, getting the count doesn't seem to be possible without the File edit.
The other Option would be to use a Query. But this would add 1 Query to Forumhome and every forumdisplay.php call where the Forum being displayed contains sub-forums that are links.
Or the Forumcache would have to be rebuild upon every Hit, which is even worse IMHO.

However, some furhter suggestions:

Your Counter-Update seems to be run every Time smth. is being done in ACP?
I'd suggest to get rid of the Settings and the admin_global Plugin.
Instead, make a new control in Forum Manager that shows the current Value so the User can just input it's own.

Hook: forumdata_start
PHP Code:
$this->validfields['linkhits'] = array(TYPE_UINTREQ_NO); 
Hook: forumadmin_edit_form
PHP Code:
if (trim($forum['link'] != ''))
{
    
$check $db->query_first("SELECT linkhits FROM " TABLE_PREFIX "forum WHERE forumid = $forum[forumid]");
    
print_table_header('Forum Link Hit Counter');
    
print_input_row('Hit Counter Value<dfn>Here you can manually adjust the Hit-Counter for this Forum-Link</dfn>''forum[linkhits]'$check['linkhits']);

The check-query isn't ideal, but necessary as the Forum Manager displays cached Data

Don't execute the Update in Global-Start, as this causes 1 additional Query for every Forum being displayed, no matter if it is a Link or not.

Hook: header_redirect
PHP Code:
global $foruminfo;
if (
trim($foruminfo['link']) != '')
{
    
$vbulletin->db->query("UPDATE " TABLE_PREFIX "forum SET linkhits = linkhits +1 WHERE forumid=$foruminfo[forumid]");

You should also cache the Template on forumdisplay, as it might be shown here too.

Hook: cache_templates
PHP Code:
if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'forumdisplay')
{
    
$globaltemplates  array_merge($globaltemplates, array('linkhits'));

Reply With Quote
  #8  
Old 08-05-2005, 02:05 AM
b6gm6n's Avatar
b6gm6n b6gm6n is offline
 
Join Date: Aug 2002
Location: UK
Posts: 691
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanx KirbyDE, i'll look into this...cheers

-b6
Reply With Quote
  #9  
Old 08-05-2005, 02:26 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There you go! I knew Kirby would be able to help.
Reply With Quote
  #10  
Old 08-05-2005, 10:58 AM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

b6gm6n - is the username Kingpin related?
Reply With Quote
Reply

Thread Tools

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 11:52 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.04947 seconds
  • Memory Usage 2,307KB
  • Queries Executed 23 (?)
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
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete