[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

kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

atnbueno wrote: If you mean to style the floated image, check out the style attribute of the img tag after <!-- BEGIN left --> in http://www.mundoplus.tv/atnbueno/left-right_162.mod
Does your mode produces XHTML compliant code?
atnbueno
Registered User
Posts: 39
Joined: Sun Aug 03, 2003 5:26 pm
Location: Spain
Contact:

Post by atnbueno »

Hi,
kulinar wrote: Does your mode produces XHTML compliant code?

Well, first of all, it's not really mine. I just tweaked the existing MOD to make it work and adapt it to my needs.

About the XHTML, it's a bbcode MOD, so it doesn't really "produce" that much code. I properly close the IMG tag, and in general my site validates to XHTML 1.0 Transitional (not the forum though, but all the warnings come from the original SubSilver theme).


Regards,
Antonio B.
mundoplus.tv - Televisión por Satélite en España
dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Post by dcz »

atnbueno wrote: Hello all.

dcz wrote:[...] I was wondering if I needed to change the #i into #si in the rest of the code before applying this code change (including #si's)

The "s" is a regex modifier that enables single-line mode. You can decide if you want to allow linebreaks in your [img] bbcodes.


Regards,


thanks

;)

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS
m2o
Registered User
Posts: 1
Joined: Sun Oct 30, 2005 2:58 pm

i can't download the mod

Post by m2o »

is there anyone able to gove me the mod when I click the link there's an error. please help me out.
phonereviews
Registered User
Posts: 99
Joined: Sat Oct 22, 2005 4:51 pm
Contact:

Post by phonereviews »

The link is working now, I just installed the mod and its working great...
Just one doubt though...how do we combine the left right mod with the thumbnail mod? That is, I want an image to appear on the left of the post, also, minimised. How do I do that?
And, is there a mod to display the image in the center?
phonereviews
Registered User
Posts: 99
Joined: Sat Oct 22, 2005 4:51 pm
Contact:

Post by phonereviews »

*bump*
phonereviews
Registered User
Posts: 99
Joined: Sat Oct 22, 2005 4:51 pm
Contact:

Post by phonereviews »

*bump*
kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

phonereviews wrote: ...how do we combine the left right mod with the thumbnail mod?
Can you provide a link to this mod?
bobber
Registered User
Posts: 104
Joined: Thu Apr 21, 2005 1:05 pm
Contact:

Post by bobber »

I've installed a fresh version of this mod on a phpBB2 2.0.19 with Topic Description Mod and this is what I get. I've got MultiBBCode installed as well. Any ideas?

Code: Select all

[img=left:ed3fce9a9e]http://fish-hawk.net/phpBB2/templates/subSilver/images/logo_phpBB.gif[/img:ed3fce9a9e] this is some text that should be besdie the image. 
Thanks,
sbourdon
Registered User
Posts: 174
Joined: Sat Nov 13, 2004 6:29 pm

Post by sbourdon »

The 2.0.20 update modifies the bbcode.php file as follow:

Code: Select all

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

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

	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	$patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i";
	$replacements[] = $bbcode_tpl['img'];

	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";
Should we modify the left and right lines added by this MOD according to this fix too?

I mean, should these lines be modified:

Code: Select all

// 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
Thanks! ;)
kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

Well, I changed to

Code: Select all

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

	// [img=right]image_url_here[/img] code..
	$patterns[] = "#\[img=right:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#si";
	$replacements[] = $bbcode_tpl['right'];
  // LEFT-RIGHT-end
adn it works fine for me.
sbourdon
Registered User
Posts: 174
Joined: Sat Nov 13, 2004 6:29 pm

Post by sbourdon »

Thank you very much, kulinar! :D
User avatar
congoclash
Registered User
Posts: 4
Joined: Sat May 06, 2006 1:03 pm
Contact:

Post by congoclash »

Thanks a lot, it worked on 2.0.20 but witout padding around images the effect is a bit ugly. Any ideas on how to introduce 2-4 px of padding?
sbourdon
Registered User
Posts: 174
Joined: Sat Nov 13, 2004 6:29 pm

Post by sbourdon »

congoclash wrote: Thanks a lot, it worked on 2.0.20 but witout padding around images the effect is a bit ugly. Any ideas on how to introduce 2-4 px of padding?


Try this:

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
   ROOT/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 ]------------------------------------------  // Similar lines of code should already be there; modify them according to the space you want around your images (here, 10px vertical and horizontal)
#
<!-- BEGIN left --><img src="{URL}" border="0" align="left" hspace="10" vspace="10" /><!-- END left -->

<!-- BEGIN right --><img src="{URL}" border="0" align="right" hspace="10" vspace="10" /><!-- END right -->
;)
kulinar
Registered User
Posts: 657
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar »

in templates/subSilver/bbcode.tpl
FIND

Code: Select all

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

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

Code: Select all

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

<!-- BEGIN right --><img src="{URL}" alt="" border="0" align="right" hspace="2" /><!-- END right -->
I guess this will do. I use it in my boards.
Post Reply

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