Location: PHPKode > projects > Mummi (Multi-user MOD_MP3 Interface) > mummi.0.6/htroot/playlist.php
<?

// Setting the title
$GLOBALS[page_title] = "Playlist Editor";

// Include files
include "common.php";
include "$GLOBALS[lib_path]/audio-db.inc";
include "$GLOBALS[lib_path]/design.inc";

// Set the user navbars.
if(!$HTTP_COOKIE_VARS[login_active]) $nav_array = array(main);
elseif($os->num_rows("SELECT user_name FROM users WHERE user_name='$session_array[user_name]' AND user_type='1'")) $nav_array = array_merge($GLOBALS[admin_navbox_array], $os->get_navbox_array($session_array[user_name]));
else $nav_array = array_merge($GLOBALS[basic_navbox_array], $os->get_navbox_array($session_array[user_name]));

$adb = new AUDIO_DB;
$adb->connect("$GLOBALS[dbhost]","$GLOBALS[dbusername]","$GLOBALS[dbuserpassword]","$GLOBALS[dbname]");


// Get the list of playlists associated with user








// Check for incoming commands
if($HTTP_GET_VARS[op] || $HTTP_POST_VARS[op]){
	if($HTTP_GET_VARS[op]) $ss_op = $HTTP_GET_VARS[op];
	else $ss_op = $HTTP_POST_VARS[op];


	switch($ss_op){



/////////////////////////////////////////////////////////////////////////////////////////////////////


		case "view":
			// to make the view case work you simply need to pass the id of the playlist.
			// Will get the playlist from the database, and show it contents on the screen.


			// Setting up the current page
			if(empty($HTTP_GET_VARS[cur_page])) $cur_page = 1;
			else $cur_page = $HTTP_GET_VARS[cur_page];

			//echo "cur page = $cur_page<br>";


			if($HTTP_GET_VARS[id]){
				$ss_id = $HTTP_GET_VARS[id];
				$query = "SELECT plst_array,plst_name,plst_mood,plst_visible FROM user_playlist WHERE id='$ss_id'";
				$plst_result = $adb->fetch_numeric($query);
				$plst_array = OVERSEER::decipher($plst_result[0][0],$GLOBALS[secret_key]);
				$plst_name = $plst_result[0][1];
				$plst_mood = $plst_result[0][2];
				$plst_visible = $plst_result[0][3];
				//echo serialize($plst_result)."<br>\n";
			}

			// need to get the total number of entries an array has
			$j=0;
			while(list($key, $val) = @each($plst_array)) $j++;
			$GLOBALS[real_return_array_count] = $j;


			// figure out what needs to be checked in the radio button.
			if($plst_visible) $pub_chk = "checked";
			else $prv_chk = "checked";

			// all the action buttons
$buttons .= <<<ENDbuttons

<form method="post" action="$GLOBALS[url_path]$PHP_SELF">
<input type="hidden" name="id" value="$ss_id">

<table cellpadding="2" cellspacing="1" border="0">
<tr>
	<td>Name</td>
	<td><input type="text" name="plst_name" value="$plst_name" size="30"></td>
</tr><tr>
	<td>Public</td>
	<td>
	<input type="radio" name="pub" value="1" $pub_chk>public&nbsp;
	<input type="radio" name="pub" value="0" $prv_chk>private</td>
</tr><tr>
	<td>Mood</td>
	<td><input type="text" name="plst_mood" value="$plst_mood" size="30"></td>
</tr></table>

<table cellpadding="1" cellspacing="1" border="0"><tr>
	<td><input type="submit" name="op" value="remove playlist"></td>
	<td><input type="submit" name="op" value="update playlist"></td>
</tr></table>

<hr>
<table cellpadding="1" cellspacing="1" border="0"><tr>
	<td><input type="submit" name="op" value="ascending"><br><br></td>
	<td><input type="submit" name="op" value="decending"><br><br></td>
	<td><input type="submit" name="op" value="randomize"><br><br></td>
</tr></table>

ENDbuttons;


			//echo "plst_id = $plst_id<br>\n";
			$GLOBALS[contents01] .= "$buttons";

			// display the page number table here
			$GLOBALS[contents01] .= draw_pagenumbers($cur_page, $GLOBALS[rpp]);

			$GLOBALS[contents01] .= "<table width=\"100%\" cellpadding=\"2\" cellspacing=\"1\" border=\"0\">";
			$GLOBALS[contents01] .= "<tr bgcolor=\"$GLOBALS[bg_clr02]\">\n".
									"\t<td align=\"left\">&nbsp;#</td>\n".
									"\t<td><font color=\"$GLOBALS[body_head_font_clr]\"><input type=\"checkbox\" ONCLICK=\"check(this.form)\"></td><td align=\"left\"><font color=\"$GLOBALS[body_head_font_clr]\">TITLE</font></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">ARTIST</font></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">ALBUM</font></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">GENRE</font></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">BITRATE</font></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">SIZE</font></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">TIME</font></td>\n</tr>";




			$i=0;
			// this is where the numbering of the display entries happens
			$w = ($cur_page-1) * $GLOBALS[rpp] +1;


			// Split the array into chunks..
			$plst_array01 = $adb->array_chunk($plst_array, $GLOBALS[rpp], TRUE);
			//echo serialize($plst_array);

			while(list($key, $val) = @each($plst_array01[$cur_page-1])){
				$plst_info = $adb->pull_plst_info($val);

				if($plst_info[seconds]) $seconds = $plst_info[seconds];
				else $seconds = "-1";

				$t_seconds += $seconds;
				$second_a = ($plst_info[seconds]%60);
				$minute_a = (($plst_info[seconds]/60)%60);
				$hour_a = ((floor($plst_info[seconds]/60)/60)%24);
				//$day_a = floor(floor(floor($plst_info[seconds]/60)/60)/24);
				$second_a = strlen($second_a) == 1 ? "0$second_a" : $second_a;
				$minute_a = strlen($minute_a) == 1 ? "0$minute_a" : $minute_a;
				$hour_a = strlen($hour_a) == 1 ? "0$hour_a" : $hour_a;
				//$day_a = strlen($day_a) == 1 ? "0$day_a" : $day_a;
				$length = "$hour_a:$minute_a:$second_a";

				$Mb_a = round($plst_info[filesize] / 1000000, 2);
				$tMb_a += $Mb_a;

				if($plst_info[id3v1_title]) $title = $plst_info[id3v1_title];
				elseif($plst_info[id3v2_title]) $title = $plst_info[id3v2_title];
				else $title = "Untitled";

				if($plst_info[id3v1_artist]) $artist = $plst_info[id3v1_artist];
				elseif($plst_info[id3v2_artist]) $artist = $plst_info[id3v2_artist];
				else $artist = "Unknown Artist";

				if($plst_info[id3v1_album]) $album = $plst_info[id3v1_album];
				elseif($plst_info[id3v2_album]) $album = $plst_info[id3v2_album];
				else $album = "&nbsp;";


				//create the multi-colored rows
				if(($clr & 1)==1) $bgc = "#cccccc";
				elseif(($clr & 1)!=1) $bgc = "#eeeeee";

				// if the id3 tag is present.
				if(($plst_info[id3v1]) || ($plst_info[id3v2])){
					$GLOBALS[contents01] .= "<tr bgcolor=\"$bgc\">\n".
											"\t<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$w</font></td>\n".
											"\t<td align=\"left\"><input type=\"checkbox\" name=\"file[$i]\" value=\"$xz[path_md5]\"></td><td><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">&nbsp;$title</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$artist</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$album</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$plst_info[id3v1_genre]</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$plst_info[bitrate]&nbspKbps</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$Mb_a MB</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$length</font></td>\n</tr>";
				}else{
					// the filename will be used.
					// trim the .mp3 or .ogg extension off the file.
					$plst_info[filename] = eregi_replace(".$plst_info[file_type]", "", "$plst_info[filename]");
					$GLOBALS[contents01] .= "<tr bgcolor=\"$bgc\">\n".
											"\t<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$w</font></td>\n".
											"\t<td align=\"left\"><input type=\"checkbox\" name=\"file[$i]\" value=\"$xz[path_md5]\"></td><td><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">&nbsp;$plst_info[filename]</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">&nbsp;</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$album</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$plst_info[id3v1_genre]</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$plst_info[bitrate]&nbspKbps</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$Mb_a MB</font></td>\n".
											"\t<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$length</font></td>\n</tr>";
				}
				$i++;
				$clr++;
				$w++;
			}//eo while
			$GLOBALS[contents01] .= "<tr bgcolor=\"$GLOBALS[bg_clr02]\">\n".
									"\t<td colspan=\"6\"><font color=\"$GLOBALS[body_head_font_clr]\">&nbsp;</font></td><td></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">$tMb_a</font></td>\n".
									"\t<td align=\"right\"><font color=\"$GLOBALS[body_head_font_clr]\">$t_seconds</font></td>\n</tr>";
			$GLOBALS[contents01] .= "</table>";

			// display the page number table here
			$GLOBALS[contents01] .= draw_pagenumbers($cur_page, $GLOBALS[rpp]);

			$GLOBALS[contents01] .= "</form>\n";
		break;

/////////////////////////////////////////////////////////////////////////////////////////////////////

		case "add_new":
			// get the temp playlist data.
			if($HTTP_GET_VARS[id]){
				$ss_id = $HTTP_GET_VARS[id];
				$query = "SELECT plst_array FROM tmp_playlist WHERE id='$ss_id'";
				echo "query = $query<br>\n";
				$plst_result = $adb->fetch_numeric($query);
				$plst_array = OVERSEER::decipher($plst_result[0][0],$GLOBALS[secret_key]);
			}
			echo serialize($plst_array)."<br>\n";
			$plst_name="new playlist";
			$plst_mood="";
			$adb->insert_user_playlist($session_array[user_name], $plst_name, $plst_mood, $plst_array);
			$os->purge_record("$ss_id", "tmp_playlist");
			$ss_time = md5($GLOBALS[current_utime]);
			header("Location: $GLOBALS[url_path]$PHP_SELF?op=view&id=$ss_time");

		break;

/////////////////////////////////////////////////////////////////////////////////////////////////////

case "create playlist":
			// get the temp playlist data.
//			if($HTTP_GET_VARS[id]){
//				$ss_id = $HTTP_GET_VARS[id];
//				$query = "SELECT plst_array FROM tmp_playlist WHERE id='$ss_id'";
//				echo "query = $query<br>\n";
//				$plst_result = $adb->fetch_numeric($query);
//				$plst_array = OVERSEER::decipher($plst_result[0][0],$GLOBALS[secret_key]);
//			}
//			echo serialize($plst_array)."<br>\n";
			$plst_name="new playlist";
			$plst_mood="";
			$adb->insert_user_playlist($session_array[user_name], $plst_name, $plst_mood, $plst_array);
//			$os->purge_record("$ss_id", "tmp_playlist");
			$ss_time = md5($GLOBALS[current_utime]);
			header("Location: $GLOBALS[url_path]$PHP_SELF?op=view&id=$ss_time");

		break;

/////////////////////////////////////////////////////////////////////////////////////////////////////

		case "add":
			//if the ID, and the PLS_ID are set, we can do this.
			//else... your a idiot.
			// get the temp playlist data.
			if($HTTP_GET_VARS[id]){
				$ss_id = $HTTP_GET_VARS[id];
				$query ="SELECT plst_array ".
						"FROM tmp_playlist ".
						"WHERE id='$ss_id' ".
						"AND user_name='$session_array[user_name]'";
				$temp_result = $adb->fetch_numeric($query);
				$temp_array = OVERSEER::decipher($temp_result[0][0],$GLOBALS[secret_key]);
				$adb->purge_record("$ss_id", "tmp_playlist");
			}
			//get the users stored playlist.
			if($HTTP_GET_VARS[plst_id]){
				$ss_pls_id = $HTTP_GET_VARS[plst_id];
				$query ="SELECT * ".
						"FROM user_playlist ".
						"WHERE id='$ss_pls_id' ".
						"AND plst_owner='$session_array[user_name]'";
				$user_result = $adb->fetch_numeric($query);
				$user_array = OVERSEER::decipher($user_result[0][8],$GLOBALS[secret_key]);
			}
			$merg_array = array_merge($user_array, $temp_array);
			$adb->update_user_playlist($user_result[0][0], $user_result[0][1], $user_result[0][5], $merg_array);
			header("Location: $GLOBALS[url_path]$PHP_SELF?op=view&id=$ss_pls_id");
		break;

/////////////////////////////////////////////////////////////////////////////////////////////////////


		case "update playlist":
			if($HTTP_POST_VARS[id]){
				$ss_id = $HTTP_POST_VARS[id];
				$plst_name = $HTTP_POST_VARS[plst_name];
				$plst_mood = $HTTP_POST_VARS[plst_mood];
				$pub = $HTTP_POST_VARS[pub];
				$query = "SELECT plst_array FROM user_playlist WHERE id='$ss_id'";
				$plst_result = $adb->fetch_numeric($query);
				$plst_array = OVERSEER::decipher($plst_result[0][0],$GLOBALS[secret_key]);
			}
			//$plst_array = $adb->sorty($plst_array,r);
			$adb->update_user_playlist($ss_id, $plst_name, $plst_mood, $plst_array, $pub);
			header("Location: $GLOBALS[url_path]$PHP_SELF?op=view&id=$ss_id");
		break;



/////////////////////////////////////////////////////////////////////////////////////////////////////


		case "remove playlist":
			if($HTTP_POST_VARS[id]){
				$ss_id = $HTTP_POST_VARS[id];
				$adb->purge_record("$ss_id", "user_playlist");
			}
			header("Location: $GLOBALS[url_path]$PHP_SELF");
		break;




/////////////////////////////////////////////////////////////////////////////////////////////////////

		case "randomize":
			if($HTTP_POST_VARS[id]){
				$ss_id = $HTTP_POST_VARS[id];
				$query = "SELECT plst_array,plst_name,plst_mood FROM user_playlist WHERE id='$ss_id'";
				$plst_result = $adb->fetch_numeric($query);
				$plst_array = OVERSEER::decipher($plst_result[0][0],$GLOBALS[secret_key]);
				$plst_name = $plst_result[0][1];
				$plst_mood = $plst_result[0][2];
			}
			$plst_array = $adb->sorty($plst_array,r);
			$adb->update_user_playlist($ss_id, $plst_name, $plst_mood, $plst_array);
			header("Location: $GLOBALS[url_path]$PHP_SELF?op=view&id=$ss_id");
		break;

/////////////////////////////////////////////////////////////////////////////////////////////////////

		case "ascending":
			if($HTTP_POST_VARS[id]){
				$ss_id = $HTTP_POST_VARS[id];
				$query = "SELECT plst_array,plst_name,plst_mood FROM user_playlist WHERE id='$ss_id'";
				$plst_result = $adb->fetch_numeric($query);
				$plst_array = OVERSEER::decipher($plst_result[0][0],$GLOBALS[secret_key]);
				$plst_name = $plst_result[0][1];
				$plst_mood = $plst_result[0][2];
			}
			while(list($key, $val) = @each($plst_array)){
				$plst_info = $adb->pull_plst_info($val);

				if($plst_info[id3v1_title]) $title = $plst_info[id3v1_title];
				elseif($plst_info[id3v2_title]) $title = $plst_info[id3v2_title];
				else $title = "Untitled";

				// if the id3 tag is present.
				if(($plst_info[id3v1]) || ($plst_info[id3v2])){
					$tmp_array[$val] = $title;
				}else{
					// the filename will be used.
					// trim the .mp3 or .ogg extension off the file.
					$plst_info[filename] = eregi_replace(".$plst_info[file_type]", "", "$plst_info[filename]");
					$tmp_array[$val] = $plst_info[filename];
				}
			}//eo while
			$tmp_arrayy = $adb->sorty($tmp_array,a);
			$i=0;
			while(list($key, $val) = each($tmp_arrayy)){
				$plst_arrayy[$i++] = $key;
			}//eo while
			$adb->update_user_playlist($ss_id, $plst_name, $plst_mood, $plst_arrayy);
			header("Location: $GLOBALS[url_path]$PHP_SELF?op=view&id=$ss_id");
		break;

/////////////////////////////////////////////////////////////////////////////////////////////////////

		case "decending":
			if($HTTP_POST_VARS[id]){
				$ss_id = $HTTP_POST_VARS[id];
				$query = "SELECT plst_array,plst_name,plst_mood FROM user_playlist WHERE id='$ss_id'";
				$plst_result = $adb->fetch_numeric($query);
				$plst_array = OVERSEER::decipher($plst_result[0][0],$GLOBALS[secret_key]);
				$plst_name = $plst_result[0][1];
				$plst_mood = $plst_result[0][2];
			}
			while(list($key, $val) = @each($plst_array)){
				$plst_info = $adb->pull_plst_info($val);

				if($plst_info[id3v1_title]) $title = $plst_info[id3v1_title];
				elseif($plst_info[id3v2_title]) $title = $plst_info[id3v2_title];
				else $title = "Untitled";

				// if the id3 tag is present.
				if(($plst_info[id3v1]) || ($plst_info[id3v2])){
					$tmp_array[$val] = $title;
				}else{
					// the filename will be used.
					// trim the .mp3 or .ogg extension off the file.
					$plst_info[filename] = eregi_replace(".$plst_info[file_type]", "", "$plst_info[filename]");
					$tmp_array[$val] = $plst_info[filename];
				}
			}//eo while
			$tmp_arrayy = $adb->sorty($tmp_array,d);
			$i=0;
			while(list($key, $val) = each($tmp_arrayy)){
				$plst_arrayy[$i++] = $key;
			}//eo while
			$adb->update_user_playlist($ss_id, $plst_name, $plst_mood, $plst_arrayy);
			header("Location: $GLOBALS[url_path]$PHP_SELF?op=view&id=$ss_id");
		break;

/////////////////////////////////////////////////////////////////////////////////////////////////////

		case "delete playlist":
			while(list( ,$val) = each($HTTP_POST_VARS[plst_array])) $adb->purge_record("$val", "user_playlist");
			header("Location: $GLOBALS[url_path]$PHP_SELF");
		break;

		case "play pls":
		break;

		case "play m3u":
		break;
	}//eo switch
}else{
	// Display the first page
	$query ="SELECT id,plst_name,created,modified,plst_count,plst_mood,plst_visible ".
			"FROM user_playlist ".
			"WHERE plst_owner='$session_array[user_name]'";
	$pls_return_array = $os->fetch_assoc($query);
	$create_str = date($val[created]);
	$GLOBALS[contents01] .= "this is the place to view your saved playlists. <br>\n";
	$GLOBALS[contents01] .= "<form method=\"post\" action=\"$GLOBALS[url_path]$PHP_SELF\">\n";
	$GLOBALS[contents01] .= "<table cellpadding=\"1\" cellspacing=\"1\" border=\"0\"><tr>".
							"<td><input type=\"submit\" name=\"op\" value=\"delete selected\"><br><br></td>".
							"<td><input type=\"submit\" name=\"op\" value=\"create playlist\"><br><br></td>".
							"</tr></table>";

			// Setting up the current page
			if(empty($HTTP_GET_VARS[cur_page])) $cur_page = 1;
			else $cur_page = $HTTP_GET_VARS[cur_page];


				// need to get the total number of entries an array has
			$j=0;
			while(list($key00, $val00) = @each($pls_return_array)) $j++;
			$GLOBALS[real_return_array_count] = $j;

			// display the page number table here
			$GLOBALS[contents01] .= draw_pagenumbers($cur_page, $GLOBALS[rpp]);

	$GLOBALS[contents01] .= "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\n";
	$GLOBALS[contents01] .= "<tr bgcolor=\"$GLOBALS[bg_clr02]\">".
							"<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[body_font_size]\" color=\"$GLOBALS[body_head_font_clr]\">#</font></td>".
							"<td align=\"middle\"><input type=\"checkbox\" ONCLICK=\"check(this.form)\"></td><td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[body_font_size]\" color=\"$GLOBALS[body_head_font_clr]\">NAME</font></td>".
							"<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[body_font_size]\" color=\"$GLOBALS[body_head_font_clr]\">COUNT</font></td>".
							"<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[body_font_size]\" color=\"$GLOBALS[body_head_font_clr]\">MODIFIED</font></td>".
							"<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[body_font_size]\" color=\"$GLOBALS[body_head_font_clr]\">PUBLIC</font></td>".
							"<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[body_font_size]\" color=\"$GLOBALS[body_head_font_clr]\">MOOD</font></td>".
							"<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[body_font_size]\" color=\"$GLOBALS[body_head_font_clr]\">ACTION</font></td>".
							"</tr>\n";
	$hh=1;

			// this is where the numbering of the display entries happens
			$w = ($cur_page-1) * $GLOBALS[rpp] +1;

			// Split the array into chunks..
			$pls_return_array01 = $adb->array_chunk($pls_return_array, $GLOBALS[rpp], TRUE);
			//echo serialize($plst_array);

	while(list($key, $val) = @each($pls_return_array01[$cur_page-1])){

		//echo serialize($val)."<br>\n";


		//create the multi-colored rows
		if(($clr & 1)==1) $bgc = "#cccccc";
		elseif(($clr & 1)!=1) $bgc = "#eeeeee";

		$mod_date = date(" m/d/Y - g:i:s A",$val[modified]);
		$cre_date = date(" m/d/Y - g:i:s A",$val[created]);
		if($val[plst_visible]){
			$vis = "YES";
		}else{
			$vis = "NO";
		}
		$GLOBALS[contents01] .= "<tr bgcolor=\"$bgc\">".
								"<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$w</font></td>".
								"<td align=\"middle\"><input type=\"checkbox\" name=\"plst_array[$val[plst_name]]\" value=\"$val[id]\"></td><td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">&nbsp;<a href=\"$GLOBALS[url_path]$PHP_SELF?op=view&id=$val[id]\"><img src=\"$GLOBALS[img_path]/plst.gif\" border=\"0\" ALT=\"\">&nbsp;$val[plst_name]</a></font></td>".
								"<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$val[plst_count]</font></td>".
								"<td align=\"left\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$mod_date</font></td>".
								"<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$vis</font></td>".
								"<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\">$val[plst_mood]</font></td>".
								"<td align=\"right\"><font face=\"$GLOBALS[body_font_face]\" size=\"$GLOBALS[result_font_size]\"><a href=\"$GLOBALS[url_path]/playlist.m3u?plst=$val[id]\">[m3u]</a>&nbsp;<a href=\"$GLOBALS[url_path]/playlist.pls?plst=$val[id]\">[pls]</a></font></td>".
								"</tr>\n";
		$clr++;
		$hh++;
		$w++;
	}//eo while
	$GLOBALS[contents01] .= "</table>";

			// display the page number table here
			$GLOBALS[contents01] .= draw_pagenumbers($cur_page, $GLOBALS[rpp]);

	$GLOBALS[contents01] .= "</form>";
}//eo IF($HTTP_GET_VARS[op])




$js_script = <<<ENDjs_script

<SCRIPT TYPE="text/javascript">
<!--
var checkflag = "false";
function check(field) {
	if(checkflag == "false"){
		for (i = 0; i < field.length; i++){
			field[i].checked = true;
		}
		checkflag = "true";
		return "Uncheck All";
	}else{
		for (i = 0; i < field.length; i++){
			field[i].checked = false;
		}
		checkflag = "false";
		return "Check All";
	}
}
// -->
</script>

ENDjs_script;




$contents = array("$GLOBALS[page_title]"=>"$GLOBALS[contents01]");
draw_header("$GLOBALS[page_title]","","$js_script");
draw_nav($nav_array);
draw_sect($contents);
draw_footer();
ob_end_flush();
?>
Return current item: Mummi (Multi-user MOD_MP3 Interface)