From 0402389cc865e67fe5f6dc8dac766de1513ff306 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sun, 11 Mar 2018 20:10:17 -0400 Subject: * Song Suggestions: Seed random numbers by current minute (for better group song selection) --- page.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit 1.4.1