[Beta] EasyMOD Add-on

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.
Locked
JuniorZ
Registered User
Posts: 188
Joined: Wed Apr 24, 2002 10:11 pm
Location: http://localhost/
Contact:

[Beta] EasyMOD Add-on

Post by JuniorZ » Mon Jun 23, 2003 8:39 pm

Hello people...

This MOD will add to your EM 0.0.9 the uninstall feature...
It works great!

Download here.
SuportephpBB.org
Sorry by the Horrible English. ;)

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix » Mon Jun 23, 2003 8:57 pm

Good :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric » Tue Jun 24, 2003 3:45 am

Say you install two MODs. Both edit atleast one file that is the same. You want to uninstall the first MOD. Does this take the backup that the first MOD made and replace it or does it take into account that the second MOD edited the same file? I don't want to uninstall a MOD and have it take out more then one.

EDIT: After looking at the code, it looks like it does. Good Work!
Eric

JuniorZ
Registered User
Posts: 188
Joined: Wed Apr 24, 2002 10:11 pm
Location: http://localhost/
Contact:

Post by JuniorZ » Tue Jun 24, 2003 6:13 pm

This MOD works this way:

1. Take the ADD actions and replace with a empty-line (as posible :wink: )

2. Take the REPLACE actions and replace them by the original code in the backup file...

This MOD don't just copy the backup files to the old location..
It generates a uninstall MOD script and precess it...
SuportephpBB.org
Sorry by the Horrible English. ;)

User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley » Tue Jun 24, 2003 6:57 pm

[b]@JuniorZ:[/b] wrote: I don't know whether this error has to do with my home server/localhost or not, but when I try to uninstall, I get an endless supply of fget() and fout() or something errors.....

Also, you had typos in the install file which I fixed for myself..... Contact me if you want the changed file

JuniorZ
Registered User
Posts: 188
Joined: Wed Apr 24, 2002 10:11 pm
Location: http://localhost/
Contact:

Post by JuniorZ » Tue Jun 24, 2003 8:05 pm

Post here what kind of changes had you made..
SuportephpBB.org
Sorry by the Horrible English. ;)

User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley » Wed Jun 25, 2003 12:16 am

Well... you spelled uninstall "unninstall" sometimes....

Code: Select all

## EasyMod 0.0.8 compliant
########################################################
## Mod Title:    Easy MOD Add-on
## Mod Author:   JuniorZ < juniorz@phpbb.com.br > (JuniorZ) http://www.phpbb.com.br
## Mod Description:  This MOD adds the uninstall option to your EasyMOD 0.0.9
## Mod Version: 1.1.0
## 
## Installation Level:  Easy
## Installation Time:   10-15 Minutes
## Included Files:      1
##			includes/em_addon_functions.php
## Files To Edit:       3
##			admin/admin_easymod.php
##			language/lang_english/lang_easymod.php
##			templates/subSilver/admin/mod_history.tpl
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
###############################################

#
#-----[ COPY ]------------------------------------------ 
# 
includes/em_addon_functions.php.txt to includes/em_addon_functions.php

#
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_easymod.php

#
#-----[ FIND ]------------------------------------------ 
#
	($mode != 'update') && ($mode != 'process')

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
($mode != 'post_process')

#
#-----[ IN-LINE AFTER, ADD]------------------------------------------ 
#
 && ($mode != 'uninstall')	
#
#-----[ FIND ]------------------------------------------ 
#
'L_NONE_INSTALLED' =>

#
#-----[ BEFORE, ADD ]------------------------------------------ 
#
		'L_UNINST' => $lang['EM_uninstall'],
		'S_ACTION' => append_sid('admin_easymod.'.$phpEx),

#
#-----[ FIND ]------------------------------------------ 
#
'URL' => $row['mod_author_url'],
'PHPBB_VER' => $row['mod_phpBB_version'],

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
			'MOD_ID' => $row['mod_id'],
			'MOD_FILE' => basename($row['mod_file']),
			'MOD_PATH' => './mods/' . dirname($row['mod_file'])  . '/',
	
