Profile
MAJ is an Open Source, PHP-based content management system (CMS) that can be deployed as a blog, bulletin or message board, Internet forum, and wiki. It is extensible via PHP panels and is HTML5 and CSS3 ready.
Git
This blob has been accessed 1063 times via Git panel.

  1. <?php
  2.  
  3.  
  4.  
  5.   function unzipFile($filename, $destination_folder) {
  6.  
  7.         /*========================================================
  8.         |
  9.         | unzip files using SimpleUnzip
  10.         |
  11.         | License: Use it, copy it, but leave my copyright where it is,
  12.         | otherwise, create your own code, thank you!
  13.         |
  14.         | coded by Vladimir Ghetau (c) 2007 pixeltomorrow.com
  15.         |
  16.         |
  17.         |
  18.         | http://www.vladimir.pixeltomorrow.com
  19.         |
  20.         |
  21.         |
  22.         | usage:
  23.         |
  24.         |  if (@function_exists('gzinflate')) {
  25.         |
  26.         |     $filename = 'uploads/zipped.zip';
  27.         |     $destionation_folder = 'unzipped/';
  28.         |     require_once ('unzip.lib.php');
  29.         |     unzipFile($filename, $destination_folder);
  30.         |
  31.         |  } else {
  32.         |
  33.         |     die ('gzinflate() is missing!');
  34.         |
  35.         |  }
  36.         |
  37.         |
  38.         | Enjoy!
  39.         |
  40.         |
  41.         ========================================================*/
  42.  
  43.                                                    
  44.         if ($filename == '') die ('Please enter a file name first of all!');
  45.    
  46.         if ($destination_folder == '') die ('The path you specified is empty!');
  47.    
  48.         if (mb_substr($destination_folder, -1) != '/') {
  49.                                                          
  50.             $destination_folder = $destination_folder .'/';
  51.                                                          
  52.         }
  53.                                                          
  54.                                                          
  55.      $vzip = new SimpleUnzip($filename);
  56.  
  57.           foreach ($vzip->Entries as $extr) {
  58.          
  59.               $path = $extr->Path;
  60.               $path_folder = explode ('/', $path);
  61.               $new_path = '';
  62.              
  63.                   foreach ($path_folder as $folder) {
  64.                  
  65.                       $new_path .= $folder .'/';
  66.                  
  67.                       $to_create = $destination_folder . $new_path;
  68.                      
  69.                           if (mb_substr($to_create, -1) == '/') {
  70.                          
  71.                             $to_create = mb_substr($to_create, 0, mb_strlen($to_create)-1);
  72.                          
  73.                           }
  74.                      
  75.                       @mkdir($to_create, 0777);
  76.                  
  77.                   }
  78.          
  79.               $new_path = '';
  80.               $filev = fopen ($destination_folder. $extr->Path .'/'. $extr->Name, 'w');
  81.               fwrite ($filev, $extr->Data);
  82.               fclose ($filev);
  83.                                                        
  84.           }
  85.          
  86.                                                          
  87.  
  88.   }
  89.  
  90.  
  91. ?>
  92.  
Credits
Sunday, Sep 18, 2005, 12:00 AM (Revision 11 - Thursday, Jul 14, 2011, 7:30 PM)
Open Source enables software developers to stand on the shoulders of giants instead of reinventing the wheel, so to speak. Kudos and many thanks to the folks who made their work freely available for reuse in MAJ.

read more
Bugs and Exploits
Friday, Aug 26, 2005, 12:00 AM (Revision 23 - Wednesday, May 29, 2013, 5:25 AM)
Although MAJ started as a family project, care has been taken to make it as "safe" as possible. With more people now working on MAJ, bugs and exploitable code may sometimes slip in. We invite you to poke around and see if you can find any. Generally, there are two things you can do when you find a MAJ or PHP-related bug or exploit:

1. Take advantage of it. But hey, what's so exciting about messing up someone's blog? Ho-hum, right?
2. Report it here so that we can work on a fix and make MAJ better.

read more
Search
Download
MAJ 2.0
75 files
33012 downloads
MAJ 1.0
26 files
13144 downloads
MAJ 0.14
45 files
35026 downloads