[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

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

Post by MCPB » Sun Dec 18, 2005 7:09 am

The output to me is meaningless... I wish I knew tho.

Here is what is said:

Code: Select all

Showing rows 0 - 4 (5 total, Query took 0.0006 sec)  
SQL query: 
SELECT * 
FROM phpbb_config
WHERE config_name LIKE 'zero_%'
LIMIT 0 , 30  


              row(s) starting from record #  
in  horizontal horizontal (rotated headers) vertical mode and repeat headers after  cells       

         Sort by key:  PRIMARY (Ascending) PRIMARY (Descending) None   
            config_name  config_value  
      zero_count 1 
      zero_enable 1 
      zero_group 1 
      zero_list 1 
      zero_newest 1 
If this tells you anything let me know, if not I'll make a ftp account for you just let me know.

THANKS!!

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

Post by TerraFrost » Sun Dec 18, 2005 7:21 am

I don't see anything wrong :(

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

Post by MCPB » Sun Dec 18, 2005 11:19 pm

Any ideas then?


Cause i'm lost on this one.

khsjr1970
Registered User
Posts: 242
Joined: Fri Aug 19, 2005 5:59 pm

Post by khsjr1970 » Sat Dec 31, 2005 2:24 am

CH has been updated to 2.1.4 somewhere in those updates

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_categories_hierarchy.php

#
#-----[ FIND ]------------------------------------------
#
	// max users
	$sql = "SELECT COUNT(user_id) AS user_total FROM " . USERS_TABLE . " WHERE user_id > 0";

#
#-----[	REPLACE WITH ]----------------------------------
#
	// max users
	$sql = "SELECT COUNT(user_id) AS user_total FROM " . USERS_TABLE . " WHERE user_id > 0" . ($board_config['zero_count'] ? "  AND user_posts <> 0" : "");

This file no longer exists in CH 2.1.4 and searching all files for

Code: Select all

// max users
	$sql = "SELECT COUNT(user_id) AS user_total FROM " . USERS_TABLE . " WHERE user_id > 0";
gave back no findings.

is this step necessary for CH 2.1.4 ?

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

Post by TerraFrost » Sat Dec 31, 2005 6:22 am

I couldn't find anything even remotely like that, either.

It might not be necessary. I'd recommend just seeing what happens. The worst that'd happen if it didn't work is that the max users count wouldn't be what it should be.

snorri
Registered User
Posts: 3
Joined: Sun Feb 05, 2006 3:06 pm

Post by snorri » Sun Feb 05, 2006 3:11 pm

Hi!

I am another one of those still using mySQL 3.x (3.23.58, to be precise). I get stuck before really starting to apply the MOD, because this statement

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;
returns an error:

Code: Select all

#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.post' at line 1 
Is it of any use to go on? I guess not ...

-- snorri

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

Post by TerraFrost » Sun Feb 05, 2006 5:44 pm


snorri
Registered User
Posts: 3
Joined: Sun Feb 05, 2006 3:06 pm

Post by snorri » Sun Feb 05, 2006 6:28 pm

Yes, thanks, I saw it ... but I had my problem even before I could install that code I am supposed to delete now: It is already the SQL from the MOD install description that fails. Can I ignore that, too, then?

-- snorri

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

Post by TerraFrost » Sun Feb 05, 2006 6:37 pm

Yup - you can ignore the particular SQL query that has all the JOINs in it. The rest, however, still need to be run if they haven't already been.

snorri
Registered User
Posts: 3
Joined: Sun Feb 05, 2006 3:06 pm

Post by snorri » Sun Feb 05, 2006 8:33 pm

Okey dokey -- thanks!

-- snorri

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

Post by cutaia » Tue Feb 28, 2006 3:19 am

Hey...it's me again from the first half of this thread. :oops:

I reinstalled a forum recently and used this mod again, but this time it did something crazy weird.

http://forum.cutaia.net/memberlist.php

This is my memberlist. Those first three people actually used to be at the very end of the list. But suddenly when I re-added this mod. They've jumped before even me!

And they apparently joined in 1969. 8O

So...the question is...how did the mod do this, and how can I fix it?

(I've tested and new signups work like they should...going to the end of the list. So, maybe it's as simple as editing the database information for just those 3 people. But I don't know how. :( )

Any help would be great.

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

Post by cutaia » Tue Feb 28, 2006 4:33 am

Oh my God. I fixed it myself. It's almost like I don't suck at this whole PHPBB thing. I just had to go into PhpMyAdmin and edit the database.

Very complex for someone of my skill level.

I'd still be interested to know exactly why that happened...

Hac
Registered User
Posts: 12
Joined: Fri Nov 25, 2005 2:23 pm

Post by Hac » Sun Mar 19, 2006 7:09 am

I installed thsi MOD and everythings going fine. But now however I wish to uninstall it. SO can anyone advice me the steps to follow to reverse back the SQL queries for this MOD.

[Edit]

Oops no need, the I just noticed the enable disable feature.

NewGuy2006
Registered User
Posts: 64
Joined: Mon May 01, 2006 1:29 am

Post by NewGuy2006 » Fri May 19, 2006 7:46 am

I installed the mod and ran into the following SQL errors:
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 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;;

SQL ERROR: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; p1.post_time INNER JOIN phpbb_posts AS p3 ON p3.post_time = p1.post_time SET u' at line 1

The following SQL was attempted: Allow
ALTER TABLE phpbb_users ADD user_firstpost INTEGER(11) NOT NULL;; Success
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;; FAILED
UPDATE phpbb_users SET user_firstpost = user_regdate WHERE user_posts <> 0 AND user_firstpost = 0;; Not Attempted
INSERT INTO phpbb_config(config_name,config_value) VALUES('zero_count',1),('zero_newest',1),('zero_group',1),('zero_list',1);;


I am using MYSQL version 4.1.18-standard and PHP version 5.04 with PhpBB version 2.0.20. I deleted the two segments of code, as indicated on page 2, from the functions_post.php file and essentially the result is that the mod doesn't work at all. When I try to enable one (or more) of the four "modules," it simply retains its default (disabled) setting.

Any suggestions: I'd love to use this mod.

Thanks much,

Brian

PS. I realized, after posting this, that the last line of the SQL commands was necessary to run the mod but that it wasn't being executed because the 2nd line was returning an error. I executed the fourth line and see that the mod is now working. However, I am curious, what functionality am I losing by not being able to execute the 2nd and 3rd lines of the SQL commands and by having deleted those two sections of code from the functions_post.php file?
Last edited by NewGuy2006 on Fri May 19, 2006 8:03 am, edited 1 time in total.

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

Post by TerraFrost » Fri May 19, 2006 8:02 am

The fix on the other page is only necessary for MySQL 3.23.

Anyway, my recommendation would be to just run the queries in phpMyAdmin or something - EasyMOD probably just doesn't parse them correctly. The EasyMOD SQL parser was rewritten in 0.3.0 and although it brought with it lots of improvements, there were a few queries that it broke. This may well be one of them.

As for your inability to change the status of stuff - that's because the INSERT INTO hppbb_config thing isn't ever being called.

Incidently, I don't really like the query it does. Unfortunately, if I use subqueries, it wouldn't work in even MySQL 4 (it'd work in 4.1 - just not 4.0). The idea SQL query would look like this:

Code: Select all

UPDATE phpbb_users
SET user_nthpost = (
   SELECT post_time FROM phpbb_posts
   WHERE phpbb_users.user_id = phpbb_posts.poster_id
   ORDER BY post_time ASC
   LIMIT $n,1
)
Where $n is, in the case of this MOD, zero. Unfortunately, it's just not all that do'able, afaik...

Post Reply

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