Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38
  1. #21
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default



    Actually, I'll find another uploader, thanks anyway

    PHP Code:
    <?php
    $dir 
    "/home/vhabbo/public_html/images/uploads"// This is the directory you wish your images to be uploaded. Change "vhabbo" to your username and remember to CHMOD to 777.
    $maxsize "10000000"// This is the max file size
    $websiteurl = ("vhabbo.com"); // Change this to your website URL, adding a www. is additional.
    $types_alowed = array("gif""png""bmp""jpg""jpeg"); // These are the files alowed to upload

    // Only edit below if you have knowledge in php.
    if(isset($_FILES["file"])) {
        
    $file $_FILES["file"]["name"];
        
    $dot explode"."$file);
        
    $tempname $_FILES["file"]["tmp_name"];    
        
    if(
    $_FILES["file"]["size"] > $maxsize || $file  == "" || !in_array($dot[1], $types_alowed)) {
        echo(
    "<p>The following errors occured:<ul>");
        
    $end "</ul></p>";
        
    $error "1";
    }

    if(
    $file == "") {
        echo(
    "<li>Please complete the required field \"File\".</li>");
        
    $error2 "1";
    }
    if(!
    in_array($dot[1], $types_alowed) && $error2 != "1") {
        echo(
    "<li>You can only upload image files.</li>");
    }
    if(
    $_FILES["file"]["size"] > $maxsize) {
        echo(
    "<li>The size of your image is too big.</li>");
    }
        echo(
    "$end");
    if(
    $error != "1") {
        
    $name uniqid("img").$_FILES["file"]["name"]; // This will create a random name for the file
        
    $newname str_replace" ""_"$name); // This will replace any spaces in the file name
        
    move_uploaded_file($tempname"$dir/$newname");
        echo(
    "<img src=\"http://"$websiteurl ."/images/uploads/$newname\" border=\"0\" />
        <fieldset>
        <legend>Direct Link:</legend>
        <input type=\"text\" name=\"direct\" value=\"http://"
    $websiteurl ."/images/uploads/$newname\" class=\"file\" size=\"100%\"><br>
        </fieldset>
        <legend>HTML Clode:</legend>
        <input type=\"text\" name=\"html\" value=\"&lt;a href=&quot;http://"
    $websiteurl ."/upload&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://v-habbo.com/images/uploads/$newname&quot; border=&quot;0&quot;&gt;&lt;/a&gt;\" class=\"file\" size=\"100%\"><br>
        </fieldset>
    "
    );
    }
    }
    else {
    ?>
    <form method="post" enctype="multipart/form-data">
    <fieldset>
    <legend>Select File:</legend>
    <input type="file" name="file" class="file" size="20"><br>
    </fieldset>
    <br>
    <input class="submit" type="submit" value="Upload" name="submit">
    </form>
    <?
    }
    ?>
    That code is probably easier to use for the newbies, I removed line 11, I added websiteURL, change that too your Site URL (Don't add a HTTP)

    Sorry if your thread
    Last edited by Independent; 20-06-2008 at 04:03 PM.

  2. #22
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    With the help of Caleb, I have fixed the problem with uploading .gif.php files.
    The downloadable version and the starter thread code should now work

  3. #23
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default

    Quote Originally Posted by Jack120 View Post
    With the help of Caleb, I have fixed the problem with uploading .gif.php files.
    The downloadable version and the starter thread code should now work
    So the error that I posted, will now be fixed?
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  4. #24
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Yay - you used my mini addon thing

  5. #25
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Biohazard View Post
    So the error that I posted, will now be fixed?
    I think the error your getting is just setup.

    Quote Originally Posted by Close View Post
    Yay - you used my mini addon thing
    Yep, thought I credited you in the post.

  6. #26
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Jack120 View Post
    I think the error your getting is just setup.


    Yep, thought I credited you in the post.
    lol, it's ok

  7. #27
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    I have updated the demo and download link.
    There now is:
    - Private upload (Doesn't display on recently uploaded page)
    - Recently Uploaded page
    - Share Page

    Demo:
    www.v-habbo.com/upload

    Download:
    www.v-habbo.com/upload/imager.zip

  8. #28
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    That layout is reminding me of TehUpload too much :|

  9. #29
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    That layout is reminding me of TehUpload too much :|
    Yea, thats what I was thinking. But its the easiest layout to design and code

  10. #30
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I don't want a billion TehUpload clones popping up.

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •