Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
9 + 9 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

stop comments adding to user post count, solved
by fatman on 2004/2/19 18:01:04

I was able to stop comments from adding to user post count, but it appears this can't be simply done XOOPS wide. Stopping the count for comments in news module and forums is explained below.

For Forums: hsalazar, your suggestion worked great. It occured to me that in forums, a 'reply' isn't really a comment, but still I want to disable the post count for my site :)

Commenting out the function around line 176 of /modules/newbb/post.php
le="color: #000000"><?php // $xoopsUser->incrementPost();


For stopping comments from adding to user post count in news your need to edit two files. /include/comment_post.php and /include/comment_delete.php

@ line 335 in comment_post.php
le="color: #000000"><?php // before $member_handler->updateUserByField($poster, 'posts', $poster->getVar('posts') + 1); // after change +1 to +0 $member_handler->updateUserByField($poster, 'posts', $poster->getVar('posts') + 0);



and arount line 152 in /include/comment_delete.php
le="color: #000000"><?php // before $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - 1); // after change -1 to -0 $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - 0);


Re: trying to stop comments adding to user post count
by hsalazar on 2004/2/19 2:14:29

fatman:

First: is the posts count increasing because of posts in the forum module? Probably yes. If so, you can see in the file /modules/newbb/post.php, around line 176, code indicating that if the user is registered and there's a post, a call is made to the function incrementPost().

This function, which by the way is deprecated, can be found in the file /kernel/user.php, lines 162-165.

So the easy answer to your question could be: delete line 176 in /modules/newbb/post.php...

Try it and give us feedback. Did it work?

Cheers.
Re: trying to stop comments adding to user post count
by brash on 2004/2/18 21:51:41

I'm no coder, but what would happen if you set posts+1 to posts+0?
trying to stop comments adding to user post count
by fatman on 2004/2/18 18:28:37

Hi, I'm hoping someone here knows a little about xoopscomments.php

around line 103 / 104 I find this
le="color: #000000"><?php if ( $isnew != false ) { $sql = sprintf("UPDATE %s SET posts = posts+1 WHERE uid = %u", $this->db->prefix("users"), $user_id); if (!$result = $this->db->query($sql)) { echo "Could not update user posts."; } }


this is the only place where I can see comments adding to the user post count.

so I tried just adding $isnew = false; but that didn't work, so I tried commenting this entire block out, but the user post count still gets updated when someone is making a new comment.

Is there another location where this count gets updated that I'm missing?

my users are only going to get credit for contributing published articles.

Who's Online

802 user(s) are online (711 user(s) are browsing Support Forums)


Members: 0


Guests: 802


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits