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 |
#22
|
|||
|
|||
Quote:
|
#23
|
|||
|
|||
Quote:
|
#24
|
|||
|
|||
Quote:
|
#25
|
|||
|
|||
Sure
I use the following code: PHP Code:
ORDER BY rand() LIMIT 1 tells him to output a randomly chosen attachment. Together with the following conditional in the threadbit -Template it generates this beautiful gallery HTML Code:
<if condition="$show['threadicons']"> <td class="alt2"> <if condition="$foruminfo[forumid] == 22 AND $hasthumbnail"> <img src="attachment.php?attachmentid=$attachmentid&stc=1&thumb=1" /> <else /> <if condition="$show['threadicon']"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else /> </if> </if> </if> |
#26
|
|||
|
|||
Okay I've been working on the problem of displaying images regardless of whether the first attachment is an image or not.
The solution I came up with is as follows: - Keeping the existing $threads SQL query, add the following into it: thread.firstpostid - Add the following: Code:
$displaythumbs = false; $forumids = array(41, 42, 43, 44, 45, 46, 47, 48, 49, 69, 70, 40, 50, 51, 52, 97, 98); if (in_array($forumid, $forumids)) { $displaythumbs = true; } - I have to add 1 extra query per forumdisplay page, which is: Code:
// Added by Delphy to add proper thumbnails if ($displaythumbs == true) { while ($thread = $DB_site->fetch_array($threads)) { // AND $counter++<$perpage) $imageposts .= $thread['firstpostid'].","; } if ($imageposts != "") { $imageposts = substr($imageposts, 0, strlen($imageposts) - 1); $sql_images = "SELECT DISTINCT postid,attachmentid FROM attachment WHERE postid IN (0$imageposts) AND thumbnail_dateline > 0"; $images = $DB_site->query($sql_images); while ($image = $DB_site->fetch_array($images)) { $thumbnails[$image[postid]] = $image[attachmentid]; } $DB_site->free_result($images); unset($imageposts, $image); } } Find: Code:
while ($thread = $DB_site->fetch_array($threads)) Code:
$threads = $DB_site->query($sql_threads); Code:
$thread['attachmentid'] = $thumbnails[$thread['firstpostid']]; Hope this helps somebody, Regards Delphy |
#27
|
|||
|
|||
any chance of a text file doingthe full install but with these modifciations added because not everyone has added teh 1st version
also m8 the demo on your site gives this error Unable to add cookies, header already sent. File: /home/forums/public_html/forumdisplay.php Line: 806 |
#28
|
|||
|
|||
mhmm... nice hack!
but i have a "problem". the nothumb image is displayed but the thumbs are not displayed. get a red cross... where do i set the default icon via admincp? i don?t find the option... gd2+ is installed and thumbnails are on. |
#29
|
|||
|
|||
lasto, I was probably modifiying it again
mhobelsb, using the actual proper hack or my one? |
#30
|
|||
|
|||
ive removed the attachment hack and will wait for u to do yours delphy as mine is showing red x`s if a rar is added as an attachemnt and it deffos needs a fix
|
#31
|
|||
|
|||
Okay I've written up a text file in the style of the original, let me know if something doesn't work.
Updated 29th December at 5pm GMT to fix table prefixes and add a line I'd missed out from my original. Should work now Regards, Delphy |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|