[2.0.11] Prevent Any Layout From Being Broken

The cleanup is complete. This forum is now read only.
Post Reply

Rating:

Excellent!
32
73%
Very Good
9
20%
Good
0
No votes
Fair
1
2%
Poor
2
5%
 
Total votes: 44

Lois215
Registered User
Posts: 40
Joined: Wed Aug 10, 2005 2:10 am

Post by Lois215 »

Unfortunately I've had to remove this mod from my board as it caused pages to load twice (I believe then wasting bandwidth) and one member could no longer read any posts. For her, it loaded for a second the first time and then would not reload. I can't have members not being able to view the posts. She used Netscape.

Otherwise, the mod worked well for me and I'm sorry to lose the use of it. If you get this fixed, I'd want to use it again.

Van Zant
Registered User
Posts: 154
Joined: Tue Aug 16, 2005 3:15 am

Post by Van Zant »

same thing happened to me lois did you find an alternative?
Check out my forum: www.gossiprocks.com/forum/

Sabyre
Registered User
Posts: 28
Joined: Tue Aug 30, 2005 1:18 pm

Post by Sabyre »

When I add:

Code: Select all

// start mw3 MOD
$admin_link .= '<script type="text/javascript" src="' . $phpbb_root_path . 'templates/mw3.js"></script>';
// fin mw3 MOD
to Page Tail the mod works but I loose the link to the ACP.

Here is my Moded Page Tail:

Code: Select all

<?php
/***************************************************************************
 *             

                 page_tail.php
 *                            -------------------
 *   begin       

         : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email 

               : support@phpbb.com
 *
 *   $Id: page_tail.php,v 1.27.2.3 2004/12/22 02:04:00 

psotfx Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program 

is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU 

General Public License as published by
 *   the Free Software Foundation; either version 2 of 

the License, or
 *   (at your option) any later version.
 *
 

***************************************************************************/

if ( !defined

('IN_PHPBB') )
{
	die('Hacking attempt');
}

//
// Show the overall footer.
//
$admin_link =
// start mw3 MOD
$admin_link .= '<script type="text/javascript" src="' . $phpbb_root_path . 

'templates/mw3.js"></script>';
// fin mw3 MOD ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?

sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

$template->set_filenames(array(
	'overall_footer' => ( empty($gen_simple_header) ) ? 

'overall_footer.tpl' : 'simple_footer.tpl')
);

$template->assign_vars(array(
	

'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '',
	

'ADMIN_LINK' => $admin_link)
);

$template->pparse('overall_footer');

//
// Close our DB connection.
//
$db->sql_close();

//
// Compress buffered output if required and send to browser
//
if ( 

$do_gzip_compress )
{
	//
	// Borrowed from php.net!
	//
	$gzip_contents = 

ob_get_contents();
	ob_end_clean();

	$gzip_size = strlen($gzip_contents);
	$gzip_crc = 

crc32($gzip_contents);

	$gzip_contents = gzcompress($gzip_contents, 9);
	$gzip_contents = 

substr($gzip_contents, 0, strlen($gzip_contents) - 4);

	echo "\x1f\x8b\x08\x00\x00\x00\x00

\x00";
	echo $gzip_contents;
	echo pack('V', $gzip_crc);
	echo pack('V', $gzip_size);
}

exit;

?>
What am I doing wrong?

RogueScribner
Registered User
Posts: 34
Joined: Thu Oct 14, 2004 10:01 pm

Post by RogueScribner »

I don't know if this has been mentioned already, but what the heck.

I installed the mw3 (Prevent Any Layout From Being Broken) MOD in lieu of the original Max Width version since it was recommended on the developer's site.

I encountered a problem after the install that I was able to remedy after a few minutes.

The MOD seemed to work fine upon initial install, but when I tried to reply to a topic with a resized photo in it, I got a parse error that referenced the includes/topic.review file. I remember thinking something was questionable about the instructions in the MOD for this file so I played around with it and finally got it to work. It's a simple clarification of where to stick the code.

The MOD currently reads:

Code: Select all

#-----[ OPEN ]------------------------------------------
#
includes/topic_review.php
#
#-----[ FIND ]------------------------------------------
#
# around line 198
#
'MESSAGE' => $message,
#
#-----[ IN-LINE FIND ]------------------------------------------
#
=>
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 '<mwthree style="display:none"></mwthree>' .
#
#-----[ FIND ]------------------------------------------
#
# around line 224
#
includes/page_tail
#
#-----[ BEFORE, ADD ]------------------------------------------
#
		echo '<script type="text/javascript" src="' . $phpbb_root_path . 'templates/mw3.js"></script>' . "\n";
		echo '<script type="text/javascript"><!--' . "\n";
		echo 'window.topr = true;' . "\n";
		echo '//--></script>';
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
It should read:

Code: Select all

#-----[ OPEN ]------------------------------------------
#
includes/topic_review.php
#
#-----[ FIND ]------------------------------------------
#
# around line 198
#
'MESSAGE' => $message,
#
#-----[ IN-LINE FIND ]------------------------------------------
#
=>
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 '<mwthree style="display:none"></mwthree>' .
#
#-----[ FIND ]------------------------------------------
#
# around line 224
#
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
		echo '<script type="text/javascript" src="' . $phpbb_root_path . 'templates/mw3.js"></script>' . "\n";
		echo '<script type="text/javascript"><!--' . "\n";
		echo 'window.topr = true;' . "\n";
		echo '//--></script>';
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
Per the instructions, I originally stuck the added code in the middle of the string instead of before it. Once I fixed the string and then moved it after the added code the MOD worked fine.

Great MOD! I hope this helps other people with the same problem. :)

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

The reason for this is that the MOD is designed to work with EasyMOD:
http://easymod.sourceforge.net/
and EM needs a FIND command impossible to confuse with another line in the document AND as short as possible in case the page changes in the future (then the FIND command has more chances to still work).

So if I put the whole line for the FIND, then if the next version of phpBB changes something to that line, the FIND won't work anymore. If I put just the beginning of the line, it won't work because another line in the page has the same beginning.

EM does not need to start from the beginning of a line for a FIND command. It will select the line where the string is (if this is the only occurence of that string in the page) and the line will be chosen for the next command, which is in my mod "BEFORE, ADD", and "before add" means ABOVE the line that you found in the previous FIND command.

For an inline-add, you first need to do an inline-find.

"includes/page_tail" will never occur more than once in includes/topic_review.php, so it was the best possible FIND for the mod to work in future versions of phpBB.

FIND recommendations for EasyMOD:
http://area51.phpbb.com/phpBB/viewtopic ... 25&t=12339

FINDing your Way Around

The FIND command is the most import of any command. By properly formatting FINDs your MOD will have a better chance of installing even if many MODs have already been installed.

The least you need to know:
  • Keep FINDs limited to their minimum uniqueness
  • Choose text that is likely to not be modified by other MODs
  • In lang files, search only for the $lang array keys and exclude the values
  • FIND once and operate many
  • FINDs are whitespace indifferent
[/b]
Uniqueness
Golden Rule #1: Keep FINDs limited to their minimum uniqueness. Rather than quoting entire blocks of core phpBB code letter for letter, isolate just those parts that make the line(s) unique. The more MODs that have been previously installed, the less likely you are to FIND an exact match for what you are seeking. Limiting to just the minimum uniqueness greatly increases the odds that you will have a successful FIND:.

Instead of having a monstrousity like this....

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
				WHERE user_id = $user_id";
You could trim it down to this....

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
#
# NOTE: the origial text is like:
#	$sql = "UPDATE " . USERS_TABLE . "
#		SET " . $username_sql ... [ follow by much more ]
#		WHERE user_id = $user_id";
#
$sql = "UPDATE " . USERS_TABLE
user_sig_bbcode_uid = '$signature_bbcode_uid',
WHERE

PlayGod
Registered User
Posts: 38
Joined: Thu Jul 31, 2003 6:16 pm

Post by PlayGod »

