Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Off-Topic Post Counter for Posts in Specified Forum(s) Details »»
Off-Topic Post Counter for Posts in Specified Forum(s)
Version: 1.00, by kall kall is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-30-2005 Last Update: Never Installs: 6
 
No support by the author.

PHP Code:
/*======================================================================*\
|| #################################################################### ||
|| # Off-Topic Post Count for Specified Forums                        # ||
|| # ---------------------------------------------------------------- # ||
|| # An NZBoards Production!                                          # ||
|| # Project Began: 0803 1 April 2005 (GMT)                           # ||
|| # Project Finished: 0818 1 April 2005   (GMT)                      # ||
|| # Version Released: 1.0                                            # ||
|| # Modification by: Kall                                            # ||
|| # This may not be redistributed without NZBoards Consent         # ||
|| # The above line applies to all you filthy pirates.                # ||
|| # Copyright 2005 [url]www.nzboards.com[/url]                                  # ||
|| #################################################################### ||
\*======================================================================*/ 
As requested by rex of www.cruiselineforums.com:

What does this hack do?

Adds a new Post Counter, for off-topic posts.

It enables you to define a Forum (or Forums) as 'Off-Topic Forums'.
Any posts made by users in that Forum are not added to the Post count, they are added to the Off-Topic Post count instead.

As a bonus, OT posting won't be rewarded with promotions or points or anything linked to $bbuserinfo[posts].

Queries to run: One
Files to edit: One
Templates to edit: One (postbit or postbit_legacy).


########################### SQL EDITS START ###############################

Run this query: (change user to yourtableprefix_user if you use a table prefix).
[sql]
ALTER TABLE `user` ADD `otposts` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL;
[/sql]
############################# SQL EDITS DONE ###############################



############################ FILE EDITS START ##############################

In includes/functions_newpost.php

Find:
PHP Code:
$doposts 'posts = posts + 1,'
Change to (make X equal to the forumid of your Off-topic forum):
PHP Code:
if ($foruminfo['forumid'] == 'X')
{
$doposts 'otposts = otposts + 1,';
}
else
{
$doposts 'posts = posts + 1,';

Save and upload.

############################ FILE EDITS DONE ###############################


############################ TEMPLATE EDITS START ##########################

In postbit (or postbit_legacy) find:
HTML Code:
$vbphrase[posts]: $post[posts]</div>
Under, add:
HTML Code:
<div class="smallfont" name="Off-Topic Posts">OT Posts: $post[otposts]</div>
############################ TEMPLATE EDITS DONE ###########################


And you are done.

Rejoice!

Updates:
0850 1 April 2005 (GMT+12): Added name attribute to div tag for mouseover explanation.

1800 7 April 2005: Dan's AdminCP Update Offtopic Counter Addon: https://vborg.vbsupport.ru/showpost....2&postcount=14

Show Your Support

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

Comments
  #2  
Old 03-31-2005, 06:44 PM
Lee's Avatar
Lee Lee is offline
 
Join Date: Jul 2004
Location: Texas
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed!
Reply With Quote
  #3  
Old 03-31-2005, 06:44 PM
rex_b rex_b is offline
 
Join Date: Jul 2004
Location: LA
Posts: 271
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screeny at cruiselineforums.com
Reply With Quote
  #4  
Old 03-31-2005, 07:32 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cn this be setup so if we have a one section any posts in there (well threads as post are not needed) can be added up ?
Reply With Quote
  #5  
Old 03-31-2005, 08:20 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lasto
cn this be setup so if we have a one section any posts in there (well threads as post are not needed) can be added up ?
I don't understand the question, sorry. :S
Reply With Quote
  #6  
Old 03-31-2005, 08:57 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is fine m8 it was way i worded it.

Does this work on posts only - would prefer one that actually worked on threads
so if i had a section for posting say pics etc evertime someone made a thread in that section it would increase the counter by 1,but people replying to the same thread would`nt get an increase as its based on threads only.
Reply With Quote
  #7  
Old 03-31-2005, 09:30 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh, right.

Well, as vB is by default, I believe that this hack would achieve what you want. (ie: as far as the $postcount variable is concerned, it increases regardless of whether it was a reply or a post.)

Therefore, new replies OR new threads in the specified OT forum would not add to Post count, but would add to OT Post count. That's why I called it 'OT Posts Hack' and not 'OT new replies Hack'.
Reply With Quote
  #8  
Old 04-01-2005, 04:00 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you need to add an update counters thing for it. else it'll only apply to posts made after the hack is installed.
Reply With Quote
  #9  
Old 04-01-2005, 08:01 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Carnage-
you need to add an update counters thing for it. else it'll only apply to posts made after the hack is installed.
Well, duh.

If *you* want to make an Update Counters thing for it, go ahead.

I can't find where it is I claim that it works retrospectively anywhere in this thread, so I don't 'need to add' anything.
Reply With Quote
  #10  
Old 04-01-2005, 10:01 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kall
Well, duh.

If *you* want to make an Update Counters thing for it, go ahead.

I can't find where it is I claim that it works retrospectively anywhere in this thread, so I don't 'need to add' anything.
mmm true...

i think it should be easy to do thou, just copy the update posts code and change this query:

PHP Code:
$forums $DB_site->query("
        SELECT forumid
        FROM " 
TABLE_PREFIX "forum AS forum
        WHERE (forum.options & 
$_FORUMOPTIONS[countposts])
    "
); 
i think the following should do it:

PHP Code:
$forums $DB_site->query("
        SELECT forumid
        FROM " 
TABLE_PREFIX "forum AS forum
        WHERE !(forum.options & 
$_FORUMOPTIONS[countposts])
    "
); 
alternativly you could try manually setting the folowing variable:

$gotforums = '';

to
$gotforums = '1,2,3';

where 1,2 and 3 are the forum ids of the forums you wish to count
Reply With Quote
Reply


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 01:15 PM.


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.04311 seconds
  • Memory Usage 2,316KB
  • 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
  • (2)bbcode_html
  • (5)bbcode_php
  • (3)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
  • (1)pagenav_pagelink
  • (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