The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Thumbnail of Attachments on forum display Details »» | |||||||||||||||||||||||||||
Thumbnail of Attachments on forum display
Developer Last Online: Oct 2005
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
|
Comments |
#52
|
|||
|
|||
Delphy, thanks but I have the same problem, I've installed this hack:
Quote:
|
#53
|
||||
|
||||
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> Aceman |
#54
|
|||
|
|||
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) |
#55
|
|||
|
|||
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 |
#56
|
|||
|
|||
When the script creates a new thread in a forum,
PHP Code:
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, " ' "); |
#57
|
|||
|
|||
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 |
#58
|
|||
|
|||
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) |
#59
|
|||
|
|||
Quote:
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 |
#60
|
||||
|
||||
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 |
#61
|
||||
|
||||
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> Aceman |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|