Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Server-side Thumbnailed Attachments Details »»
Server-side Thumbnailed Attachments
Version: 1.00, by CVMagic CVMagic is offline
Developer Last Online: May 2009 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 12-27-2003 Last Update: Never Installs: 10
Is in Beta Stage  
No support by the author.

Thumbnailed Attachments Version 1.0

Description: Its kind of Self explanitory, but in anycase if you dont know what it does, it checks if an attached image is larger than your specified size and if it is it will use ImageMagick, Netpbm, or the GD Image functions to resize it accourdingly using a rather simple formula to make sure the thumbnails are kept in scale.

Usual Mod Warning: This moddification unlike most other thumbnailed attachment mods isn't only a template hack so mind you, you'd have to make sure you backup your files before using this hack.

Screenshots/Test Threads: I have one included below and this link contains a vB that has already been modded: http://www.cheatandwin.com/forums/sh...=&threadid=216. But i should let you know that both are kind of outdated already since i did update the instructions from an oversight i had made earlier..

Requirements: Umm, as vB goes i'd say you'd need 2.2.x or higher but i designed it under 2.3.3 so there might be slight differences namely in the templates but not much to worry about that..
PHP 4.0.6 <- For the moment that is the minimum requirement for the modifications i have made aside to the ones required for vB
Any of the following 3: ImageMagick, Netpbm, or GD 2.01 or higher

Thats about it, any comments, suggestions, or questions feel free to post here or even email me personally at cvmagic at cheatandwin dot com.

[edit]
New Updated Version Download Today!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-02-2004, 03:07 PM
aliencode aliencode is offline
 
Join Date: May 2003
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

CVMagic - excellent hack - this is how hacks should be made, clean simple, not much modification. Thank you kindly!
Reply With Quote
  #23  
Old 01-02-2004, 07:54 PM
AutomatikStudio's Avatar
AutomatikStudio AutomatikStudio is offline
 
Join Date: Dec 2003
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...well I added the script but I'm getting broken images now and when you click on the broken thumbnail image it takes you to the real picture.
Reply With Quote
  #24  
Old 01-02-2004, 11:49 PM
CVMagic's Avatar
CVMagic CVMagic is offline
 
Join Date: Dec 2002
Location: USA/Connecticut
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that is odd, can you add '&dl=1' to the attachment url and post the results of the error..
Reply With Quote
  #25  
Old 01-04-2004, 01:15 AM
CVMagic's Avatar
CVMagic CVMagic is offline
 
Join Date: Dec 2002
Location: USA/Connecticut
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I debugged the issue, and it was a simple error in my part that my version of php for windows didnt pick up which i odd i must say so here is the simple fix