Lois215 wrote: ... it caused pages to load twice (I believe then wasting bandwidth) and one member could no longer read any posts.

I had several members complain that they could not read posts... Safari browsers. Now looking for server-side solution.

RogueScribner
Registered User
Posts: 34
Joined: Thu Oct 14, 2004 10:01 pm

Post by RogueScribner »

I had to uninstall the MOD because it was preventing me from accessing the ACP properly. If I logged in normally I could perform all administrator actions within the forums, but the link to the ACP would no longer be visible on the pages. If I attempted to access it directly via the address bar, it would send me back to the index page. If I logged out completely and then tried to access the ACP via the address bar, it would prompt for a log in and then I could gain access. However, if I returned to the forums via the ACP the link still would not be there and if I tried to "jump forward" to the ACP I would be denied access like before. Despite that, I could use the back button to return to the ACP, no problem.

I assume this problem has something to do with the script, but I'm not knowledgeable with such things so I guess for now I'll have to live without the image resizer. Too bad since it otherwise seemed to work great.

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

Put this line in overall_footer.tpl and simple_footer.tpl:

Code: Select all

<script type="text/javascript" src="./templates/mw3.js"></script>
Just before the closing body tag:

Code: Select all

<script type="text/javascript" src="./templates/mw3.js"></script>
</body>
</html>
And don't make any change to page_tail.php (the ones in the mod file). That will solve your problem.

Stu@PassionFord
Registered User
Posts: 68
Joined: Wed Jan 14, 2004 11:26 am
Location: Blackpool, Uk
Contact:

Post by Stu@PassionFord »

Using it on PassionFord now and its fantstic, many thanks for this :lol: :D 8)

Been Told
Registered User
Posts: 90
Joined: Sat May 07, 2005 11:26 pm

Post by Been Told »

phpBB Version: 2.0.17
Skin: smartDark
Error:
When posting in Internet Explorer, my users get an error message (from the IE) saying this:
Stack overflow at line: 393

They click "Ok" and then they can post as usual - but obviously this error-box is rather annoying.
The mod I use is: "Prevent Any Layout From Being Broken"

If there is no fix for this, the mod will have to go which is a shame because I love it.

Stu @ M Developments
Registered User
Posts: 8
Joined: Sat Sep 20, 2003 9:51 pm

Post by Stu @ M Developments »

Stu@PassionFord wrote: Using it on PassionFord now and its fantstic, many thanks for this :lol: :D 8)


UPDATE:
Had to remove it due to it doing wierd things with some peoples non IE Browser. Once loaded, it kind of "Flashes" on IE as well, and lots of members complained about it. :(

k10magic
Registered User
Posts: 314
Joined: Thu Mar 20, 2003 11:38 pm
Location: Canada

Post by k10magic »

Had to remove this as well, quite a useless mod if it doesn't work on all browsers...

adam75south
Registered User
Posts: 27
Joined: Tue Nov 22, 2005 9:18 pm

Post by adam75south »

best mod ever, thanks for that one.

mac-rolec
Registered User
Posts: 16
Joined: Sat Jun 18, 2005 5:34 pm
Location: Netherlands
Contact:

Post by mac-rolec »

k10magic wrote: Had to remove this as well, quite a useless mod if it doesn't work on all browsers...


There is already an alpha version of 1.1.0, wich dous support safari and mac, you can download it on his site:

http://www.christianfecteau.com/mw3/styles.html

Note: it is an alpha release, not an official one! So it may contain bugs.

adam75south
Registered User
Posts: 27
Joined: Tue Nov 22, 2005 9:18 pm

Post by adam75south »

that's the one i installed and it is working awesome.
www.dallasriders.com , feel free to use as demo to check out the mods.
mods added to site: attachment mod, super quick reply, quick poll, null vote, pm quick reply, descriptive time zones, welcome on index, avatar on index, 15 minute who is online, mw3(prevent layout break), search titles only, custom user title, allow multiple spaces in posts, name links to profile, log on automatically checked by default....BBTech and Charcoal2 styles.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”