vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   attachmenttype and extension and mimetype (https://vborg.vbsupport.ru/showthread.php?t=101200)

Moodeey 11-20-2005 06:38 AM

attachmenttype and extension and mimetype
 
im lost on a vbmod that im doin im not sure what the line of code would be for this idea i have in mind...

what im doin is im trying to make a .zip viewer mod where a user could click on a drop down and view the contents of a .zip file (Attachment) this mod uses the "postbit_attachment" template and showthread.php file..

my question is how would i just call a query for just .zip files only ?

please help

Marco van Herwaarden 11-20-2005 06:53 AM

You could select on the extension column.

Moodeey 11-20-2005 06:54 AM

what do u mean ?

Marco van Herwaarden 11-20-2005 07:00 AM

[sql]SELECT * FROM attachement WHERE extension = 'zip';[/sql]

Moodeey 11-20-2005 07:10 AM

thanks just one more thing how would i call the attachmentid for the .zip file ? or each zip file ?

would this work ?

PHP Code:

$DB_site->query("SELECT * FROM attachement WHERE extension ='zip' ORDER BY id"); 


Marco van Herwaarden 11-20-2005 08:17 AM

Are you coding for 3.0 or 3.5?

Moodeey 11-20-2005 08:26 AM

only for 3.0.X

Marco van Herwaarden 11-20-2005 08:39 AM

Then there is no extension column, you would need to determine the type yourself.

Maybe with a:
[sql]SELECT attachmentid FROM attachment WHERE filename LIKE '%.zip';[/sql]

Moodeey 11-20-2005 05:43 PM

well here is the start of the code here

PHP Code:


header
('Content-Type: text/html; charset=windows-1256');
$dir $DOCUMENT_ROOT.dirname($PHP_SELF);
$file ' WHAT DO I PUT HERE ';
$zip zip_open($dir.'/'.$file); 

where do i put the query ?


All times are GMT. The time now is 03:54 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.01797 seconds
  • Memory Usage 1,720KB
  • 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
  • (9)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