[2.0.6] Left and Right IMG tags

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

Rating:

Excellent!
13
76%
Very Good
2
12%
Good
1
6%
Fair
0
No votes
Poor
1
6%
 
Total votes: 17

ImpactDNI
Registered User
Posts: 36
Joined: Sat May 01, 2004 5:54 pm

Post by ImpactDNI »

I hadn't seen this mod when I looked. I had actually written the same thing when I didn't see it... For some reason, mine messed with the signatures, which prompted me to search again. Can Anyone tell me which part of this mod deals with it not hurting the sigs? Would really help...
ImpactDNI
Registered User
Posts: 36
Joined: Sat May 01, 2004 5:54 pm

Post by ImpactDNI »

Just applied this mod, it screws with signatures as well. If a picture is aligned as one of the last items, it has issues and wraps the signature around the image....
Anyone?
mickelsn
Registered User
Posts: 16
Joined: Sat Apr 06, 2002 4:39 am
Location: Planet Earth
Contact:

Needs Update for phpBB 2.0.10

Post by mickelsn »

Just installed the MOD today, after needing to make a quick update for compliance with the 2.0.10 codebase. Someone mentioned earlier that changes were made in 2.0.8 for better security; apparently, there were some additional changes.

Replace this part of the MOD

Code: Select all

#
#-----[ FIND ]------------------------------------------ 
#

$text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);

#
#-----[ AFTER, ADD ]------------------------------------------ 
#