#
#-----[ FIND ]------------------------------------------ 
#
else if (($mode == 'process' ) ||

#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
($mode == 'download_file')

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 || ($mode == 'uninstall')

#
#-----[ FIND ]------------------------------------------ 
#
// loop
for ($i=0; $i<count($commands); $i++)

#
#-----[ BEFORE, ADD ]------------------------------------------ 
#
	//But Before we generate the uninstall script (if needed)
	if ($mode == 'uninstall')
	{
		include($phpbb_root_path . 'includes/em_addon_functions.'.$phpEx);
		$mode = generate_uninstall($commands, $body);
	}

#
#-----[ FIND ]------------------------------------------ 
#
for ($i=0; $i<count( $command_file->afile); $i++)

#
#-----[ BEFORE, ADD ]------------------------------------------ 
#
		$hidden .= ( intval($HTTP_POST_VARS['mod_id']) > 0 ) ? '<input type="hidden" 

name="mod_id" value="'.intval($HTTP_POST_VARS['mod_id'])."\">\n" : '';


#
#-----[ FIND ]------------------------------------------ 
#
for ( $i=0; $i<$num_command_steps; $i++)

#
#-----[ BEFORE, ADD ]------------------------------------------ 
#
	$hidden .= ( intval($HTTP_POST_VARS['mod_id']) > 0 ) ? '<input type="hidden" name="

mod_id" value="'.intval($HTTP_POST_VARS['mod_id'])."\">\n" : '';

#
#-----[ FIND ]------------------------------------------ 
#
$template->assign_vars(array(
	'S_ACTION' => 
	'L_STEP' => 
	'L_COMPLETE' => 
	'L_COMP_DESC' => 

#
#-----[ REPLACE WITH ]------------------------------------------ 
#
	if( intval($HTTP_POST_VARS['mod_id']) > 0 )
	{
		$compl_msg = $lang['EM_pp_install_comp'];
		$compl_msg_desc = $lang['EM_pp_comp_desc'];
	}
	else
	{
		$compl_msg = $lang['EM_pp_uninstall_comp'];
		$compl_msg_desc = $lang['EM_pp_un_comp_desc'];
	}

	$template->assign_vars(array(
		'S_ACTION' => append_sid('admin_easymod.'.$phpEx),

		'L_STEP' => $lang['EM_pp_step3'],
		'L_COMPLETE' => $compl_msg,
		'L_COMP_DESC' => $compl_msg_desc,

#
#-----[ FIND ]------------------------------------------ 
#
$sql = 'INSERT INTO ' . EASYMOD_TABLE . "
VALUES ( '" . substr($install_path, 7)

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	if ( intval($HTTP_POST_VARS['mod_id']) > 0 )
	{
		$sql = "DELETE FROM " . EASYMOD_TABLE ."
			WHERE mod_id = " . intval($HTTP_POST_VARS['mod_id']);

		$lang['EM_err_em_info'] = $lang['EM_err_em_unins'];
	}

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_easymod.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//uninstall
$lang['EM_uninstall'] = 'Uninstall';
$lang['EM_err_em_unins'] = 'Could not delete the MOD entry from EasyMOD table';
$lang['EM_pp_uninstall_comp'] = 'Uninstallation Complete!';
$lang['EM_pp_un_comp_desc']  = 'Uninstallation of this MOD is now complete!  You should verify if 

the MOD really is not functioning in any installed themes and languages. You should too to remove 

all files added to your phpBB by this MOD if you are uninstalling this MOD permanently. Therefore 

if you just want to reinstall this MOD, you can ignore this.' ;

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/mod_history.tpl

#
#-----[ FIND ]------------------------------------------ 
#
	<td width="5%"  class="{install.ROW_CLASS}" align="center"><span class="gensmall"

>details</span></td>

#
#-----[ REPLACE WITH ]------------------------------------------ 
#
	<td class="{install.ROW_CLASS}" align="center" valign="bottom">
		<form method="post" action="{S_ACTION}">
			<input type="hidden" name="mode" value="uninstall">
			<input type="hidden" name="mod_id" value="{install.MOD_ID}">
			<input type="hidden" name="install_file" value="{install.MOD_FILE}">
			<input type="hidden" name="install_path" value="{install.MOD_PATH}">
			<input type="submit" name="post" class="mainoption" value="{L_UNINST}" />
		</form>
	</td>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM 
Be careful of the   errors.... (If there are any)

[MA]dCow_Inc{velt}
Registered User
Posts: 23
Joined: Sat Mar 08, 2003 9:05 pm

Post by [MA]dCow_Inc{velt} » Wed Jun 25, 2003 2:39 pm

You should probably tell Nuttzy about that MOD, he may have improvements for it (he is the author of EM, anyway).

EDIT: Tried it out. It worked better than I expected, it will even work on MODs installed after the Uninstall mod was, uhh...., installed. Even works on lycos (where my test forum is).

JuniorZ
Registered User
Posts: 188
Joined: Wed Apr 24, 2002 10:11 pm
Location: http://localhost/
Contact:

Post by JuniorZ » Wed Jun 25, 2003 5:14 pm

GPHemsley wrote: Well... you spelled uninstall "unninstall" sometimes....


Have you changed just this???
Just the "unninst" related things, right?? (You don't changed the code )

I'm asking this because I have a new em_addon_functions.php...
(Waiting your confirmation to release this...)
SuportephpBB.org
Sorry by the Horrible English. ;)

User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley » Wed Jun 25, 2003 6:38 pm

Nope, I just fixed some spelling types of mistakes... One or two of which may have hindered the process.... But maybe not ;) You can release the new file, I didn't change it at all.

JuniorZ
Registered User
Posts: 188
Joined: Wed Apr 24, 2002 10:11 pm
Location: http://localhost/
Contact:

Post by JuniorZ » Wed Jun 25, 2003 8:08 pm

Uptaded to 1.2.0

Just get the new em_addon_functions.php end reupload-it to the server...
SuportephpBB.org
Sorry by the Horrible English. ;)

JuniorZ
Registered User
Posts: 188
Joined: Wed Apr 24, 2002 10:11 pm
Location: http://localhost/
Contact:

Post by JuniorZ » Wed Jun 25, 2003 8:17 pm

I had tested it only with short MODs...
And because this I need some return about uninstalling large MODs and uninstalling on servers with a lot of MODs (I need to certifies if there's not any conflict or uncompatibility)

This new version can decrease the performance (a little - probalby in large MODs) but now it will confirm if the uninstaller is getting the last backuped filed for each MODified file.
SuportephpBB.org
Sorry by the Horrible English. ;)

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik » Wed Jun 25, 2003 10:00 pm

I'm afraid the only quite reliant way to uninstall a mod is to restore the backup generated before the install of this mod, then re-apply all mods installed after the one removed. Any other way to proceed will drive the board to be screwed. This supposed also all further mod to have been installed with easyMod, which is far from beeing the case on many boards.

Retro-engeneering is far from being as simple as you think :).

JuniorZ
Registered User
Posts: 188
Joined: Wed Apr 24, 2002 10:11 pm
Location: http://localhost/
Contact:

Post by JuniorZ » Thu Jun 26, 2003 5:36 pm

Ptirhiik - RPGnet-fr wrote: Retro-engeneering is far from being as simple as you think :).


Could you tell me why?
SuportephpBB.org
Sorry by the Horrible English. ;)

User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley » Sun Jul 06, 2003 3:03 am

OK, I've got a few little bugs to report about this Add-On, which is very helpful, BTW. OK, here we go:

1) It mixes up the install and uninstall windows. (i.e. the install window is shown for uninstalling, and vice versa)
2) It leaves a little

Code: Select all

/* A MOD was here */
comment in one of the template files where a MOD was, and since

Code: Select all

/* */
doesn't comment something out in HTML, it appears in the output... It seems to happen only when the MOD edited the overall_header.tpl template...

Also, any news from Nuttzy about this?

Locked

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

cron