Disabling Post Count in Cetrain Categories or Discussions
![Skisma](https://secure.gravatar.com/avatar/f5832dd5ad59a21f9b3cd7b84499693a/?default=https%3A%2F%2Fvanillicon.com%2Ff9a89e3251279cbf59d0cc5f60fcca32_100.png&rating=g&size=100)
Hey everyone,
I'm here with yet another question, although this time I have searched the forums here and don't think this has been asked before.
I'm wanting to know how I can disable post count in a certain category or even a certain discussion. In my Off-Topic category/forum there is a discussion where I actually allow spam posts. When I say spam posts I'm not talking about legitimate spam, but instead short, 1 -2 word posts that don't have to be relevant to any sort of specific topic. Because this one discussion doesn't require insightful, constructive posts there will likely be users who post dozens of times a day in this thread/topic (once I gain a userbase of course) and I don't want that to show on their post count.
You're probably thinking, "then why do you have such a topic" and I don't blame you. It's hard to explain, but this is something crucial to my forum that my users are going to want.
Comments
In simple words if you are saying how do I prevent post count from displaying in certain categories.
the answer would be via css.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Hmmm... This is a tricky one.
On the one hand, it is trivial to prevent a post from updating the post count. On the other hand, running
dba/counts
will correct the account.Let me have a think on it. Some one else might figure it out first.![:) :)](https://open.vanillaforums.com/plugins/emojiextender/emoji/little/smile.png)
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@peregrine Thank you for the reply, but no that's not exactly what I'm looking for. What I'm wanting is to disable any posts within this category/discussion so that they don't count towards the users total post count. So if they have 47 posts here and 35 posts in all other places, their total post count will be 35 instead of 82.
Edit: @hgtonight thank you for giving this a thought!
The plugin dba/count handlers are registered after the applications, so the counts could just be overwritten
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Skisma Hook into the Comment Model, look for the discussion ID and decrement the user post count.
Then you need to create a simple model that will recalculate the user count.
Finally, register the counts handler on the DBA controller.
Hopefully someone else can help you fill in the blanks as far as what query to execute.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
How about
to exclude CategoryID 3 for example
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
If you are excluding an entire category (misread initial post, sorry), you change your comment model hook to something like:
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight @Bleistivt Wow you guys are awesome! I'm trying to make sense of all of this, but being a noob it's hard. lol. So do I need to add @Bleistivt's code in the section where @hgtonight says "// TODO: Add recalculation SQL here" on line 4?
I think I'm going to take the php course on codecademy.com to familiarize myself a little.
Oh and to be clear, ultimately what I want is to have the "Post Party Countdown" discussion to have disabled post count...so anytime someone posts in there it won't count towards their total posts. However, if it's much easier to just disable the entire "Off Topic Discussion category that would be fine. http://forgehaven.com/vforums/categories/off-topic-discussion
On line 2, could I replace c.CategoryID with c.DiscussionID and where (3) is listed, replace it with the corresponding discussion ID?
Yes. You can also put multiple discussion IDs
(1, 2, 3)
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt awesome! Just a tiny bit more clarification and I think I'm good![:) :)](https://open.vanillaforums.com/plugins/emojiextender/emoji/little/smile.png)
1 Create a basic plugin structure in the plugins directory like so:
/plugins/DiscountDiscussions/class.discountdiscussions.plugin.php
and a model
plugins/DiscountDiscussions/models/class.discountdiscussionmodel.php
The first and the third snippet of hgtonight are event hooks that belong in the plugin, the second is the model class.
2 Yes, what I posted was the recalculation SQL
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt thanks for the clarification! You made that so easy...however, it's not working.
Here's what I've got, and keep in mind I've made the directories just as you said to.
Have you enabled the plugin through the dashboard?
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt Yup, still no go.
That means you have to enable debug mode in your config to see if you get any error messages.![;) ;)](https://open.vanillaforums.com/plugins/emojiextender/emoji/little/wink.png)
But if you are impatient, the error is in the spoiler:
It should be
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt thanks!
I've updated to script and uploaded it to the directory, however, it's still not working![:neutral_face: :neutral_face:](https://open.vanillaforums.com/plugins/emojiextender/emoji/little/neutral.png)
Here's my debug: (The first two were there previously)
@Skisma You need to add
$Configuration['Debug'] = TRUE;
to your/conf/config.php
file to enable debug mode.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight Thanks, but I already did that, haha. The image above are the results. The first two have to do with something else.