google-site-verification: googlebaca44933768a824.html PHP again. Simple file archive, a trash bin. - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

PHP again. Simple file archive, a trash bin.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PHP again. Simple file archive, a trash bin.

    Simply uploads your files to main folders like I have public and private. these folders have subfolders for every month.

    For example your picture can be in /public/2012-10/


    Source code:


    Source includes readme but as nobody usually reads it:
    Code:
    To add / remove folders, just edit the lines 60 & 63 from index.php.
    The script takes care of the folders and their subfolders :)
    
    Updates to come, stay tuned.
    ok bai

    #2
    Re: PHP again. Simple file archive, a trash bin.

    Directory listing in the first subfolders is done:
    Code:
        $kansio = ".";
        $ohita = array('cgi-bin', '.', '..',);
        $avaa = @opendir($kansio);
        while(false!==( $alikansio = readdir($avaa)))
        {
                if(!in_array( $alikansio, $ohita))
                {
                        if(is_dir("$kansio/$alikansio"))
                        {
                                echo "$alikansio<br />";
                }
            }
        }
        closedir($avaa);
    looks like shit now but works, will edit the design later
    Last edited by lolimsoasd; 10-20-2012, 10:35 AM.
    ok bai

    Comment


      #3
      Re: PHP again. Simple file archive, a trash bin.

      Made a fancy navigation system.

      just need some helps: can I change the folder image to image thumbnail easily? I should change the CSS code, so I really don't know how to do this...


      Here's CSS code:
      Code:
      #navlist {
      	margin: 0;
      	padding-right: 0px;
      }
      #navlist li
      {
      	float: left;
      	width: 40%;
      	list-style-type: none;
      	text-align: center;
      	display: block;
      	padding: 2em;
      	background-color: #ccc;
      	color: #333;
      	font: normal bold 36px/40px Verdana,Arial,Helvetica,sans-serif;
      	text-decoration: none;
      }
      #navlist li:hover
      {
      background-color: #666;
      color: #fff;
      }
      #navlist li.folder
      {
      background-position:center;
      background-position:left;
      background-image: url(kansio.png);
      background-repeat:no-repeat;	
      }
      ok bai

      Comment


        #4
        Re: PHP again. Simple file archive, a trash bin.

        Image thumbnail script for all filetypes with max width and height.
        Code:
        $leveys = 200;
        $korkeus = 200;
        $kuva = "1499.png";
        $thumb = "b-thumb.jpg";
        list($leveys_orig, $korkeus_orig) = getimagesize($kuva);
        $tyyppi = explode(".", $kuva);
        $tyyppi = $tyyppi[count($tyyppi)-1];
        switch($tyyppi)
        {    
        	case 'gif':
        		$simg = imagecreatefromgif($kuva);
        		break;
        	case 'jpg':
        		$simg = imagecreatefromjpeg($kuva);
        		break;
        	case 'png':
        		$simg = imagecreatefrompng($kuva);
        		break;
        } 
        $suhde = $width_orig/$height_orig;
        
        if ($leveys/$korkeus > $suhde) {
           $leveys = $korkeus*$suhde;
        } else {
           $korkeus = $leveys/$suhde;
        }
        $dimg = imagecreatetruecolor($leveys, $korkeus);
        imagecopyresampled($dimg,$simg,0,0,0,0,$leveys,$korkeus,$leveys_orig,$korkeus_orig);
        imagejpeg($dimg,$thumb,100);
        ok bai

        Comment


          #5
          Re: PHP again. Simple file archive, a trash bin.

          V 1.8.0 released--


          changelog:
          Code:
          V 1.8.0
          -Everything is automated. YOU ONLY NEED TO EDIT folders.txt and index.php FROM ONLY LINE 15.
          -The script updates the index site with right folders every time. Also creates them and copies php files inside them.
           -->Still , if you want to edit the script, go on, but email me (my email is inside the readme.txt)
          
          V 1.7.0
          -The stub files and folders are now automatically created. Just edit the "folders.txt" in this folder.
           --> Rename folder.txt and edit index.php on line 13 (outdated line). Will increase your security.
           --> Run the script once so you know how the folders.txt works. Will add more function for it later.. (hidden folder etc..)
          
          V 1.6.0
          -The stub files are now copied, so you don't have to worry about it anymore!
          -They will be made after you upload 1 file tho. Will update this to something better soon...
          
          V 1.5.0
          -The script now makes thumbnail folders, and makes little thumbnails for the images uploaded.
          -You can define the max thumbnail image size in index.php @ root (also in readme), it's now set to fit the binded layout.
          -The script creates all the folders so don't worry about them!
          
          V 1.2.0
          -Layout done for sub-subfolders. Every file has an icon of a folder tho, will update them later.
          
          V 1.1.0
          -Directory listing & file listing done in subfolders.
          -stub files located in root dir, you need to manually move them into the subfolders.
              -stub1.php = put it inside category folders and rename to index.php
              -stub2.php = put it inside month folders and rename to index.php
          -Fancy layout for first subfolders.
          
          
          V 1.0.0
          -Base done, upload works, allows all filetypes at the moment.
          -Creates subfolders automatically, but no design in subfolders.
          ok bai

          Comment


            #6
            Re: PHP again. Simple file archive, a trash bin.

            neat-o :D
            Pressing thanks helps alot!

            Comment


              #7
              Re: PHP again. Simple file archive, a trash bin.

              Originally posted by Gekk0 View Post
              neat-o :D
              thanks!
              Feel free to download source and learn something new ;)
              ok bai

              Comment


                #8
                Re: PHP again. Simple file archive, a trash bin.



                need to translate it ;)
                Pressing thanks helps alot!

                Comment


                  #9
                  Re: PHP again. Simple file archive, a trash bin.

                  Originally posted by Gekk0 View Post
                  http://ownedmuch.net/php/

                  need to translate it ;)
                  oh yea I gotta make an English version of it. :P

                  EDIT: seems like it doesn't work properly. Maybe you should chmod the index.php to 644 or 755 ?
                  ok bai

                  Comment


                    #10
                    Re: PHP again. Simple file archive, a trash bin.

                    yeah just tried to chmod didnt work out :o
                    Pressing thanks helps alot!

                    Comment


                      #11
                      Re: PHP again. Simple file archive, a trash bin.

                      Originally posted by Gekk0 View Post
                      yeah just tried to chmod didnt work out :o
                      I'll look into it when the nameservers update and I got my own acc up.. :)
                      I think I'll have a fix tomorrow !
                      ok bai

                      Comment


                        #12
                        Re: PHP again. Simple file archive, a trash bin.

                        fixed it just had chmod the folders too :)

                        Pressing thanks helps alot!

                        Comment


                          #13
                          Re: PHP again. Simple file archive, a trash bin.

                          ah great :) 755 did the trick?

                          add:


                          Gotta update the code with this.
                          ok bai

                          Comment


                            #14
                            Re: PHP again. Simple file archive, a trash bin.

                            i also translated the stuff u see then uploading. :)

                            Pressing thanks helps alot!

                            Comment


                              #15
                              Re: PHP again. Simple file archive, a trash bin.

                              I will take a look :)

                              Comment


                                #16
                                Re: PHP again. Simple file archive, a trash bin.

                                u wont, cuz m3nc0re owned you. bai.
                                *Tom: badazz b trollin n hatin , sellin crack , hiding smack and now having to jack cause life gone all whack*
                                www.myg0t.com

                                Comment


                                  #17
                                  Re: PHP again. Simple file archive, a trash bin.

                                  Originally posted by BaDaZZ View Post
                                  u wont, cuz m3nc0re owned you. bai.
                                  read my sig.

                                  lol, the files are deleted from zippyshare already
                                  ok bai

                                  Comment

                                  Working...
                                  X