[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

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 »

Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )
User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 »

**double post, please delete**
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )
OddDuckCarter
Registered User
Posts: 135
Joined: Wed Mar 06, 2002 12:30 am

Post by OddDuckCarter »

Hello. I have some additions to this mod. First up, when using align=left or align=right, if the image is bigger than the text, the users signature will also be aligned on the image, instead of below it. You can fix this by:

Code: Select all

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

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

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

#
#-----[ SAVE/CLOSE FILES ]---------------------------------
#
# EoM
Additionally, if you wish to have padding around your the image (so the text doesn't touch the image):

Code: Select all

# 
#-----[ 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
wombat42
Registered User
Posts: 2
Joined: Thu Nov 20, 2003 2:45 am

From left=/right= to img= (conversion)

Post by wombat42 »

A really "thick" question here.

I believe a previous iteration of this mod used left= and right= tags to align the pictures. And it works well.

With the shift to img=left and img=right how do I find and update every bit of post text to convert to the new way of doing this? What would the SQL be for this or alternatively does someone have a php bit of code they could pass on to achieve this?

On a related matter does anyone know if image alignment will be a feature of the next phpbb release? If so, is it likely to follow the same format as this mod?
benjaminlwells
Registered User
Posts: 43
Joined: Sun Jan 11, 2004 6:52 pm
Location: PEI Canada

Post by benjaminlwells »

I just installed this mod, it's great! I was really glad to find it! Thumbs up!
Darth Wong
Registered User
Posts: 2401
Joined: Wed Jul 03, 2002 5:20 am
Location: Toronto, Canada
Name: Michael Wong
Contact:

Post by Darth Wong »

This is a great mod, but it is not compliant with the changes made in version 2.0.8 to improve security. In order to fix it, you have to go into includes/bbcode.php and find the section that looks like this:

Code: Select all

// 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
and then replace it with one that looks like this:

Code: Select all

// LEFT-RIGHT-start
$text = preg_replace("#\[img=left\]((ht|f)tp://)([^ \?&=\"\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\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img=right:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
// LEFT-RIGHT-end
Freedom of speech is not absolute, nor was it ever meant to be. If it were, then fraud would not be illegal.
agiacosa
Registered User
Posts: 186
Joined: Mon Jan 19, 2004 1:45 pm

Post by agiacosa »

This mod is not working for me. It doesn't show the image. When I check the image property by right clicking the red X, I get this:

http://www.aquaticplantcentral.com/forum/{URL}

What could be wrong?
agiacosa
Registered User
Posts: 186
Joined: Mon Jan 19, 2004 1:45 pm

Post by agiacosa »

anyone?
User avatar
Mav
Former Team Member
Posts: 2261
Joined: Wed May 15, 2002 9:19 am
Location: England
Contact:

Post by Mav »

agiacosa wrote: This mod is not working for me. It doesn't show the image. When I check the image property by right clicking the red X, I get this:

http://www.aquaticplantcentral.com/forum/{URL}

What could be wrong?

make sure that you've made the edits in bbcode.tpl to every theme you're using, not just the copy in templates/subSilver/
agiacosa
Registered User
Posts: 186
Joined: Mon Jan 19, 2004 1:45 pm

Post by agiacosa »

I'm only using subSilver.
User avatar
Mav
Former Team Member
Posts: 2261
Joined: Wed May 15, 2002 9:19 am
Location: England
Contact:

Post by Mav »

agiacosa wrote: I'm only using subSilver.

ok. have you double checked that you've made all of the edits in the install file and uploaded all of the edited files to your webserver?
agiacosa
Registered User
Posts: 186
Joined: Mon Jan 19, 2004 1:45 pm

Post by agiacosa »

I used Easymod. I'll double check it. It did say everything was successfull.
Darth Wong
Registered User
Posts: 2401
Joined: Wed Jul 03, 2002 5:20 am
Location: Toronto, Canada
Name: Michael Wong
Contact:

Post by Darth Wong »

agiacosa wrote: I used Easymod. I'll double check it. It did say everything was successfull.

If you use EasyMOD, then you have to install the Multi-BBCode mod before you install the left-right IMG tag mod.
Freedom of speech is not absolute, nor was it ever meant to be. If it were, then fraud would not be illegal.
agiacosa
Registered User
Posts: 186
Joined: Mon Jan 19, 2004 1:45 pm

Post by agiacosa »

I did install the Multi BBCode mod first using Easy Mod.
silvercloud
Registered User
Posts: 8
Joined: Wed May 26, 2004 6:41 am

Post by silvercloud »

Anyone know how to keep the old method working too? I like to have both wrap and non-wrapped option. There is also no centre option? It could just be my board, but I'm having serious problems with trying to fix the issue of wrappage.

http://ww2thegame.vcs-online.com
Post Reply

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