![]() |
Off-Topic Post Counter for Posts in Specified Forum(s)
PHP Code:
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:
PHP Code:
############################ FILE EDITS DONE ############################### ############################ TEMPLATE EDITS START ########################## In postbit (or postbit_legacy) find: HTML Code:
$vbphrase[posts]: $post[posts]</div> HTML Code:
<div class="smallfont" name="Off-Topic Posts">OT Posts: $post[otposts]</div> 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 |
Installed!
|
screeny at cruiselineforums.com
|
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 ?
|
Quote:
|
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. |
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'. :) |
you need to add an update counters thing for it. else it'll only apply to posts made after the hack is installed.
|
Quote:
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. |
Quote:
i think it should be easy to do thou, just copy the update posts code and change this query: PHP Code:
PHP Code:
$gotforums = ''; to $gotforums = '1,2,3'; where 1,2 and 3 are the forum ids of the forums you wish to count |
All times are GMT. The time now is 05:30 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|