Page 13 of 16

Re: [BETA] Prune Inactive Users

Posted: Sat Jun 09, 2007 1:50 pm
by bowdeni
Thank you very much for this mod. I've been looking for something like this for a long time.

Installed no problems and have pruned them - perfect!

Re: [BETA] Prune Inactive Users

Posted: Sun Jun 10, 2007 4:25 pm
by p4plus2
whenever im on the prune inactive user i always get this error. anyone know a fix?

Code: Select all

Warning: Invalid argument supplied for foreach() in /home/www/p4plus2.freehostia.com/Forums/admin/admin_prune_users.php on line 762

Warning: Cannot modify header information - headers already sent by (output started at /home/www/p4plus2.freehostia.com/Forums/admin/admin_prune_users.php:762) in /home/www/p4plus2.freehostia.com/Forums/admin/page_header_admin.php on line 143

Warning: Cannot modify header information - headers already sent by (output started at /home/www/p4plus2.freehostia.com/Forums/admin/admin_prune_users.php:762) in /home/www/p4plus2.freehostia.com/Forums/admin/page_header_admin.php on line 145

Warning: Cannot modify header information - headers already sent by (output started at /home/www/p4plus2.freehostia.com/Forums/admin/admin_prune_users.php:762) in /home/www/p4plus2.freehostia.com/Forums/admin/page_header_admin.php on line 146

Re: [BETA] Prune Inactive Users

Posted: Sun Jun 10, 2007 4:36 pm
by kkroo
Are you using version 0.5.0? I believe it is fixed in that version.

If not:

Find:

Code: Select all

			foreach ( $default_data_array as $data_array )
			{
				if ( !empty ( $data_array['value'] ) )
				{
					switch ( $data_array['type'] )
					{
						case "select": $onload_javascript .=  " selectValueFromSelect(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\")[0], \"" . addslashes( $data_array['value'] ) . "\");"; break;
						case "check":  $onload_javascript .=  " selectValueFromCheckBox(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\"), \"" . addslashes( $data_array['value'] ) . "\");"; break;
						case "button": $onload_javascript .=  " selectValueFromButton(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\"), \"" . addslashes( $data_array['value'] ) . "\");"; break;
						case "text":   $onload_javascript .=  " selectValueFromText(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\"), \"" . addslashes( $data_array['value'] ) . "\");"; break;
					}
				}
Before add:

Code: Select all

		if ( is_array ( $default_data_array ) )
		{
After add:

Code: Select all

		}

Re: [BETA] Prune Inactive Users

Posted: Sun Jun 10, 2007 4:53 pm
by p4plus2
thanks ill try that

Re: [BETA] Prune Inactive Users

Posted: Sun Jun 10, 2007 4:57 pm
by p4plus2
thanks a ton, it worked :D

Re: [BETA] Prune Inactive Users

Posted: Sun Jun 10, 2007 5:55 pm
by kkroo
No problem :)

Re: [BETA] Prune Inactive Users

Posted: Fri Jul 06, 2007 11:18 pm
by neolord
I'm not an expert on php (I am still learning) but would you mind explaning this a little more:
kkroo wrote:Are you using version 0.5.0? I believe it is fixed in that version.

If not:

Find:

