示例#1
0
function get_songlist_struct()
{
    $songlist_struct = array();
    $filename_base = ".opentape_songlist";
    if (file_exists(constant("SETTINGS_PATH") . $filename_base . ".php") && is_readable(constant("SETTINGS_PATH") . $filename_base . ".php")) {
        // this is the more secure way of storing this data, as
        // the web users can't fetch it
        include constant("SETTINGS_PATH") . $filename_base . ".php";
        $songlist_struct = unserialize(base64_decode($songlist_struct_data));
    } elseif (file_exists(constant("SETTINGS_PATH") . $filename_base . ".array") && is_readable(constant("SETTINGS_PATH") . $filename_base . ".array")) {
        $songlist_struct_data = file_get_contents(constant("SETTINGS_PATH") . $filename_base . ".array");
        $songlist_struct = unserialize($songlist_struct_data);
        if ($songlist_struct === false || !is_array($songlist_struct)) {
            error_log("Songlist currently empty");
            $songlist_struct = array();
        } else {
            // upgrade to the new method of storing the data quietly
            write_songlist_struct($songlist_struct);
        }
    }
    return $songlist_struct;
}
示例#2
0
					sendEvent('PLAY', true);
				} else {
					songClock.removeClass('green');
					songClock.addClass('grey');	
					sendEvent('PLAY', false);
				}
			} else {
				stopTrack();
				currentTrack = id;
				playTrack();
			}
		}
		
		// Player maintenance functions
		function sendEvent(typ,prm) { 
			if( isReady ) {	thisMovie('openplayer').sendEvent(typ,prm); }
		}

		function thisMovie(movieName) {
			if(navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; }
			else { return document[movieName]; }
		}
		
	</script>
				
	</body>
</html>
<?php 
if ($songlist_struct != $songlist_struct_original) {
    write_songlist_struct($songlist_struct);
}