diff --git a/html/lmbrowse.php b/html/lmbrowse.php index 7d41fe5..373acfc 100644 --- a/html/lmbrowse.php +++ b/html/lmbrowse.php @@ -1,8 +1,8 @@ ", + "
", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ); + + $replace_tab = array( + "&", + "\n ", + "", + "\n", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ); + + return( str_replace( $search_tab, $replace_tab, $input_text)); +} + + + /*--------------------------------------------------------------------------------------------------------------------*/ /* Make Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ @@ -709,11 +779,12 @@ function lmb_header( $page_id, $page_name, $img_path, $img_alt, $description, $k function lmb_footer() { - global $lmb_myname; - global $lmb_myver; - global $lmb_body_footer; - global $lmb_page_footer; - global $time_start; + global $lmb_url; + global $lmb_myname; + global $lmb_myver; + global $lmb_body_footer; + global $lmb_page_footer; + global $time_start; echo " @@ -745,6 +816,8 @@ function lmb_footer() + +         @@ -753,7 +826,7 @@ function lmb_footer() - + @@ -766,6 +839,8 @@ function lmb_footer() + + @@ -857,11 +932,69 @@ function lmb_welcome_tab( ) +/*--------------------------------------------------------------------------------------------------------------------*/ +/* News Tab Get */ +/*--------------------------------------------------------------------------------------------------------------------*/ + +function lmb_news_tab_get( ) +{ + global $lmb_url; + + + $news_file = "news.txt"; + + $line = array(); + $cmd = "sed -e 's/\t*\t/\t/g' ${news_file}"; + + exec( $cmd, $line); + + + for( $i = 0; $i < count($line); $i++) + { + $tab = explode( "\t", $line[$i]); + $css_row = ( $i + 1) % 2 + 1; + + if( count($tab) > 3) + { + $play_name = $tab[3]; + $play_type = $tab[4]; + $play_id = $tab[5]; + $play_priority = $tab[6]; + + $news_tab[$i]["name"] = "{$play_name}"; + $news_tab[$i]["rlink"] = "{$lmb_url}?page=play&type={$play_type}&id={$play_id}&priority={$play_priority}"; + $news_tab[$i]["alink"] = "http://www.langueur-monotone.com{$news_tab[$i]["rlink"]}"; + $news_tab[$i]["rimg"] = "/discography/{$play_type}/{$play_priority}-{$play_id}/covers/{$play_id}-cover-1-icon.png"; + $news_tab[$i]["aimg"] = "http://www.langueur-monotone.com{$news_tab[$i]["rimg"]}"; + } + else + { + $news_tab[$i]["name"] = ""; + } + + $news_tab[$i]["date"] = $tab[0]; + $news_tab[$i]["title"] = $tab[1]; + + if( $tab[2] != ".") + { + $news_tab[$i]["news"] = $tab[2]; + } + else + { + $news_tab[$i]["news"] = ""; + } + } + + return($news_tab); +} + + + /*--------------------------------------------------------------------------------------------------------------------*/ /* News Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ -function lmb_news_tab( ) +function lmb_news_tab_old( ) { global $lmb_url; @@ -918,6 +1051,64 @@ function lmb_news_tab( ) } +/*--------------------------------------------------------------------------------------------------------------------*/ +/* News Tab */ +/*--------------------------------------------------------------------------------------------------------------------*/ + +function lmb_news_tab( ) +{ + global $lmb_url; + + + $news_tab = lmb_news_tab_get(); + + ob_start(); + + for( $i=0; $i < count($news_tab); $i++) + { + $css_row = ( $i + 1) % 2 + 1; + + if( "{$news_tab[$i]["name"]}" != "") + { + $height = 110; + $link_tag = ""; + $img_tag = "\"\"/"; + $play_tag=" + "; + $colspan_tag = ""; + } + else + { + $play_tag = ""; + $cover_tag = ""; + $colspan_tag = "colspan=\"3\""; + } + + if( $news_tab[$i]["news"] != "") + { + $news = "
{$news_tab[$i]["title"]}

{$news_tab[$i]["news"]}

"; + } + else + { + $news = "
{$news_tab[$i]["title"]}

"; + } + + echo "
+ + + +{$play_tag} + +"; + } + + $data = ob_get_contents(); + ob_end_clean(); + + lmb_make_tab( "news", "news", "r", "/images/lm-logo5-n-220.png", $data); +} + + /*--------------------------------------------------------------------------------------------------------------------*/ /* Main Body */ @@ -950,6 +1141,83 @@ function lmb_main_page() +/*--------------------------------------------------------------------------------------------------------------------*/ +/* RSS Page */ +/*--------------------------------------------------------------------------------------------------------------------*/ + +function lmb_rss_page() +{ + header( 'Content-Type: application/rss+xml'); + + echo " + + + + Langueur Monotone News Page + http://www.langueur-monotone.com/?page=rss + + Langueur Monotone project news RSS feed + + http://www.langueur-monotone.com/images/lm-logo6-n-220.png + Langueur Monotone News Page + http://www.langueur-monotone.com/?page=rss + +"; + + $news_tab = lmb_news_tab_get(); + + for( $i=0; $i < count($news_tab); $i++) + { + $news = lmb_xml_text_format( $news_tab[$i]["news"]); + $pubdate = date("r", strtotime($news_tab[$i]["date"])); + + echo " +"; + + if( "{$news_tab[$i]["name"]}" != "") + { + echo " {$news_tab[$i]["title"]}: {$news_tab[$i]["name"]} +"; + } + else + { + echo " {$news_tab[$i]["title"]} +"; + } + + echo " {$pubdate} + Langueur Monotone + http://www.langueur-monotone.com/#$i +"; + + if( "{$news_tab[$i]["name"]}" != "") + { + echo " + {$news_tab[$i]["alink"]} + {$news_tab[$i]["alink"]} +"; + } + else + { + echo " {$news} +"; + } + + echo " +"; + } + + echo " + + +"; +} + + + /*--------------------------------------------------------------------------------------------------------------------*/ /* About Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ @@ -1135,7 +1403,7 @@ function lmb_playlist_next( $play_type, $path, $row) { $tab=explode( "\t", $line[$i]); - if( "{$tab[4]}" != "") + if( ( count($tab) >4 ) && ( "{$tab[4]}" != "")) { $icon = "/images/{$tab[4]}"; } @@ -1146,7 +1414,16 @@ function lmb_playlist_next( $play_type, $path, $row) $css_row=($row+1)%2+1; - echo " + if( count($tab) > 3) + { + $comment = $tab[3]; + } + else + { + $comment = ""; + } + + echo " "; } } @@ -1330,42 +1607,52 @@ function lmb_track_info_get( $play_type, $play_id, $play_priority, $track_id) $line = array(); $track_info = array(); - $cmd="eval \$( metaflac --export-tags-to=- \"${track_file}\" | grep -v -e \".* .*=\" -e \".*-.*=\" | sed -e 's/=/=\\\"/' -e 's/$/\"/') + if( count($track_array) == 0) + { + $track_info["status"] = 0; + } + else + { + $track_info["status"] = 1; + + + $cmd="eval \$( metaflac --export-tags-to=- \"${track_file}\" | grep -v -e \".* .*=\" -e \".*-.*=\" | sed -e 's/=/=\\\"/' -e 's/$/\"/') echo -e \"\${TRACKNUMBER}\t\$(basename ${track_file} .flac)\t\${ARTIST}\t\${ALBUM}\t\$(echo \${TITLE} | sed 's/ (.*//')\t\$(echo \${TITLE} | sed -e 's/.* (//' -e 's/)$//')\t\${COMPOSER}\t\${COMMENT}\t\$(metaflac --show-sample-rate \"${track_file}\")\t\$(metaflac --show-total-samples \"${track_file}\")\t\${SAFECREATIVE}\""; - exec($cmd, $line); + exec($cmd, $line); - $tab = explode( "\t", $line[0]); + $tab = explode( "\t", $line[0]); - $track_info["id"] = $tab[0]; - $track_info["file"] = $tab[1]; - $track_info["artist"] = $tab[2]; - $track_info["album"] = $tab[3]; - $track_info["title"] = $tab[4]; - $track_info["mix"] = $tab[5]; - $track_info["composer"] = $tab[6]; - $track_info["comment"] = $tab[7]; - $track_info["sample_rate"] = $tab[8]; - $track_info["sample_nb"] = $tab[9]; + $track_info["id"] = $tab[0]; + $track_info["file"] = $tab[1]; + $track_info["artist"] = $tab[2]; + $track_info["album"] = $tab[3]; + $track_info["title"] = $tab[4]; + $track_info["mix"] = $tab[5]; + $track_info["composer"] = $tab[6]; + $track_info["comment"] = $tab[7]; + $track_info["sample_rate"] = $tab[8]; + $track_info["sample_nb"] = $tab[9]; - if( "{$track_info["title"]}" == "{$track_info["mix"]}") - { + if( "{$track_info["title"]}" == "{$track_info["mix"]}") + { $track_info["mix"]=""; + } + + $total = intval( $track_info["sample_nb"] / $track_info["sample_rate"]); + $min = intval( $total / 60); + $sec = $total - $min * 60; + + $track_info["length"] = "{$min}' {$sec}\""; + $track_info["duration"] = "PT{$min}M{$sec}S"; + $track_info["safe_creative"] = $tab[10]; + + $search_tab = array( "/flac/", ".flac"); + $replace_tab = array( "/mp3-192/", ".mp3"); + + $track_info["url"] = "/".str_replace( $search_tab, $replace_tab, "${track_file}"); } - $total = intval( $track_info["sample_nb"] / $track_info["sample_rate"]); - $min = intval( $total / 60); - $sec = $total - $min * 60; - - $track_info["length"] = "{$min}' {$sec}\""; - $track_info["duration"] = "PT{$min}M{$sec}S"; - $track_info["safe_creative"] = $tab[10]; - - $search_tab = array( "/flac/", ".flac"); - $replace_tab = array( "/mp3-192/", ".mp3"); - - $track_info["url"] = "/".str_replace( $search_tab, $replace_tab, "${track_file}"); - return( $track_info); } @@ -1391,16 +1678,39 @@ function lmb_track_file_tag_get( $play_type, $play_id, $play_priority, $track_id $dir = basename( $file_dir); $tab = explode( "-", $dir); $file_type = $tab[0]; - $file_subtype = $tab[1]; - $file_pat = "{$track_path}/{$dir}/{$track_id}-*.{$file_type}"; + if( count( $tab) > 1) + { + $file_subtype = $tab[1]; + } + else + { + $file_subtype = ""; + } + + if( "{$track_id}" == "00") + { + $file_pat = "{$track_path}/{$dir}/01-*.{$file_type}"; + } + else + { + $file_pat = "{$track_path}/{$dir}/{$track_id}-*.{$file_type}"; + } + $file_tab = glob( "{$file_pat}"); - $file_url = $file_tab[0]; + + if( count( $file_tab) > 0) + { + $file_url = $file_tab[0]; + } + else + { + $file_url = ""; + } + $file_tag = "{$file_tag} +"; + } + echo " "; } @@ -1604,6 +1925,7 @@ function lmb_cover_file_tab_get( $play_type, $play_id, $play_priority, $cover_id exec( $cmd, $cover_format_tab); $file_tab = array(); + $file_tag = ""; for( $i = 0; $i < count($cover_format_tab); $i++) { @@ -1669,7 +1991,7 @@ function lmb_coverlist( $play_type, $play_id, $play_priority) "; - lmb_file_entry_print( $file_tab, "covers3", "covers4", "{$entry_tag}"); + lmb_file_entry_print( $file_tab, "covers3", "covers4", "{$entry_tag}", count( $file_tab)); for( $i = 0; $i < count($sheet_tab); $i++) { @@ -1699,7 +2021,7 @@ function lmb_coverlist( $play_type, $play_id, $play_priority) "; - lmb_file_entry_print( $file_tab, "covers3", "covers4", "{$entry_tag}"); + lmb_file_entry_print( $file_tab, "covers3", "covers4", "{$entry_tag}", count( $file_tab)); } @@ -1708,8 +2030,6 @@ function lmb_coverlist( $play_type, $play_id, $play_priority) ob_end_clean(); lmb_make_tab( "covers", "covers", "l", "{$logo_path}-2-128.png", $data); - - return( $row); } @@ -1797,7 +2117,7 @@ function lmb_videolist( $play_type, $play_id, $play_priority) "; - lmb_file_entry_print( $file_tab, "videos5", "videos6", $entry_tag); + lmb_file_entry_print( $file_tab, "videos5", "videos6", $entry_tag, count( $file_tab)); for( $i = 0; $i < count($video_tab); $i++) { @@ -1825,7 +2145,7 @@ function lmb_videolist( $play_type, $play_id, $play_priority) "; - lmb_file_entry_print( $file_tab, "videos5", "videos6", "{$entry_tag}"); + lmb_file_entry_print( $file_tab, "videos5", "videos6", "{$entry_tag}", count( $file_tab)); } } @@ -1834,8 +2154,6 @@ function lmb_videolist( $play_type, $play_id, $play_priority) ob_end_clean(); lmb_make_tab( "videos", "videos", "r", "{$logo_path}-1-128.png", $data); - - return( $row); } @@ -1852,10 +2170,11 @@ function lmb_extra_file_tab_get( $play_type, $play_id, $play_priority, $extra_id $play_path="discography/{$play_type}/{$play_priority}-{$play_id}"; $extra_path="{$play_path}/extras"; - $cmd = "ls {$extra_path}/{$play_id}-{$extra_id}-*.png | sed -e 's/.*-//' -e 's/.png$//' | sort -rnu"; + $cmd = "ls {$extra_path}/{$play_id}-{$extra_id}-*.png | sed -e 's/.*-//' -e 's/.png$//' | sort -nu"; exec( $cmd, $extra_format_tab); $file_tab = array(); + $file_tag = ""; for( $i = 0; $i < count($extra_format_tab); $i++) { @@ -1905,7 +2224,7 @@ function lmb_extralist( $play_type, $play_id, $play_priority) ob_start(); - $cmd="ls {$extra_path}/{$play_id}-*-*-icon.png | sed -e 's/-icon.png$//' -e 's/.*{$play_id}-.*-//' | sort -rnu"; + $cmd="ls {$extra_path}/{$play_id}-*-*-icon.png | sed -e 's/-icon.png$//' -e 's/.*{$play_id}-.*-//' | sort -u"; exec($cmd, $format_tab); if( count($format_tab) == 0 || ( file_exists( "{$extra_path}/.hide" ) && ! lmb_admin_is())) @@ -1921,22 +2240,30 @@ function lmb_extralist( $play_type, $play_id, $play_priority) $title_tag = " "; + $file_tab = array(); + $max_file_nb = 0; + + foreach( $format_tab as $format) + { + $file_tab[ $format] = lmb_extra_file_tab_get( $play_type, $play_id, $play_priority, "*-{$format}", "MULTI"); + $max_file_nb = max( $max_file_nb, count( $file_tab[ $format])); + } + foreach( $format_tab as $format) { - $file_tab = lmb_extra_file_tab_get( $play_type, $play_id, $play_priority, "*-{$format}", "MULTI"); $extra_format = str_replace( "_", "/", "{$format}"); - + $entry_tag = " ${title_tag} "; - lmb_file_entry_print( $file_tab, "extras5", "extras6", "{$entry_tag}"); + lmb_file_entry_print( $file_tab[ $format], "extras5", "extras6", "{$entry_tag}", $max_file_nb); $title_tag = ""; } - $cmd="ls {$extra_path}/{$play_id}-*-*-icon.png | sed -e 's/-icon.png$//' -e 's/.*{$play_id}-//'"; + $cmd="ls {$extra_path}/{$play_id}-*-*-icon.png | sed -e 's/-icon.png$//' -e 's/.*{$play_id}-//' | sort "; exec($cmd, $extra_tab); $height = max( 86, ( ( 220 - 30 * $format_nb) / count($extra_tab))); @@ -1957,13 +2284,13 @@ ${title_tag} - + "; - lmb_file_entry_print( $file_tab, "extras5", "extras6", "{$entry_tag}"); + lmb_file_entry_print( $file_tab, "extras5", "extras6", "{$entry_tag}", $max_file_nb); } } @@ -1981,12 +2308,13 @@ ${title_tag}
               {$link_tag}{$news_tab[$i]["name"]}{$link_tag}{$img_tag}
{$news_tab[$i]["date"]}".lmb_html_text_format( "{$news}")."
\"\"/{$tab[0]} {$tab[1]} {$tab[2]} {$tab[3]} 
\"\"/{$tab[0]} {$tab[1]} {$tab[2]} {$comment} 
"; -// echo "TI: $track_id | FD: $tab[0] | FP: $file_pat | file_url: {$file_url}
"; - if( count( glob( "{$file_url}"))) { if( "{$track_id}" == "00") @@ -1555,8 +1865,6 @@ function lmb_tracklist( $play_type, $play_id, $play_priority) ob_end_clean(); lmb_make_tab( "tracks", "tracks", "r", "/images/lm-logo3-n-96.png", $data); - - return( $row); } @@ -1565,7 +1873,7 @@ function lmb_tracklist( $play_type, $play_id, $play_priority) /* File Entry Print */ /*--------------------------------------------------------------------------------------------------------------------*/ -function lmb_file_entry_print( $file_tab, $format_css_id, $size_css_id, $entry_tag) +function lmb_file_entry_print( $file_tab, $format_css_id, $size_css_id, $entry_tag, $max_nb) { echo "{$entry_tag}"; @@ -1582,6 +1890,19 @@ function lmb_file_entry_print( $file_tab, $format_css_id, $size_css_id, $entry_t "; } +for( $i = count( $file_tab); $i < $max_nb; $i++) + { + echo "
+ + + + + +
+
  All the Covers \"\"/  {$sheet_name}   All the Videos  {$video_mix_name}   All the Extras 
 {$extra_format} &nbs $css_row = $i % 2 + 1; $entry_tag = "
\"\"/\"\"/  {$extra_type}   {$extra_subid}   {$extra_format} &nbs function lmb_links_tab( $play_type, $play_id, $play_priority) { - $play_path="discography/{$play_type}/{$play_priority}-{$play_id}"; - $links_file = "{$play_path}/.links"; + $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; + $global_links_file = ".links"; + $local_links_file = "{$play_path}/.links"; $line = array(); - $cmd = "sed -e 's/\t*\t/\t/g' ${links_file}"; + $cmd = "cat ${local_links_file} ${global_links_file} | sed -e 's/\t*\t/\t/g'"; exec( $cmd, $line); @@ -1999,10 +2327,18 @@ function lmb_links_tab( $play_type, $play_id, $play_priority) $tab = explode( "\t", $line[$i]); $css_row = ( $i + 1) % 2 + 1; - $text = lmb_html_text_format( "{$tab[0]}"); - $link = htmlentities( "{$tab[1]}"); - $image = "{$tab[2]}"; - $flag = "{$tab[3]}"; + $text = lmb_html_text_format( "{$tab[0]}"); + $link = htmlentities( "{$tab[1]}"); + $image = "{$tab[2]}"; + + if( count( $tab) > 3) + { + $flag = "{$tab[3]}"; + } + else + { + $flag = ""; + } if( $flag == "nf") { @@ -2519,7 +2855,7 @@ function lmb_track_intro( $play_type, $play_id, $play_priority, $track_id, $trac - + @@ -2648,28 +2984,59 @@ function lmb_track_download( $play_type, $play_id, $play_priority, $track_id, $t $play_tab = explode( "-", $path_tab[2]); $track_tab = explode( "-", $path_tab[5]); - $mix_tab[$i]["play_type"] = $path_tab[1]; - $mix_tab[$i]["play_type_name"] = lmb_play_type_name_get( $path_tab[1]); - $mix_tab[$i]["play_id"] = $play_tab[1]; - $mix_tab[$i]["play_pri"] = $play_tab[0]; - $mix_tab[$i]["track_id"] = $track_tab[0]; + $play_type = $path_tab[1]; + $play_pri = $play_tab[0]; + $play_id = $play_tab[1]; - $mix_tab[$i]["play_url"] = "{$lmb_url}?page=play&type={$mix_tab[$i]["play_type"]}&id={$mix_tab[$i]["play_id"]}&priority={$mix_tab[$i]["play_pri"]}"; - $mix_tab[$i]["mix_url"] = "{$lmb_url}?page=track&type={$mix_tab[$i]["play_type"]}&id={$mix_tab[$i]["play_id"]}&priority={$mix_tab[$i]["play_pri"]}&tid={$mix_tab[$i]["track_id"]}"; - $track_info = lmb_track_info_get( $mix_tab[$i]["play_type"], $mix_tab[$i]["play_id"], $mix_tab[$i]["play_pri"], $mix_tab[$i]["track_id"]); + if( file_exists( "discography/{$play_type}/{$play_pri}-{$play_id}/.hide" )) + { + $hide = "y"; + } + else + { + $hide = "n"; + } - $mix_tab[$i]["track_name"] = $track_info["title"]; - $mix_tab[$i]["mix_name"] = $track_info["mix"]; - $mix_tab[$i]["play_name"] = $track_info["album"]; + if( ( $hide == "n") || lmb_admin_is()) + { + $mix_tab[$k]["hide"] = $hide; + + $mix_tab[$k]["play_type"] = $play_type; + $mix_tab[$k]["play_type_name"] = lmb_play_type_name_get( $path_tab[1]); + $mix_tab[$k]["play_id"] = $play_id; + $mix_tab[$k]["play_pri"] = $play_pri; + $mix_tab[$k]["track_id"] = $track_tab[0]; + + $mix_tab[$k]["play_url"] = "{$lmb_url}?page=play&type={$mix_tab[$k]["play_type"]}&id={$mix_tab[$k]["play_id"]}&priority={$mix_tab[$k]["play_pri"]}"; + $mix_tab[$k]["mix_url"] = "{$lmb_url}?page=track&type={$mix_tab[$k]["play_type"]}&id={$mix_tab[$k]["play_id"]}&priority={$mix_tab[$k]["play_pri"]}&tid={$mix_tab[$k]["track_id"]}"; + + $track_info = lmb_track_info_get( $mix_tab[$k]["play_type"], $mix_tab[$k]["play_id"], $mix_tab[$k]["play_pri"], $mix_tab[$k]["track_id"]); + + $mix_tab[$k]["track_name"] = $track_info["title"]; + $mix_tab[$k]["mix_name"] = $track_info["mix"]; + $mix_tab[$k]["play_name"] = $track_info["album"]; + + $k++; + } } + for( $k = 0; $k < count( $mix_tab); $k++) { + if( "{$mix_tab[$k]["hide"]}" == "y") + { + $hide_flag="*"; + } + else + { + $hide_flag=""; + } + $css_row = ( $k + 1 + count( $mix_tab)) % 2 + 3; echo " - + @@ -3141,13 +3508,29 @@ function lmb_fl_page( $lmb_id, $lmb_name, $lmb_curver, $lmb_currel) function lmb_get_proceed( $get_array) { + global $lmb_tab; + + lmb_admin_update(); lmb_cookie_update( $get_array); - $page_id=$get_array["page"]; + if( array_key_exists ( "page", $get_array)) + { + $page_id=$get_array["page"]; + } + else + { + $page_id=""; + } switch ($page_id) { + case "rss": + { + lmb_rss_page( ); + break; + } + case "about": { lmb_about_page( $lmb_tab); @@ -3234,7 +3617,7 @@ function lmb_get_proceed( $get_array) default: { - lmb_main_page( $lmb_tab); + lmb_main_page( ); break; } }
Informations
{$mix_tab[$k]["track_name"]}{$mix_tab[$k]["track_name"]}{$hide_flag} {$mix_tab[$k]["mix_name"]} {$mix_tab[$k]["play_type_name"]} {$mix_tab[$k]["play_name"]}