colour anons by IP address, for easier samefag spotting (commented out atm though)
This commit is contained in:
parent
0b26eba141
commit
77fc6f22b2
@ -197,6 +197,18 @@ function show_ip($ip, $ban_reason) {
|
|||||||
return $ip;
|
return $ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn an IP address into a colour, for easily spotting samefags
|
||||||
|
*
|
||||||
|
* NOTE: this should only be shown to admins, as it can be reversed
|
||||||
|
* to get an original IP address
|
||||||
|
*/
|
||||||
|
function ip2color($ip) {
|
||||||
|
$b = explode(".", $ip);
|
||||||
|
#return sprintf("#%02x%02x%02x", $b[0]/2, $b[1]/2, $b[2]/2);
|
||||||
|
return sprintf("hsl(%d, %d%%, %d%%)", $b[3]*360/256, $b[2]*100/256, $b[1]*100/256/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Different databases have different ways to represent booleans; this
|
* Different databases have different ways to represent booleans; this
|
||||||
|
@ -153,7 +153,11 @@ class CommentListTheme extends Themelet {
|
|||||||
$anoncode = '<sup>'.$this->anon_id.'</sup>';
|
$anoncode = '<sup>'.$this->anon_id.'</sup>';
|
||||||
$this->anon_id++;
|
$this->anon_id++;
|
||||||
}
|
}
|
||||||
$h_userlink = "<span class='username'>" . $h_name . $anoncode . "</span>";
|
$style = "";
|
||||||
|
#if($user->can("view_ip")) {
|
||||||
|
# $style = " style='color: ".ip2color($comment->poster_ip).";'";
|
||||||
|
#}
|
||||||
|
$h_userlink = "<span class='username'$style>" . $h_name . $anoncode . "</span>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$h_userlink = '<a class="username" href="'.make_link('user/'.$h_name).'">'.$h_name.'</a>';
|
$h_userlink = '<a class="username" href="'.make_link('user/'.$h_name).'">'.$h_name.'</a>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user