Code: Select all

			foreach ( $default_data_array as $data_array )
			{
				if ( !empty ( $data_array['value'] ) )
				{
					switch ( $data_array['type'] )
					{
						case "select": $onload_javascript .=  " selectValueFromSelect(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\")[0], \"" . addslashes( $data_array['value'] ) . "\");"; break;
						case "check":  $onload_javascript .=  " selectValueFromCheckBox(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\"), \"" . addslashes( $data_array['value'] ) . "\");"; break;
						case "button": $onload_javascript .=  " selectValueFromButton(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\"), \"" . addslashes( $data_array['value'] ) . "\");"; break;
						case "text":   $onload_javascript .=  " selectValueFromText(document.getElementsByName(\"" . addslashes( $data_array['name'] ) . "\"), \"" . addslashes( $data_array['value'] ) . "\");"; break;
					}
				}
Before add:

Code: Select all

		if ( is_array ( $default_data_array ) )
		{
After add:

Code: Select all

		}
I need this fix too (having the same errors) but where do I add the changes to the aforementioned script? Should the changes be added 'before' the script? I tried adding the changes 'before' and it didn't have an effect on the following errors:

Warning: Invalid argument supplied for foreach() in /home/writemyn/public_html/yardsale/admin/admin_prune_users.php on line 765

Warning: Cannot modify header information - headers already sent by (output started at /home/writemyn/public_html/yardsale/admin/admin_prune_users.php:765) in /home/writemyn/public_html/yardsale/admin/page_header_admin.php on line 143

Warning: Cannot modify header information - headers already sent by (output started at /home/writemyn/public_html/yardsale/admin/admin_prune_users.php:765) in /home/writemyn/public_html/yardsale/admin/page_header_admin.php on line 145

Warning: Cannot modify header information - headers already sent by (output started at /home/writemyn/public_html/yardsale/admin/admin_prune_users.php:765) in /home/writemyn/public_html/yardsale/admin/page_header_admin.php on line 146

Re: [BETA] Prune Inactive Users

Posted: Wed Aug 01, 2007 6:35 am
by fanzing
kkroo wrote:Well it appears you have not executed the SQL queries that were in the install file. In phpmyadmin, execute this:
CREATE TABLE `phpbb_pruned_users` (
`id` mediumint(8) NOT NULL auto_increment,
`deleted_by` int(255) NOT NULL,
`delete_time` int(11) NOT NULL,
`data` text NOT NULL,
PRIMARY KEY (`id`)
);

ALTER TABLE `phpbb_users` ADD `user_last_notified` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `phpbb_users` ADD `user_prune_flagged` INT( 11 ) NOT NULL DEFAULT '0';

INSERT INTO `phpbb_config` VALUES ( 'prune_users_default', '' );
ALTER TABLE `phpbb_config` CHANGE `config_value` `config_value` TEXT NULL DEFAULT NULL
I'm glad someone else asked about that. This was the part of the Instructions that baffled me. When I got to the part that says, "[ SQL ]" I didn't know what to do with it. This was the first MOD I've ever installed that had that sort of instruction. If you could enhance your instructions in that part to specify what to do in phpmyadmin, I'm sure it would be appreciated by users at my relative-newbie level. (I'd never even had to touch phpmyadmin until earlier this week!)

Re: [BETA] Prune Inactive Users

Posted: Wed Aug 01, 2007 12:45 pm
by kkroo
That is the standard syntax for phpBB's mods. they are all like that. If you need help using phpmyadmin take a look at this topic:

http://www.phpbb.com/community/viewtopi ... 16&t=74143

Re: [BETA] Prune Inactive Users

Posted: Thu Aug 02, 2007 5:59 am
by fanzing
*sigh* I'm sure it is the standard syntax... but it's baffling. All other instructions are pretty simple.

I just come from too much of a "For Dummies" background when it comes to technical instructions. I've always believed that the clearer the instructions at the beginning, the less you have to explain it all in a 20-page thread. But, that's not the way they do it at PHPBB, and I'm not trying to fight city hall.

Getting back to it...

I went into mysqladmin and finally found the spot where you run a query. I pasted in those instructions and received this message. (It looks good, just including it to be clear.)

Code: Select all

CREATE TABLE `phpbb_pruned_users` (
`id` mediumint( 8 ) NOT NULL AUTO_INCREMENT ,
`deleted_by` int( 255 ) NOT NULL ,
`delete_time` int( 11 ) NOT NULL ,
`data` text NOT NULL ,
PRIMARY KEY ( `id` )
);# MySQL returned an empty result set (i.e. zero rows).
ALTER TABLE `phpbb_users` ADD `user_last_notified` INT( 11 ) NOT NULL DEFAULT '0';# Affected rows: 4639
ALTER TABLE `phpbb_users` ADD `user_prune_flagged` INT( 11 ) NOT NULL DEFAULT '0';# Affected rows: 4639
INSERT INTO `phpbb_config`
VALUES (
'prune_users_default', ''
);# Affected rows: 1
ALTER TABLE `phpbb_config` CHANGE `config_value` `config_value` TEXT NULL DEFAULT NULL # Affected rows: 81
I've also exported the files. So we should be ready to go.

I go to the Admin panel. I see "Prune Inactive Users" as a button now. I press it.

This is what I get now:
Template->make_filename(): Error - file admin/prune_users_list.tpl does not exist

Any clues?

Re: [BETA] Prune Inactive Users

Posted: Thu Aug 02, 2007 12:14 pm
by kkroo
It appears that you didnt copy the files in the root directory to your phpbb directory.

Re: [BETA] Prune Inactive Users

Posted: Fri Aug 03, 2007 4:21 am
by fanzing
Nope, that's not the case. I can say that with certainty because I just manually uploaded every file again and in each instance it asked me if I wanted to overwrite the file that was already there. It wouldn't say that if the file was missing. But I uploaded them all over again. Then I logged in, clicked on Prune Inactive Users and got that again:

Code: Select all

Template->make_filename(): Error - file admin/prune_users_sql.tpl does not exist
Any other ideas?

Sorry to be a Negative Nelly in Sector Two. I'm really anxious to get this working because I need to eliminate thousands of spam users from my database.

Re: [BETA] Prune Inactive Users

Posted: Fri Aug 03, 2007 10:20 am
by kkroo
Well according to the mod, the files don't exist, did you copy root/templates/admin/prune_users_sql.tpl to

YOUR_PHPBB_DIRECTORY/templates/admin/prune_users_sql.tpl

make sure you placed it correctly

Re: [BETA] Prune Inactive Users

Posted: Sat Aug 04, 2007 3:46 am
by fanzing
Ah! I think I figured it out.

You wrote:
kkroo wrote:Well according to the mod, the files don't exist, did you copy root/templates/admin/prune_users_sql.tpl to

YOUR_PHPBB_DIRECTORY/templates/admin/prune_users_sql.tp
Except that that's not how it is in the zipfile. It's not templates/admin, it's templates/subsilver/admin

I made a duplicate of those files under a new /templates/admin/ directory, and that still didn't help.

:cry:

Re: [BETA] Prune Inactive Users

Posted: Sat Aug 04, 2007 2:30 pm
by kkroo
Sorry I did an error, I meant:

copy root/templates/subSilver/admin/prune_users_sql.tpl to

YOUR_PHPBB_DIRECTORY/templates/subSilver/admin/prune_users_sql.tpl


If that still doesn't work, try chmoding the file 755