[2.0.12] Hide Zero Posters

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

Rating:

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

User avatar
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Thu Mar 24, 2005 3:53 am

Thanks! I'll try to get back to you on getting this working with your board in the next few days (I need to some research on it, first).

cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia » Thu Mar 24, 2005 7:50 am

Can't wait. Guess that everyone will just have to deal with not being able to delete posts until then. Could prove interesting, maybe? :)

cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia » Tue Mar 29, 2005 8:57 am

Just checking in to see if any progress has been made on this. :)

User avatar
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Tue Mar 29, 2005 9:50 pm

I asked on comp.databases why the sql query wasn't working, and was told that MySQL wasn't real SQL and that it shouldn't be used. As good advice as that may be, I don't think it's all that useful. Short of switching hosts, those who pay for hosting can't do much.

As such, I'd recommend looking for and deleting the following lines in functions_post.php:

Code: Select all

		// if this is the users first post, set user_firstpost to 0.
		$sql = "UPDATE " . USERS_TABLE . " AS u, " . POSTS_TABLE . " AS p1
				INNER JOIN " . POSTS_TABLE . " AS p2
				ON p2.post_id = " . $post_id . "
			SET u.user_firstpost = 0
			WHERE u.user_id = p2.poster_id AND u.user_firstpost = p2.post_time;";

		if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Unable to update user_firstpost', '', __LINE__, __FILE__, $sql);
		}

		$resync = $db->sql_affectedrows();

Code: Select all

		if ($resync)
		{
			// if the previously deleted post was the users first post, redefine user_firstpost.
			$sql = "UPDATE " . USERS_TABLE . " AS u, " . POSTS_TABLE . " AS p1
					LEFT OUTER JOIN " . POSTS_TABLE . " AS p2
					ON p1.poster_id = p2.poster_id AND p2.post_time < p1.post_time
					INNER JOIN " . POSTS_TABLE . " 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 AND u.user_id = " . $post_data['poster_id'] .";";

			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Unable to update user_firstpost', '', __LINE__, __FILE__, $sql);
			}
		}

cutaia
Registered User
Posts: 76
Joined: Sun Mar 06, 2005 3:35 am

Post by cutaia » Wed Mar 30, 2005 3:24 am

You rock it hard!

Everything seems to be running well enough now. (Technically, if someone registers, posts, then deletes their only post, they still show up as the "Newest Registered User" until someone else registers. But they don't show up on the memberlist, or in the member count, so i'm perfectly ok with that.)

:)

I'll let you know if something unexpected pops up.

(Mod gets an excellent)

shadychick212
Registered User
Posts: 17
Joined: Wed Jun 22, 2005 9:42 pm

Post by shadychick212 » Wed Dec 07, 2005 3:02 pm

I could use some help please.

I had the same SQL error as the person above and followed the given advice but after editing all of the files, my root index showed as just a blank page.

So I restored all of my backup files and now when a user posts it is not showing the "new post" icon next to the forum or next to the thread. :?:

I have no clue what could possibly have gone wrong to cause this.

I would really like to get this mod working - it looks great! Can you offer any help at all please? Also please some help as to why my new posts are no longer showing as a new post?

Thanks in advance!

User avatar
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Wed Dec 07, 2005 5:12 pm

The SQL doesn't work on MySQL 3.23. You need 4.0, minimum. The change above should have worked, though. Not sure why it didn't.

As for the problem you experienced after uninstalling it... this MOD doesn't really do anything with the new post icon. I suspect the MOD was just uninstalled incorrectly...

I can try to debug further if you were to provide me, via PM, with a temp. FTP account.

shadychick212
Registered User
Posts: 17
Joined: Wed Jun 22, 2005 9:42 pm

Post by shadychick212 » Wed Dec 07, 2005 7:19 pm

the new post icon was just a stupid thing on my part, totally unrelated lol sorry about that

i totally uninstalled the mod and reinstalled it again and had the same thing

index page just displays as blank, nothing shows at all...

i can't provide you with an ftp account, because this site is shared and the other person would kill me 8O

thanks for the response though

User avatar
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Wed Dec 07, 2005 7:47 pm

So, basically, the edits to functions_post.php are making your index.php not work? If so, then I am rather confussed. If not, then I guess I'm misunderstanding the steps that are causing the problem.

shadychick212
Registered User
Posts: 17
Joined: Wed Jun 22, 2005 9:42 pm

Post by shadychick212 » Wed Dec 07, 2005 11:02 pm

ahhhh i got it, it was one of the partial matches in the install that threw everything off

it's working as desired now

great mod, thank you very much for the quick replies, sorry to have wasted your time!

MCPB
Registered User
Posts: 198
Joined: Wed Jan 14, 2004 3:07 am

Post by MCPB » Fri Dec 16, 2005 5:39 pm

I installed this mod and its not working.

I don't get any errors.

Just don't work.

Any ideas?

User avatar
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Fri Dec 16, 2005 6:30 pm

I'm gonna guess you didn't run the associated SQL since not doing that would effectively disable the MOD.

MCPB
Registered User
Posts: 198
Joined: Wed Jan 14, 2004 3:07 am

Post by MCPB » Sat Dec 17, 2005 12:35 am

I ran the SQL and here is what is said:

Code: Select all

SQL query: 
ALTER TABLE phpbb_users ADD user_firstpost INTEGER( 11 ) NOT NULL ;# Affected rows:3
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;# Affected rows:1
UPDATE phpbb_users SET user_firstpost = user_regdate WHERE user_posts <>0 AND user_firstpost =0;# MySQL returned an empty result set (i.e. zero rows).
INSERT INTO phpbb_config( config_name, config_value ) 
VALUES (
'zero_count', 1
), (
'zero_newest', 1
), (
'zero_group', 1
), (
'zero_list', 1
);# Affected rows:4

Did not show any errors. But its still not working. I made a rest account and it showed up.

Any ideas?

MCPB
Registered User
Posts: 198
Joined: Wed Jan 14, 2004 3:07 am

Post by MCPB » Sun Dec 18, 2005 12:31 am

How can I go in and check each line of SQL to make sure its all in it?

It's still not working. And the SQL did not give any errors..


Any ideas?

User avatar
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Sun Dec 18, 2005 2:19 am

I guess you could verify the existance of those columns by doing the following (untested):

Code: Select all

SELECT * FROM phpbb_config WHERE config_name LIKE 'zero_%'
If the output doesn't mean anything to you, post it here.

Aside from that, I have no idea what the problem would be :(

I could try to diagnose / fix it, myself, if you were to provide me with a temp. FTP account, but there's no guarantee that I'd find anything :(

Post Reply

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

Who is online

Users browsing this forum: No registered users and 4 guests