Activity Stream
48,167 MEMBERS
61104 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1.     
    #11
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    Do you mean one gz contains many files? or may gzips contain one file each?

    If they each have one file, you just loop through them or stick them in an object.

    for example, off the top of my head:

    PHP Code: 
    $files = array('some.gz''file.gz''made.gz''up.gz');

    function 
    hostImage($filename) {
        
    $file gzfile($filename);
        
    $file implode("\n",$file);

        
    $matches = array(
            array(
    'rapidshare.png''[url=http://rapidshare'),
            array(
    'megaupload.png''[url=http://megaupload')
        );

        
    $image 'none.png';

        foreach(
    $matches as $match) {
            if(
    strpos($file$match[1]) !== false) {
                
    $image $match[0];
                break;
            }
        }

        return 
    $image;
    }

    foreach(
    $files as $file) {
         
    $image hostImage($file);
         
    // do other things here

    It'd be nicer class based now I believe, because having the array of strings to match inside the function isn't ideal.

    Also, this will return 'none.png' if nothing is found.
    Projects:
    WCDDL - The Professional DDL Script
    Top Secret Project: In Development - ZOMG
    ImgTrack - Never Have Dead Images Again!

  2.   Sponsored Links

  3.     
    #12
    Member
    Website's:
    maxneeds.info
    @JmZ

    Yea .. They are arround 1300 .gz files in a folder and keep increasing . Each .gz contains only 1 .txt file . I have a path where the .gz files are - $pathz = CONTENT_DIR.$y.'/'.$m;
    The path is taking 10 .gz files.When user click the next page it takes the next 10 .gz.

    I hope i haven't confused you.

  4.     
    #13
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    Yeah I see.

    Well you'd want to find all gz files in the dir first, then loop through like above.

    e.g.

    change $files at the top of the code, to:
    PHP Code: 
    $current_dir getcwd();
    chdir($pathz);
    $files glob('*.gz');
    chdir($current_dir); 
    Projects:
    WCDDL - The Professional DDL Script
    Top Secret Project: In Development - ZOMG
    ImgTrack - Never Have Dead Images Again!

  5.     
    #14
    Banned
    Website's:
    FusionWarez.info SmokeHost.net Leechers.co
    Coding Geek battle =/

  6.     
    #15
    Member
    Website's:
    maxneeds.info
    It is content/10/05
    I tried
    Code: 
    $pathz = CONTENT_DIR.$y.'/'.$m.'/'.$glo;
    
     $glo=glob('*.gz');
    
     
     echo $pathz;
    To see if i am going to take the .gz file names but it was again content/10/05/

  7.     
    #16
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    PHP Code: 
    /*
        *Functions
    */
    function hostImage($filename) {
        
    $file gzfile($filename);
        
    $file implode("\n",$file);

        
    $matches = array(
            array(
    'rapidshare.png''[url=http://rapidshare'),
            array(
    'megaupload.png''[url=http://megaupload')
        );

        
    $image 'none.png';

        foreach(
    $matches as $match) {
            if(
    strpos($file$match[1]) !== false) {
                
    $image $match[0];
                break;
            }
        }
        return 
    $image;
    }

    //Ditrectory stuff
    $gdir CONTENT_DIR.$y.'/'.$m.'/*.gz';

    foreach(
    glob($gdir) as $file)
    {
        
    $image hostImage(CONTENT_DIR.$y.'/'.$m.'/' $file);
        echo 
    $image// rapidshare.png or megaupload.png

    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  8.     
    #17
    Member
    Website's:
    maxneeds.info
    Warning: gzfile(content/10/05/content/10/05/entry100501-210451.txt.gz) [function.gzfile]: failed to open stream: No such file or directory

    the bolded shouldnt exist..

  9.     
    #18
    Respected Member
    Wow what a blob of too many coders.

    First let me say I have no idea where your code came from as I don't see content_dir being defined anywhere.
    But looking at what it is producing try removing the content_dir. from the command whatever it was.
    Seeing what your total code is for these routines would be nice since you are following 2 peoples advice.

  10.     
    #19
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    no:

    Chnage

    $image = hostImage(CONTENT_DIR.$y.'/'.$m.'/' . $file);

    to

    $image = hostImage($file);

    i forgot glob returns an absolute path
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  11.     
    #20
    Member
    Website's:
    maxneeds.info
    Thanks guys !
    I managed to get it working...

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Selling] .:: Clip23.Com ::. Having a video site should not be complicated
    By errabbaa in forum Completed Transactions
    Replies: 1
    Last Post: 16th Sep 2012, 12:14 AM
  2. So, the question is:
    By M.D.House in forum General Discussion
    Replies: 6
    Last Post: 15th Nov 2011, 02:52 AM
  3. Question
    By UmairDiGrt in forum Other
    Replies: 5
    Last Post: 14th Aug 2011, 09:01 AM
  4. Question
    By MasterDKR in forum Webmaster Discussion
    Replies: 13
    Last Post: 3rd Sep 2010, 04:28 AM
  5. Replies: 5
    Last Post: 3rd Jan 2010, 05:23 PM

Tags for this Thread

BE SOCIAL