![]() |
Thumbnail of Attachments on forum display
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. |
Nice idea... I assume this adds only 1 query to forumdisplay?
|
Quote:
|
does this require image software to be running on the server, ie GD image?
|
Quote:
|
how come u released this - considering i just paid for it 2 days ago ?? - it was supposed to of been a custom paid hack ?
Also the files ive downloaded here are the exact as i have from the paid hack In the readme file it says `Notes: THIS IS A CUSTOM HACK - DO NOT REDISTRIBUTE IT PLEASE!` Also it has faults - if a rar or zip is attached and not an image u end up in forum display a red X - and so far is no known way to fix it. If u add multiple attachemnts it used to show all the attachments as seperate posts but not sure if fixed in your version as i was sent an addon to fix this. Edit ok read the txt file and seems u was the author - but i bet aint the only one to of paid for this - this week.Paid 2 days ago - 2 days later its released lets see if anyone else fell for it. |
This was always meant to be released. It was a bought hack, the expense was shared, and then it was to be released. Sorry if you felt otherwise, as it was never an issue.
|
A simple yet great hack, thanks for sharing Dechevious :)
|
How does it handle multiple attachments? For example if someone posted 5 images on a single posting.
//edit - Also, what about other images posted in the thread besides the first post? Are they displayed somehow as well? |
Quote:
Quote:
|
I'm having a problem getting the thumbnails to display, and I'm not sure where to look to troubleshoot. The thumbnails display fine in the post, and I have set the forum id in the forumdisplay file. It's showing thumbnail not available for threads without attachments (I believe it's threads that have a threadicon).
I tried removing the last else bit, that shows the threadicon if there is no attachment. Also tried rebuilding thumbails. Any suggestions? http://buffy-boards.com/forumdisplay.php?f=19 Edit: I discovered the problem - it was that I needed to have a default icon enabled for the forum. I don't have any idea why that makes a difference...lol...but it does :) |
Quote:
|
Thanks for this! I tried for the longest time to code it myself but lol, not a coder :D
I think maybe if you have no set default icon (via your admincp options), you just need to rearrange the conditional in the threadbit template in order to get it to work without having a threadicon specified. Like move that '<if condition="$show['threadicon']">' bit. But I haven't played around with that or anything so I don't know. Edit: Okay, yes, if you have no default post icon selected in your admincp, I used this code for the threadbit template and it works: Code:
<!-- Start: idolpx and dechevious Thumbnail in Forum Display Hack - 20041220 --> |
Is there a way to check the attachment for its extension ?
Wondering how to get round the non image attachment situation. |
oh wow! something i've been dreaming for months... I'll install it once my host move is over :P
|
This looks good and I could certainly use it on my forums (http://www.modthesims2.com/)
One thing though I need clarifying: It's mentioned that it takes the first attachment.. what if the first attachment is not an image? Does it display no attachment available? If so, then would there be a way of looping until it does get the first image available only in the first post on the thread? I'm guessing this would add another query though. Regards, Delphy |
Quote:
|
Okay thanks for the reply. I've had a few thoughts about how to achieve this with the minimum of queries, so I'll take a look at the hack :)
|
Nice, already had it running at http://www.pagodentreff.de/diskussio...splay.php?f=22 but I never released it because I thought nobody will ever use it :)
Mine chooses randomly from any picture which is attached to the first post. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
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']"> |
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; - I have to add 1 extra query per forumdisplay page, which is: Code:
// Added by Delphy to add proper thumbnails 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 |
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 |
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. |
lasto, I was probably modifiying it again :)
mhobelsb, using the actual proper hack or my one? |
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
|
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 |
done it right got no errors but even if i upload a pic i still get the No thumbnail is available
|
lasto, give me a link to the forum where you did my version of the hack and I'll take a look.
|
@delphy: just tried your version and, very strange, if i lock now in that forum it says "no entrys in that forum". (but in the stats it still counts the posts and threats)
also tried the one from dechevious and with that i have the problem that the "no thumb pic" is shown but the real thumbs are just red crosses. :) i want this so much. hope you guys continue work! :) thank you... Martin |
Are you using table prefixes at all? The quick text file I wrote up didn't have prefixes, so you'll need to edit the SELECT ... FROM attachment to include that.
Sounds like an error in the main SELECT $votequery $previewfield query. The only addition I make is the thread.firstpostid field. Remember, to install my version you need to REMOVE all traces of the previous thumbnail hack. |
ah, yes i used a table prefix. cool, will try it. thanks!!!!
Martin |
mhmm... somehow it still donĀ“t work. (maybe i just did the prefix wrong. i have 3dmodeling_ as prefix.. .maybe you can help)
i used a backuped file so there is nothing from previous thumbnail hack... sorry, maybe i just do something wrong Martin |
Nah it's probably my fault - I wrote up the text file stupidly early in the morning :)
Any chance I could have a look at your modified forumdisplay? |
wrote you a pm with the link. thanks so much for your help and time!
Martin |
Replied with fix and updated the original text file :)
|
wot was it m8 does the whole hack need redoing or just the forumdisplay bit ?
|
All times are GMT. The time now is 04:50 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|