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 1 of 5 12345 LastLast
Results 1 to 10 of 50
  1. #1
    Join Date
    Aug 2008
    Location
    Swindon, Wiltshire, Southwest
    Posts
    36
    Tokens
    5,569

    Latest Awards:

    Default HotLink Protection Mini Script - Wikid enit

    Okai ladies and gents, and little scripters (you 1337 *****)

    Here's some PHP & Lil Apache rewrite for you

    Basically, I got bored and coded this up. It allows people to hotlink for a period of time, say 1 minute, or 50 hours?

    Its not the best way to do it and could probably changed > alot <

    Heres the main part of it...

    PHP Code:
    <?php
    mysql_connect
    'localhost''dev_hotLink''hottie' ) or die( 'Error Mysql DB' );
    mysql_select_db'dev_hotLinks' );

    function 
    createImg$i )
    {
        
    $f = @file_get_contents$i );
        
    $iS imagecreatefromstring$f );
        
    header'content-type: image/png' );
        
    imagepng$iS );
        
    imagedestroy$iS );
    }

    function 
    hotLink$i$t$a )
    {
        if( 
    $i != '' && $t != '' )
        {
            if( 
    is_numeric$t ) )
            {
                
    $iS rand() . '-imageHotlink-' rand();
                if( 
    $q mysql_query'INSERT INTO `hotlinks` (`id`, `img`, `session`, `timeout`, `time`) VALUES (NULL, "' mysql_real_escape_string$i ) . '", "' $iS '", "' . ( $t 60 ) . '", "' time() . '");' ) )
                {
                    echo( 
    '<img src="images/' $iS '" alt="' $a '" />' );
                }
            }
            else
            {
                echo( 
    '<img src="error.jpg" alt="' $a '" />' );
            }
        }
        else
        {
            echo( 
    '<img src="error.jpg" alt="' $a '" />' );
        }
    }

    function 
    findImage$s )
    {
        if( 
    $s != '' )
        {
            if( 
    $q mysql_query'SELECT *  FROM `hotlinks` WHERE `session` = "' mysql_real_escape_string$s ) . '"' ) )
            {
                if( 
    mysql_num_rows$q ) >= )
                {
                    if( 
    $f mysql_fetch_array$q ) )
                    {
                        if( 
    abs( ( time() - $f'time' ] ) ) <= $f'timeout' ] )
                        {
                            
    createImg$f'img' ] );
                        }
                        else
                        {
                            
    mysql_query'DELETE FROM `hotlinks` WHERE `hotlinks`.`id` = "' $f'id' ] . '" LIMIT 1' );
                            
    createImg'hotlink.jpg' );
                        }
                    }
                }
                else
                {
                    
    createImg'hotlink.jpg' );
                }
            }
            else
            {
                
    createImg'error.jpg' );
            }
        }
        else
        {
            
    createImg'error.jpg' );
        }
    }
    ?>
    I'ma post the folder here, so you can see how it all works alltogether, if ur interested.

    Heres the SQL => http://dev.e-mx.co.uk/dev_hotLinks.sql
    Heres the ZIP => http://dev.e-mx.co.uk/hotlink.zip

    FLAME FLAME FLAME :eusa_danc

    xxxxxxx
    Protege

  2. #2
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    very nice of you to rlease
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  3. #3
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default

    nice of you giving this out.

  4. #4
    Join Date
    Aug 2008
    Location
    Swindon, Wiltshire, Southwest
    Posts
    36
    Tokens
    5,569

    Latest Awards:

    Default

    http://dev.e-mx.co.uk/hotLink

    For a live preview, that image times out 1minute

  5. #5
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by TheProtege View Post
    http://dev.e-mx.co.uk/hotLink

    For a live preview, that image times out 1minute
    Is it cool to have your trousers pulled down like that? I'm confused.

  6. #6
    Join Date
    Aug 2008
    Location
    Swindon, Wiltshire, Southwest
    Posts
    36
    Tokens
    5,569

    Latest Awards:

    Default

    Nuh I dont think it is, but it was like in my music folder and it was the folder open at the time

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

    Latest Awards:

    Default

    This wasn't a necessary post at all. You're trying to "troll", and you're not very good at it.

    ----

    On topic, it looks nice I might have a play with it later. Thanks for releasing it.

  8. #8
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    This wasn't a necessary post at all. You're trying to "troll", and you're not very good at it.

    ----

    On topic, it looks nice I might have a play with it later. Thanks for releasing it.
    Okay.. okay.. just because your dummy is too sour to taste don't start spitting it out. I wasn't insulting Theprotege, merely making a comment on the CD cover he chose.

    OT: The script is actually great, would stop idiots from claiming bandwidth Well done.

  9. #9
    Join Date
    Aug 2008
    Location
    Swindon, Wiltshire, Southwest
    Posts
    36
    Tokens
    5,569

    Latest Awards:

    Default

    Thank you xxxx

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

    Latest Awards:

    Default

    Quote Originally Posted by Excellent View Post
    Okay.. okay.. just because your dummy is too sour to taste don't start spitting it out. I wasn't insulting Theprotege, merely making a comment on the CD cover he chose.

    OT: The script is actually great, would stop idiots from claiming bandwidth Well done.
    Okay.. okay.. just because your dummy is too sour to taste don't start spitting it out. I wasn't insulting Theprotege, merely making a comment on the CD cover he chose.
    Aww.. "my dummy is too sour", where did you get that from, "Insults for Dummies" (ISBN: 011EXCELLENT011).

    There was no need to make a comment on his "cd cover", if you haven't noticed.. this thread is about a HotLink Protection Script, not the CD cover in his link.

    If you wanted to talk to him about that, you could have PMed him.

Page 1 of 5 12345 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
  •