View Full Version : [IMG] tag -- align?
bigmattyh
11-19-2001, 05:54 AM
I've been working in php for quite some time now, but I admit that I'm a little new to some of the more advanced regular expressions, like vB uses.
Is there any way to have the vB bbcode parser turn this:
http://image.com/image.gifinto this:
<img align="left" src="http://image.com/image.gif">
I'm sure there is -- I regret that I don't yet have the skills to make sense of the 30+ character strings vB uses in preg_replace.
Thanks!
Admin
11-19-2001, 06:03 AM
Just add it as a custom vB code, from the Admin CP.
You'll see an option to use a {param}.
Only you won't be able to do this:
but rather this:
[img=left]
[QUOTE][i]Originally posted by bigmattyh
I'm sure there is -- I regret that I don't yet have the skills to make sense of the 30+ character strings vB uses in preg_replace.
yulee
12-18-2001, 10:39 PM
ok, I'm trying it but without success :(
Check please what I'm doing wrong:
vB code tag: img align
vB code replacement: <p><img src={param} align="{option}"></p>
vB code example: https://vborg.vbsupport.ru/
use options: yes.
I'm receiving this in hte definitons:
https://vborg.vbsupport.ru/ is replaced with https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/)
It seems it's not changing [ for <
I have vBulletin 2.2.1. Aggh :( What I'm doing wrong!
Thank you very much
Reeve of shinra
12-18-2001, 11:15 PM
You named the new BBCode img ... where one already exists.
Rename it something else, like img align as shown in Firefly's example above.
Alternately, you could just add the align code and memers can just use that....
[align=center][img]www.shinraonline.com [/img ][ /align]
amykhar
12-18-2001, 11:23 PM
It should be:
vb code tag img
vb code replacement <img src="{param}" align="{option}">
vb code example http://www.mysite.com/logo.gif
Hope that helps.
Amy
amykhar
12-18-2001, 11:25 PM
Mine is working even with using the img tag, but a new tag is probably best as they suggested.
Amy
yulee
12-18-2001, 11:36 PM
No success:
vB Code tag: imgalign
vB Code replacement: <img src="{param}" align="{option}">
vB Code example: https://vborg.vbsupport.ru/
Use option: Yes.
I think I'm doing what you mean, but it's not running. No hack done in my forum yet.
yulee
12-18-2001, 11:40 PM
Originally posted by Reeve of shinra
You named the new BBCode img ... where one already exists.
Rename it something else, like img align as shown in Firefly's example above.
Alternately, you could just add the align code and memers can just use that....
[align=center][img]www.shinraonline.com [/img ][ /align]
If you do that you don't receive a real align left. I need to have the real img align.
Please, I know it sould be very easy, but I can't manage it.
Thank you very much!
yulee
12-19-2001, 04:40 PM
Should I use any replacement or only add the vbcode? I can't manage it :(
Please, help me to have success with img align
yulee
12-19-2001, 09:21 PM
Any idea?
Thank you!
yulee
12-19-2001, 10:26 PM
DONE!!! It was necessary to set the same name of the vbcode as in the replacement!!! Look I set the name as imgalign but no img!!! So if you set img as name it runs:
vB Code tag: imgalign
vB Code replacement: <img src="{param}" align="{option}">
vB Code example: http://www.mywebsite.com/images/image.jpg
Use option: Yes.
See you!
Martin CX
12-20-2001, 01:49 AM
I haven't tested this but I suppose the greatest flexibility would come from using 'style="{option]' then the world would be your oyster (or something...):
image
Or am I wrong?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.