Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Map IP to unique creative identifier

    I would like to create a system where people can post messages without registering. Rather than showing their IP address to identify which message belongs to a unique person, I would like to somehow map it to a creative/non-technical solution. For example, I think I saw somewhere someone doing it to colored boxes. So when I would post a message, in the left column would be 2 different colored boxes and in the right column would be my message. The next person posting from a different IP would have different colors. Can anyone think of any other ideas to solve a problem like this or know of any premade PHP code that might do this (for colors or equitable solutions)?

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    This is a cool idea.

    I like the colours, as humans are very good at recognizing colours.

    Shapes could also be introduced...

    What about patterns in the colours? Vertical lines, horizontal lines, diagonal, etc.

    Creating this would be a little bit harder, as you have to take into account that people have dynamic IPs. So you have to use only the first 2 or 3 groups of digits.

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is aimed to be a kind of hybrid between chat and discussion forum. If someone returns with a different IP, that will be fine for the current setup. As long as that IP is fixed during their visit to the page... which it will be. Can you think of a clever way to code this? I don't really want to create 255+ unique hand drawn images.

  • #4
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    PHP Code:
    $ip explode('.'$_SERVER['REMOTE_ADDR']);
    $backgroundcolor dechex($ip[0]) . dechex($ip[1]) . dechex($ip[2]);

    $backgroundimages = array('stripes.png''diag1.png''diag2.png'); // transparent PNGs

    $image $backgroundimages[$ip[3] % sizeof($backgroundimages)];

    echo 
    '<div style="width:100px;height:100px;background-color:#'.$backgroundcolor.';background-image: url('.$image.');"> Squares </div>'
    Mine's teal
    Last edited by Mwnciau; 11-08-2007 at 11:48 PM.

  • #5
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    Was it 'identicons' you saw? (http://www.docuverse.com/blog/donpar...identification)
    the link to the source on that page contains instructions as well as a link to a PHP implementation of something similar...
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com


  •  

    Posting Permissions

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