vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Thumbnails of Attachments on Forum-Display (https://vborg.vbsupport.ru/showthread.php?t=92565)

Harald_T 07-19-2005 10:00 PM

Thumbnails of Attachments on Forum-Display
 
Foreword:

This is the old hack of Dechevious, i only changed it to work under 3.5.0 Beta 3.

I've used this hack, to build a gallery for my forum.

You'll need the icon for no Thumbs from Dechevious hack, so be sure
to check his hack out, too.

tamarian 07-20-2005 07:25 PM

I never saw the original hack, but this is amazing:

http://www.scifi-fan.de/forumdisplay.php?f=60

Well integrated to look like the other galleries, but it is a real vB forum URL :up:

I don't think you need to edit global.php though, that portion can be written in forumdisplay.php, or made as a plugin to the forumdisplay_start hook.

Harald_T 07-20-2005 07:30 PM

I've just made it, because i want to administrate the gallery through the AdminCP (as soon, as i found out, how...)

Oh, and don't mind, that in my gallery some pictures are missing. I had a little forum crash these days and i'm busy on building it up again.

Harald_T 07-20-2005 07:38 PM

I'll release the gallery-hack soon, btw.

ohgenki 07-21-2005 04:36 PM

excellent ! i will wait for this hack !

alkatraz 07-22-2005 03:30 AM

works great for classifieds

thanks!

Harald_T 07-25-2005 04:15 PM

I've tested my gallery so far. Works good. You can now define by setting an option, which forum is used as a gallery. So no need for the forumid's any longer.

I will write the install-text now and release it later on this evening, i hope.

tamarian 07-25-2005 04:24 PM

Harald, you're getting closer to what might be one of the most important hacks :) Looking forward to the gallery hack.

Harald_T 07-25-2005 04:32 PM

Oh, don't excpect too much for the beginning. Of course there are some things, which still have to be done, but if your looking at my website, you can see, how far i have come. It works fine so far, but as i said, there are still a lot of things to do. But it's a start.

mooj 07-31-2005 02:06 PM

Harald_T

could you add ( display the last 5 Thumbnails from X forum ) on the forum home .

moreover,
we can use a specific variable to display the last x Thumbnails from xx,xx forums on (forum index ) ??

it would be very effective gallery mod with 100% vb integration :)

--------------------------
take an example (IPB):
http://www.lifejourney.com.sa/community/

its desplaying the last 4 Thumbnails from ( forum # 143 ) which is for ( digital arts )
(AND )
desplaying the last 4 Thumbnails from ( forum # 144 ) which is for ( Photography images )
--------------------------

I PM'ed him and he said that the mod is quite simple .. 2 Queries to get the thumbnails and some changes in (forumhome_forumbit_level2_post) :rolleyes:

can you add this feature to the mod .. ??

:)

Harald_T 07-31-2005 02:11 PM

I'm already working on something like this for my gallery-hack.

mooj 07-31-2005 02:43 PM

Good work Harald_T ..
and im glad to see your gallery .. :)

keep on going .. ;)

Andreas 08-01-2005 12:03 PM

Nice Hack. But you might want to consinder releasing it as a Plugin to avoid File Edits:

Hook: forumdisplay_query
PHP Code:

