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)

???`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.


All times are GMT. The time now is 07:57 AM.

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.01121 seconds
  • Memory Usage 1,759KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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