vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Attachments query to get files and thumbnails? (https://vborg.vbsupport.ru/showthread.php?t=96102)

Boofo 09-12-2005 04:31 AM

Attachments query to get files and thumbnails?
 
Can anyone help me translate this to 3.5? I used this on 3.0 and it worked as designed. But something has changed as now attached thumbails show up as files with this query. I want to be able to pull out the amount of images and the amount of files.

PHP Code:

     $attachs=$db->query_first(
        SELECT forum.title AS forum, COUNT(attachment.attachmentid) AS count, SUM(IF(thumbnail = '', 0, 1)) AS thumbs, SUM(IF(thumbnail = '', 1, 0)) AS files, SUM(attachment.filesize) AS bytes 
        FROM " 
TABLE_PREFIX "attachment AS attachment, " TABLE_PREFIX "post AS post, " TABLE_PREFIX "thread AS thread, " TABLE_PREFIX "forum AS forum 
        WHERE attachment.postid = post.postid 
        AND post.threadid=thread.threadid 
        AND forum.forumid=thread.forumid 
        AND forum.forumid=
$forumid 
        GROUP BY thread.forumid 
        ORDER BY count DESC 
    "
); 


Boofo 09-13-2005 09:55 AM

I know this is the part that has changed. Anyone have any idea what I need to change this to to put the img count and files count out of the query?

PHP Code:

SUM(IF(thumbnail ''01)) AS thumbsSUM(IF(thumbnail ''10)) AS files 


lexx27 10-21-2005 09:43 PM

I dont know if we want the same thing. I need a hack that will let me download to my hard drive all the attachments as files!!!


All times are GMT. The time now is 07:18 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.01485 seconds
  • Memory Usage 1,718KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete