vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Total Posts (https://vborg.vbsupport.ru/showthread.php?t=5960)

12-26-2000 11:27 AM

We have a "Chit Chat" forum on our boards where users can post anything. The problem is that some of our users complain because others get very high post counts by making useless posts to the Chit Chat forum. I'd really appreciate it if someone could tell me how to make the user post counts not go up in a specific forum.

Thanks

12-26-2000 11:52 AM

Sure this is pretty easy to do. Just open up "newreply.php" and change the following code:

Code:

$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
And replace it with this:
Code:

// Change the number 1 below to the forum you don't want posts to count in
if ($threadinfo[forumid]==1) {
$DB_site->query("UPDATE user SET posts=posts,$dotitle"."lastpost=".time()." WHERE userid=$userid");
} else {
$DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
}

And that should do it.

-Chris

12-26-2000 11:57 AM

look just what i have been looking for as well :)

what if you want to specify 2 or more forums ?

12-26-2000 12:06 PM

Quote:

Originally posted by eva2000
what if you want to specify 2 or more forums ?
Then just change that first line and add an 'or' for each forum you want to exclude:
Code:

if ($threadinfo[forumid]==1 or $threadinfo[forumid]==2) {

12-26-2000 12:26 PM

Well thanks for the quick reply! It works great but I have a problem. What about new threads? I did the same change for the newthread.php but my post count increased when I posted a new thread. I'll be very happy if you could find a solution for the new threads.

Thanks

12-26-2000 12:47 PM

Quote:

Originally posted by DoST
What about new threads?
Sorry about the oversight there, yes you should be able to make the same change to newthread.php as you did in newreply.php, the code for incrementing the post count is the same in both. I'm not sure why it still changed your post count, but you might want to empty your browser's cache file and try it again?

12-26-2000 04:42 PM

It doesn't work for me. Maybe someone else who tried can tell if it works or not?

12-26-2000 07:33 PM

I did it a little differently.

In the Forum table I added a column called countposts

countposts smallint(6) default 1

Then using SQL queries I set them forums I wanted to ignore in the post count to zero.

update forum set countposts=0 where forumid=XX

newthread.php
Look for:
Code:

$foruminfo=$DB_site->query_first("SELECT
change to:
Code:

$foruminfo=$DB_site->query_first("SELECT countposts,
Leave the rest of the line alone.

Under that line add:
Code:

$countposts=$foruminfo[countposts];
Then look for:
Code:

        $DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
Change to:
Code:

        //Wayne Luke 11/01/2000
        //Exclude certain forums from post counts
        if ($countposts) {
          $DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
        } else {
        $DB_site->query("UPDATE user SET posts=posts,$dotitle"."lastpost=".time()." WHERE userid=$userid");
        }
        // End Modification.

newreply.php
Look for:
Code:

  $foruminfo=$DB_site->query_first("SELECT
Change to:
Code:

  $foruminfo=$DB_site->query_first("SELECT countposts,
Leave the rest of the line as it is.

Look for:
Code:

          $DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
Change to:
Code:

        //Wayne Luke 11/01/2000
        //Exclude certain forums from post counts
        if ($countposts) {
          $DB_site->query("UPDATE user SET posts=posts+1,$dotitle"."lastpost=".time()." WHERE userid=$userid");
        } else {
        $DB_site->query("UPDATE user SET posts=posts,$dotitle"."lastpost=".time()." WHERE userid=$userid");
        }
        // End Modification

THen if I want to exclude another forum in the future, I can just set the countposts column = 0 for that forum without touching the code.


[Edited by wluke on 12-26-2000 at 04:39 PM]

01-01-2001 10:27 PM

Thanks, I think I will include this on my site.


All times are GMT. The time now is 05:14 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.01010 seconds
  • Memory Usage 1,735KB
  • 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
  • (12)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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