// LEFT-RIGHT-start
$text = preg_replace("#\[img=left\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img=left:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
$text = preg_replace("#\[img=right\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img=right:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
// LEFT-RIGHT-end
...with this...

Code: Select all

#
#-----[ FIND ]------------------------------------------ 
#

$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);

#
#-----[ AFTER, ADD ]------------------------------------------ 
#

// LEFT-RIGHT-start
$text = preg_replace("#\[img=left\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=left:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
$text = preg_replace("#\[img=right\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=right:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
// LEFT-RIGHT-end
...and everything should work just fine in EasyMOD.

And to make sure you clear the images before posting your signature, read the first part of this post.
ImpactDNI
Registered User
Posts: 36
Joined: Sat May 01, 2004 5:54 pm

Post by ImpactDNI »

awesome, thanks a ton! =P
ace2ace
Registered User
Posts: 364
Joined: Sat Aug 14, 2004 3:48 pm

Post by ace2ace »

With all those add-ons and changes made to this MOD, an updated version would be nice.
thanks guys. It's good to be part of this MOD adventure.
NewBuyer
Registered User
Posts: 248
Joined: Thu Nov 08, 2001 3:14 pm
Location: AlpineZone.com
Contact:

Post by NewBuyer »

ace2ace wrote: With all those add-ons and changes made to this MOD, an updated version would be nice.

Agreed.
Greg B
AlpineZone.com: Northeast Skiing
COskiing.com: Colorado Skiing
User avatar
Merri
Registered User
Posts: 255
Joined: Mon Nov 25, 2002 1:08 pm
Location: Riihimäki, Finland
Contact:

Post by Merri »

Here is an update:

Code: Select all

## EasyMOD compliant
############################################################## 
## MOD Title:   Left and Right IMG tags
## MOD Author:  Nuttzy < [email protected] > (n/a) http://www.blizzhackers.com
## MOD Author, Secondary:  Xore < [email protected] > (Robert Hetzler) http://www.xore.ca
## MOD Author, Thirdary:  Merri < [email protected] > (Vesa Piittinen) http://merri.net
##
## MOD Description:  This MOD will allow you to better format
##    you posts by aligning images left and right instead of 
##    just in-line as with the standard [img][/img] tag. Text
##    will also neatly wrap around the images.
## MOD Version: 1.6.1
## 
## Installation Level:  EASY
## Installation Time:   4-5 Minutes
## Files To Edit:       6
##                   - includes/bbcode.php
##                   - templates/subSilver/bbcode.tpl
##                   - language/lang_english/lang_main.php
##                   - language/lang_english/lang_bbcode.php
## 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:
##
##     Works with phpBB 2.0.11
##     IMPORTANT: you MUST first have already installed the Multi Quick BBCode MOD
##
## Usage:
##     [img=left]url of image[/img] to left justify image
##     [img=right]url of image[/img] to right justify image
## (used to be [left][/left] and [right][/right] -- this frees up more hotkeys)
##
##
############################################################## 
##
## MOD History:
##    2004-12-17 - Version 1.6.1
##         + Made compatible with phpBB 2.0.11 (by Merri)
##    
##    2003-11-02 - Version 1.6.0
##         + Changed to img=left and img=right
##    
##    2003-09-25 - Version 1.5.2
##         + improved MOD Template compliance
##    
##    02/05/03 - bug fix: changed instance in bbcode.tpl where 
##                 left should have been right - DanielT
##
##    02/04/03 - updated for 2.0.4
##             - added BBCode FAQ entry
##
##    08/31/02 - fixed interference with font color/size problem
##             - made compliant with EasyMod alpha 2
##
##    06/28/02 - fixed a bbcode problem - thanks to
##               desean84 for discovering the problem!
##
##    04/21/02 - updated for phpBB 2.0.0 final
##             - quick BBcode added by Christi
##             - made EasyMod compliant
##
##    03/18/02 - initial releae for phpBB 2.0 RC3
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 


#
# IMPORTANT: you MUST first have already installed the Multi Quick BBCode MOD
#


#
#-----[ OPEN ]------------------------------------------ 
#
includes/bbcode.php


#
#
# NOTE: the full line to look for is:
#	$bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']);
#
#-----[ FIND ]------------------------------------------ 
#
	$bbcode_tpl['img'] =

#
#-----[ AFTER, ADD ]------------------------------------------ 
#

// LEFT-RIGHT-start
	$bbcode_tpl['left'] = str_replace('{URL}', '\\1', $bbcode_tpl['left']);
	$bbcode_tpl['right'] = str_replace('{URL}', '\\1', $bbcode_tpl['right']);
// LEFT-RIGHT-end

#
#-----[ FIND ]------------------------------------------ 
#
	$patterns[] = "#\[img:$uid\](.*?)\[/img:$uid\]#si";
	$replacements[] = $bbcode_tpl['img'];

#
#-----[ AFTER, ADD ]------------------------------------------ 
#

// LEFT-RIGHT-start
	// [img=left]image_url_here[/img] code..
	$patterns[] = "#\[img=left:$uid\](.*?)\[/img:$uid\]#si";
	$replacements[] = $bbcode_tpl['left'];

	// [img=right]image_url_here[/img] code..
	$patterns[] = "#\[img=right:$uid\](.*?)\[/img:$uid\]#si";
	$replacements[] = $bbcode_tpl['right'];
// LEFT-RIGHT-end

#
#-----[ FIND ]------------------------------------------ 
#

$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);

#
#-----[ AFTER, ADD ]------------------------------------------ 
#

// LEFT-RIGHT-start
$text = preg_replace("#\[img=left\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=left:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
$text = preg_replace("#\[img=right\]((http|ftp|https|ftps)//)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=right:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
// LEFT-RIGHT-end

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

# 
#-----[ FIND ]---------------------------------
# full line, in english, is:
#	$lang['bbcode_p_help'] = 'Insert image: [img]http://image_url[/img]  (alt+p)';
#
$lang['bbcode_p_help']

# 
#-----[ IN-LINE FIND ]---------------------------------
#
[img

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
( | =left | =right )

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


#
#-----[ FIND ]---------------------------------
# 
# NOTE: the full line to look for is:
# $faq[] = array("Adding an image to a post", "phpBB BBCode [..SNIP..] <br />");
#
array("Adding an image to a post"


# 
#-----[ AFTER, ADD ]---------------------------------
# 

// LEFT-RIGHT-start
$faq[] = array("Aligning images and wrapping text", "This forum has the Left-Right IMG tag MOD installed.  Through the use of these tags, you can better format your posts by aligning text to the left or right side of the post body.  Additionally, through the use of these tags, text will now neatly wrap around the images as opposed to being in-line as with a normal [img] tag.  For example:<br /><br /><b>With img tags:</b><br />A really really <b>[img]</b>phplogo.gif<b>[/img]</b> <b>[img]</b>phplogo.gif<b>[/img]</b> really really really really really really long sentence. <table width=\"420\" cellpadding=\"5\"><tr><td class=\"quote\"><br />A really really <img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" /> <img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" /> really really really really really really long sentence.<br /><br /></td></tr></table><br /> <b>With left and right tags:</b><br />A really really <b>[img=left]</b>phplogo.gif<b>[/img]</b> <b>[img=right]</b>phplogo.gif<b>[/img]</b> really really really really really really long sentence. <table width=\"420\" cellpadding=\"5\"><tr><td class=\"quote\"><br /><img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" align=\"left\" /> <img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" align=\"right\" /> A really really really really really really really really long sentence.<br /><br /><br /></td></tr></table>") ;
// LEFT-RIGHT-end

##
##
## --- NOTE: You will have to make this change to ALL themes you have       ---
## ---       installed.  I use "subSilver" as an example.                   ---
##
##

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/bbcode.tpl


#
#-----[ FIND ]------------------------------------------ 
#
# NOTE: the full line to look for is:
#<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
#
<!-- BEGIN img -->


#
#-----[ AFTER, ADD ]------------------------------------------ 
#

<!-- BEGIN left --><img src="{URL}" border="0" align="left" /><!-- END left -->

<!-- BEGIN right --><img src="{URL}" border="0" align="right" /><!-- END right -->

#
#-----[ SAVE/CLOSE FILES ]---------------------------------
#
# EoM

Too lazy to send it in the proper way.
ymmotrojam
Registered User
Posts: 279
Joined: Thu Oct 07, 2004 10:10 pm

Post by ymmotrojam »

Merri wrote: Here is an update:
...

I tried what you changed and it worked okay except for the right alignment. The right alignment shows only code. Left align works fine though. Have you gotten it to work?
KLIMO
Registered User
Posts: 6
Joined: Sun Apr 28, 2002 1:13 pm

Post by KLIMO »

Code: Select all


# 
#-----[ FIND ]------------------------------------------ 
# 

$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// LEFT-RIGHT-start 
$text = preg_replace("#\[img=left\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=left:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
$text = preg_replace("#\[img=right\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=right:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
// LEFT-RIGHT-end 

All that was missing was a : to make the right alignment work. Copy that section above and replace the existing code in your bbcode.php file and you should be all set.
pichirichi
Registered User
Posts: 83
Joined: Wed Jun 02, 2004 5:34 am
Contact:

An update to support RTL language

Post by pichirichi »

This MOD had no support in RTL langaues, here is an update that is using the {S_CONTENT_DIR_LEFT/RIGHT} parameters :

Code: Select all

#=======================================================
#
# Support in RTL languages.
#
#=======================================================
# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/bbcode.tpl


#
#-----[ FIND ]------------------------------------------ 
#
<!-- BEGIN left --><img src="{URL}" border="0" align="left" /><!-- END left -->

<!-- BEGIN right --><img src="{URL}" border="0" align="right" /><!-- END right -->
#
#-----[ REPLACE WITH ]------------------------------------------ 
#

<!-- BEGIN left --><img src="{URL}" border="0" align="{S_CONTENT_DIR_LEFT}" /><!-- END left -->

<!-- BEGIN right --><img src="{URL}" border="0" align="{S_CONTENT_DIR_RIGHT}" /><!-- END right -->

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes\bbcode.php
#
#-----[ FIND ]------------------------------------------ 
#
	// LEFT-RIGHT-start
#
#-----[ AFTER, AFTER ]------------------------------------------ 
#
	$bbcode_tpl['left']  = str_replace('{S_CONTENT_DIR_LEFT}', $lang['LEFT'], $bbcode_tpl['left']);
	$bbcode_tpl['right'] = str_replace('{S_CONTENT_DIR_RIGHT}', $lang['RIGHT'], $bbcode_tpl['right']);
#
#-----[ SAVE/CLOSE FILES ]---------------------------------
#
# EoM
porplemontage
Registered User
Posts: 15
Joined: Sun Oct 10, 2004 3:48 am

Post by porplemontage »

After doing what OddDuckCarter said to, the image still messes up the user's signature. Does anyone have an idea why?
ymmotrojam
Registered User
Posts: 279
Joined: Thu Oct 07, 2004 10:10 pm

Post by ymmotrojam »

ymmotrojam wrote:
Merri wrote:Here is an update:
...

I tried what you changed and it worked okay except for the right alignment. The right alignment shows only code. Left align works fine though. Have you gotten it to work?

I figured out what my problem was. It was that I was missing a colon in the bbcode.php file.
// LEFT-RIGHT-start
$text = preg_replace("#\[img=left\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=left:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
$text = preg_replace("#\[img=right\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=right:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
// LEFT-RIGHT-end
spear
Registered User
Posts: 2
Joined: Thu Mar 10, 2005 10:40 pm

Post by spear »

Here is all added and the result is v.1.6.2:

Code: Select all

## EasyMOD compliant 
############################################################## 
## MOD Title:   Left and Right IMG tags 
## MOD Author:  Nuttzy < [email protected] > (n/a) http://www.blizzhackers.com 
## MOD Author, Secondary:  Xore < [email protected] > (Robert Hetzler) http://www.xore.ca 
## MOD Author, Thirdary:  Merri < [email protected] > (Vesa Piittinen) http://merri.net 
## 
## MOD Description:  This MOD will allow you to better format 
##    you posts by aligning images left and right instead of 
##    just in-line as with the standard [img][/img] tag. Text 
##    will also neatly wrap around the images. 
## MOD Version: 1.6.2 
## 
## Installation Level:  EASY 
## Installation Time:   4-5 Minutes 
## Files To Edit:       6 
##                   - includes/bbcode.php 
##                   - templates/subSilver/bbcode.tpl 
##                   - language/lang_english/lang_main.php 
##                   - language/lang_english/lang_bbcode.php 
## 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: 
## 
##     Works with phpBB 2.0.11 
##     IMPORTANT: you MUST first have already installed the Multi Quick BBCode MOD 
## 
## Usage: 
##     [img=left]url of image[/img] to left justify image 
##     [img=right]url of image[/img] to right justify image 
## (used to be [left][/left] and [right][/right] -- this frees up more hotkeys) 
## 
## 
############################################################## 
## 
## MOD History: 
##    2004-12-17 - Version 1.6.1 
##         + Made compatible with phpBB 2.0.11 (by Merri) 
##    
##    2003-11-02 - Version 1.6.0 
##         + Changed to img=left and img=right 
##    
##    2003-09-25 - Version 1.5.2 
##         + improved MOD Template compliance 
##    
##    02/05/03 - bug fix: changed instance in bbcode.tpl where 
##                 left should have been right - DanielT 
## 
##    02/04/03 - updated for 2.0.4 
##             - added BBCode FAQ entry 
## 
##    08/31/02 - fixed interference with font color/size problem 
##             - made compliant with EasyMod alpha 2 
## 
##    06/28/02 - fixed a bbcode problem - thanks to 
##               desean84 for discovering the problem! 
## 
##    04/21/02 - updated for phpBB 2.0.0 final 
##             - quick BBcode added by Christi 
##             - made EasyMod compliant 
## 
##    03/18/02 - initial releae for phpBB 2.0 RC3 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 


# 
# IMPORTANT: you MUST first have already installed the Multi Quick BBCode MOD 
# 


# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/bbcode.php 


# 
# 
# NOTE: the full line to look for is: 
#   $bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']); 
# 
#-----[ FIND ]------------------------------------------ 
# 
   $bbcode_tpl['img'] = 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// LEFT-RIGHT-start 
   $bbcode_tpl['left'] = str_replace('{URL}', '\\1', $bbcode_tpl['left']); 
   $bbcode_tpl['right'] = str_replace('{URL}', '\\1', $bbcode_tpl['right']); 
// LEFT-RIGHT-end 

# 
#-----[ FIND ]------------------------------------------ 
# 
   $patterns[] = "#\[img:$uid\](.*?)\[/img:$uid\]#si"; 
   $replacements[] = $bbcode_tpl['img']; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// LEFT-RIGHT-start 
   // [img=left]image_url_here[/img] code.. 
   $patterns[] = "#\[img=left:$uid\](.*?)\[/img:$uid\]#si"; 
   $replacements[] = $bbcode_tpl['left']; 

   // [img=right]image_url_here[/img] code.. 
   $patterns[] = "#\[img=right:$uid\](.*?)\[/img:$uid\]#si"; 
   $replacements[] = $bbcode_tpl['right']; 
// LEFT-RIGHT-end 

# 
#-----[ FIND ]------------------------------------------ 
# 

$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// LEFT-RIGHT-start 
$text = preg_replace("#\[img=left\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=left:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
$text = preg_replace("#\[img=right\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=right:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); 
// LEFT-RIGHT-end 


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

# 
#-----[ FIND ]--------------------------------- 
# full line, in english, is: 
#   $lang['bbcode_p_help'] = 'Insert image: [img]http://image_url[/img]  (alt+p)'; 
# 
$lang['bbcode_p_help'] 

# 
#-----[ IN-LINE FIND ]--------------------------------- 
# 
[img 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
( | =left | =right ) 

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


# 
#-----[ FIND ]--------------------------------- 
# 
# NOTE: the full line to look for is: 
# $faq[] = array("Adding an image to a post", "phpBB BBCode [..SNIP..] <br />"); 
# 
array("Adding an image to a post" 


# 
#-----[ AFTER, ADD ]--------------------------------- 
# 

// LEFT-RIGHT-start 
$faq[] = array("Aligning images and wrapping text", "This forum has the Left-Right IMG tag MOD installed.  Through the use of these tags, you can better format your posts by aligning text to the left or right side of the post body.  Additionally, through the use of these tags, text will now neatly wrap around the images as opposed to being in-line as with a normal [img] tag.  For example:<br /><br /><b>With img tags:</b><br />A really really <b>[img]</b>phplogo.gif<b>[/img]</b> <b>[img]</b>phplogo.gif<b>[/img]</b> really really really really really really long sentence. <table width=\"420\" cellpadding=\"5\"><tr><td class=\"quote\"><br />A really really <img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" /> <img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" /> really really really really really really long sentence.<br /><br /></td></tr></table><br /> <b>With left and right tags:</b><br />A really really <b>[img=left]</b>phplogo.gif<b>[/img]</b> <b>[img=right]</b>phplogo.gif<b>[/img]</b> really really really really really really long sentence. <table width=\"420\" cellpadding=\"5\"><tr><td class=\"quote\"><br /><img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" align=\"left\" /> <img src=\"templates/subSilver/images/logo_phpBB_med.gif\" border=\"0\" alt=\"\" align=\"right\" /> A really really really really really really really really long sentence.<br /><br /><br /></td></tr></table>") ; 
// LEFT-RIGHT-end 

## 
## 
## --- NOTE: You will have to make this change to ALL themes you have       --- 
## ---       installed.  I use "subSilver" as an example.                   --- 
## 
## 

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/bbcode.tpl 


# 
#-----[ FIND ]------------------------------------------ 
# 
# NOTE: the full line to look for is: 
#<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img --> 
# 
<!-- BEGIN img --> 


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

<!-- BEGIN left --><img src="{URL}" border="0" align="left" /><!-- END left --> 

<!-- BEGIN right --><img src="{URL}" border="0" align="right" /><!-- END right --> 

# 


#======================================================= 
# 
# Support in RTL languages. 
# 
#======================================================= 
# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/bbcode.tpl 


# 
#-----[ FIND ]------------------------------------------ 
# 
<!-- BEGIN left --><img src="{URL}" border="0" align="left" /><!-- END left --> 

<!-- BEGIN right --><img src="{URL}" border="0" align="right" /><!-- END right --> 
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

<!-- BEGIN left --><img src="{URL}" border="0" align="{S_CONTENT_DIR_LEFT}" /><!-- END left --> 

<!-- BEGIN right --><img src="{URL}" border="0" align="{S_CONTENT_DIR_RIGHT}" /><!-- END right --> 

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes\bbcode.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
   // LEFT-RIGHT-start 
# 
#-----[ AFTER, AFTER ]------------------------------------------ 
# 
   $bbcode_tpl['left']  = str_replace('{S_CONTENT_DIR_LEFT}', $lang['LEFT'], $bbcode_tpl['left']); 
   $bbcode_tpl['right'] = str_replace('{S_CONTENT_DIR_RIGHT}', $lang['RIGHT'], $bbcode_tpl['right']); 
# 

###### bigger to small image ################
#-----[ OPEN ]--------------------------------- 
# 
templates/subSilver/viewtopic_body.tpl 

# 
#-----[ FIND ]--------------------------------- 
# 
<td colspan="2"><span class="postbody">{postrow.MESSAGE} 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
<br clear="all" /> 

######## padding around your the image ############
# 
#-----[ OPEN ]--------------------------------- 
# 
templates/subSilver/bbcode.tpl 

# 
#-----[ FIND ]--------------------------------- 
# 
<!-- BEGIN left --><img src="{URL}" border="0" align="left" 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
 hspace="10" vspace="5" 

# 
#-----[ FIND ]--------------------------------- 
# 
<!-- BEGIN right --><img src="{URL}" border="0" align="right" 

# 
#-----[ IN-LINE AFTER, ADD ]--------------------------------- 
# 
 hspace="10" vspace="5" 

# 
#-----[ SAVE/CLOSE FILES ]--------------------------------- 
# 
# EoM
readysteadyjedi
Registered User
Posts: 1
Joined: Thu Apr 14, 2005 9:05 am
Contact:

Post by readysteadyjedi »

Code: Select all

Parse error: parse error, unexpected '<' in /home/.elam/readyste/readysteadyjedi.com/phpBB2/includes/bbcode.php(86) : eval()'d code on line 73
Any ideas?
atnbueno
Registered User
Posts: 39
Joined: Sun Aug 03, 2003 5:26 pm
Location: Spain
Contact:

Post by atnbueno »

Hello all.

I'm redoing the forums for my site from scratch and this was a MOD I was really interested in. I tried spear's version but EasyMOD choked in several places with it.

So I read all I could about EasyMOD and BBCodes and did my own 1.6.2 version of this MOD.

I added all the updates and modifications suggested here except RTL support (I don't really need it and it clashed with the style I use for spacing around the images). I also tried to make it a little more language independent, and tested in my test forum (2.0.14). If someone else can confirm it works for him, I'll submit it the proper way.

Oh, and you can see a particularly extreme example of this MOD in use.


Regards,
Antonio B.
mundoplus.tv - Televisión por Satélite en España
Post Reply

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