View Full Version : New BB tag to do image thumbnails...
This hack adds a new tag to your forums that will allow you to post images
in the form of a thumbnail.
The tag allows you to post pictures in the form of a thumbnail. Large images
can throw off the page, and the tag will scale the picture down to an 80x60
thumbnail preserving its original length and width ratio and turn it into a
hyperlink that you can click on and see the full image in a new browser window.
If the image being thumbnailed is smaller than 80x60, it will show up as is.
This tag is identical to the IMG tag. The new tag is THUMB
Tables affected: none
Templates affected: none
Files affected: admin/functions.php
Check out this link for a demo: http://www.ls1.com/forums/showthread.php?s=&threadid=276879
Note: This tag does not resize the actual picture. It just displays them at a smaller
scale. It will not help with bandwidth preservation.
Kars10
03-27-2003, 06:52 PM
Very cool Zzed!!
Thanks for sharing.
Kars :)
Sebastian
03-27-2003, 07:12 PM
Sorry! Due to high server loads, this forum and its contents are currently unavailable. Please try again in a few minutes.
Current server load is 17.
This forum will reopen when the server load drops below 15.
.......
excellent idea - great hack and easy to add too - well done
NuclioN
03-27-2003, 07:31 PM
I've rainbowcode in it, how to replace it with this?
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
$bbcode=preg_replace("/(\[)(rainbow)(])(\r\n)*(.*)(\[\/rainbow\])/esiU", "dorainbow('\\5')", $bbcode);
return censortext($bbcode);
Today at 01:31 PM NuclioN said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=374184#post374184)
I've rainbowcode in it, how to replace it with this?
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
$bbcode=preg_replace("/(\[)(rainbow)(])(\r\n)*(.*)(\[\/rainbow\])/esiU", "dorainbow('\\5')", $bbcode);
return censortext($bbcode);
Replace it with this:
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
$bbcode=preg_replace("/\[thumb\](\r\n|\r|\n)*((http|https):\/\/([^;<>\(\)\"".iif($allowdynimg,"","!\*\?\&")."]+)|[a-z0-9\/\\\._\- ]+)\[\/thumb\]/esiU", "dothumb('\\2')", $bbcode);
$bbcode=preg_replace("/(\[)(rainbow)(])(\r\n)*(.*)(\[\/rainbow\])/esiU", "dorainbow('\\5')", $bbcode);
return censortext($bbcode);
Thank you all for your kind words. https://vborg.vbsupport.ru/
Sebastian, I made VB.org visitors immune to the high load shutout. ;)
Intex
03-27-2003, 07:50 PM
Nice hack Zzed :cool:. Will add to my install list.
colicab-d
03-27-2003, 08:09 PM
how would i saw replace the image code with this? or even better add a THUMB button beside the IMG one?
VampireMan
03-27-2003, 08:12 PM
very usefull feature, thanks. Clicks install ..
Boofo
03-27-2003, 08:13 PM
Installing now. Great hack, my friend, as usual. ;)
Contact me later when you have time.
Zelda-King
03-27-2003, 08:45 PM
I like it. I installed. The thing with using php for it though is if someone posts a corrupt URL for an image (non-existent or something) a php error flashes for a moment.
Smoothie
03-27-2003, 09:18 PM
verys cool stuff.
Smoothie
03-27-2003, 09:23 PM
Now how to add the vB code thumb button to the new reply vB code buttons.
LangTuDaTinh
03-27-2003, 09:26 PM
Warning: getimagesize() [function.getimagesize]: HTTP request failed! HTTP/1.1 404 Not Found in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Warning: getimagesize(http://www..com/users-images/2003/BeforeConcert8-vi.jpe) [function.getimagesize]: failed to create stream: Invalid argument in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Warning: getimagesize() [function.getimagesize]: HTTP request failed! HTTP/1.1 404 Not Found in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Warning: getimagesize(http://www..com/users-images/2003/Concert9-or.jpe) [function.getimagesize]: failed to create stream: Invalid argument in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Those links are no good. I copied and pasted the URL in my browser and it says page not found...
LangTuDaTinh
03-27-2003, 09:43 PM
found the problem
must add @ before getimagesize($code);
but another problem is that in my postbit, if i use and [/thumb ] it display as my image link as text not thumbnail
for example, [thumb]http://mydomain.com/image.jpg it will display as http://mydomain.com/image.jpg
what is happen?
That is because you have disabled the IMG tag for that particular forum. ;) You need to edit the forum properties in the Admin CP and allow IMG tags to be used. ;)
The tag behaves identical to the IMG tag and checks for IMG tag permissions per forum.
LangTuDaTinh
03-27-2003, 10:12 PM
no, i have enable img that for that forum...
i'm testing it by post a post with two pics, 1 use thumb and other use img, img does display, other display as text
Hmm... Interesting. Can you give me the URL for the thread on your board?
LangTuDaTinh
03-27-2003, 10:23 PM
<a href="http://www.tvseriesfans.com/forums/showthread.php?postid=45397#post45397" target="_blank">http://www.tvseriesfans.com/forums/s...5397#post45397</a>
u will see a link, that one was use thumb bbcode
I get a page not found when I go to this URL: http://www.tvseriesfans.com/users-images/2003/2_28-3-326_2001101116021.jpg
LangTuDaTinh
03-27-2003, 10:35 PM
i have image hotliking protection on my website
but anyway, i added thumb to other pix, and they all got the same problem.
(note, changed my first pix to img)
OK, I see. Let me look into this. :)
LangTuDaTinh
03-27-2003, 10:43 PM
opps, i think i found the problem.... this code use { instead of [ for regular vbcode right?
but then again, it recognize my image as link
after i submit, it add the [url ] tag between my link
Today at 03:26 PM LangTuDaTinh said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=374245#post374245)
Warning: getimagesize() [function.getimagesize]: HTTP request failed! HTTP/1.1 404 Not Found in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Warning: getimagesize(http://www..com/users-images/2003/BeforeConcert8-vi.jpe) [function.getimagesize]: failed to create stream: Invalid argument in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Warning: getimagesize() [function.getimagesize]: HTTP request failed! HTTP/1.1 404 Not Found in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Warning: getimagesize(http://www..com/users-images/2003/Concert9-or.jpe) [function.getimagesize]: failed to create stream: Invalid argument in /home/virtual/site3/fst/var/www/html/forums/admin/functions.php on line 972
Try and disable your mod-rewrite and see if this problem still exists or not. There seems to be a conflict between your web server and the function getimagesize(). The may require you to revise some of your rewrite rules.
Also try the thumbnails with an image that is not on your server to see if it behaves correctly or not.
Today at 04:43 PM LangTuDaTinh said this in Post #25 (https://vborg.vbsupport.ru/showthread.php?postid=374276#post374276)
opps, i think i found the problem.... this code use { instead of [ for regular vbcode right?
but then again, it recognize my image as link
after i submit, it add the [url ] tag between my link
Your tags should look identical to this:
http://www.tvseriesfans.com/users-images/2003/2_28-3-326_2001101116021.jpg
LangTuDaTinh
03-27-2003, 10:51 PM
well, changed back...
CK2003
03-28-2003, 12:50 AM
zzed can you please tell me which lines the following are on? i have truble finding them, thanks:)
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
return censortext($bbcode);
// ###################### Start phphighlite #######################
thanks again if you can help me, it would be very much appritiated:) btw i am using the functions.php file:)
Smoothie
03-28-2003, 03:49 AM
If I use a url that isn't correct, I get a whole slew of errors. Try this and see if you get errors. http://borg.gif. A member on my forums accidently typed this url incorrectly, and got errors.
Boofo
03-28-2003, 03:52 AM
Today at 11:49 PM Smoothie said this in Post #31 (https://vborg.vbsupport.ru/showthread.php?postid=374391#post374391)
If I use a url that isn't correct, I get a whole slew of errors. Try this and see if you get errors. http://borg.gif. A member on my forums accidently typed this url incorrectly, and got errors.
Try this and it will hide any errors.
add @ before getimagesize($code);
Smoothie
03-28-2003, 04:19 AM
Today at 12:52 AM Boofo said this in Post #32 (https://vborg.vbsupport.ru/showthread.php?postid=374393#post374393)
Try this and it will hide any errors.
add @ before getimagesize($code); Thanks Boofo. :)
Boofo
03-28-2003, 04:39 AM
Anytime, my friend. You are very welcome. ;)
Today at 09:52 PM Boofo said this in Post #32 (https://vborg.vbsupport.ru/showthread.php?postid=374393#post374393)
Try this and it will hide any errors.
add @ before getimagesize($code);
Thank you for covering me bob. https://vborg.vbsupport.ru/
Boofo
03-28-2003, 04:59 AM
You've covered me more than once. Glad to return the favor. ;)
EvilLS1
03-28-2003, 05:07 AM
Nice one Zed. :)
*clicks install
Erwin
03-28-2003, 05:07 AM
Good idea.
To get rid of the borders as linked images are bordered - add this to the <img src bits:
border=0
:)
Kars10
03-28-2003, 06:58 AM
Works like a charm!!
BTW: thanks Erwin for the "Border-Idea"...
Kars :)
CK2003
03-28-2003, 06:13 PM
Today at 02:53 AM Zzed said this in Post #30 (https://vborg.vbsupport.ru/showthread.php?postid=374332#post374332)
Line 771. :)
771 didnt show up with the same script:(
That is the line number in an unmodified functions.php for version 2.2.9.
It is the last few lines of bbcodeparse2() function.
Or if you search for the following line:
// ###################### Start phphighlite #######################
and scroll up about 6-7 lines you will get there. ;)
Pikok
03-29-2003, 12:08 AM
03-27-03 at 10:09 PM colicab-d said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=374203#post374203)
how would i saw replace the image code with this? or even better add a THUMB button beside the IMG one? To add a button you would need to edit 3 things.. The "vbcode_buttons" template, and the two JavaScripts "vbcode.js" and "vbcode_language.js".
In the "vbcode_buttons" template add this where you want the button to appear:
<input type="button" class="bginput" value="THUMB" title="Insert Thumbnail" onclick="vbcode(this.form,'THUMB','http://')" onmouseover="stat('thumb')">
In the "vbcode.js" you would need to add this just after the code for the IMG tag:
// ************************************************** *****
function vbcode(theform,vbcode,prompttext) {
// insert yyy style markup
if ((normalmode(theform)) || (vbcode=="THUMB")) {
inserttext = prompt(tag_prompt+"\n["+vbcode+"]xxx[/"+vbcode+"]",prompttext);
if ((inserttext != null) && (inserttext != ""))
theform.message.value += "["+vbcode+"]"+inserttext+"[/"+vbcode+"] ";
}
else {
donotinsert = false;
for (i = 0; i < tags.length; i++) {
if (tags[i] == vbcode)
donotinsert = true;
}
if (donotinsert)
stat("already_open");
else {
theform.message.value += "["+vbcode+"]";
arraypush(tags,vbcode);
}
}
theform.message.focus();
}
In the "vbcode_language.js" you would need to add this just after the code for the "img_text":
thumb_text = "Insert a thumbnail into your message";
;)
Larry@IOG
03-30-2003, 12:20 AM
How would I go about just getting my IMG tag to auto thumb every image?
I have my attachments like that already
Thanks
Larry
ivanmcp
04-01-2003, 12:47 PM
Hi, this is cool hack.
I presume that I can change size of a thumbnail to my own prefference. So, for example, I might want to set image width to 600 max (so not to loose table formating), and any image larger that that would be scaled down to 600 pixels width, with the option to display original image size when clicked on appropriate link.
If so, I will implement this hack immediately :).
Oh yes, I got to use this smiley :banana: .
Ivan
Great hack. :D I'm using it very nicely in a gallery-type format.
Is there a way to cache the images after initial loading, by chance?
Anyway, great hack and very useful.
NuclioN
04-06-2003, 04:52 PM
Great Pikok. What is the code to place a thumb button by the quick reply in showtread template?
Classy
04-06-2003, 08:49 PM
Thank you ... works in 2.3.0 also. Clicked install :D
Classy
04-06-2003, 10:08 PM
is there a way to make it so when your posting people have the option to click the bbcode? Just like they do for [img] or [code]?
Hope this makes sense. Thanks.
Blindchild02
04-07-2003, 06:50 PM
yea, i also want that... like in the newthread, so your able to click a button, like the IMG button and HTML button
also.. a problem i have, is that not all the images work with [thumb] ... why is that? o_O
Classy
04-07-2003, 06:51 PM
I'm thinkin it has to do with the code in functions.php .... not sure though
Blindchild02
04-07-2003, 06:54 PM
i think its only jpg's that dont work, cuz gif does :|
boutwell
04-08-2003, 03:00 PM
I wish I had found this months ago...great hack Z :)
However, I think the install .txt file may have gotten trunked somehow. This is all I am getting:
This hack adds a new tag to your forums that will allow you to post images
in the form of a thumbnail.
The tag allows you to post pictures in the form of a thumbnail. Large images
can throw off the page, and the tag will scale the picture down to an 80x60
thumbnail preserving its original length and width ratio and turn it into a
hyperlink that you can click on and see the full image in a new browser window.
If the image being thumbnailed is smaller than 80x60, it will show up as is.
This tag is identical to the IMG tag.
Tables affected: none
Templates affected: none
Files affected: admin/functions.php
Check out this link for a demo: http://www.ls1.com/forums/showthread.php?s=&threadid=276879
************************************************** ***********************************
Note: This tag does not resize the actual picture. It just displays them at a smaller
scale. It will not help with bandwidth preservation.
************************************************** ***********************************
In admin/functions.php
Look for:
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
return censortext($bbcode);
And change it to:
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
$bbcode=preg_replace("/\[thumb\](\r\n|\r|\n)*((http|https):\/\/([^;<>\(\)\"".iif($allowdynimg,"","!\*\?\&")."]+)|[a-z0-9\/\\\._\- ]+)\[\/thumb\]/esiU", "dothumb('\\2')", $bbcode);
return censortext($bbcode);
########################################
In admin/functions.php
look for:
// ###################### Start phphighlite #######################
Add the following directly above it:
// ###################### Start dothumb #######################
function dothumb($code) {
$img_info = @getimagesize($code);
if($img_info[0]) {
if(($img_info[0] <= 80) and ($img_info[1] <= 60)) {
$code = "<a href=\"$code\" target=\"_blank\"><img src=\"$code\"></a>";
}
else {
$xratio = $img_info[0] / 80;
$yratio = $img_info[1] / 60;
$factor = $xratio;
if($yratio > $xratio) {
$factor = $yratio;
}
$xsize = intval($img_info[0] / $factor);
$ysize = intval($img_info[1] / $factor);
$code="<a href=\"$code\" target=\"_blank\"><img src=\"$code\" width=\"$xsize\" height=\"$ysize\" border=\"3\"></a>";
}
}
return($code);
}
I did this and the tag isn't working...don't I have to add a BBcode via the admin control panel as well?
It is the complete file. That's all you need to do. No need to add anything through the admin CP. ;)
boutwell
04-08-2003, 05:41 PM
Ok I am at a total loss here Zzed...are there any other hacks that this doesn't cooperate with with perhaps? Everything is set correctly but it still only shows the URL of the image I post for some reason.
Here is my test post:
http://dev.ringofdestiny.com/vb/showthread.php?threadid=2
Here is the contents of that post:
{thumb}http://205.214.94.176/~rod/images/emperor.jpg{/thumb} (with brackets of course)
If you are really bored I will mail you the info for my dev board and you can take a look :)
Today at 11:41 AM boutwell said this in Post #54 (https://vborg.vbsupport.ru/showthread.php?postid=379300#post379300)
Ok I am at a total loss here Zzed...are there any other hacks that this doesn't cooperate with with perhaps? Everything is set correctly but it still only shows the URL of the image I post for some reason.
Here is my test post:
http://dev.ringofdestiny.com/vb/showthread.php?threadid=2
Here is the contents of that post:
{thumb}http://205.214.94.176/~rod/images/emperor.jpg{/thumb} (with brackets of course)
If you are really bored I will mail you the info for my dev board and you can take a look :)
Sure. Hit me... :D
My Email is: edwink@seebeyond.com
boutwell
04-08-2003, 06:18 PM
Info is on its way Zzed. Thanks bud :)
Everything is working fine. ;)
Blindchild02
04-08-2003, 07:52 PM
:( .jpg's dont work for me either :'(
zzed do u have AIM or MSN??
Today at 01:52 PM Blindchild02 said this in Post #58 (https://vborg.vbsupport.ru/showthread.php?postid=379341#post379341)
:( .jpg's dont work for me either :'(
zzed do u have AIM or MSN??
I worked with boutwell and we dicovered that his site is not able to get the length and width dimensions for certain pictures.
The dothumb() function tries to obtain the XY sizes for the picture and if it is not able to do it, it displays the URL for the picture...
This is how you can debug your code:
In functions.php
Look for:
$img_info = @getimagesize($code);
And replace it with the following:
$img_info = @getimagesize($code);
echo "$code <br>";
echo "$img_info[0] <br>";
echo "$img_info[1] <br>";
And you will notice that the length and width information show up blank.
If you want to bypass all the drama you can go the easy route and replace the function dothumb() with the following:
function dothumb($code) {
$code="<a href=\"$code\" target=\"_blank\"><img src=\"$code\" width=\"80\" height=\"60\" border=\"3\"></a>";
return($code);
}
Of course the only drawback with this is that if you try and thumbnail a smilie, it will actually magnify it. :)
Let me know if this helps...
Blindchild02
04-08-2003, 08:21 PM
well i woudl like to talk on AIM or msn plz :(
aim - bc aka blind
msn - starman_02@msn.com
qwertzu
04-10-2003, 10:18 AM
Cool
nice hack Zzed
thanks for that great one
i try it right now :)
qwertzu
04-10-2003, 10:49 AM
i've got a little bug it works fine everywhere (post & signs)
exept for one member in his sign it displays only the link but if i put that pic in a post the thumb works :lick:
i'v find the solution by hosting on my server & renaming the pic
here is the original pic i have remove the % and change JPG in jpg http://membres.lycos.fr/seadoo1979/signature%20baggio%20sonny.JPG
do you think that's normal ??
and thanks again for this great hack
qwertzu, that only happens when getimagesize() can not determine the image height and width. :(
And thank you for your kind words. :)
Katman
04-11-2003, 08:06 PM
I can't get this to work! It still shows as the original image size. Is there something I'm missing or not doing right? vB 2.2.9
Example:
http://www.tlplanet.com/forums/showthread.php?threadid=2023
Today at 02:00 PM Katman said this in Post #64 (https://vborg.vbsupport.ru/showthread.php?postid=380727#post380727)
I can't get this to work! It still shows as the original image size. Is there something I'm missing or not doing right? vB 2.2.9
Example:
http://www.tlplanet.com/forums/showthread.php?postid=21965#post21965
You are using the wrong tag. Instead of IMG you need to use THUMB. ;)
I registered and posted a reply to your thread. Check it out. :D
Katman
04-11-2003, 08:31 PM
I see that you made it work! Yes, I was using the [*img*] tag, that's the way I understood the hack to work. My mistake, sorry.
I guess my question now is, is there any way to make the IMG tag do this automatically?
Thanks for the help!
In functions.php:
Look for:
function bbcodeparse2($bbcode,$dohtml,$dobbimagecode,$dosmi lies,$dobbcode)
{ // parses text for vB code, smilies and censoring
global $DB_site,$wordwrap,$allowdynimg, $bbuserinfo;
static $smilies,$bbcodes;
global $regexcreated,$searcharray,$replacearray,$phpversi onnum;
Add the following directly below it:
$bbcode = preg_replace("/img\]/i", "thumb]", $bbcode);
This will replace all your IMG tags with THUMB tags. ;)
Katman
04-11-2003, 08:41 PM
Do I have to add [ in front of the /img\] and thumb]? Because when I tried it as you have it I received an error.
Parse error: parse error in /home/tlplanet/www/html/forums/admin/functions.php on line 640
Fatal error: Call to undefined function: vbdate() in /home/tlplanet/www/html/forums/admin/sessions.php on line 400
Hmm, I don't know why the PHP tag mutilated my preg_replace statement.
I have tried this on my board and it worked just fine. :)
$bbcode = preg_replace("/img\]/i", "thumb]", $bbcode);
Katman
04-11-2003, 09:11 PM
I don't know what it was but I tried it again and now it's working! Thank You! You are the master!
Now the only problem I can see is the images in the signatures, they're linked now, with a border, even after I changed border=1 to 0. :D
Today at 03:05 PM Katman said this in Post #70 (https://vborg.vbsupport.ru/showthread.php?postid=380767#post380767)
I don't know what it was but I tried it again and now it's working! Thank You! You are the master!
Now the only problem I can see is the images in the signatures, they're linked now, with a border, even after I changed border=1 to 0. :D
Thank you kind sir. :)
Please give me a link to a thread containing an image in the sig.
And I am so hurt that you deleted my replies... :laugh::banana:
Katman
04-11-2003, 09:18 PM
<a href="http://www.tlplanet.com/forums/showthread.php?threadid=2006" target="_blank">http://www.tlplanet.com/forums/showt...?threadid=2006</a>
Sorry about that, just part of the testing process
That's because the image is 256x170 which is smaller than your 320x240 image resize. ;)
in dothumb()
Replace this:
if(($img_info[0] <= 80) and ($img_info[1] <= 60)) {
$code = "<a href=\"$code\" target=\"_blank\"><img src=\"$code\"></a>";
}
with this:
if(($img_info[0] <= 80) and ($img_info[1] <= 60)) {
$code = "<a href=\"$code\" target=\"_blank\" border=\"0\"><img src=\"$code\"></a>";
}
Excpet that instead of 80 and 60 you would be using 320 and 240 in the if statement. ;)
Katman
04-11-2003, 09:30 PM
I did that originally.
Forget it, I see, Duh, you added the border=0
// ###################### Start dothumb #######################
function dothumb($code) {
$img_info = @getimagesize($code);
if($img_info[0]) {
if(($img_info[0] <= 320) and ($img_info[1] <= 240)) {
$code = "<a href=\"$code\" target=\"_blank\"><img src=\"$code\"></a>";
}
else {
$xratio = $img_info[0] / 320;
$yratio = $img_info[1] / 240;
$factor = $xratio;
if($yratio > $xratio) {
$factor = $yratio;
}
$xsize = intval($img_info[0] / $factor);
$ysize = intval($img_info[1] / $factor);
$code="<a href=\"$code\" target=\"_blank\"><img src=\"$code\" width=\"$xsize\" height=\"$ysize\" border=\"0\"></a><br><font size=\"-2\">(click for larger image)</font>";
}
}
return($code);
}
// ###################### End dothumb #######################
Katman
04-11-2003, 09:35 PM
Nope, still linked with border. I'm going to add border=\"0\" to every href tag! :)
Damn, still there.
Got it! Needed to add border=0 to
<img src=\"$code\" border=\"0\"></a>";
Today at 03:29 PM Katman said this in Post #76 (https://vborg.vbsupport.ru/showthread.php?postid=380789#post380789)
Nope, still linked with border. I'm going to add border=\"0\" to every href tag! :)
Nope, just hit reload. ;) The border will go away. ;)
Katman
04-11-2003, 09:40 PM
OK, I'm done now, it's all good! Thanks for the quick helpful replies!
Larry@IOG
04-11-2003, 09:59 PM
Today at 05:57 PM Zzed said this in Post #69 (https://vborg.vbsupport.ru/showthread.php?postid=380761#post380761)
Hmm, I don't know why the PHP tag mutilated my preg_replace statement.
I have tried this on my board and it worked just fine. :)
$bbcode = preg_replace("/img\]/i", "thumb]", $bbcode);
Didnt work for me, showed the image as a link rather than a thumbnail
Larry
This seems to be a common problem with certain hosts. This happens when getimagesize() is not able to obtain the length and the width of the picture as it is trying to calculate how to resize the image.
I have been asked by several people to come up with a workaround for this. :( I am going to do some research and see if there are any alternatives....
Katman
04-13-2003, 04:22 PM
Is there any way to have this hack not affect linked images in member signatures? My members are revolting! RIght now this hack is resizing all images in a post including those in their signatures.
One thing you can do to allow yourboard to have images that are not affected by this hack is to go to function bbcodeparse2() and see where the implementation for the IMG tag is and replace the word IMG with IMG2.
Blindchild02
04-15-2003, 03:44 AM
zzed... have u fixed my problem? :(
monstergamer
05-29-2003, 07:25 AM
this is one of the best hacks i have installed*
dont laught at me lol
monstergamer
05-30-2003, 07:54 PM
edit** i got it working lol **edit
SVTBlackLight01
05-31-2003, 06:57 PM
I installed this and tried it on a few images. The problem was that it was only working randomly on some images.
How do you adjust the resizing limits. Do they have to be the same ratio as 80x60? I had mine set at 350x350.
I would really like to be able to use this one. :classic:
ghroob
06-01-2003, 08:33 AM
thank you Zzed for this nice hack
but I need to change [thumb] with [ img ]
Can you help me Zzed?
Best regards
Splitfyre
06-03-2003, 09:15 PM
Some of users have the following enabled:
http://www.futurelooksforums.com/forums/attachment.php?postid=63893
Is there any way to include the [thumb] tag as well so images encased in the [thumb] tag just show a URL, if they have the option turned on?
wolfgang2
07-04-2003, 09:56 AM
works great on vB 2.3.0
Thank You for this excellent Hack!!!!
wolfgang2
07-04-2003, 10:16 AM
no problems anymore :D
fiendnutz
07-13-2003, 07:16 PM
is there anyway to make this work with attached images that were uploaded through a post made by someone. They use an img src tag rather than a {img} tag.
Tweak589
11-06-2003, 05:35 AM
This works great!
Except I run into a very terrible issue with the code I think....
Zzed, if you can help possibly, please do so. I am all set with your code, and used your recomendation from this post:
https://vborg.vbsupport.ru/showthread.php?t=51278&highlight=%5Bimg%5D
To use that line of code that will have [IMG] tags changed to [THUMB] tags. So I edited the functions.php perfectly fine, and everything works perfect.
The max estimated image size I can use for the forum dimensions is 540 x 405. Any image Higher than 540 will automatically resize to 540, no problems. But for things like signatures.... and small icons, I will always get a big thick black border around the small image. I even made the setting in your code of border="3" set to "0". So what could be the problem?
Is it looking at any image w/ [IMG] tags around it and trying to do this little equation or what?
All I am asking is for a fix that takes away those borders even though border="0" is on... Please Help!
-Tweak
ChrisSy
11-09-2003, 08:18 PM
is there anyway to make this work with attached images that were uploaded through a post made by someone. They use an img src tag rather than a {img} tag.
BUMP - also wanting this :l
MatrixSh0cke
11-12-2003, 02:00 AM
Seems people dont want the border LOL I on the other hand DO, just want to color it? Is there any way to change it's color?
hypedave
11-12-2003, 08:18 PM
Seems people dont want the border LOL I on the other hand DO, just want to color it? Is there any way to change it's color?
try this. Open admin/functions.php up
look for the folowing code.
$code="<a href=\"$code\" target=\"_blank\"><img src=\"$code\" width=\"$xsize\" height=\"$ysize\" border=\"3\"></a>";
and change "border=\"3\ to border=\"1\
I havent tryed it, but let us know if that works
Tweak589
11-12-2003, 10:54 PM
He asked how to color the border, not the thickness....
MatrixSh0cke
11-13-2003, 01:21 AM
LOL, yeah I already trimmed the border down, I just wanted to color it. I tried the bordercolor= thing, but it didnt work. Is there something else I need to do?
MatrixSh0cke
11-19-2003, 06:18 PM
No one can tell me how? ;_;
Prince
12-10-2003, 04:40 PM
did you add the bordercolor tag to the first img line too?
this one:
$code = "<a href=\"$code\" target=\"_blank\"><img src=\"$code\"></a>";
Prince
12-10-2003, 04:45 PM
what I would like is a way to have it ignore the IMG tags in signatures, or be able to set a different size limit for them.
Prince
12-10-2003, 04:46 PM
the reason I say this is because I used this code to have all IMG tags changed to the THUMB tags automatically:
$bbcode = preg_replace("/img\]/i", "thumb]", $bbcode);
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.