1
0

Added ProgOfTheDay to AdminArea (+Bugfix)

This commit is contained in:
2014-06-16 20:36:48 +02:00
parent e7c7881afb
commit 2ebe660272
5 changed files with 245 additions and 214 deletions

View File

@@ -16,9 +16,13 @@ class SeededRandom
$this->get();
}
function seedWithDailySeed()
function seedWithDailySeed($date)
{
$this->seed($this->getDailySeed());
$this->seed(($date->format('Y') % 100) * 10459);
$max = $date->format('z');
for ($i = 0; $i < $max; $i++) {
$this->get();
}
}
function get($min = 0, $max = 9999999)
@@ -35,11 +39,4 @@ class SeededRandom
{
return $arr[$this->get(0, count($arr))];
}
function getDailySeed()
{
$now = getdate();
return ($now['year'] % 100) * 366 + $now['yday'] /* * $now['seconds'] */;
}
}