if (in_array($forumid, array(XXYY))
{
    
$hook_query_fields .= ", attachment.attachmendid AS attachmentid";
    
$hook_query_joins .= " LEFT JOIN " TABLE_PREFIX "attachment as attachment ON (attachment.postid = thread.firstpostid)";


To make it even more Userfriendly, you could add a setting Show Attachment Thumbnails to Forum Manager, so Users could easily turn this On/Off for individual Forums.

Harald_T 08-01-2005 04:08 PM

This is a great idea.

If you allow, i will try to add the query to my gallery-hack.

Andreas 08-01-2005 04:44 PM

Feel free to use it :)

Harald_T 08-01-2005 04:58 PM

Besides a little typpo it works fine

attachment.attachmendid must be attachment.attachmentid

Andreas 08-01-2005 06:52 PM

Wonder how this happened ^.^

???`S?LV?R???` 09-16-2005 10:40 AM

Quote:

Originally Posted by KirbyDE
Nice Hack. But you might want to consinder releasing it as a Plugin to avoid File Edits:

Hook: forumdisplay_query
PHP Code:

if (in_array($forumid, array(XXYY))
{
    
$hook_query_fields .= ", attachment.attachmendid AS attachmentid";
    
$hook_query_joins .= " LEFT JOIN " TABLE_PREFIX "attachment as attachment ON (attachment.postid = thread.firstpostid)";


To make it even more Userfriendly, you could add a setting Show Attachment Thumbnails to Forum Manager, so Users could easily turn this On/Off for individual Forums.

I could not get this to work

I got this error on top of the page:
Parse error: parse error, unexpected '{' in /var/www/html/message_board/forumdisplay.php(799) : eval()'d code on line 2

and this one as the vbulletin message:
Unable to add cookies, header already sent.
File: /var/www/html/message_board/forumdisplay.php(799) : eval()'d code
Line: 2

Harald_T 09-18-2005 09:20 AM

Quote:

attachment.attachmendid AS attachmentid
Did you see the little typpo? It has to bee attachment.attachmentid, not attachment.attachmendid

mhobelsb 09-19-2005 08:42 AM

hi Harald_T,

really nice addon. i already use it in my forum and for sure want to use it as soon as the gold is released. any chance that you change it to work as plugin? would really love that. not that the file changes are big, but it would make updateing much easier. :)

thanks again for the good work

martin

ps.: don?t really get there to use the Query of KirbyDE. maybe i am just not really awake. :)

???`S?LV?R???` 09-25-2005 09:36 PM

Quote:

Originally Posted by mhobelsb
hi Harald_T,

really nice addon. i already use it in my forum and for sure want to use it as soon as the gold is released. any chance that you change it to work as plugin? would really love that. not that the file changes are big, but it would make updateing much easier. :)

thanks again for the good work

martin

ps.: don?t really get there to use the Query of KirbyDE. maybe i am just not really awake. :)

having it as a plugin would definitly make it easier

Andreas 09-27-2005 05:55 PM

Here is the Plugin (which is just a Copy&Paste of the Code I posted earlier ...)

Note: It must be edited: 1, 2 ,3 has to be replaced with the Forumids where you want to activate this.

But as said above, I still think the best thing would be if the was a setting in Forum Manager to easily turn this on/off without having to edit the code.

Harald_T 09-27-2005 08:32 PM

Sorry, hadn't much time the last days. I think, i've also already made an plugin.

@Kirby: Nice Idea. I'll look after it.

MrNase 10-01-2005 08:43 AM

Quote:

Originally Posted by KirbyDE
Here is the Plugin (which is just a Copy&Paste of the Code I posted earlier ...)

Note: It must be edited: 1, 2 ,3 has to be replaced with the Forumids where you want to activate this.

But as said above, I still think the best thing would be if the was a setting in Forum Manager to easily turn this on/off without having to edit the code.

Doesn't seem to be working with vB3.5 :(

Some threads appear twice, some are even listed three or four times..

GrendelKhan{TSU 10-01-2005 10:21 AM

anyone else try this for 3.5?

I want to install it but wanna see if its ok. :)

Adek 10-01-2005 04:03 PM

Yes. It has small bug. Thumbnails are from first post in thread and if first post has more than one attachment, there are more than one thread.

mhobelsb 10-02-2005 05:01 PM

yes, same here. anyone a idea to fix that?

eXtremeTim 10-02-2005 05:15 PM

Then we just need a group by if their isnt one but it sounds like he needs to add a group by into the query. :)

Adek 10-06-2005 09:33 PM

Yes, that's right. We need to add "GROUP BY" and one "iff" to the SQL query.

my code (in forumdisplay.php)

PHP Code:

// gallery hack

    
if (in_array($forumid$forumids)) {
                
$displaythumbs true;
        }

    
$sql_threads "
        SELECT 
$votequery $previewfield
            thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, replycount, postusername, postuserid, thread.iconid AS threadiconid,
            
$lastpost_info, thread.dateline, IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, sticky, votetotal, thread.attach "
            
iif($displaythumbs == true", attachment.attachmentid AS attachmentid ")
            . 
iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed"
            . 
iif($deljoin", deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason")
            . 
iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], ', threadread.readtime AS threadread') . "
        FROM " 
TABLE_PREFIX "thread AS thread 
            
$deljoin
            " 
iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " TABLE_PREFIX "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " $vbulletin->userinfo['userid'] . ")") . "
            " 
iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " TABLE_PREFIX "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " $vbulletin->userinfo['userid'] . ")") . "
            
$previewjoin 
            " 