Code:
-----------
find 
-----------
if($dc=0){

-----------
Replace with
-----------
if(!($dc==1)){

###########

Done ^_^
It has already been applied to the 1.5 version so all is well, and thank you for pointing the error out AutomatikStudio
Reply With Quote
  #26  
Old 01-09-2004, 12:27 AM
tcs's Avatar
tcs tcs is offline
 
Join Date: Jun 2002
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack, however I have a problem. I set the max size of an image to 200x200 and the size to 1 mb. I try to upload a file that is 500x400 and vb warns that the image is too big to upload. (Exceeds the 200x200 I set)

I am on VB 2.3.3
I have no other hacks installed in the attachments.php
I ran the Sql quarries and verified there existence in the db
I triple checked the php additions
I have disable GD 2+ and tried enabled as well
I set the imagemagak 2 1 and have the exact path.

It is making a image to the thumbs folder but not the size I told it to. "150x150"
If I up the size of my image allowance it uploads the image and does say "Click here to enlarge" but the image in the thread is the same size as the attached image in the thread.

Hope I explained this well enough. Let me knoe if not.

Chuck
Reply With Quote
  #27  
Old 01-12-2004, 05:59 PM
pigsy pigsy is offline
 
Join Date: Nov 2001
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Had some problems getting this to work.

The problems I've encountered were:

1. The main problem is because it resizes on the fly when a page loads. If you're applying to this hack to a busy site, you can sometimes as we do have 5+ images in a thread. Although it seems to work when there's just one image, any more and it seems like the script doesn't have long enough to complete the conversion and you end up with broken images, and corrupt files in the thumbs dir. Is there any way to give the script time to generate the thumbnails. Alternatively if a script could be created to convert all images store in the directory in one hit, might take some time, but its where you'll eventually end up - and I think it can cope with converting one image on a thread as a new post is made.

2. ImageMagick worked in that it created a resized thumbnail but for some reason it generated the name without quotes - but the script is expecting those since it uses the php function escapeshellarg for the filename. Anyone know a way round this?

3. Couldn't get NetPBM to reduce the image size, it simply created a copy of the oversized image to display.

Great hack, and potentially what I've been looking for - but unworkable on my forum unfortunately. Any assistance much appreciated.
Reply With Quote
  #28  
Old 01-27-2004, 02:04 PM
CVMagic's Avatar
CVMagic CVMagic is offline
 
Join Date: Dec 2002
Location: USA/Connecticut
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

:-P what can i say, sorry about the delay... i should note that with safemode this hack does not run well at all, I didnt code it with making it safemode compatible in mind at all..., but as in multiple images at a time, it should work just fine because w/o safemode the images have all the time in the world to complie its thumbnails and plus if a user were to press stop it still continues on its own(again not safe mode compatible)... but noted i was using a much older version of netphm and imagemagick so it might not work as i intended at all, but dont worry at all im working on a newversion that instead of processing the attachment on post view it will do it during the post thus be safemode compatible in a sence...
Reply With Quote
  #29  
Old 01-27-2004, 02:10 PM
CVMagic's Avatar
CVMagic CVMagic is offline
 
Join Date: Dec 2002
Location: USA/Connecticut
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tcs
Nice hack, however I have a problem. I set the max size of an image to 200x200 and the size to 1 mb. I try to upload a file that is 500x400 and vb warns that the image is too big to upload. (Exceeds the 200x200 I set)

I am on VB 2.3.3
I have no other hacks installed in the attachments.php
I ran the Sql quarries and verified there existence in the db
I triple checked the php additions
I have disable GD 2+ and tried enabled as well
I set the imagemagak 2 1 and have the exact path.


It is making a image to the thumbs folder but not the size I told it to. "150x150"
If I up the size of my image allowance it uploads the image and does say "Click here to enlarge" but the image in the thread is the same size as the attached image in the thread.

Hope I explained this well enough. Let me knoe if not.

Chuck
Well Chuck it seems that you had two problems that were not related to this hack at all, the size limit that you set it to limit the size of the upload itself not the thumb so if you upload 500x400 image it might just have been way too big for your settings to allow, now as for the 150x150 image there could be 2 problems, one you have GD disabled or php does not see it at all so it just lets the image pass on because it has nothing else it can do, or the image your uploading itself is smaller than 150x150
Reply With Quote
  #30  
Old 01-29-2004, 06:39 AM
FeKuLa FeKuLa is offline
 
Join Date: Aug 2002
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you help me CVMagic?

In my forum, I obtain any broken thumbnails, look:

http://www.indicedivx.com/foro/showt...threadid=24416

OR

http://www.indicedivx.com/foro/showt...threadid=23930

(You need register for show thumbs. Login: testing, pass: testing)

Thanks
Reply With Quote
  #31  
Old 01-29-2004, 07:18 AM
CVMagic's Avatar
CVMagic CVMagic is offline
 
Join Date: Dec 2002
Location: USA/Connecticut
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've PMed you on your site already with the name: CVMagic, but in anycase if you have blocked out PMs, there might be 2 issues one that the file was somehow interupted during thumbnail generation which your solution would to be just deleting all the thumbs and let the script generate all the thumbs again, if its the second issue til this day gets me which is the your using GD2 it as some problem with some gif files and wont allow it to go beyond reading it at all which then i'd just either recommend disabling gif file uploading or getting Imagemagick or Netphm with gif/jpeg/jpeg2000/png support and using them as your method to thumbnail images...

[edit] There is another method too, actually its a work around if you dont want to install those other 2 programs, it means that those bad gif files will go unresized but hey its alot better than an X no? well here is the code you need to replace:
PHP Code:
    }
    else
    {
    
imagedestory($simg);
    
$dc=0;
  }
 } 
Replace that with:
PHP Code:
    }
    else
    {
    if(
function_exists(imagedestory)){
         
imagedestory($simg);
    }
    
$dc=0;
  }
 } 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:43 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.05177 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete