[2.0.12] Hide Zero Posters

The cleanup is complete. This forum is now read only.
Post Reply

Rating:

Excellent!
13
65%
Very Good
2
10%
Good
0
No votes
Fair
2
10%
Poor
3
15%
 
Total votes: 20

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 29216
Joined: Sat Aug 16, 2003 7:36 am

[2.0.12] Hide Zero Posters

Post by Extensions Robot »

MOD Name: Hide Zero Posters
Author: TerraFrost
MOD Description: Prevents people with zero posts from showing up in the memberlist, as the newest user (which is, instead, redefined to be the user whose made his first post most recently), in groups, and doesn't count them in the overall membercount.


MOD Version: 2.0.0

Download File: zero_users-4563.zip
mods overview page: View
File Size: 6730 Bytes

Security Score: 0
Last edited by Extensions Robot on Mon Apr 30, 2007 12:31 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

MOD Validated/Released

Notes:
Makes it so that only those who have posted atleast once are shown in the memberlist and counted towards your total members. This elminates the purpose of bots registering on your site just to have a website listed on the memberlist.
Eric
sirAndr3w
Registered User
Posts: 2
Joined: Fri Mar 18, 2005 7:31 pm

Post by sirAndr3w »

Hello i was wondering if there is an addon or a mod that can prune inactive users such as the ones with zero posts or those who haven`t joined the forum in a long while, but without deleting some users that the admin decided to tag with an option like: Don`t purge or something like that, to prevent certain forum admins/moderators from being pruned if they don`t join the forum for a while.
xboxundone
Registered User
Posts: 13
Joined: Thu Sep 30, 2004 12:10 pm

Post by xboxundone »

sirAndr3w wrote: Hello i was wondering if there is an addon or a mod that can prune inactive users such as the ones with zero posts or those who haven`t joined the forum in a long while, but without deleting some users that the admin decided to tag with an option like: Don`t purge or something like that, to prevent certain forum admins/moderators from being pruned if they don`t join the forum for a while.


Yes I could use something like this!!
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost »

This MOD would probably be better suited to your needs. I don't believe admins can chose not to delete specific users, but the author of that MOD might be willing to add that as a feature.
cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia »

Hi. I tried installing this mod but ran into problems with the SQL part...

I don't really know what I'm doing, but here's what I did:

I installed with ezmod.

When it got to the sql part, it said"

Code: Select all

SQL PROCESSING HALTED

An error was encountered while processing the SQL commands. Further SQL processing has been halted. You may choose to complete the MOD installation anyway and perform the SQL commands manually yourself. However, at this point EM cannot guarantee the MOD will work correctly so you are best off seeking support from the Author before continuing further.

The failed line was:
UPDATE users AS u, phpbb_posts AS p1 LEFT OUTER JOIN phpbb_posts AS p2 ON p1.poster_id = p2.poster_id AND p2.post_time < p1.post_time INNER JOIN phpbb_posts AS p3 ON p3.post_time = p1.post_time SET u.user_firstpost=p3.post_time WHERE p2.post_time IS NULL AND p1.poster_id = u.user_id

SQL Error: 1064
You have an error in your SQL syntax near 'AS u, phpbb_posts AS p1 LEFT OUTER JOIN phpbb_posts AS p2 ON p1.poster_id = p2.p' at line 1
So, I tried going to phpbbhacks like the install file said, and got the php generator to make me a sql installer php file. When I ran that I got the following:

Code: Select all

ALTER TABLE users ADD user_firstpost int(11) NOT NULL
+++ Error: Duplicate column name 'user_firstpost'

UPDATE users AS u, posts AS p1 LEFT OUTER JOIN posts AS p2 ON p1.poster_id = p2.poster_id AND p2.post_time < p1.post_time INNER JOIN posts AS p3 ON p3.post_time = p1.post_time SET u.user_firstpost=p3.post_time WHERE p2.post_time IS NULL AND p1.poster_id = u.user_id
+++ Error: You have an error in your SQL syntax near 'AS u, posts AS p1 LEFT OUTER JOIN posts AS p2 ON p1.poster_id = p2.p' at line 1

UPDATE users SET user_firstpost = user_regdate WHERE user_posts <> 0 AND user_firstpost = 0
+++ Successful

INSERT INTO config (config_name, config_value) VALUES ('zero_count',1),('zero_newest',1),('zero_group',1),('zero_list',1)
+++ Successful
I'm guessing that first error was just because ezmod had already changed that one, but I still need to figure out what the problem is with the syntax of that second part. Can anyone help?

