Location: PHPKode > projects > Axis Groupware > musiclib/inc/output_functions.inc.php
<?php
function playlistHeader($size) 
{
	global $musiclib;

	if ($musiclib['config']['playlist_format'] == 1) 
	{
		$file = "listen.pls";
	} 
	else 
	{
		$file = "listen.m3u";
	}

	header("Cache-Control: public");
	header("Content-disposition: inline; filename=\"".$file."\"");
	header("Pragma: public");
	header("Expires: 0");
#	header("Content-Transfer-Encoding: binary");
  
	if ($musiclib['config']['playlist_format'] == 1) 
	{
		header("Content-type: audio/x-scpls");
		header("Content-Description: PLS Audio Playlist" );
		echo "[playlist]\n";
		echo "NumberOfEntries=".$size."\n";
	} 
	else 
	{
		header("Content-type: audio/m3u");
		header("Content-Description: M3U Audio Playlist" );
	}
}

function generate_playlist($mode,$query) 
{
	global $musiclib;
	
	$result = $GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
	$playlist_size = $GLOBALS['phpgw']->db->num_rows();
	
	playlistHeader($playlist_size);
	
	$i = 0;
	while ($GLOBALS['phpgw']->db->next_record()) 
	{
	    $i++;
		$row = $GLOBALS['phpgw']->db->Record;

		if ($mode != 'random' and $mode != 'album')
		{
    		times_played($mode,$row['id']);
    	}
		
		if ($musiclib['config']['playlist_format'] == 1) 
		{
			$line = "File".$i."=".generate_music_url($mode,$row)."\n";
		} 
		else 
		{
			$line = generate_music_url($mode,$row)."\n";
		}
		
		echo $line;
	}
}

function showBox($title, $text) 
{
	echo "<div id=\"message\"><h2>$title</h2>$text</div>";
}
/*
if (isset($pw))
{
	$kweerie = "select user_id, status from users where user='$user' and pw=password(\"$pw\")";
	$result = mysql_db_query($db_name, $kweerie);
	$row = mysql_fetch_row($result);
	$user_id = $row[0];
	$status = $row[1];

	$kweerie = "select songsperpage from preferences where user_id='$user_id'";
	$result = mysql_db_query($db_name, $kweerie);
	$row = mysql_fetch_row($result);
	$songsperpage = $row[0];
}
*/
function print_checkall_js() 
{

echo "<script language=\"javascript\" type=\"text/javascript\">

function check(val,field) {
    for ( i = 0; i < field.length; i++ )
      field[i].checked = val ;
  }

</script>";
}

function print_checkall_options() 
{
	echo "<tr><td colspan=2><br><a href=\"javascript:check(true,document.listform.elements['add_to_playlist_array[]'])\">
		<font face=\"Arial, Helvetica, Verdana\" size=\"2\">Check All</font></a>   
		 | <a href=\"javascript:check(false,document.listform.elements['add_to_playlist_array[]'])\">
		<font face=\"Arial, Helvetica, Verdana\" size=\"2\">Uncheck All</font></a><br><br></td></tr>";
}

function print_are_you_sure_js() 
{
	echo "<script>
			function Question(url) {
		    	if (confirm('Are You Sure?')) {
					return true;
		        } else {
        		    return false;
		        }

			}
		</script>";
}
?>
Return current item: Axis Groupware