Page 1 of 1

[MOD] IMG=special for indirect images

PostPosted: Sat Apr 08, 2006 4:55 am
Author: evolver
The new version of IntegraMOD will be bug-fixed??
Maybe a good moment for this reminder... <img>

The IMG-TAG bug

It works well for pictures...
But for pictures from PhotoAlbum and other PHP-linked pictures,
it will only work with 'left' or 'right'...
[strike][flash=,]php-linked image[/flash:2um0su03][/strike]
[img=left:2um0su03]php-linked image[/img]
[img=right:2um0su03]php-linked image[/img]
To bad...there's no way to center those pictures...(not even by using text-align)

[hr:2um0su03]I have found this nice script for random pictures:
http://software.redshift.je/?p=m&i=23
[color=green]With this script, you can make your own random signature... <!-- s]
[color=red]BUT...because of the IMG-tag bug it can only be placed left or right,
not at the center where I want it to be... <!-- s][hr:2um0su03]

I have tested this script on my site...
The script uses one directory to pick out a random picture.
I've placed 8 pictures there for testing...

[align=center:2um0su03][img=left:2um0su03]http://www.stelplaats.be/RandomImage/RSforum.php[/img]
brings up this result :[/align:2um0su03]

[img=left:2um0su03]http://www.stelplaats.be/RandomImage/RSforum.php[/img]


(just refresh to see another picture)

Re: [bug] IMG tag

PostPosted: Sat Apr 08, 2006 5:05 am
Author: evolver
An attempt to center this picture on this site:

[align=center:e6kwiv4n][flash=,:e6kwiv4n]http://www.stelplaats.be/RandomImage/RSforum.php[/flash:e6kwiv4n][/align:e6kwiv4n]


Doesn't work...as you can see <img>

Re: [bug] IMG tag

PostPosted: Sat Apr 08, 2006 6:18 am
Author: evolver
Just one other thing:

Custom random signatures for visitors???
Is it possible?
YES IT IS!!!

I have found:
http://www.randomsigs.com/

Re: [bug] IMG tag

PostPosted: Mon Apr 10, 2006 6:33 am
Author: Michaelo
This is not a bug. There is no bbcode assigned for center (centre)à¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ I have played around with adding the center to it but for some reason it refused to workà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ Anyone familiar with the bbcode? Note the new version of phpBB3 allows you to add bbcodes form the ACP

A simple solution would be to search the message for a token such as [IMG_CENTER]à¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦[/IMG_CENTER] and replace the tokens with html <center> à¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦</center>.

The random image and sig could be done without linking off site... I wonder... might play with this later :oops:

Re: [bug] IMG tag

PostPosted: Mon Apr 10, 2006 9:20 am
Author: evolver
"Michaelo";p="802" wrote:This is not a bug. There is no bbcode assigned for center (centre)à¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

OK...
If I understand you correctly, it isn't supposed to be possible to use php-linked images with the standard [IMG] tag.
This feature has only been made possible with the image-MOD for aligning images...

Then it's no bug, indeed... <img>

[strike]Then a center-tag would be nice...[/strike]
It doesn't have to be a center tag, you know...
Just adding a super-normal tag to the IMG-MOD would do fine, because then we could use the text alignment like we can with the standard tag...
Ofcourse, then the standard (normal) tag will become obsolete...

Or...isn't it possible to use the ALIGNment-tag over the IMG-MOD??
...is surely isn't working on a IMG-tag with a left or right statement, but that's most logical ofcourse...

PostPosted: Sat Apr 22, 2006 8:08 am
Author: Michaelo
[align=center:21vlvv90][flash=,:21vlvv90]http://integramod.com/forum/images/smiles/icon_mrgreen.gif[/flash:21vlvv90][/align:21vlvv90]

Re: [bug?] IMG tag

PostPosted: Sat Apr 22, 2006 4:05 pm
Author: Simon N
[align=center:1bwqa2vs][flash=,:1bwqa2vs]http://www.free-riders.co.uk/templates/FR_Tech/images/logo_mid.gif[/flash:1bwqa2vs][/align:1bwqa2vs]

Oh look a centred image <img>

PostPosted: Sat Apr 22, 2006 4:52 pm
Author: Michaelo
Simon, you forgot to say thanks! :mrgreen:

Re: [bug?] IMG tag

PostPosted: Sat Apr 22, 2006 4:53 pm
Author: evolver
OK, can someone center this? (without HTML)
[img=left:2g3ser2b]http://www.stelplaats.be/RandomImage/RSforum.php[/img]

Re: [bug?] IMG tag

PostPosted: Sat Apr 22, 2006 5:06 pm
Author: Michaelo
Seems like the code only supports centre images with real links but there might be a way to use code (reference to image) inside tag?
Strange <img>

Re: [bug?] IMG tag

PostPosted: Sat Apr 22, 2006 5:10 pm
Author: evolver
Nice try <img>

PostPosted: Sat Apr 22, 2006 5:18 pm
Author: Michaelo
When images are referenced (now image is given) the display code removes one instance the bbcode not two... You would have to do a second pass as with smilies to fix the problem which might be worth while

[align=center:1ueznb15][flash=,:1ueznb15]http://www.imagesjournal.com/graphics/2004/title-touch1.jpg[/flash:1ueznb15][/align:1ueznb15]

Re: [bug?] IMG tag

PostPosted: Sat Apr 22, 2006 7:02 pm
Author: evolver
I have found my own way...
And it works <img>

...I will post it tomorrow

Re: [bug?] IMG tag

PostPosted: Sun Apr 23, 2006 7:23 am
Author: evolver
I've done some modification to add a IMG=special

This image-tag doesn't do any alignment, but makes indirect images possible. (that's the only difference from the IMG=normal tag)[hr:24x7t5bs]

[size=99px])     {         $text = str_replace("[img]",%20"",%20$text);%20 %20%20 %20%20 %20%20 %20$text%20=%20str_replace("[/img]", "", $text);         $text = str_replace("[img=left]", "", $text);         $text = str_replace("[img=right:$uid]", "", $text);         $text = str_replace("[imgrel:$uid]", "", $text);         $text = str_replace("[/imgrel:$uid]", "", $text);         $text = str_replace("[imgrel=left:$uid]", "", $text);         $text = str_replace("[imgrel=right:$uid]", "", $text);         $text = str_replace("[theme:$uid]", "", $text);         $text = str_replace("[theme=left:$uid]", "", $text);         $text = str_replace("[theme=right:$uid]", "", $text);         $text = str_replace("[/theme:$uid]", "", $text);     }//-- fin mod : profile cp --------------------------------------------------------------------------[/code]
REPLACE
Code: Select all
//-- mod ])      {            $text = str_replace("[img]", "", $text);            $text = str_replace("[/img]", "", $text);            $text = str_replace("[img=special:$uid]", "", $text);            $text = str_replace("[img=left:$uid]", "", $text);            $text = str_replace("[img=right:$uid]", "", $text);            $text = str_replace("[imgrel:$uid]", "", $text);            $text = str_replace("[/imgrel:$uid]", "", $text);            $text = str_replace("[imgrel=special:$uid]", "", $text);            $text = str_replace("[imgrel=left:$uid]", "", $text);            $text = str_replace("[imgrel=right:$uid]", "", $text);            $text = str_replace("[theme:$uid]", "", $text);            $text = str_replace("[theme=special:$uid]", "", $text);            $text = str_replace("[theme=left:$uid]", "", $text);            $text = str_replace("[theme=right:$uid]", "", $text);            $text = str_replace("[/theme:$uid]", "", $text);      }//-- fin mod : profile cp --------------------------------------------------------------------------


FIND
Code: Select all
// LEFT-RIGHT-start            // [img=left]image_url_here[/img] code..      $patterns[] = "#[img=left:$uid](.*?)[/img]#si";      $replacements[] = $bbcode_tpl['left'];        // [img=right:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[img=right:$uid](.*?)[/img]#si";      $replacements[] = $bbcode_tpl['right'];              // [imgrel=left]image_url_here[/imgrel] code..      $patterns[] = "#[imgrel=left:$uid](.*?)[/imgrel:$uid]#si";      $replacements[] = $bbcode_tpl['relleft'];        // [img=right:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[imgrel=right:$uid](.*?)[/imgrel:$uid]#si";      $replacements[] = $bbcode_tpl['relright'];            // [img=left:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[theme=left:$uid](.*?)[/theme:$uid]#si";      $replacements[] = $bbcode_tpl['themeleft'];        // [img=right:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[theme=right:$uid](.*?)[/theme:$uid]#si";      $replacements[] = $bbcode_tpl['themeright'];

REPLACE
Code: Select all
// LEFT-RIGHT-start      // [img=special]image_url_here[/img] code..      $patterns[] = "#[img=special](.*?)[/img]#si";      $replacements[] = $bbcode_tpl['special'];                        // [img=left:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[img=left:$uid](.*?)[/img]#si";      $replacements[] = $bbcode_tpl['left'];        // [img=right:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[img=right:$uid](.*?)[/img]#si";      $replacements[] = $bbcode_tpl['right'];        // [imgrel=special]image_url_here[/imgrel] code..      $patterns[] = "#[imgrel=special:$uid](.*?)[/imgrel:$uid]#si";      $replacements[] = $bbcode_tpl['relspecial'];              // [imgrel=left]image_url_here[/imgrel] code..      $patterns[] = "#[imgrel=left:$uid](.*?)[/imgrel:$uid]#si";      $replacements[] = $bbcode_tpl['relleft'];        // [img=right:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[imgrel=right:$uid](.*?)[/imgrel:$uid]#si";      $replacements[] = $bbcode_tpl['relright'];            // [img=left:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[theme=special:$uid](.*?)[/theme:$uid]#si";      $replacements[] = $bbcode_tpl['themespecial'];        // [img=left:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[theme=left:$uid](.*?)[/theme:$uid]#si";      $replacements[] = $bbcode_tpl['themeleft'];        // [img=right:24x7t5bs]image_url_here[/img] code..      $patterns[] = "#[theme=right:$uid](.*?)[/theme:$uid]#si";      $replacements[] = $bbcode_tpl['themeright'];


FIND
Code: Select all
      //BBCode Search Mod      $text = preg_replace("#[search](.*?)[/search]#si", "[search]\1[/search:$uid]", $text);        $text = preg_replace("#[theme]([^ ?&=#"nrt<]*?)[/theme]#sie", "'[theme:$uid]\1' . str_replace(' ', '%20', '\3') . '[/theme:$uid]'", $text);      $text = preg_replace("#[theme=left]([^ ?&=#"nrt<]*?)[/theme]#sie", "'[theme=left:$uid]\1' . str_replace(' ', '%20', '\3') . '[/theme:$uid]'", $text);      $text = preg_replace("#[theme=right]([^ ?&=#"nrt<]*?)[/theme]#sie", "'[theme=right:$uid]\1' . str_replace(' ', '%20', '\3') . '[/theme:$uid]'", $text);        $text = preg_replace("#[imgrel]([^ ?&=#"nrt<]*?)[/imgrel]#sie", "'[imgrel:$uid]\1' . str_replace(' ', '%20', '\3') . '[/imgrel:$uid]'", $text);      $text = preg_replace("#[imgrel=left]([^rnt<"]*?)[/imgrel]#sie", "'[imgrel=left:$uid]\1' . str_replace(' ', '%20', '\3') . '[/imgrel:$uid]'", $text);      $text = preg_replace("#[imgrel=right]([^rnt<"]*?)[/imgrel]#sie", "'[imgrel=right:$uid]\1' . str_replace(' ', '%20', '\3') . '[/imgrel:$uid]'", $text);  // LEFT-RIGHT-start      $text = preg_replace("#[img=left]((http|ftp|https|ftps)://)([^rnt<"]*?)[/img]#sie", "'[img=left:$uid]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);      $text = preg_replace("#[img=right]((http|ftp|https|ftps)://)([^rnt<"]*?)[/img]#sie", "'[img=right:$uid]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);

REPLACE
Code: Select all
            //BBCode Search Mod      $text = preg_replace("#[search](.*?)[/search]#si", "[search]\1[/search:$uid]", $text);        $text = preg_replace("#[theme]([^ ?&=#"nrt<]*?)[/theme]#sie", "'[theme:$uid]\1' . str_replace(' ', '%20', '\3') . '[/theme:$uid]'", $text);      $text = preg_replace("#[theme=special]([^ ?&=#"nrt<]*?)[/theme]#sie", "'[theme=special:$uid]\1' . str_replace(' ', '%20', '\3') . '[/theme:$uid]'", $text);      $text = preg_replace("#[theme=left]([^ ?&=#"nrt<]*?)[/theme]#sie", "'[theme=left:$uid]\1' . str_replace(' ', '%20', '\3') . '[/theme:$uid]'", $text);      $text = preg_replace("#[theme=right]([^ ?&=#"nrt<]*?)[/theme]#sie", "'[theme=right:$uid]\1' . str_replace(' ', '%20', '\3') . '[/theme:$uid]'", $text);        $text = preg_replace("#[imgrel]([^ ?&=#"nrt<]*?)[/imgrel]#sie", "'[imgrel:$uid]\1' . str_replace(' ', '%20', '\3') . '[/imgrel:$uid]'", $text);      $text = preg_replace("#[imgrel=special]([^rnt<"]*?)[/imgrel]#sie", "'[imgrel=special:$uid]\1' . str_replace(' ', '%20', '\3') . '[/imgrel:$uid]'", $text);      $text = preg_replace("#[imgrel=left]([^rnt<"]*?)[/imgrel]#sie", "'[imgrel=left:$uid]\1' . str_replace(' ', '%20', '\3') . '[/imgrel:$uid]'", $text);      $text = preg_replace("#[imgrel=right]([^rnt<"]*?)[/imgrel]#sie", "'[imgrel=right:$uid]\1' . str_replace(' ', '%20', '\3') . '[/imgrel:$uid]'", $text);  // LEFT-RIGHT-start      $text = preg_replace("#[img=special]((http|ftp|https|ftps)://)([^rnt<"]*?)[/img]#sie", "'[img=special:$uid]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);      $text = preg_replace("#[img=left]((http|ftp|https|ftps)://)([^rnt<"]*?)[/img]#sie", "'[img=left:$uid]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);      $text = preg_replace("#[img=right]((http|ftp|https|ftps)://)([^rnt<"]*?)[/img]#sie", "'[img=right:$uid]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);



[size=99px]http]";[/code]
REPLACE
Code: Select all
img_help = "Insert Image]http://image path[/img]";


FIND
Code: Select all
function BBCimg() {     var FoundErrors = '';     var enterType = prompt("Enter image alignment]"+enterURL+"[/img]";     }else if (enterType == "left" || enterType == "Left" || enterType == "LEFT"){         var ToAdd = "[img=left:24x7t5bs]"+enterURL+"[/img]";     }else{         var ToAdd = "[flash=,:24x7t5bs]"+enterURL+"[/flash:24x7t5bs]";     }     BBCodeSelection(ToAdd,"",99,"");}

REPLACE
Code: Select all
function BBCimg() {     var FoundErrors = '';     var enterType = prompt("Enter image alignment]"+enterURL+"[/img]";     }else if (enterType == "left" || enterType == "Left" || enterType == "LEFT"){         var ToAdd = "[img=left:24x7t5bs]"+enterURL+"[/img]";     }else if (enterType == "special" || enterType == "Special" || enterType == "SPECIAL"){         var ToAdd = "[img=special]"+enterURL+"[/img]";     }else{         var ToAdd = "[flash=,:24x7t5bs]"+enterURL+"[/flash:24x7t5bs]";     }     BBCodeSelection(ToAdd,"",99,"");}



In templatesfisubice(and all other templates)bbcode.tpl

FIND
Code: Select all
<BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END>

REPLACE
Code: Select all
<BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END><BEGIN><img><END>

PostPosted: Sun Apr 23, 2006 8:57 am
Author: Michaelo
Evolver, this work perfectly for indirect images... Real nice job. :D
Mike

Will proposed we update to allow Left, Right, Center and Special. <img>

PostPosted: Sun Apr 23, 2006 10:54 am
Author: evolver
"Michaelo";p="2760" wrote:Evolver, this work perfectly for indirect images... Real nice job. :D
Mike

Thanks :?:[/quote]
There's no real need for center anymore.
You can do with the img=special as with the normal img tag
[ align=center][img=special]php-linked_image.php?...[/img][ /align]

PostPosted: Sun Apr 23, 2006 12:43 pm
Author: Michaelo
True, but with center you don't need select center after you use special, just make things easier...
Mike

Re: [MOD] IMG=special for indirect images

PostPosted: Mon Apr 24, 2006 12:59 am
Author: evolver
OK :wink:

PostPosted: Mon Apr 24, 2006 4:31 am
Author: Michaelo
Perfect, I have tested it with 1.4.1 beta_a. Barring any objections it should find its way to next release.

Re: [MOD] IMG=special for indirect images

PostPosted: Wed Apr 26, 2006 1:28 pm
Author: evolver
I've been thinking...there can be more of that:

IMG=border IMG=max

An option to place a picture with a border around it,
and an option to place a picture with width=100% (would also be ideal for placing large pictures without scrollbar <img> )

What do you think about that?
Good idea?

PostPosted: Wed Apr 26, 2006 3:38 pm
Author: Michaelo
If you could automatically restrict image size, <img> this might stop the stretching as it still occurs with some images...

PostPosted: Wed Apr 26, 2006 7:55 pm
Author: evolver
[quote=""Michaelo";p="3212""]If you could automatically restrict image size, :) (I really need this)

But there's one problem:
How do I know the maximum width?

Re: [MOD] IMG=special for indirect images

PostPosted: Thu Apr 27, 2006 5:39 am
Author: Michaelo
I wonder if you can use java to return the window size? There are a few mods out there that have managed to restrict images in the posts but I cant remember the site names. CyberAliens site is a good starting placeà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ If I find any useful info I will post back.
Mike <img>

Re: [MOD] IMG=special for indirect images

PostPosted: Thu Apr 27, 2006 6:26 am
Author: evolver
Found something, but I think this is going to be over my head...

http://www.weethet.nl/english/html_100percent.php <img>

PostPosted: Thu Apr 27, 2006 2:37 pm
Author: Michaelo
This applet should return the width of the page where the request was made, so it should return the window size for everyone irrespective of browser or resolution. If we then subtract the block width + any other td in the same table we should get the actual size available for an image. I will test it out later and get back to youà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦
Mike

Re: [MOD] IMG=special for indirect images

PostPosted: Thu Apr 27, 2006 5:34 pm
Author: evolver
This code is almost the same as the modification Jason made for the no-thread-stretch:
http://integramod.com/forum/viewtopic.php?p=2601#2601

That's almost perfect...
Only: It depends a lot on avatar restriction...
I've integrated the remote avatar resizer for that, but I would prefer it to be the other way around...
I would like that code to keep the avatar size in mind...

BTW: What happends when the blocks-column gets stretched by an image?
Those are the things that make this code very vulnerable...unless it can all be detected as well...THAT would really make it PERFECT!!!

There is a way to detect the real table width in javasript...
It uses a blank image with width 100% to substract the actual width...
However, it needs to be put 'ONLOAD' (I really don't like 'ONLOAD' <img> ),
That's very logical ofcourse: those calculations need to be done before the page has loaded...

PostPosted: Fri Apr 28, 2006 12:41 pm
Author: evolver
[quote=""Michaelo";p="3212""]If you could automatically restrict image size, :)