Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 03-02-2005, 09:41 PM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [REQ] view zip file contents hack

what i need is a viewer that will show all the contents in a .zip file,
so when a user clicks to see whats in the file ( .zip file ) it will list all the contents of it...

look at the pictures

here is a little info HERE or you can look at this script HERE this script let people view a zip file contents as a pop-up window.. This script is called PHPATM = PHP Advanced Transfer Manager witch is a download manager it would also be awsome if some one would intergrade this script into vbulletin ( 3.0.7 ) this hack would be displayed in the " postbit_attachment " template
and useing a collapse image.. so please help me on this as i do think this would be a great hack for those people that have sites with attachments on there sites

the pic's posted here were made as an example of what i would like to have
Attached Images
File Type: jpg files list.JPG (17.1 KB, 0 views)
File Type: jpg files list1.JPG (32.9 KB, 0 views)
Reply With Quote
  #2  
Old 03-03-2005, 05:04 AM
WhSox21 WhSox21 is offline
 
Join Date: Feb 2004
Posts: 328
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I might still have some code laying around here from MyImgs.com when I programed that feature for that site. Do you have the ziplib installed on your server? An alternative way to do what you want would be to unzip the file into a directory and read the files in that directory. I'll do my best to help but I'm pretty busy now with the HelpDesk and just life in general. Hopefully I'll get to this eventually.
Reply With Quote
  #3  
Old 03-03-2005, 08:19 PM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey host dose have ziplib and many others so it will work cause i used phpatm on my server to see if the zip viewer work and it did nicely
Reply With Quote
  #4  
Old 03-05-2005, 03:33 PM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so can any one please help on this hack ?
Reply With Quote
  #5  
Old 03-07-2005, 10:39 PM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can any one please please help me
Reply With Quote
  #6  
Old 03-08-2005, 12:27 AM
why-not why-not is offline
 
Join Date: Feb 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Joe Pimms
can any one please please help me

PHP Code:
<?

// the location of the zip file and its name

/* windows use full path, ie: c:/www/docs/www/docs/test.zip */

$path_file = './http_docs/files/test.zip';

// type to return ( 0 = files array(), 1 = path and files array )

$type = 0;

// usage

$zip = zip_reader ( $path_file, $type );

// dump the results

print_r ( $zip );

function zip_reader ( $file )
{
    $ds = array ();
    $io = zip_open ( $file );

    if ( $io )
    {
        while ( $handle = zip_read ( $io ) )
        {
            $ft = is_zip_dir ( zip_entry_name ( $handle ) );

            if ( $ft[0] )
            {
                if ( $type )
                {
                    $ds[$ft[1]][] = array ( $ft[2], real_size ( zip_entry_filesize ( $handle ) ), real_size ( zip_entry_compressedsize( $handle ) ) );
                }
                else
                {
                    $ds[] = array ( $ft[2], real_size ( zip_entry_filesize ( $handle ) ), real_size ( zip_entry_compressedsize( $handle ) ) );
                }
            }
        }

        zip_close ( $io );
    }

    return ( $ds );
}

function is_zip_dir ( $in )
{
    $out = array ();
    $in = trim ( substr ( $in, strpos ( $in, chr ( 47 ) ) ) );
    $test = substr ( $in, strrpos ( $in, chr ( 47 ) ) + 1 );

    if ( ! empty ( $test ) )
    {
        $out[] = true;
        $out[] = substr ( $in, 0, strrpos ( $in, chr ( 47 ) ) + 1 );
        $out[] = $test;
    }
    else
    {
        $out[] = false;
        $out[] = $in;
        $out[] = '';
    }

    return ( $out );
}


function real_size ( $t )
{
    $out = 0;
    $math = pow ( 10, 2 );

       if ( $t < 1024 )
    {
        $out = $t . ' bytes';
    }
       else if ( $t < 1048576 )
    {
        $out = ( floor( ( $t / 1024 ) * $math ) / $math ) . ' KB';
    }
       else if ( $t < 1073741824 )
    {
        $out = ( floor( ( $t / 1048576 ) * $math ) / $math ) . ' MB';
    }

    return ( $out );
}

?>

C, ya...

Sonia
Reply With Quote
  #7  
Old 03-08-2005, 02:30 AM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for this but how do i use it there is no template edit like the pic i poted so how would this work ?i need it to be able to list a attachment id to open u have it saying to open test.zip
Reply With Quote
  #8  
Old 03-08-2005, 08:57 AM
Arial Arial is offline
 
Join Date: Feb 2005
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sonia? Please check your PM
Thank you.
Reply With Quote
  #9  
Old 03-11-2005, 05:17 AM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey can you explain how this is to work for me please where i need it to be able to look more like or work more like the image i had made to show this hack ?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04385 seconds
  • Memory Usage 2,264KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete