Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 10-13-2002, 07:27 AM
roxics's Avatar
roxics roxics is offline
 
Join Date: Jan 2002
Location: Detroit Area
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Easy Image Gallery

It's just an idea and I don't know how possible it is but...

So you have a forum with a list of threads. Those threads are labled with titles (text). You go into the thread and there is a picture that was attached using the "attach file" option. The board is set to display that picture. Hey great people can see the picture and comment on it too.

Now what if instead of having the text title the system automatically created a thumbnail of that picture to diplay in the thread view.

Now when you go to that forum there is a list of thumbnails going down the screen instead of thread titles. Click on the thumbnail and it takes you to that post where the picture shows up.

Hey now that forum is an image gallery.

What do you think? Can anyone do it? Is it possible?
Reply With Quote
  #2  
Old 10-13-2002, 11:52 PM
Dmitriy Dmitriy is offline
 
Join Date: Jun 2002
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would require installing some type of image manipulation software on the server, either GD, or image magic (probably the best choice) or gimp, but sure, this can be done.
Reply With Quote
  #3  
Old 10-14-2002, 12:21 AM
Eander Eander is offline
 
Join Date: Mar 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Dmitriy
This would require installing some type of image manipulation software on the server, either GD, or image magic (probably the best choice) or gimp, but sure, this can be done.
Nah, you wouldn't need that stuff. I'll work on this and post something up.

Ok so I lied. You will need GD. However, most versions of PHP nowadays come with it already. If you don't have it, beg your host to install it.


You need to find this near line 630 in forumdisplay.php:

PHP Code:
    eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";"); 
And right before it put this:

PHP Code:
if ($forumid==xxxxx) {
    
$checkquery=$DB_site->query_first("SELECT postid FROM post WHERE threadid=$thread[threadid] and username='$thread[postusername]' ORDER BY dateline ASC");
    
$avurl="http://www.yourdomainhere.com/forums/attachment.php?postid=" $checkquery['postid'];
    
$sizes getimagesize($avurl);
    if (
$sizes) {
        
$newwidth=$sizes[0];
        
$newheight=$sizes[1];
        if (
$sizes[0] > 100) {
            
$newwidth=100;
            
$diff=$sizes[0]-100;
            
$rat=100/$sizes[0];
            
$newheight=$sizes[1]*$rat;
        }
        
$imagethumb="<img src=\"./attachment.php?postid=" $checkquery['postid'] . "\" width=" $newwidth " height=" $newheight "><br>";
    }

Replace xxxxx with the forumid that you wish to have set as an image gallery. Replace http://www.yourdomainhere.com/forums/ with the path to your vbulletin directory.

The last thing you'll need to do is edit your forumdisplay template finding this string:

Quote:
<td bgcolor="{firstaltcolor}" align="left" width="70%"><normalfont>$thread[gotonew] $paperclip$thread[movedprefix]$thread[typeprefix]<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a></normalfont> <smallfont>$thread[pagenav]</smallfont></td>
and changing it to this (changes underlined)

Quote:
<td bgcolor="{firstaltcolor}" align="left" width="70%"><normalfont>$imagethumb $thread[gotonew] $paperclip$thread[movedprefix]$thread[typeprefix]<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a></normalfont> <smallfont>$thread[pagenav]</smallfont></td>
That should do it. Hope this is what you wanted. Also, I made it so if the first person that posts doesn't attach an image it doesn't try to show a thumbnail. Enjoy!
Reply With Quote
  #4  
Old 10-15-2002, 08:55 AM
roxics's Avatar
roxics roxics is offline
 
Join Date: Jan 2002
Location: Detroit Area
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for doing this. Unfortunately for me it doesn't seem to work.

http://ve.roxics.com/board/forumdisp...?s=&forumid=11

Is it because there is no GD installed on the server? How would I know? What is GD exactly?

BTW where you said you have to change the "forumdisplay" template it's actually the "forumdisplaybit" template.
Reply With Quote
  #5  
Old 10-15-2002, 09:05 AM
roxics's Avatar
roxics roxics is offline
 
Join Date: Jan 2002
Location: Detroit Area
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also just out of curiousity, would there be a way to make it work with multiple forums to have multiple galleries?
Reply With Quote
  #6  
Old 10-15-2002, 10:22 PM
Eander Eander is offline
 
Join Date: Mar 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by roxics
Thanks for doing this. Unfortunately for me it doesn't seem to work.

http://ve.roxics.com/board/forumdisp...?s=&forumid=11

Is it because there is no GD installed on the server? How would I know? What is GD exactly?

BTW where you said you have to change the "forumdisplay" template it's actually the "forumdisplaybit" template.
Yeah, the only thing that I could see for it not to be working would be that you don't have GD installed. As you can see in the php, if $sizes isn't defined it won't declare the $imagethumb variable that is called for in the template. The only reason for $sizes not to be set is if you don't have GD. The only real way I can think of is try making a php file with just <? phpinfo(); ?> and see if it says anything about GD being installed. If it doesn't, look for the version of PHP you're running, and if need be upgrade to the newest version. If all else fails contact your host, asking if they have the GD module of PHP installed. Hope this helps. :\
Reply With Quote
  #7  
Old 10-15-2002, 11:11 PM
Dmitriy Dmitriy is offline
 
Join Date: Jun 2002
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question for Eander: even if the PHP has a GD support, what if the GD support only comes with libpng? Whould it still be able to re-size the gif and jpeg images?

I don't think GD has any support for GIF at all.
Reply With Quote
  #8  
Old 10-16-2002, 10:15 PM
Eander Eander is offline
 
Join Date: Mar 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

GD isn't actually resizing it. All it's doing is getting the sizes by the getimagesize() command, then adding a width="xxx" height="xxx" parameter to the <img> tag. It's all IE doing the resizing, but the numbers it is resized to are determined by GD.
Reply With Quote
  #9  
Old 10-17-2002, 12:52 AM
Dmitriy Dmitriy is offline
 
Join Date: Jun 2002
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see

Well, you don't need GD to have the getimagesize function to work. In fact, this function is used in several files in vbulleting.

If you just change the height and width attributes of the image, it's not the same as re-sizing the image itself.

Also, in order to do what was originally requested in this tread, you must create thumbnail images at the same time an image is uploaded and store them somewhere separately, you can't just create thumnail images in real-time, it will take too much time.
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07548 seconds
  • Memory Usage 2,247KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete