Error from EM when installing remove sig and edit priv. MOD

Wondering why that MOD you have won't install correctly? Let's take a look
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
Beavis&Butthead
Posts: 66
Joined: Wed Aug 09, 2006 3:03 am

Error from EM when installing remove sig and edit priv. MOD

Post by Beavis&Butthead »

Critical Error

FIND FAILED: In file [posting.php] could not find:

$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode

MOD script line #204 :: FAQ :: Report

Install.txt:

Code: Select all

############################################################## 
## MOD Title: Remove Users Signature & Editing Privileges
## MOD Author: fredol < fredol@lovewithsmg.com > (fredol) http://phpbb.lovewithsmg.com/ 
## MOD Description: Will allow ADMIN to remove signature & post editing priviliges to specific users
## MOD Version: 1.0.2
## 
## Installation Level: Easy 
## Installation Time: 3 Minutes (less than one with the great EasyMOD! :-) 
## Files To Edit:	admin/admin_users.php
##			includes/usercp_register.php
##			language/lang_english/lang_admin.php
##			language/lang_english/lang_main.php
##			posting.php
##			viewtopic.php
##			viewforum.php
##			templates/subSilver/admin/user_edit_body.tpl
##			templates/subSilver/profile_add_body.tpl
## Included Files:	n/a 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
############################################################## 
## Author Notes: 
##	This MOD will add two options in ACP/Users management so you can remove signature/post editing
##	priviliges for specific users. Removing signature will make them unable to edit their signature in
##	their profile, and their signature won't show up in any new posts they have or will make.
##	Removing post editing privileges will make them unable to edit their posts.
############################################################## 
## MOD History: 
## 
##   2004-10-29 - Version 1.0.2
##	- Fixed: when users used the preview option when posting, it removed the signature from the post
##
##   2004-09-01 - Version 1.0.1
##	- Some minor changes to the MOD
##
##   2004-08-24 - Version 1.0.0
##	- Submitted to phpBB's MODDB 
##
##   2004-07-14 - Version 0.0.1 [BETA]
##	- First version, should work just fine ;) 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 


# 
#-----[ SQL ]----- 
# 
ALTER TABLE `phpbb_users` ADD `user_allowsig` TINYINT( 1 ) DEFAULT '1' NOT NULL
# 
#-----[ SQL ]----- 
# 
ALTER TABLE `phpbb_users` ADD `user_allowedit` TINYINT( 1 ) DEFAULT '1' NOT NULL
# 
#-----[ OPEN ]----- 
# 
admin/admin_users.php
# 
#-----[ FIND ]----- 
# 
		$user_allowavatar = ( !empty($HTTP_POST_VARS['user_allowavatar']) ) ? intval( $HTTP_POST_VARS['user_allowavatar'] ) : 0;
# 
#-----[ AFTER, ADD ]----- 
# 
		//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
		$user_allowsig = ( !empty($HTTP_POST_VARS['user_allowsig']) ) ? intval( $HTTP_POST_VARS['user_allowsig'] ) : 0;
		$user_allowedit = ( !empty($HTTP_POST_VARS['user_allowedit']) ) ? intval( $HTTP_POST_VARS['user_allowedit'] ) : 0;
		//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
#
			$sql = "UPDATE " . USERS_TABLE . "
# 
#-----[ BEFORE, ADD ]----- 
# 
		//MOD-REPLACE: Remove Users Signature & Editing Privileges --------------------------------------
		//added: , user_allowsig = $user_allowsig, user_allowedit = $user_allowedit
# 
#-----[ FIND ]----- 
#
#Note: full line longer
				SET " . $username_sql . $passwd_sql . "user_email
# 
#-----[ IN-LINE FIND ]----- 
# 
. $avatar_sql . "
# 
#-----[ IN-LINE AFTER, ADD ]----- 
# 
, user_allowsig = $user_allowsig, user_allowedit = $user_allowedit
# 
#-----[ FIND ]----- 
# 
		$user_allowpm = $this_userdata['user_allow_pm'];
# 
#-----[ AFTER, ADD ]----- 
# 
		//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
		$user_allowsig = $this_userdata['user_allowsig'];
		$user_allowedit = $this_userdata['user_allowedit'];
		//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