iif($displaythumbs == true"LEFT JOIN ".TABLE_PREFIX."attachment as attachment ON(attachment.postid = thread.firstpostid) "). "
            
$tachyjoin
        WHERE thread.threadid IN (0
$ids)" 
             
iif($displaythumbs == true"GROUP BY attachment.postid ") ."
        
        ORDER BY sticky DESC, 
$sqlsortfield $sqlsortorder
    "
;
    
$threads=$db->query_read($sql_threads);


    
//end of gallery hack 

Check it :)

Adek 10-16-2005 01:46 PM

sorry, there are still bugs in my code.

rharbison 11-06-2005 07:46 PM

Any progress on fixing the bugs? Looks like a really good plugin

Adek 11-06-2005 07:52 PM

Yes. Here you have correct code:

PHP Code:


// gallery hack (fixed by adek)

    
if (in_array($forumid$forumids)) {
                
$displaythumbs true;
        }

    
$sql_threads "
        SELECT 
$votequery $previewfield
            thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, replycount, postusername, postuserid, thread.iconid AS threadiconid,
            
$lastpost_info, thread.dateline, IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, sticky, votetotal, thread.attach "
            
iif($displaythumbs == true", attachment.attachmentid AS attachmentid ")
            . 
iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed"
            . 
iif($deljoin", deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason")
            . 
iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], ', threadread.readtime AS threadread') . "
        FROM " 
TABLE_PREFIX "thread AS thread 
            
$deljoin
            " 
iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " TABLE_PREFIX "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " $vbulletin->userinfo['userid'] . ")") . "
            " 
iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " TABLE_PREFIX "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " $vbulletin->userinfo['userid'] . ")") . "
            
$previewjoin 
            " 
iif($displaythumbs == true"LEFT JOIN ".TABLE_PREFIX."attachment as attachment ON(attachment.postid = thread.firstpostid) "). "
            
$tachyjoin
        WHERE thread.threadid IN (0
$ids) GROUP BY thread.firstpostid
        ORDER BY sticky DESC, 
$sqlsortfield $sqlsortorder
    "
;
    
$threads=$db->query_read($sql_threads);

    
//end of gallery hack 

Now. Even after update to 3.5.1 everything looks great :)

rharbison 11-06-2005 08:48 PM

Works great, and I really like it.

One question / suggestion... How do I make this work in the search results? I see they use the threadbit template, but it doesn't show the icons. I'd like to show the thumbnails, even if they show up for all forums.

Any suggestions on how to do that?

rharbison 11-07-2005 02:16 AM

My members love this! It's getting great reviews.

One question... How does it decide which image to show? It usually, but not always, shows the first image. Sometimes it's the second or third. Any idea how/why that happens?

Also, <beg>PLEASE</beg> somebody tell me how to do this with the "new post" and "today's post" searches. I think it would be very useful!

fabianv 11-14-2005 09:44 PM

Harald_T, how would I make this work together with your other Gallery hack release but on seperate areas?

Theyre both so good, wish they worked together.. when Install both and I try use this one it just looks like your other gallery release which I dont want for that specific area.. just want thumbnails :P

reply would be great

Harald_T 11-15-2005 01:25 AM

I'll look after this tomorrow.

Edit: The problem is based on the way the gallery-hack was build up. Wait for the next version (i hope this night), then the problems should be removed.

fabianv 11-15-2005 05:22 PM

You are a star!!

I will be waiting in suspense! :D

Thank you Thank you Thank you!!!!!

my forum , http://forum.cgcentral.net

Its launched yesterday so its under beta... what will basically happen is under the gallery section the first 3 forums will just be thumbnail.. and the last one (awards) will be that great gallery with the new works on the main page.

Cant wait for your release.. told my friends and they also cant wait! :D

fabianv 11-16-2005 08:08 PM

when its done please notify in this thread or email me.. i'll put it to good use..

Harald_T 11-18-2005 11:18 AM

The new version of my gallery is up now. Try it out.

fabianv 11-18-2005 11:07 PM

Quote:

Originally Posted by Harald_T
The new version of my gallery is up now. Try it out.


Harald I have 2 questions:

1) I installed the new version but now am wondering why when I view my gallery it shows the blocks and everything but no thumbnail at all.. not even on the front page, nowhere.. I added the image as an attachment; why isnt this working?

2) So now I will be able to install both gallery codes?


All times are GMT. The time now is 04:47 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
  • Page Generation 0.01375 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete