Changeset 283

Show
Ignore:
Timestamp:
08/10/07 21:34:00 (3 years ago)
Author:
eevee
Message:

Added an IP hash to the shoutbox listing so non-admins can tell when two anonymous idiots are the same person.

Location:
veekun/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Utils.pm

    r266 r283  
    33use Socket qw//; 
    44use List::Util qw/first/; 
     5use Digest::SHA1 qw/sha1_hex/; 
    56 
    67=head1 NAME 
     
    125126sub inet_aton { unpack 'N*', Socket::inet_aton(shift) } 
    126127 
     128# name comes from what imageboards do, but really it's just a short hash 
     129sub tripcode { substr sha1_hex(shift), 0, 12 } 
     130 
    127131=head1 AUTHOR 
    128132 
  • veekun/trunk/lib/Vee/View/TT.pm

    r202 r283  
    3232        hsv2rgb => \&Vee::Utils::hsv2rgb, 
    3333        wordcap => \&Vee::Utils::wordcap, 
     34        tripcode => \&Vee::Utils::tripcode, 
    3435 
    3536        # forum stuff... 
  • veekun/trunk/templates/shoutbox.tt

    r167 r283  
    1414<tr class="heading"> 
    1515    <th class="time">Date/Time</th> 
    16 [% IF can_ip %] 
    1716    <th class="ip">IP</th> 
    18 [% END %] 
    1917    <th class="user">User</th> 
    2018    <th class="message">Shout</th> 
     
    2725<tr class="color[% color %]"> 
    2826    <td class="time" title="[% time - s.time | timespan %] ago">[% s.time | date %]</td> 
    29 [%     IF can_ip %] 
    30     <td class="ip">[% inet_ntoa(s.ip) %]</td> 
    31 [%     END %] 
     27    <td class="ip">[% can_ip ? inet_ntoa(s.ip) : tripcode(s.ip) %]</td> 
    3228    <td class="user"> 
    3329[%     IF s.userid %]