# 
			'RANK_SELECT_BOX' => $rank_select_box,
# 
#-----[ AFTER, ADD ]----- 
# 
			//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
			'ALLOW_SIG_YES' => ($user_allowsig) ? 'checked="checked"' : '',
			'ALLOW_SIG_NO' => (!$user_allowsig) ? 'checked="checked"' : '',
			'ALLOW_EDIT_YES' => ($user_allowedit) ? 'checked="checked"' : '',
			'ALLOW_EDIT_NO' => (!$user_allowedit) ? 'checked="checked"' : '',
			//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
# 
			'L_ALLOW_AVATAR' => $lang['User_allowavatar'],
# 
#-----[ AFTER, ADD ]----- 
# 
			//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
			'L_ALLOW_SIG' => $lang['User_allowsig'],
			'L_ALLOW_EDIT' => $lang['User_allowedit'],
			//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ OPEN ]----- 
# 
includes/usercp_register.php
# 
#-----[ FIND ]----- 
# 
		$s_hidden_fields .= '<input type="hidden" name="current_email" value="' . $userdata['user_email'] . '" />';
# 
#-----[ AFTER, ADD ]----- 
# 
		//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
		if (!$userdata['user_allowsig'])
		{
			$s_hidden_fields .= '<input type="hidden" name="signature" value="' . $userdata['user_sig'] . '" />';
			$s_hidden_fields .= '<input type="hidden" name="attachsig" value="' . $userdata['user_attachsig'] . '" />';
		}
		//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
# 
	//
	// This is another cheat using the block_var capability
	// of the templates to 'fake' an IF...ELSE...ENDIF solution
	// it works well :)
	//
# 
#-----[ BEFORE, ADD ]----- 
# 
	//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
	if ($userdata['user_allowsig'])
	{
		$template->assign_block_vars('switch_signature', array());
	}
	//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------


# 
#-----[ OPEN ]----- 
# 
language/lang_english/lang_admin.php
# 
#-----[ FIND ]----- 
# 
$lang['User_allowavatar'] = 'Can display avatar';
# 
#-----[ AFTER, ADD ]----- 
# 
//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
$lang['User_allowsig'] = 'Can display signature';
$lang['User_allowedit'] = 'Can edit their posts';
//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ OPEN ]----- 
# 
language/lang_english/lang_main.php
# 
#-----[ FIND ]----- 
# 
//
// That's all, Folks!
# 
#-----[ BEFORE, ADD ]----- 
# 
//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
$lang['Lost_postediting'] = 'Sorry but you have lost your post editing priviliges.';
//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------


# 
#-----[ OPEN ]----- 
# 
posting.php
# 
#-----[ FIND ]----- 
# 
#Note: full line longer
		$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode
# 
#-----[ BEFORE, ADD ]----- 
# 
		//MOD-REPLACE: Remove Users Signature & Editing Privileges --------------------------------------
		//added: , u.user_allowsig
# 
#-----[ IN-LINE FIND ]----- 
# 
u.user_sig
# 
#-----[ IN-LINE AFTER, ADD ]----- 
# 
, u.user_allowsig
# 
#-----[ FIND ]----- 
# 
	redirect(append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
}
# 
#-----[ AFTER, ADD ]----- 
# 
//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
if ( ($mode=='editpost') && !($userdata['user_allowedit']) && ($userdata['user_level'] != ADMIN) )
{
	message_die(GENERAL_MESSAGE, $lang['Lost_postediting']);
}
//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------

# 
#-----[ FIND ]----- 
# 
#Note: full line longer
		$user_sig = ( $userdata['user_sig'] != ''
# 
#-----[ BEFORE, ADD ]----- 
# 
		//MOD-REPLACE: Remove Users Signature & Editing Privileges --------------------------------------
		//added: && $userdata['user_allowsig']
# 
#-----[ IN-LINE FIND ]----- 
# 
$board_config['allow_sig']
# 
#-----[ IN-LINE AFTER, ADD ]----- 
# 
&& $userdata['user_allowsig']
# 
#-----[ FIND ]----- 
# 
#Note: full line longer
		$user_sig = ( $post_info['user_sig'] != ''
# 
#-----[ BEFORE, ADD ]----- 
# 
		//MOD-REPLACE: Remove Users Signature & Editing Privileges --------------------------------------
		//added: && $userdata['user_allowsig']
# 
#-----[ IN-LINE FIND ]----- 
# 
$board_config['allow_sig']
# 
#-----[ IN-LINE AFTER, ADD ]----- 
# 
&& $userdata['user_allowsig']
# 
#-----[ FIND ]----- 
# 
		$user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';
# 
#-----[ AFTER, ADD ]----- 
# 
		//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
		$user_allowsig = $userdata['user_allowsig'];
		//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
# 
		$user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';
# 
#-----[ AFTER, ADD ]----- 
# 
		//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
		$user_allowsig = $userdata['user_allowsig'];
		//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
# 
			$user_sig = $post_info['user_sig'];

# 
#-----[ AFTER, ADD ]----- 
# 
			//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
			$user_allowsig = $post_info['user_allowsig'];
			//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
# 
			$user_sig = $userdata['user_sig'];
# 
#-----[ AFTER, ADD ]----- 
# 
			//MOD-BEGIN: Remove Users Signature & Editing Privileges ----------------------------------------
			$user_allowsig = $userdata['user_allowsig'];
			//MOD-END: Remove Users Signature & Editing Privileges ------------------------------------------
# 
#-----[ FIND ]----- 
# 
// Signature toggle selection
//
if( $user_sig != '' )
# 
#-----[ REPLACE WITH ]----- 
# 
// Signature toggle selection
//
//MOD-REPLACE: Remove Users Signature & Editing Privileges ----------------------------------------
//added: && $user_allowsig
if( $user_sig != '' && $userdata['user_allowsig'] )
# 
#-----[ OPEN ]----- 
# 
viewtopic.php
# 
#-----[ FIND ]----- 
# 
#Note: full line longer
$sql = "SELECT u.username, u.user_id, u.user_posts,
# 
#-----[ BEFORE, ADD ]----- 
# 
//MOD-REPLACE: Remove Users Signature & Editing Privileges ----------------------------------------
//added: , u.user_allowsig
# 
#-----[ IN-LINE FIND ]----- 
# 
u.user_allowsmile
# 
#-----[ IN-LINE AFTER, ADD ]----- 
# 
, u.user_allowsig
# 
#-----[ FIND ]----- 
# 
$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
# 
#-----[ REPLACE WITH ]----- 
# 
//MOD-REPLACE: Remove Users Signature & Editing Privileges ----------------------------------------
//added: && $userdata['user_allowedit']
$s_auth_can .= ( ( $is_auth['auth_edit'] && $userdata['user_allowedit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
# 
#-----[ FIND ]----- 
# 
	if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] ) || $is_auth['auth_mod'] )
# 
#-----[ REPLACE WITH ]----- 
# 
	//MOD-REPLACE: Remove Users Signature & Editing Privileges ----------------------------------------
	//added: $userdata['user_allowedit'] && (  .... )
	if ( $userdata['user_allowedit'] && (( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] ) || $is_auth['auth_mod']) )
# 
#-----[ FIND ]----- 
# 
#Note: full line longer
	$user_sig = ( $postrow[$i]['enable_sig'] && $postrow[$i]['user_sig'] != ''
# 
#-----[ BEFORE, ADD ]----- 
# 
	//MOD-REPLACE: Remove Users Signature & Editing Privileges ----------------------------------------
	//added: && $postrow[$i]['user_allowsig']
# 
#-----[ IN-LINE FIND ]----- 
# 
$board_config['allow_sig']
# 
#-----[ IN-LINE AFTER, ADD ]----- 
# 
 && $postrow[$i]['user_allowsig']
# 
#-----[ OPEN ]----- 
# 
viewforum.php
# 
#-----[ FIND ]----- 
# 
$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
# 
#-----[ REPLACE WITH ]----- 
# 
//MOD-REPLACE: Remove Users Signature & Editing Privileges ----------------------------------------
//added: && $userdata['user_allowedit']
$s_auth_can .= ( ( $is_auth['auth_edit'] && $userdata['user_allowedit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
# 
#-----[ OPEN ]----- 
# 
templates/subSilver/admin/user_edit_body.tpl
# 
#-----[ FIND ]----- 
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_ALLOW_AVATAR}</span>
# 
#-----[ FIND ]----- 
# 
	</tr>
# 
#-----[ AFTER, ADD ]----- 
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_ALLOW_SIG}</span></td>
	  <td class="row2"> 
		<input type="radio" name="user_allowsig" value="1" {ALLOW_SIG_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="user_allowsig" value="0" {ALLOW_SIG_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_ALLOW_EDIT}</span></td>
	  <td class="row2"> 
		<input type="radio" name="user_allowedit" value="1" {ALLOW_EDIT_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="user_allowedit" value="0" {ALLOW_EDIT_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
# 
#-----[ OPEN ]----- 
# 
templates/subSilver/profile_add_body.tpl
# 
#-----[ FIND ]----- 
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_SIGNATURE}:</span>
# 
#-----[ BEFORE, ADD ]----- 
# 
	<!-- BEGIN switch_signature -->
# 
#-----[ FIND ]----- 
# 
	</tr>
# 
#-----[ AFTER, ADD ]----- 
# 
	<!-- END switch_signature -->
# 
#-----[ FIND ]----- 
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_ALWAYS_ADD_SIGNATURE}:</span>
# 
#-----[ BEFORE, ADD ]----- 
# 
	<!-- BEGIN switch_signature -->
# 
#-----[ FIND ]----- 
# 
	</tr>
# 
#-----[ AFTER, ADD ]----- 
# 
	<!-- END switch_signature -->
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Thanks for any help that you can provide =)
legwon
Registered User
Posts: 14
Joined: Sun Jan 15, 2006 12:07 am

Re: Error from EM when installing remove sig and edit priv. MOD

Post by legwon »

99.9% of MODs were made for a Vanilla PHPBB board. if u cant find that line.. either u have a second skin or a heavily modded board.
ive come accross this issue hundreds of times with Charcoal2 skin.
all i can say is with a secondary skin use your best judgement and modifiy it manually(u will have to modify all your skins for that file).
if its because you have a heavy modded board ... go through EM History and figure out what other MOD has modified that file and figure out where that line is supposed to be... again u most likely have to edit it manually or change the MOD install to work for your board.
User avatar
Poomerio
Registered User
Posts: 552
Joined: Tue Jan 02, 2007 7:09 pm
Location: 4(x - 20y) = 20

Re: Error from EM when installing remove sig and edit priv. MOD

Post by Poomerio »

legwon wrote:99.9% of MODs were made for a Vanilla PHPBB board. if u cant find that line.. either u have a second skin or a heavily modded board.
ive come accross this issue hundreds of times with Charcoal2 skin.
all i can say is with a secondary skin use your best judgement and modifiy it manually(u will have to modify all your skins for that file).
if its because you have a heavy modded board ... go through EM History and figure out what other MOD has modified that file and figure out where that line is supposed to be... again u most likely have to edit it manually or change the MOD install to work for your board.
Incorrect.

Try this:

OPEN:
install.txt

FIND:

Code: Select all

#
#-----[ FIND ]-----
#
#Note: full line longer
      $select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode
REPLACE WITH:

Code: Select all

#
#-----[ FIND ]-----
#
#Note: full line longer
      $select_sql = ( !$submit )
Save, upload and try again.

- Poomie
Beavis&Butthead
Posts: 66
Joined: Wed Aug 09, 2006 3:03 am

Re: Error from EM when installing remove sig and edit priv. MOD

Post by Beavis&Butthead »

Error Detail

Critical Error

FIND FAILED: In file [posting.php] could not find:

$select_sql = ( !$submit )

MOD script line #204 :: FAQ :: Report
User avatar
Kevin Clark
Support Team
Support Team
Posts: 751
Joined: Thu Feb 10, 2005 5:34 pm
Location: UK
Contact:

Re: Error from EM when installing remove sig and edit priv. MOD

Post by Kevin Clark »

It doesn't find it because the vanilla posting.php file has a space before and after !$submit and there's a " instead of a '
Top line is posting.php
Bottom line is the MOD

Code: Select all

$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode
$select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode
The MOD is 3 years old. Some of the basic vanilla code has changed since then.

Put the real line from your posting.php into the MOD install file.
Image
Locked