vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How hard is it to make posting in a specific board -1 postcount? (https://vborg.vbsupport.ru/showthread.php?t=204967)

k111 02-11-2009 04:45 AM

How hard is it to make posting in a specific board -1 postcount?
 
I thought this would be a simple request with a simple solution but I haven't been able to find anything even remotely related to this request.

There is one board that I would like to give negative postcounts when people post there.. how complicated is this to achieve?

Many thanks to anyone smart enough to know..

Dismounted 02-11-2009 05:17 AM

Not complicated at all if you know vBulletin confidently. Find the code that updates the post count (most likely in the Post Data Manager), and run a query to subtract 2 posts (remember that it will have already been incremented).

k111 02-11-2009 01:10 PM

Quote:

Originally Posted by Dismounted (Post 1740483)
Not complicated at all if you know vBulletin confidently. Find the code that updates the post count (most likely in the Post Data Manager), and run a query to subtract 2 posts (remember that it will have already been incremented).

I want this to happen only in one area, not the whole board.. wouldn't this do it to everything?

bananalive 02-11-2009 02:11 PM

Quote:

Originally Posted by k111 (Post 1740840)
I want this to happen only in one area, not the whole board.. wouldn't this do it to everything?

Not if you use php conditional, something along the lines

PHP Code:

if ($foruminfo[forumid] == 23)
{
//post count -2 here



k111 02-11-2009 11:26 PM

Thanks both of you for your help, sorry to be so ignorant but I'm not entirely sure where I should be inserting that code. I am crawling around in phpmyadmin looking for anything related to the 'Post Data Manager' and then templates.. I think it's just been a long day and I am maybe a bit fried but I failed to work out where that should go. :erm: Any ideas?

Sorry to be a pain, I promise I am a quick learner..

Ted S 02-12-2009 01:05 AM

phpMyAdmin is a tool to edit mysql data once it is posted... You need to be looking at the php scripts that actually make the posts (part of vBulletin) and editing those.

Take a look at newpost.php and newreply.php and their required library scripts. It's somewhere in the middle.

--------------- Added [DATE]1234408231[/DATE] at [TIME]1234408231[/TIME] ---------------

Ok I decided to look for myself and while I didn't test I think I found it for you...

1. Open file includes/class_dm_threadpost.php
2. Go to line 614 and you'll see the posts going up

You can directly edit the code here or find a hook and build a plugin.

One way to do this is to disable posts from counting in that forum and then copy the if statement on line 614 and change it to check for the right forum ID and then adjust the query to be posts - 1.

Have fun

Dismounted 02-12-2009 03:47 AM

Quote:

Originally Posted by k111 (Post 1741342)
Thanks both of you for your help, sorry to be so ignorant but I'm not entirely sure where I should be inserting that code. I am crawling around in phpmyadmin looking for anything related to the 'Post Data Manager' and then templates.. I think it's just been a long day and I am maybe a bit fried but I failed to work out where that should go. :erm: Any ideas?

Sorry to be a pain, I promise I am a quick learner..

If you do not have some sort of PHP proficiency, it will be difficult for you to do this.


All times are GMT. The time now is 03:28 PM.

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.01061 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete