Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Lenny's Signature Ip address box???

Options
  • 02-09-2003 11:49am
    #1
    Closed Accounts Posts: 1,376 ✭✭✭


    Any1 seen lennys box that appears under all his posts that displays ur ip address and whatos u are running?
    Any1 got any idea how he coded this??
    I think its real coool and would love to be able to do it.
    I pmed him about it but got no reply.
    Any1 got any idea??


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    http://www.danasoft.com/vipersig.jpg
    I wrote this signature after a long drive when I was inspired by the thought of taking the referring information in a scipt and putting a "tricky" wrapper around it. Yes, the image above is really a PHP script that uses referrer information to make the image on-the-fly. I use a rewrite rule on my server to fool browsers into thinking its an image and allowing it in signatures. You may have picked up on that when you realized the image is actually a PNG file, but called a JPG file. It also throws in a random quote from some of my favorite movies - and if you happen to be on AOL or MSN, you get an extra treat.
    from
    http://www.danasoft.com/


  • Registered Users Posts: 7,739 ✭✭✭mneylon


    It's a very cool signature... What's even more interesting is that he was banned from the Trillian forum for using it


  • Registered Users Posts: 660 ✭✭✭anthonymcg


    Love to know how it's done. B*stard won't release the code.


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    yeah, very bill gates like. shame on you!@#


  • Registered Users Posts: 26,571 ✭✭✭✭Creamy Goodness


    the guy had the code release a couple of months back i had it on my old computer i just have to dish out that hard drive to see if it's still there.


    i'll come back to tell you if i've found it or not


  • Advertisement
  • Moderators, Technology & Internet Moderators, Regional South East Moderators Posts: 28,483 Mod ✭✭✭✭Cabaal



    Random quites are very good, and I've seen the extra treat when on a AOL hostname (AOL Sucks!)
    :D


  • Closed Accounts Posts: 1,376 ✭✭✭joc_06


    Originally posted by anthonymcg
    Love to know how it's done. B*stard won't release the code.

    Well i done an awful amount of resaerch on this and heres wat i came up wit.
    "I think that this is probably running on a server with PHP. It probably has the GD library (http://www.php.net/manual/en/ref.image.php ). This allows you to create images in multiple formats on the fly. It can then just use the predefined variables $_SERVER["REMOTE_ADDR"] to find the ip and $_SERVER["REMOTE_HOST"]. Remote_host is a reverse dns lookup so it returns the host u r using. The script just removes the end of the string "optonline.net" for example and there you have it. To get the browser and OS, it uses $_SERVER["HTTP_USER_AGENT"], which returns a string something like this: "Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586)". YOu can then just parse the string and remove the relevant parts. The rest is just a random picked phrase. cool eh? its should be pretty easy in PHP, except i'm not sure how easy it is to use the GD lib!!"


  • Registered Users Posts: 660 ✭✭✭anthonymcg


    Yeah he says he's using PHP and GD on his site. I'd just like to see how he's ouputting the text to the image. :)


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    There's a php function that writes text on an image for you. Can't remember what it is though, something like
    [php]
    ImageText(imagename, text, x, y)
    [/php]

    or something ...


  • Registered Users Posts: 2,281 ✭✭✭DeadBankClerk


    [php]
    imagestring

    (PHP 3, PHP 4 )
    imagestring -- Draw a string horizontally
    Description
    int imagestring ( resource image, int font, int x, int y, string s, int col)

    imagestring() draws the string s in the image identified by image at coordinates x, y (top left is 0, 0) in color col. If font is 1, 2, 3, 4 or 5, a built-in font is used.
    [/php]


  • Advertisement
  • Registered Users Posts: 935 ✭✭✭Mixie


    [php]
    <?
    // get ISP
    $hostname = gethostbyaddr($REMOTE_ADDR);
    $thesegments = explode(".", $hostname);
    $reversed = array_reverse($thesegments);
    $theisp = "$reversed[1].$reversed[0]";

    Header("Content-type: image/jpeg");
    Header("Expires: Mon, 1, 1999 05:00:00 GMT");
    Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    Header("Cache-Control: no-store, no-cache, must-revalidate");
    Header("Cache-Control: post-check=0, pre-check=0", false);
    Header("Pragma: no-cache");

    //sig.jpg is a real image... This is what we write over

    $im = imagecreatefromjpeg("sig.jpg");
    $mycolor = imagecolorclosest($im, 255, 255, 255);

    // some ip's dont have a reverse name... in that case just display their ip
    if(is_numeric($reversed[0]))
    {
    imagestring($im, 3, 50, 22, "Your IP: $REMOTE_ADDR", $mycolor);
    }
    else
    {
    imagestring($im, 3, 50, 22, "Your ISP: $theisp", $mycolor);
    }

    Imagejpeg($im,'',90);
    ImageDestroy($im);
    ?>
    [/php]

    You'll also need a .htaccess file that says:
    RedirectMatch sig.jpg sig.php


Advertisement