Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-08-2007, 09:56 PM   PM User | #1
perlhelp
New to the CF scene

 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
perlhelp is an unknown quantity at this point
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)?
perlhelp is offline   Reply With Quote
Old 11-08-2007, 10:42 PM   PM User | #2
aedrin
Senior Coder

 
Join Date: Jan 2007
Posts: 1,648
Thanks: 1
Thanked 58 Times in 54 Posts
aedrin will become famous soon enough
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.
aedrin is offline   Reply With Quote
Old 11-08-2007, 10:51 PM   PM User | #3
perlhelp
New to the CF scene

 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
perlhelp is an unknown quantity at this point
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.
perlhelp is offline   Reply With Quote
Old 11-08-2007, 11:19 PM   PM User | #4
Mwnciau
Regular Coder

 
Join Date: May 2006
Location: Wales
Posts: 820
Thanks: 1
Thanked 82 Times in 79 Posts
Mwnciau is on a distinguished road
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..
Mwnciau is offline   Reply With Quote
Old 11-09-2007, 12:21 AM   PM User | #5
GJay
Senior Coder

 
Join Date: Sep 2005
Posts: 1,791
Thanks: 5
Thanked 36 Times in 35 Posts
GJay is on a distinguished road
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
GJay is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:48 PM.


Advertisement
Log in to turn off these ads.