Skip to content

Commit

Permalink
Merge pull request idno#430 from mapkyca/iconcolours
Browse files Browse the repository at this point in the history
Closes idno#429: Generate icon colour via hash rather than random number.
  • Loading branch information
benwerd committed Aug 31, 2014
2 parents d18e78c + b4e74d9 commit e91948d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions templates/default/entity/User/icon.tpl.php
@@ -1,9 +1,6 @@
<?php

if (empty($vars['user']->icon_number)) {
$number = rand(1,6);
} else {
$number = $vars['user']->number_format;
}
$bn = hexdec(substr(md5($vars['user']->uuid), 0, 15));
$number = 1 + ($bn % 5);
echo \Idno\Core\site()->config()->url . 'gfx/users/default-'. str_pad($number, 2, '0', STR_PAD_LEFT) .'.png';

0 comments on commit e91948d

Please sign in to comment.