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

Reply
 
Thread Tools
Thumbnail of Attachments on forum display Details »»
Thumbnail of Attachments on forum display
Version: 1.00, by Dechevious Dechevious is offline
Developer Last Online: Oct 2005 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 12-21-2004 Last Update: Never Installs: 72
 
No support by the author.

This hack has been requested a number of times, for multiple versions of vBulletin. For whatever reason, it was never done (at least publicly) until now. Heres to wishing each and everyone of you a Merry Christmas, and a prosperous, healthy, and safe, New Year!

What it does: This hack will display a thumbnail of the threads attachment on the forum display. Quite useful if you have forums designated for graphics/photos .. etc. Could also be tweaked to display the posters avatar instead of an attachment. Variable possibilities. (Screenshot attached for further review) and or see it in action at this forum in realtime. If the thread has multiple attachments, it will display the first. If no attachment, a 'no attachment' thumb will appear. Can be assigned for use in any forum you wish it to be active in.

Install time is minimal - Less than 5 minutes for the average joe. (Simplicity at it's Finest)
1 file to modify, and 1 template to modify, along with the upload of an image.

Known Issues: If the attachment is not an image, a thumbnail will not be shown. (IE: .zip or .rar)

If you install it, please click the 'Install' icon - Updates will be sent to those who do.

Supporters / CoAuthors

Show Your Support

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

Comments
  #52  
Old 01-03-2005, 08:13 AM
gkar gkar is offline
 
Join Date: Sep 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Delphy, thanks but I have the same problem, I've installed this hack:

Quote:
MOD: Modified Thumbnail In Forum Display
By: delphy@modthesims2.com

Original MOD: Thumbnail to be displayed in the Forum Display - For vBulletin v3.0.3
By: idolpx & dechevious (idolpx@email4life.com) - Need custom work? E-Mail Me!
Date: December 20th, 2004

Description: If a post has a photo attachment, it will be displayed on the Forum Display.
You can click on the thumbnail to bypass the post itself, and go directly to
the full sized image (if you wish).

This hack modifies the original Thumbnail In Forum Display to accomodate threads
where the first attachment is not an image file. It does this by compiling a list
of posts, querying the attachment table and selecting the *last* image file

Details: The thumbnail size is based upon your default settings in your AdminCP.
You can further resize the thumbnail for the 'universal look' with simple
'height = xx' and width = 'xx' in the template. Thats your call.

Changes: Make changes to forumdisplay.php and 1 Change to template: threadbit
(The forumdisplay.php you wish to alter is in your root forums directory)

Notes: This adds 1 extra query to your forumdisplay page
Thanks: To idolpx and dechevious for the original hack
all in a fresh forumdisplay.php but when I go to the post, everyone has dissapear, in all forums. Take a look at the attachment, there you can view everything has gone away, and there are 96 pages of post, no one of then are visible, any help would be great. Thanks a lot.
Reply With Quote
  #53  
Old 01-03-2005, 02:31 PM
Aceman's Avatar
Aceman Aceman is offline
 
Join Date: Mar 2002
Location: Virginia, USA
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this hack fully functional on my site which you can see running here.

http://www.scifi-meshes.com/forums/forumdisplay.php?f=6

Using conditionals I was able to add "ads" column in specific forums, that's not part of this hack. I've also modified this code so that the image shown on forumdisplay links to the thread NOT the attachment. I found this more useful.

Below you will find a copy of code I used to link to THREAD and not the attachment - threadbit template:

Code:
<a HREF="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]"><img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" border=0></a>
Hope this helps someone.
Aceman
Reply With Quote
  #54  
Old 01-03-2005, 10:45 PM
alkatraz alkatraz is offline
 
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 384
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Delphy: works perfect! thanks!!!

Is there a way to strip ' and " from the title? I put up a note saying not to type those but my members can't read apparently and keep getting errors. (when the script ads the forum info to the db)
Reply With Quote
  #55  
Old 01-04-2005, 01:45 AM
Delphy Delphy is offline
 
Join Date: Dec 2004
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

alkatraz,

Do you mean when they add posts in those forums, or what? I'm sorry I don't know what you mean...

Aceman, yeah I find linking to the actual thread much better too
Reply With Quote
  #56  
Old 01-04-2005, 01:59 AM
alkatraz alkatraz is offline
 
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 384
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When the script creates a new thread in a forum,

PHP Code:
INSERT INTO " . TABLE_PREFIX . "thread(titlelastpostforumidopenreplycount,
                                
postusernamepostuseridlastposterdatelineiconidvisibleattach)
                                
VALUES
                                        
('$ad_type $ad_title '" . TIMENOW . "$formforumid,
                                         
10'" . addslashes($bbuserinfo['username']) . "'$bbuserinfo[userid],
                                         
'" . addslashes($bbuserinfo['username']) . "'" . TIMENOW . "01,
                                         
0)
                        
"); 
an error occurs if a member has posted a ' in the thread title.

I'd like to process $ad_title (the var. i've used for the title) to strip out ' and " or any characters that could cause a problem.

doing some research into it, the trim function might do it
http://ca.php.net/trim

Think this would remove ' ? How would I remove "?
trim($ad_title, " ' ");
Reply With Quote
  #57  
Old 01-04-2005, 02:21 AM
Delphy Delphy is offline
 
Join Date: Dec 2004
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

alkatraz,

Neither mine nor the original hack contains that code, so you're looking at a problem which isn't related to this thread.

What you probably want, btw, is $ad_title = html_entities($ad_title, ENT_QUOTES)

Hope this helps
Reply With Quote
  #58  
Old 01-04-2005, 03:02 AM
alkatraz alkatraz is offline
 
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 384
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol wrong thread, my bad!
forgot i was dealing with this thread:
https://vborg.vbsupport.ru/showthread.php?t=66082 (which is a perfect addition to this thumbnail browsing script)
Reply With Quote
  #59  
Old 01-04-2005, 06:46 AM
memobug memobug is offline
 
Join Date: Jun 2002
Posts: 418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Aceman
I have this hack fully functional on my site which you can see running here.

http://www.scifi-meshes.com/forums/forumdisplay.php?f=6
Hi Aceman,

You might want to move the image display into a template conditional if you don't have attachments enabled for guests. Otherwise your page becomes a column of red Xs separated by the occasional THUMBNAIL NOT AVAILABLE.

(log out of your forum and check your link)

Regards,

Matt
Reply With Quote
  #60  
Old 01-04-2005, 03:44 PM
Aceman's Avatar
Aceman Aceman is offline
 
Join Date: Mar 2002
Location: Virginia, USA
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the heads up Memobug. I'll use a if not registered conditional to remove the thumbnail column or something.. haven't figured it out yet.

I guess it would have helped to logout and see what the visitors see.

Aceman
Reply With Quote
  #61  
Old 01-04-2005, 04:32 PM
Aceman's Avatar
Aceman Aceman is offline
 
Join Date: Mar 2002
Location: Virginia, USA
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MemoBug -

I fixed this oversite by modifying the could to see if the member/guest is registered or not. IF they are not the message, "Only Registered Members can view thumbnails" shows, IF they ARE the thumbnail shows up. This is the code for the <TR> that I used.

This is just the code for the table cell that shows the thumbnail.
Code:
<td class="alt2" align="center" valign="middle">
			<if condition="$displaythumbs">
			     <if condition="$thread['attachmentid']">
				         <if condition="$bbuserinfo[userid] == 0">
						 	<span class="smallfont"><b>Only Registered Members can view thumbnails.</b></span>
						 <else />
			     			<a HREF="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">	
			          			<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" border=0>
			        		</a>
						</if>
			     <else />
			        <img src="$stylevar[imgdir_misc]/nothumb.gif" width=100 height=75 border="0">
			     </if>
			<else />
			     <img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" Border="0">
			</if>
		</td>
I hope this helps people.
Aceman
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 05:26 AM.


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.05554 seconds
  • Memory Usage 2,332KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)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
  • (1)pagenav_pagelinkrel
  • (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