vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   New BB tag to do image thumbnails... (https://vborg.vbsupport.ru/showthread.php?t=50882)

Zzed 03-26-2003 10:00 PM

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...hreadid=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.

.......

Pady 03-27-2003 07:15 PM

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);

Zzed 03-27-2003 07:43 PM

Quote:

Today at 01:31 PM NuclioN said this in Post #5
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:
PHP Code:

        $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); 


Zzed 03-27-2003 07:49 PM

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

Zzed 03-27-2003 09:32 PM

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 [thumb ] and [/thumb ] it display as my image link as text not thumbnail

for example, [thumb]http://mydomain.com/image.jpg[/thumb] it will display as http://mydomain.com/image.jpg

what is happen?

Zzed 03-27-2003 10:01 PM

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

Zzed 03-27-2003 10:14 PM

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

Zzed 03-27-2003 10:30 PM

I get a page not found when I go to this URL: http://www.tvseriesfans.com/users-im...1101116021.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)

Zzed 03-27-2003 10:37 PM

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

Zzed 03-27-2003 10:43 PM

Quote:

Today at 03:26 PM LangTuDaTinh said this in Post #15
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.

Zzed 03-27-2003 10:45 PM

Quote:

Today at 04:43 PM LangTuDaTinh said this in Post #25
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:

[thumb]http://www.tvseriesfans.com/users-images/2003/2_28-3-326_2001101116021.jpg[/thumb]

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:)

Zzed 03-28-2003 12:53 AM

Line 771. :)

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. [thumb]http://borg.gif[/thumb]. A member on my forums accidently typed this url incorrectly, and got errors.

Boofo 03-28-2003 03:52 AM

Quote:

Today at 11:49 PM Smoothie said this in Post #31
If I use a url that isn't correct, I get a whole slew of errors. Try this and see if you get errors. [thumb]http://borg.gif[/thumb]. 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

Quote:

Today at 12:52 AM Boofo said this in Post #32



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. ;)

Zzed 03-28-2003 04:56 AM

Quote:

Today at 09:52 PM Boofo said this in Post #32



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

Quote:

Today at 02:53 AM Zzed said this in Post #30
Line 771. :)

771 didnt show up with the same script:(


All times are GMT. The time now is 04:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01462 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete