[BETA] Prune Inactive Users

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
bowdeni
Registered User
Posts: 14
Joined: Sun Jan 08, 2006 12:15 pm

Re: [BETA] Prune Inactive Users

Post by bowdeni » Sat Jun 09, 2007 1:50 pm

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!

User avatar
p4plus2
Registered User
Posts: 140
Joined: Sat May 26, 2007 5:06 am

Re: [BETA] Prune Inactive Users

Post by p4plus2 » Sun Jun 10, 2007 4:25 pm

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
My lo-fi version of phpbb MOD

Help the Dial up users, give them a chance! :D

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Prune Inactive Users

Post by kkroo » Sun Jun 10, 2007 4:36 pm

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

		}
My MODs

Need a coder?

Enjoy my Mods? - Image

User avatar
p4plus2
Registered User
Posts: 140
Joined: Sat May 26, 2007 5:06 am

Re: [BETA] Prune Inactive Users

Post by p4plus2 » Sun Jun 10, 2007 4:53 pm

thanks ill try that
My lo-fi version of phpbb MOD

Help the Dial up users, give them a chance! :D

User avatar
p4plus2
Registered User
Posts: 140
Joined: Sat May 26, 2007 5:06 am

Re: [BETA] Prune Inactive Users

Post by p4plus2 » Sun Jun 10, 2007 4:57 pm

thanks a ton, it worked :D
My lo-fi version of phpbb MOD

Help the Dial up users, give them a chance! :D

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Prune Inactive Users

Post by kkroo » Sun Jun 10, 2007 5:55 pm

No problem :)
My MODs

Need a coder?

Enjoy my Mods? - Image

neolord
Registered User
Posts: 3
Joined: Tue Jul 03, 2007 1:39 am

Re: [BETA] Prune Inactive Users

Post by neolord » Fri Jul 06, 2007 11:18 pm

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

fanzing
Registered User
Posts: 33
Joined: Mon Sep 12, 2005 5:36 am
Location: Rochester, MN
Contact:

Re: [BETA] Prune Inactive Users

Post by fanzing » Wed Aug 01, 2007 6:35 am

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!)
Michael Hutchison, Comic Book Writer
http://www.thehutch.com

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Prune Inactive Users

Post by kkroo » Wed Aug 01, 2007 12:45 pm

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
My MODs

Need a coder?

Enjoy my Mods? - Image

fanzing
Registered User
Posts: 33
Joined: Mon Sep 12, 2005 5:36 am
Location: Rochester, MN
Contact:

Re: [BETA] Prune Inactive Users

Post by fanzing » Thu Aug 02, 2007 5:59 am

*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?
Michael Hutchison, Comic Book Writer
http://www.thehutch.com

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Prune Inactive Users

Post by kkroo » Thu Aug 02, 2007 12:14 pm

It appears that you didnt copy the files in the root directory to your phpbb directory.
My MODs

Need a coder?

Enjoy my Mods? - Image

fanzing
Registered User
Posts: 33
Joined: Mon Sep 12, 2005 5:36 am
Location: Rochester, MN
Contact:

Re: [BETA] Prune Inactive Users

Post by fanzing » Fri Aug 03, 2007 4:21 am

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.
Michael Hutchison, Comic Book Writer
http://www.thehutch.com

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Prune Inactive Users

Post by kkroo » Fri Aug 03, 2007 10:20 am

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
My MODs

Need a coder?

Enjoy my Mods? - Image

fanzing
Registered User
Posts: 33
Joined: Mon Sep 12, 2005 5:36 am
Location: Rochester, MN
Contact:

Re: [BETA] Prune Inactive Users

Post by fanzing » Sat Aug 04, 2007 3:46 am

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:
Michael Hutchison, Comic Book Writer
http://www.thehutch.com

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Re: [BETA] Prune Inactive Users

Post by kkroo » Sat Aug 04, 2007 2:30 pm

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
My MODs

Need a coder?

Enjoy my Mods? - Image

Post Reply

Return to “[2.0.x] MODs in Development”