[edit: I also apologize if I'm asking this in the wrong place. If so, could anyone please direct me to the correct area for a question like this?]
cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia »

Oh, and by the way: I'm assuming that this would be the code that's having trouble?

Code: Select all

UPDATE phpbb_users AS u, phpbb_posts AS p1
   LEFT OUTER JOIN
   phpbb_posts AS p2
   ON p1.poster_id = p2.poster_id AND
      p2.post_time < p1.post_time
   INNER JOIN
   phpbb_posts AS p3
   ON p3.post_time = p1.post_time
SET u.user_firstpost=p3.post_time
WHERE p2.post_time IS NULL AND
   p1.poster_id = u.user_id;
Mostly just asking this one to see if I'm really learning anything. ;)
cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia »

Hmmm...ok, I finally just got impatient, and decided to try finishing the ezmod installation, and SO FAR everything seems to be working out. :) :) :) So, I don't know. If that's the case, should I even worry about that whole sql thing? Or should I let sleeping dogs lie? ;)
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost »

Yup - that's the problem code.

Anyway, can you tell me which database software (and which version) your running, be it MySQL, MSSQL, or something else?

Also, could you try running this SQL query?:

Code: Select all

UPDATE phpbb_users SET (user_firstpost) = SELECT MIN(post_time) FROM phpbb_posts WHERE phpbb_posts.poster_id = phpbb_users.user_id;
This should do the same thing but I get an error since MySQL 4.0 doesn't support updates with subqueries (atleast that's why I assume I'm getting the error).

If it does work, I wouldn't recommend installing this MOD just yet - there are portions which won't work if the query you're unable to run doesn't work. The reason I'm asking you to run the query is to help me diagnose / understand the problem so I can fix it :)

EDIT: In response to your latest post - problems will arise under certain conditions (deleting a post might do it) since the above SQL query didn't work. Also, the join date of users won't be equal to the date of their first post - not that that's necessarily a problem, but that's kinda half of what my intentions were with this MOD.
cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia »

1) I'm pretty sure MySQL sounds familiar. Like I said, I'm not really good at this.

2) I don't really know what running a query means, or how to do it. :( I would need a little help to do that.

3) So, you're saying if I can't get that line working then people will still have their "real" join date when they finally do post? Is that all? Because I'd actually almost like that better. (I'd still be willing to help you find out what happened, though. :)
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost »

1) I'm pretty sure MySQL sounds familiar. Like I said, I'm not really good at this.

If you're paying for hosting, you may have a control panel which tells you what you have.

Also, something else you can do is to look in config.php and find a line similar to this:

$dbms = '*';

They'll be something else there, in place of the *. What is it?
2) I don't really know what running a query means, or how to do it. Sad I would need a little help to do that.

As for how to run the query... copy / paste the SQL into this tool, and run the resultant script on your server. If you get any errors, post here.
3) So, you're saying if I can't get that line working then people will still have their "real" join date when they finally do post? Is that all? Because I'd actually almost like that better. (I'd still be willing to help you find out what happened, though.

They will indeed, but like I said - if that works, then there will be a few other things that need changing, in this MOD.
cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia »

Yup...mysql.

Ok...I made that php file from that code, and ran it, and came back with this:

Code: Select all

UPDATE users SET (user_firstpost) = SELECT MIN(post_time) FROM posts WHERE posts.poster_id = users.user_id
+++ Error: You have an error in your SQL syntax near '(user_firstpost) = SELECT MIN(post_time) FROM posts WHERE posts.poster_id = user' at line 1
And you're right...it is also getting errors right now trying to delete posts, so I guess I do need to fix this.
cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia »

Yup...mysql.

Ok...I made that php file from that code, and ran it, and came back with this:

Code: Select all

UPDATE users SET (user_firstpost) = SELECT MIN(post_time) FROM posts WHERE posts.poster_id = users.user_id
+++ Error: You have an error in your SQL syntax near '(user_firstpost) = SELECT MIN(post_time) FROM posts WHERE posts.poster_id = user' at line 1
And you're right...it is also getting errors right now trying to delete posts, so I guess I do need to fix this.
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost »

The last thing I need to know, now, is the version. You can find this out by running the following PHP script:

Code: Select all

<?
  phpinfo();
?>
After you've done that, do a search on the resultant page for "Client API version" and tell me what the right column says. If "Client API version" appears twice, I'll need to give you something else to look for.
cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia »

Looks to be: 3.23.58

Just appeared once. :)
Post Reply

Return to “[2.0.x] MOD Database Cleanup”