about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2018-03-11 20:10:17 -0400
committerZach DeCook <zachdecook@gmail.com>2018-03-11 20:10:17 -0400
commit0402389cc865e67fe5f6dc8dac766de1513ff306 (patch)
tree4e463eb3d73259872a291bbd94bcef311bf190b3
parent0026ca48c2800425ea5018b2626c390114aea68f (diff)
downloadprosongsa-0402389cc865e67fe5f6dc8dac766de1513ff306.tar.gz
* Song Suggestions: Seed random numbers by current minute
(for better group song selection)
-rw-r--r--page.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/page.php b/page.php
index cdc7921..ef8f6d8 100644
--- a/page.php
+++ b/page.php
@@ -69,6 +69,8 @@ function refToNum( $ref )
  */
 function load_song( $number, $transp = 0 )
 {
+	// Song suggestions are based on the minute you loaded the page
+	mt_srand( time()/60 );
 	$handle = fopen("inputfile.txt", "r");
 	if( ! $transp ) $transp = 0;
 
@@ -93,7 +95,7 @@ function load_song( $number, $transp = 0 )
 		{
 			$allsongs[$matches[1]] = $line;
 			$current_song = $matches[1];
-			if( rand(0,100) < 5 )
+			if( mt_rand(0,100) < 5 )
 			{
 				$suggestedSong[$current_song]['title'] = $line;
 			}