phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Freeze Postcount


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Feb 11, 2009 9:58 am 
Post subject: Freeze Postcount

Where is this MOD? I can't find it. icon_rolleyes.gif
_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Wed Feb 11, 2009 2:16 pm 
Post subject: Re: Freeze Postcount

http://www.phpbb.com/mods/db/index.php?i=browse&mode=group:author&sub=66126
has a problem, though, which you will see.

so use this link to download it: http://www.phpbb.com/mods/db/download/189

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield ILMac 512K BlogMac GUI
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Feb 11, 2009 4:22 pm 
Post subject: Re: Freeze Postcount

Thanks. Very much apreciated. icon_wink.gif
_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Feb 11, 2009 5:21 pm 
Post subject: Re: Freeze Postcount

I have just installed it, but it doesn't work. icon_sad.gif The post count is still working, even after setting "freeze post count" to "yes". For admins and for simple users. icon_sad.gif Anyone tested this MOD? I am using 2.0.23. icon_cry.gif
_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 729
Location: Texas


flag
PostPosted: Wed Feb 11, 2009 5:28 pm 
Post subject: Re: Freeze Postcount

What is it supposed to do?
_________________
phpBBDoctor Blog
Back to top
~Cowboy~
Board Member



Joined: 08 Dec 2008

Posts: 297
Location: Chicago


flag
PostPosted: Wed Feb 11, 2009 5:58 pm 
Post subject: Re: Freeze Postcount

If I remember correctly it stops spammers post counts from going up.

So if they are spamming the board simply to get their post counts up then you can move the high post count prize out of their reach. icon_wink.gif

_________________
Image link
We are not refugees we are trail blazers. icon_wink.gif
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 729
Location: Texas


flag
PostPosted: Wed Feb 11, 2009 6:21 pm 
Post subject: Re: Freeze Postcount

I took a quick look at the code and it seems straight forward. After you set someone to frozen in the admin panel, when you go back in, are they still listed as frozen? Have you checked in the database to see that the new field exists and is getting populated?

Also there are queries in the MOD that are completely not necessary. For example:
Code:
$sql = "SELECT user_posts_frozen
   FROM " . USERS_TABLE . "
   WHERE user_id = $user_id";


if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}

$row = $db->sql_fetchrow($result);
         
$posts_frozen = $row['user_posts_frozen'];

Can be replaced by
Code:
$posts_frozen = $userdata['user_posts_frozen'];

The entire users table is retrieved into the $userdata array, there is never a need to requery the users table to get a user setting for the current user.

I didn't have time to go much further than that, but as the MOD stands it can certainly be improved.

_________________
phpBBDoctor Blog
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Wed Feb 11, 2009 6:54 pm 
Post subject: Re: Freeze Postcount

drathbun wrote:

I didn't have time to go much further than that, but as the MOD stands it can certainly be improved.

Who validated this MOD?? icon_neutral.gif Probably someone who is no longer on the MOD team.

Code:

#
#-----[ REPLACE WITH ]------------------------------------------
#

while ( $row = $db->sql_fetchrow($result) )
{
   //
   // Determine whether the users
   // post count is frozen
   // or not.
   //
   $sql = "SELECT user_posts_frozen
      FROM " . USERS_TABLE . "
      WHERE user_id = " . $row['poster_id'];


   if( !($fresult = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Error in deleting', '', __LINE__, __FILE__, $sql);
   }

   $frow = $db->sql_fetchrow($fresult);
   $posts_frozen = $frow['user_posts_frozen'];


   //
   // Only update the users post
   // count if they aren't frozen!
   //
   if ( !$posts_frozen )
   {
      $count_sql[] = "UPDATE " . USERS_TABLE . "
         SET user_posts = user_posts - " . $row['posts'] . "
         WHERE user_id = " . $row['poster_id'];
   }
}


This part could be changed to put user IDs into an array, then use a single SQL query at the end with an IN() clause.

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield ILMac 512K BlogMac GUI
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Thu Feb 12, 2009 9:32 am 
Post subject: Re: Freeze Postcount

Don't know how to do that, Dog Cow. icon_biggrin.gif
drathbun wrote:
What is it supposed to do?

You got a new option is user's management. Freeze Post Count: Yes/ No. If you put Yes, it should not go up or down, the number of posts should stay the same.
drathbun wrote:
I took a quick look at the code and it seems straight forward. After you set someone to frozen in the admin panel, when you go back in, are they still listed as frozen? Have you checked in the database to see that the new field exists and is getting populated?

Yes, it changes in the database from 0 to 1.

Image link

drathbun wrote:
Also there are queries in the MOD that are completely not necessary. For example:
Code:
$sql = "SELECT user_posts_frozen
   FROM " . USERS_TABLE . "
   WHERE user_id = $user_id";


if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}

$row = $db->sql_fetchrow($result);
         
$posts_frozen = $row['user_posts_frozen'];

Can be replaced by
Code:
$posts_frozen = $userdata['user_posts_frozen'];

I've done this changes, but still the post count is not freezing. icon_sad.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 2.3511 seconds using 16 queries. (SQL 0.0197 Parse 0.0009 Other 2.3305)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo