 | Sig in Profile MOD |  |
Posted: 07/22/2007 5:58 AM |
|
|
|
|
|
| Hawk |
| Posts |
193 |
| Word Cnt. |
9,285 |
| BDay |
Jun 8 |
| Sign |
Gemini |
| Sex |
 |
|
|
|
Joined: Apr 25, 2007
Local time: 7:54 PM
Location: Esperance, Australia
|

|
|
|
|
 |
Hey Nightrider,
I Tried to install this MOD:
| Code:
|
##############################################################
## MOD Title: Signature in Profile
## MOD Author: Dicky < > (Richard Foote) http://dicky.askmaggymae.com
## MOD Description: Adds the member's signature to their view profile page.
## MOD Version: 1.0.0b
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit: (2)
## includes/usercp_viewprofile.php
## templates/subSilver/profile_view_body.tpl
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This MOD has been verified to work with phpBB 2.0.22
## This MOD can be installed by EasyMOD
##############################################################
## MOD History:
##
## 2007-01-21
## - Corrected missing instruction in modX file
## 2006-12-22
## - Updated FIND instructions
## 2006-11-25 - Version 1.0.0 Released
## - Fix smilies not working and bbcode configurations
## 2006-01-03 - Version 0.0.3
## - Move signature block so that header goes all the way across
## 2006-01-07 - Version 0.0.2
## - Add switch by Kiwietje
## 2006-01-05 - Version 0.0.1
## - Initial version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT *
#
#-----[ BEFORE, ADD ]------------------------------------
#
// BEGIN ADD Signature in Profile
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
// END ADD Signature in Profile
#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------
#
// BEGIN Signature in Profile
$user_sig = '';
if ( $profiledata['user_attachsig'] && $board_config['allow_sig'] )
{
$user_sig = $profiledata['user_sig'];
$user_sig_bbcode_uid = $profiledata['user_sig_bbcode_uid'];
if ( $user_sig != '' )
{
$template -> assign_block_vars('switch_signature', array());
if ( !$board_config['allow_html'] || !$profiledata['user_allowhtml'])
{
$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig);
}
if ( $user_sig_bbcode_uid != '' && $profiledata['user_allowbbcode'] )
{
$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:$user_sig_bbcode_uid/si", '', $user_sig);
}
$user_sig = make_clickable($user_sig);
if ( $profiledata['user_allowsmile'] && $board_config['allow_smilies'] )
{
$user_sig = smilies_pass($user_sig);
}
if (count($orig_word))
{
$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
}
$user_sig = str_replace("\n", "\n<br />\n", $user_sig);
}
}
// END Signature in Profile
#
#-----[ FIND ]------------------------------------------
#
'AVATAR_IMG' => $avatar_img,
#
#-----[ AFTER, ADD ]------------------------------------
#
'USER_SIG' => $user_sig,
#
#-----[ FIND ]------------------------------------------
#
'L_INTERESTS' => $lang['Interests'],
#
#-----[ AFTER, ADD ]------------------------------------
#
'L_SIGNATURE' => $lang['Signature'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{L_CONTACT} {USERNAME} </span></b></td>
</tr>
<tr>
#
#-----[ FIND ]------------------------------------------
#
<td class="row1"
#
#-----[ IN-LINE FIND ]------------------------------------------
#
"row1"
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------
#
rowspan="3"
#
#-----[ FIND ]------------------------------------------
#
{ICQ_IMG}
#
#-----[ AFTER, ADD ]------------------------------------
#
<!-- BEGIN switch_signature -->
<tr>
<td class="catRight" width="60%"><b><span class="gen">{L_SIGNATURE}</span></b></td>
</tr>
<tr>
<td class="row1"> <span class="postbody">{USER_SIG}</span></td>
</tr>
<!-- END switch_signature -->
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM
|
It installed ok but when I tried to test it and looked at someones profile it came up with:
| Code:
|
|
Fatal error: Cannot redeclare load_bbcode_template() (previously declared in /home/www/forum.pegasus-outpost.com/includes/bbcode.php:45) in /home/www/forum.pegasus-outpost.com/includes/bbcode.php on line 43
|
I think this part of the mod has screwed it up, because its the onlu bit mentioning BBcode
| Code:
|
#-----[ BEFORE, ADD ]------------------------------------
#
// BEGIN ADD Signature in Profile
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
// END ADD Signature in Profile
#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------
#
// BEGIN Signature in Profile
$user_sig = '';
if ( $profiledata['user_attachsig'] && $board_config['allow_sig'] )
{
$user_sig = $profiledata['user_sig'];
$user_sig_bbcode_uid = $profiledata['user_sig_bbcode_uid'];
if ( $user_sig != '' )
{
$template -> assign_block_vars('switch_signature', array());
if ( !$board_config['allow_html'] || !$profiledata['user_allowhtml'])
{
$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig);
}
if ( $user_sig_bbcode_uid != '' && $profiledata['user_allowbbcode'] )
{
$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:$user_sig_bbcode_uid/si", '', $user_sig);
}
$user_sig = make_clickable($user_sig);
if ( $profiledata['user_allowsmile'] && $board_config['allow_smilies'] )
{
$user_sig = smilies_pass($user_sig);
}
if (count($orig_word))
{
$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
}
$user_sig = str_replace("\n", "\n<br />\n", $user_sig);
}
}
// END Signature in Profile
|
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/22/2007 2:14 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:54 AM
Location: St Pete, FL
|

|
|
|
|
 |
The reason this is happening is because the bbcode.php file is being included more than once. So try this:
OPEN
includes/usercp_viewprofile.php
FIND
| Code:
|
// BEGIN ADD Signature in Profile
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
REPLACE WITH
| Code:
|
// BEGIN ADD Signature in Profile
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/22/2007 8:44 PM |
|
|
|
|
|
| Hawk |
| Posts |
193 |
| Word Cnt. |
9,285 |
| BDay |
Jun 8 |
| Sign |
Gemini |
| Sex |
 |
|
|
|
Joined: Apr 25, 2007
Local time: 7:54 PM
Location: Esperance, Australia
|

|
|
|
|
 |
I Just did that, But the error keeps comming up  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/23/2007 1:44 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:54 AM
Location: St Pete, FL
|

|
|
|
|
 |
Ok, then you will have to search for every instance of that code in all of your files and change it from include to include_once. If you're lucky, there might be more than one line of this code in the usercp_viewprofile.php that you can fix in order to correct the problem...
Try fixing the include in the usercp_register.php file first to see if that cures the problem...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/23/2007 3:04 AM |
|
|
|
|
|
| Hawk |
| Posts |
193 |
| Word Cnt. |
9,285 |
| BDay |
Jun 8 |
| Sign |
Gemini |
| Sex |
 |
|
|
|
Joined: Apr 25, 2007
Local time: 7:54 PM
Location: Esperance, Australia
|

|
|
|
|
 |
I might just uninstall the MOD using EM's backups and correct the mod install.txt and install it again, proberly easier  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/23/2007 3:08 AM |
|
|
|
|
|
| Hawk |
| Posts |
193 |
| Word Cnt. |
9,285 |
| BDay |
Jun 8 |
| Sign |
Gemini |
| Sex |
 |
|
|
|
Joined: Apr 25, 2007
Local time: 7:54 PM
Location: Esperance, Australia
|

|
|
|
|
 |
The one you pointed out is the only instance of it in the mod install.txt file  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/23/2007 2:57 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:54 AM
Location: St Pete, FL
|

|
|
|
|
 |
Right. So apparently, the line that we changed was called first, then the line of code in the usercp_register.php file was called next. Since the second is an include rather than include_once command, the problem still persists until you correct it. The problem is that the bbcode.php file is being included more than once in the sequence, so the only way to fix it is to change all the includes for the bbcode.php file that are called in the sequence to include_once. Most likely, once you fix the include in the usercp_register.php file, the problem will go away...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/25/2007 5:07 AM |
|
|
|
|
|
| Hawk |
| Posts |
193 |
| Word Cnt. |
9,285 |
| BDay |
Jun 8 |
| Sign |
Gemini |
| Sex |
 |
|
|
|
Joined: Apr 25, 2007
Local time: 7:54 PM
Location: Esperance, Australia
|

|
|
|
|
 |
| I'm sorry but am I meant to look for every include command in the usercp_register.php and change it too include_once? |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/25/2007 2:28 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 7:54 AM
Location: St Pete, FL
|

|
|
|
|
 |
No, just do it for the bbcode.php include lines of code...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Sig in Profile MOD |  |
Posted: 07/26/2007 3:05 AM |
|
|
|
|
|
| Hawk |
| Posts |
193 |
| Word Cnt. |
9,285 |
| BDay |
Jun 8 |
| Sign |
Gemini |
| Sex |
 |
|
|
|
Joined: Apr 25, 2007
Local time: 7:54 PM
Location: Esperance, Australia
|

|
|
|
|
 |
ah thanks  |
|
|
 |
 |
| Back to Top |
|
|
 | Information |  |
|