$criterion) { $criteria[$index] = is_array($criterion) ? array_pad($criterion, 3, null) : array($criterion, SORT_ASC, null); } return function($first, $second) use (&$criteria) { foreach ($criteria as $criterion) { // How will we compare this round? list($column, $sortOrder, $projection) = $criterion; $sortOrder = $sortOrder === SORT_DESC ? -1 : 1; // If a projection was defined project the values now if ($projection) { $lhs = call_user_func($projection, $first[$column]); $rhs = call_user_func($projection, $second[$column]); } else { $lhs = $first[$column]; $rhs = $second[$column]; } // Do the actual comparison; do not return if equal if ($lhs < $rhs) { return -1 * $sortOrder; } else if ($lhs > $rhs) { return 1 * $sortOrder; } } return 0; // tiebreakers exhausted, so $first == $second }; } function lmb_sort_multi_array( $array, $key) { $keys = array(); for ($i=1;$i 1024; $i++) { $size = intval( $size / 1024); } $size_tab["size"] = $size; $size_tab["unit"] = $unit_tab[$i]; return( $size_tab); } /*--------------------------------------------------------------------------------------------------------------------*/ /* HTML Text Format */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_html_text_format( $input_text) { $search_tab = array( "&", "\n", "< >", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ); $replace_tab = array( "&", "
\n ", " ", "", "", "", "", "", "", "", "", "", "", "
", "
 
", "
", "
" ); return( str_replace( $search_tab, $replace_tab, $input_text)); } /* G+1 Synchronius
G+1 Asynchronius
 
 
*/ /*--------------------------------------------------------------------------------------------------------------------*/ /* XML Text Format */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_xml_text_format( $input_text) { $search_tab = array( "&", "\n", "< >", "
", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ); $replace_tab = array( "&", "\n ", "", "\n", "", "", "", "", "", "", "", "", "", "", "", "", "" ); return( str_replace( $search_tab, $replace_tab, $input_text)); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Make Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_make_tab( $tab_id, $css_id, $tab_side, $logo_path, $data) { $tab_file = "tab-{$tab_id}-{$tab_side}.png"; $image_path = "/images"; $tab_path = "{$image_path}/{$tab_file}"; if( "$tab_side" == "l") { $logo_side="r"; } else { $logo_side="l"; } $tab_tag = "\"\"/"; $logo_tag = "\"\"/"; if( "$tab_side" == "l") { $l_tag = "{$tab_tag}"; $r_tag = "{$logo_tag}"; } else { $l_tag = "$logo_tag"; $r_tag = "$tab_tag"; } echo " {$l_tag} {$r_tag}
  "; echo $data; echo "
 
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Spacer */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_spacer( $size) { echo " "; for( $i = 0; $i < $size; $i++) { echo "
"; } echo " "; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Menu */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_menu( $menu_id) { global $lmb_url; for( $i = 0; $i < 3; $i++) { if( $i == $menu_id) { $mode="off"; } else { $mode="on"; } switch($i) { case 0: { if( $i == $menu_id) { echo " \"Home "; } else { echo " "; } break; } case 1: { if( $i == $menu_id) { echo " \"About\"/ "; } else { echo " "; } break; } case 2: { if( $i == $menu_id) { echo " \"Discography\"/ "; } else { echo " "; } break; } default: { break; } } if( $i < 2) { echo " \"\"/ "; } } } /*--------------------------------------------------------------------------------------------------------------------*/ /* Header */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_header( $page_id, $page_name, $img_path, $img_alt, $description, $keywords, $min_width) { global $lmb_keywords; header('Content-type: text/html; charset=iso-8859-1'); $page_title = "$page_name"; $keywords = "$lmb_keywords,$keywords"; if( $min_width != 0) { $mw_tag = "min-width: {$min_width}px;"; } else { $mw_tag = ""; } // echo ""; // echo ""; echo ""; // echo ""; echo " "; echo " $page_name "; echo " "; echo " "; echo " "; /* echo " "; */ echo " "; echo " "; /* echo " "; */ echo " "; echo "
\"\"/ \"\"/\"Langueur

Langueur Monotone

\"\"/ \"\"/
\"$img_alt\"/

$img_alt

\"\"/ \"\"/
"; lmb_menu($page_id); echo "
\"\"/ \"\"/
"; echo "
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Footer */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_footer() { global $lmb_url; global $lmb_myname; global $lmb_myver; global $lmb_body_footer; global $lmb_page_footer; global $time_start; echo "
\"\"/ \"\"/
\"\"/ "; echo "
       
"; if( lmb_admin_is()) { echo " "; } else { echo " "; } $time_stop = microtime_float(); $time_elaps = intval( ( $time_stop - $time_start) * 1000) / 1000; echo "
                           
Page generated in $time_elaps seconds by {$lmb_myname} V {$lmb_myver}
\"\"/
\"\"/
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Welcome Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_welcome_tab( ) { $welcome_file = "welcome.txt"; $welcome_string = file_get_contents( "{$welcome_file}"); ob_start(); echo " ".lmb_html_text_format( "{$welcome_string}")." "; $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "welcome", "welcome", "l", "/images/lm-logo5-n-220.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* 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( ) { 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=" {$link_tag}{$news_tab[$i]["name"]} {$link_tag}{$img_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 " {$news_tab[$i]["date"]} ".lmb_html_text_format( "{$news}")." {$play_tag} "; } $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "news", "news", "r", "/images/lm-logo5-n-220.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Main Body */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_main_body() { lmb_welcome_tab(); lmb_spacer(4); lmb_news_tab(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Main Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_main_page() { global $lmb_tab; lmb_header( 0, "Langueur Monotone - Home Page", "/images/title-home_page.png", "Home Page", "Langueur Monotone home page, entry point to information, news and links", "home page", 0); lmb_main_body(); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* SiteMap Item */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_sitemap_item( $item_type, $page_url, $img_tab) { global $lmb_url; echo " "; echo " http://www.langueur-monotone.com{$lmb_url}${page_url} 2013-08-20 weekly 0.5 "; if( isset( $img_tab)) { foreach( $img_tab as $img) { echo " http://www.langueur-monotone.com/{$img["url"]} {$img["title"]} "; } } echo " "; } /*--------------------------------------------------------------------------------------------------------------------*/ /* SiteMap Track */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_sitemap_track( $play_type, $play_id, $play_priority, $track_id) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $url = "?page=track&type={$play_type}&id={$play_id}&priority={$play_priority}&tid={$track_id}"; $img_tab = array(); $size = 1024; lmb_sitemap_item( "track", "{$url}", $img_tab); } /*--------------------------------------------------------------------------------------------------------------------*/ /* SiteMap Play */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_sitemap_play( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path = "{$play_path}/covers"; $extra_path = "{$play_path}/extras"; $play_info = lmb_play_info_get( $play_type, $play_id, $play_priority); $url = "?page=play&type={$play_type}&id={$play_id}&priority={$play_priority}"; $img_tab = array(); $img_idx = 0; $play_title = lmb_play_title_get( $play_type, $play_id, $play_priority); $img_tab[$img_idx ]["url"] = "{$play_path}/logos/{$play_id}-logo-1-128.png"; $img_tab[$img_idx++]["title"] = "Langueur Monotone - {$play_title} - Logo 1"; $img_tab[$img_idx ]["url"] = "{$play_path}/logos/{$play_id}-logo-2-128.png"; $img_tab[$img_idx++]["title"] = "Langueur Monotone - {$play_title} - Logo 2"; /* Cover Dump */ $cmd = "ls {$cover_path}/{$play_id}-cover-*.png | sed -e 's/.*{$play_id}-//' | grep -v icon.png | sort "; exec( $cmd, $cover_tab); for( $i = 0, $j = 1; $i < count($cover_tab); $i++, $j++) { $cover_info_tab = explode( "-", $cover_tab[$i]); $nb = $cover_info_tab[1]; $size = str_replace( ".png", "", $cover_info_tab[2]); $img_tab[$img_idx ]["url"] = "{$cover_path}/{$play_id}-{$cover_tab[$i]}"; $img_tab[$img_idx++]["title"] = "Langueur Monotone - {$play_title} - Cover {$nb} ({$size})"; } /* Extra Dump */ if( ! file_exists( "{$extra_path}/.hide" )) { $cmd = "ls {$extra_path}/{$play_id}-*.png | sed -e 's/.*{$play_id}-//' | grep -v icon.png | sort "; exec($cmd, $extra_tab); for( $i = 0, $j = 1; $i < count($extra_tab); $i++, $j++) { $extra_info_tab = explode( "-", $extra_tab[$i]); $type = ucfirst( $extra_info_tab[0]); $nb = $extra_info_tab[1]; $format = str_replace( "_", "/", $extra_info_tab[2]); $size = str_replace( ".png", "", $extra_info_tab[3]); $img_tab[$img_idx ]["url"] = "{$extra_path}/{$play_id}-{$extra_tab[$i]}"; $img_tab[$img_idx++]["title"] = "Langueur Monotone - {$play_title} - Extra - {$type} {$nb} ({$format}-{$size})"; } } lmb_sitemap_item( "play", "{$url}", $img_tab); $track_list_info = lmb_tracklist_info_get( $play_type, $play_id, $play_priority); foreach( $track_list_info as $track_info) { lmb_sitemap_track( $play_type, $play_id, $play_priority, str_pad( "{$track_info["id"]}", 2, '0', STR_PAD_LEFT)); } } /*--------------------------------------------------------------------------------------------------------------------*/ /* SiteMap Play Type */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_sitemap_play_type( $play_type) { $path = "discography/{$play_type}"; $line = array(); $cmd = "ls -d {$path}/??-* | sed -e 's/.*\///'"; exec($cmd, $line); for( $i = 0; $i < count($line); $i++) { $play_tab = explode( "-", $line[$i]); $play_priority = $play_tab[0]; $play_id = $play_tab[1]; if( ! file_exists( "{$path}/{$play_priority}-{$play_id}/.hide" )) { lmb_sitemap_play( $play_type, $play_id, $play_priority); } } } /*--------------------------------------------------------------------------------------------------------------------*/ /* SiteMap Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_sitemap_page() { global $lmb_myname; global $lmb_myver; global $time_start; header( 'Content-Type: application/xml'); echo " "; $img_tab = array(); $size = 220; $img_tab[0]["url"] = "{$play_path}/images/lm-logo5-n-{$size}.png"; $img_tab[0]["title"] = "Langueur Monotone - Logo 5 ({$size})"; lmb_sitemap_item( "top", "", $img_tab); // $img_tab = array(); // lmb_sitemap_item( "page", "?page=rss", $img_tab); $img_tab = array(); $size = 220; $img_tab[0]["url"] = "{$play_path}/images/lm-logo6-n-{$size}.png"; $img_tab[0]["title"] = "Langueur Monotone - Logo 6 ({$size})"; lmb_sitemap_item( "page", "?page=about", $img_tab); $img_tab = array(); lmb_sitemap_item( "page", "?page=discography", $img_tab); lmb_sitemap_play_type( "ep", $img_tab); lmb_sitemap_play_type( "lp", $img_tab); lmb_sitemap_play_type( "oldies", $img_tab); $time_stop = microtime_float(); $time_elaps = intval( ( $time_stop - $time_start) * 1000) / 1000; echo " "; } /*--------------------------------------------------------------------------------------------------------------------*/ /* RSS Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_rss_page() { global $lmb_myname; global $lmb_myver; global $time_start; 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 " "; $time_stop = microtime_float(); $time_elaps = intval( ( $time_stop - $time_start) * 1000) / 1000; echo " "; } /*--------------------------------------------------------------------------------------------------------------------*/ /* About Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_about_tab( ) { $about_file = "about.txt"; $about_string = file_get_contents( "{$about_file}"); ob_start(); echo " "; // echo str_replace( "\n", "
\n ", "{$about_string}"); echo " ".lmb_html_text_format( "{$about_string}")." "; $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "about", "about", "l", "/images/lm-logo6-n-220.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* History Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_history_tab() { $history_file = "history.txt"; $history_string = file_get_contents( "{$history_file}"); $history_tab = explode( "\n\n", "{$history_string}"); ob_start(); for( $i = 0; $i < count($history_tab); $i++) { $history_line = explode( "\n", "{$history_tab[$i]}"); $css_row = ( $i + 1) % 2 + 1; echo " {$history_line[0]} {$history_line[1]}
"; for( $j = 2; $j < count($history_line); $j++) { echo " ".lmb_html_text_format( "{$history_line[$j]}")."
"; } echo "
"; } $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "history", "history", "r", "/images/lm-logo6-n-220.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* About Body */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_about_body( $lmb_tab) { lmb_about_tab(); lmb_spacer(4); lmb_history_tab(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* About Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_about_page() { global $lmb_tab; lmb_header( 1, "Langueur Monotone - About Page", "/images/title-about.png", "About", "Langueur Monotone about page, describing the project, the members and its history", "about", 0); lmb_about_body( $lmb_tab); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Info Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_info_get( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $cmd = "sed -e 's/\t*\t/\t/g' {$play_path}/.list"; $line = array(); $play_info = array(); exec( $cmd, $line); $tab = explode( "\t", $line[0]); $play_info["name"] = $tab[0]; $play_info["month"] = $tab[1]; $play_info["year"] = $tab[2]; $play_info["comment"] = $tab[3]; return($play_info); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play List Cur */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_playlist_cur( $play_type, $path, $row) { global $lmb_url; $line=array(); $cmd="ls -d {$path}/??-* | sed -e 's/.*\///'"; exec($cmd, $line); for( $i = 0; $i < count($line); $i++, $row++) { $play_tab = explode( "-", $line[$i]); $play_priority = $play_tab[0]; $play_id = $play_tab[1]; if( ! file_exists( "{$path}/{$play_priority}-{$play_id}/.hide" ) || lmb_admin_is()) { $play_info = lmb_play_info_get( $play_type, $play_id, $play_priority); $css_row = ($row+1)%2+1; $url = "{$lmb_url}?page=play&type={$play_type}&id={$play_tab[1]}&priority={$play_tab[0]}"; echo " \"\"/{$play_info["name"]} {$play_info["month"]} {$play_info["year"]} {$play_info["comment"]}  "; } else { $row--; } } return( $row); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play List Next */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_playlist_next( $play_type, $path, $row) { $line=array(); $cmd="sed -e 's/\t*\t/\t/g' ${path}/.list"; exec($cmd, $line); for( $i = 0; $i < count($line); $i++, $row++) { $tab=explode( "\t", $line[$i]); if( ( count($tab) >4 ) && ( "{$tab[4]}" != "")) { $icon = "/images/{$tab[4]}"; } else { $icon = "/images/unknown-cover-96.png"; } $css_row=($row+1)%2+1; if( count($tab) > 3) { $comment = $tab[3]; } else { $comment = ""; } echo " \"\"/{$tab[0]} {$tab[1]} {$tab[2]} {$comment}  "; } } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play List */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_playlist( $play_type, $side) { $row = 1; ob_start(); $row = lmb_playlist_cur( $play_type, "discography/{$play_type}", $row); $row = lmb_playlist_next( $play_type, "discography/{$play_type}", $row); $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "{$play_type}", "play", $side, "/images/lm-logo3-n-96.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Discography Body */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_discography_body() { /* --- EP --- */ lmb_playlist( "ep", "l"); lmb_spacer( 5); /* --- LP --- */ lmb_playlist( "lp", "r"); lmb_spacer( 5); /* --- Oldies --- */ lmb_playlist( "oldies", "l"); lmb_spacer( 5); /* --- TrackList --- */ lmb_tracklist_body(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Discography Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_discography_page() { global $lmb_tab; lmb_header( 2, "Langueur Monotone - Discography Page", "/images/title-discography.png", "Discography", "Langueur Monotone discography page, listing the released and the futures ep, lp and oldies", "discography", 0); lmb_discography_body(); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Introduction */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_intro( $play_type, $play_id, $play_priority) { $play_path="discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path="{$play_path}/covers/{$play_id}-cover"; $logo_path="{$play_path}/logos/{$play_id}-logo"; echo "
\"\"/
Introduction

"; $intro_file = "{$play_path}/.intro"; $intro_string = file_get_contents( "{$intro_file}"); echo " ".lmb_html_text_format( "{$intro_string}")."
"; echo "
\"\"/
\"\"/

"; $hardware_file = "{$play_path}/.hardware"; $hardware_string = file_get_contents( "{$hardware_file}"); echo " ".lmb_html_text_format( "{$hardware_string}")."
"; echo "
Hardware & Software
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Info Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_info_get( $play_type, $play_id, $play_priority, $track_id) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $track_path = "{$play_path}/tracks"; $track_array = glob("{$track_path}/flac/{$track_id}-*.flac"); $track_file = $track_array[0]; $line = array(); $track_info = array(); $track_info["play_type"] = $play_type; $track_info["play_priority"] = $play_priority; $track_info["play_id"] = $play_id; 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); $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]; 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}"); } return( $track_info); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track File Tag Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_file_tag_get( $play_type, $play_id, $play_priority, $track_id) { global $lmb_url; $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $track_path = "{$play_path}/tracks"; $file_type_pat = "{$track_path}/{flac,ogg,mp3,med}*"; $file_dir_tab = glob( "{$file_type_pat}", GLOB_BRACE); $file_tag = ""; foreach( $file_dir_tab as $file_dir) { $dir = basename( $file_dir); $tab = explode( "-", $dir); $file_type = $tab[0]; 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}"); if( count( $file_tab) > 0) { $file_url = $file_tab[0]; } else { $file_url = ""; } $file_tag = "{$file_tag}"; if( count( glob( "{$file_url}"))) { if( "{$track_id}" == "00") { $download_url = "{$lmb_url}?page=download&type={$play_type}&id={$play_id}&priority={$play_priority}&dtype=track&ftype={$dir}"; $file_size = lmb_download_tracks( $play_type, $play_id, $play_priority, $dir, "SIZE"); $size_tab = lmb_size_convert( $file_size); } else { $download_url = "{$file_url}"; $size_tab = lmb_size_convert( filesize( "{$file_url}")); } $file_tag = "{$file_tag}
{$file_type} {$file_subtype}
(${size_tab["size"]} {$size_tab["unit"]})
"; } $file_tag = "{$file_tag} "; } return( "{$file_tag}"); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Loc Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_loc_get( $track_url) { $path_tab = explode( "/", $track_url); $play_tab = explode( "-", $path_tab[2]); $track_tab = explode( "-", basename( "{$path_tab[5]}", ".flac")); $track_loc["play_type"] = $path_tab[1]; $track_loc["play_priority"] = $play_tab[0]; $track_loc["play_id"] = $play_tab[1]; $track_loc["track_id"] = $track_tab[0]; $track_loc["track_title"] = $track_tab[1]; $track_loc["track_mix"] = $track_tab[2]; return( $track_loc); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track List Info Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_tracklist_info_get( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $track_path = "{$play_path}/tracks"; $track_list = glob( "{$track_path}/flac/*.flac"); $track_list_info = array(); for( $i = 0; $i < count($track_list); $i++) { $track_loc = lmb_track_loc_get( "{$track_list[$i]}"); $track_info_list[$i] = lmb_track_info_get( "{$track_loc["play_type"]}", $track_loc["play_id"], $track_loc["play_priority"], $track_loc["track_id"]); } return( $track_info_list); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track List Microdata */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_tracklist_microdata( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path = "{$play_path}/covers/{$play_id}-cover"; $track_list_info = lmb_tracklist_info_get( $play_type, $play_id, $play_priority); $tracks_nb = count($track_list_info); echo "
"; for( $i = 0; $i < $tracks_nb; $i++) { echo "
"; } echo "
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track List */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_tracklist( $play_type, $play_id, $play_priority) { global $lmb_url; $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path = "{$play_path}/covers/{$play_id}-cover"; $logo_path = "{$play_path}/logos/{$play_id}-logo"; $track_path = "{$play_path}/tracks"; $track_list_info = lmb_tracklist_info_get( $play_type, $play_id, $play_priority); $track_nb = count($track_list_info); ob_start(); $size = $track_nb + 1; $height = 220/$size; $file_tag = lmb_track_file_tag_get( "{$play_type}", "{$play_id}", "{$play_priority}", "00"); $title_tag = " \"\"/"; echo " "; lmb_tracklist_microdata( $play_type, $play_id, $play_priority); echo "    Full Album including covers  {$file_tag} "; for( $i = 0, $row = 1; $i < $track_nb; $i++, $row++) { $track_info = $track_list_info[$i]; $css_row = ($row+1)%2+1; $track_id = str_pad( "{$track_info["id"]}", 2, '0', STR_PAD_LEFT); $track_url = "{$lmb_url}?page=track&type={$play_type}&id={$play_id}&priority={$play_priority}&tid={$track_id}"; $file_tag = lmb_track_file_tag_get( $play_type, $play_id, $play_priority, $track_id); echo " "; echo " {$track_info["id"]}  {$track_info["title"]}  {$track_info["mix"]}  {$track_info["length"]}  {$track_info["composer"]}  {$track_info["comment"]} {$file_tag} "; } $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "tracks", "tracks", "r", "/images/lm-logo3-n-96.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* File Entry Print */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_file_entry_print( $file_tab, $format_css_id, $size_css_id, $entry_tag, $max_nb) { echo "{$entry_tag}"; foreach( $file_tab as $file) { echo "
{$file["format"]}
(${file["size"]} {$file["unit"]})
"; } for( $i = count( $file_tab); $i < $max_nb; $i++) { echo "
"; } echo " "; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Cover File Tab Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_cover_file_tab_get( $play_type, $play_id, $play_priority, $cover_id, $mode) { global $lmb_url; $play_path="discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path="{$play_path}/covers"; $cmd = "ls {$cover_path}/{$play_id}-cover-1-*.png | sed -e 's/.*-//' -e 's/.png$//' | sort -rn"; exec( $cmd, $cover_format_tab); $file_tab = array(); $file_tag = ""; for( $i = 0; $i < count($cover_format_tab); $i++) { $cover_format = "{$cover_format_tab[$i]}"; if( "{$cover_format}" != "icon") { $file_url = "{$cover_path}/{$play_id}-cover-{$cover_id}-{$cover_format}.png"; $file_tag = "{$file_tag}"; if( count( glob( "{$file_url}"))) { if( $mode == "MULTI") { $file_tab[$i]["url"] = "{$lmb_url}?page=download&type={$play_type}&id={$play_id}&priority={$play_priority}&dtype=cover&cformat={$cover_format}"; $file_size = lmb_download_covers( $play_type, $play_id, $play_priority, $cover_format, "SIZE"); $size_tab = lmb_size_convert( $file_size); } else { $file_tab[$i]["url"] = "{$file_url}"; $size_tab = lmb_size_convert( filesize( "{$file_url}")); } $file_tab[$i]["format"] = "{$cover_format}"; $file_tab[$i]["size"] = "{$size_tab["size"]}"; $file_tab[$i]["unit"] = "{$size_tab["unit"]}"; } } } return( $file_tab); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Cover List */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_coverlist( $play_type, $play_id, $play_priority) { $play_path="discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path="{$play_path}/covers/{$play_id}-cover"; $logo_path="{$play_path}/logos/{$play_id}-logo"; ob_start(); $cmd="ls {$cover_path}-*-icon.png | sed -e 's/-icon.png$//' -e 's/.*-//'"; exec($cmd, $sheet_tab); $size=count($sheet_tab) + 1; // $height=220/$size; // $height=110; $height = max( 110, ( ( 220 - 30) / count($sheet_tab))); $file_tab = lmb_cover_file_tab_get( $play_type, $play_id, $play_priority, "*", "MULTI"); $entry_tag = "   All the Covers  "; lmb_file_entry_print( $file_tab, "covers3", "covers4", "{$entry_tag}", count( $file_tab)); for( $i = 0; $i < count($sheet_tab); $i++) { if( $i == 0) { $sheet_name="Front"; } else { if( $i == 1) { $sheet_name="Back"; } else { $sheet_name=$i-1; } } /* Cover Entry */ $file_tab = lmb_cover_file_tab_get( $play_type, $play_id, $play_priority, $i+1, "MONO"); $css_row = $i % 2 + 1; $entry_tag = " \"\"/  {$sheet_name} "; lmb_file_entry_print( $file_tab, "covers3", "covers4", "{$entry_tag}", count( $file_tab)); } $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "covers", "covers", "l", "{$logo_path}-2-128.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Video File Tab Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_video_file_tab_get( $play_type, $play_id, $play_priority, $video_id, $mode) { global $lmb_url; $play_path="discography/{$play_type}/{$play_priority}-{$play_id}"; $video_path="{$play_path}/videos"; $cmd = "ls {$video_path}/{$video_id}-*-*-*.avi | sed -e 's/.*{$play_id}-.*-//' -e 's/.avi$//' | sort -rn"; exec( $cmd, $video_format_tab); $file_tab = array(); for( $i = 0; $i < count($video_format_tab); $i++) { $video_format = "{$video_format_tab[$i]}"; $file_url = "{$video_path}/{$video_id}-*-{$video_format}.avi"; if( count( glob( "{$file_url}"))) { if( $mode == "MULTI") { $file_tab[$i]["url"] = "{$lmb_url}?page=download&type={$play_type}&id={$play_id}&priority={$play_priority}&dtype=video&vformat={$video_format}"; $file_size = lmb_download_videos( $play_type, $play_id, $play_priority, $video_format, "SIZE"); $size_tab = lmb_size_convert( $file_size); } else { $tab = glob( "{$file_url}"); $file_tab[$i]["url"] = "{$tab[0]}"; $size_tab = lmb_size_convert( filesize( "{$file_tab[$i]["url"]}")); } $file_tab[$i]["format"] = "{$video_format}"; $file_tab[$i]["size"] = "{$size_tab["size"]}"; $file_tab[$i]["unit"] = "{$size_tab["unit"]}"; } } return( $file_tab); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Video List */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_videolist( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $video_path = "{$play_path}/videos"; $logo_path = "{$play_path}/logos/{$play_id}-logo"; ob_start(); $cmd="ls {$video_path}/*-icon.png | sed -e 's/-icon.png$//' -e 's/.*\///'"; exec($cmd, $video_tab); if( count($video_tab) == 0 || ( file_exists( "{$video_path}/.hide" ) && ! lmb_admin_is())) { echo "    \"\"/ No video found...     "; } else { $height = max( 110, ( ( 220 - 30) / count($video_tab))); $file_tab = lmb_video_file_tab_get( $play_type, $play_id, $play_priority, "*", "MULTI"); $entry_tag = "   All the Videos  "; lmb_file_entry_print( $file_tab, "videos5", "videos6", $entry_tag, count( $file_tab)); for( $i = 0; $i < count($video_tab); $i++) { $tab = explode( "-", $video_tab[$i]); $video_id = "{$tab[0]}"; $video_track = "{$tab[1]}"; $video_mix = "{$tab[2]}"; $video_track_name = ucwords( str_replace( "_", " ", "{$video_track}")); $video_mix_name = ucwords( str_replace( "_", " ", "{$video_mix}")); $video_file = "{$video_id}-{$video_track}-{$video_mix}"; /* Video Entry */ $file_tab = lmb_video_file_tab_get( $play_type, $play_id, $play_priority, $i+1, "MONO"); $css_row = $i % 2 + 1; $entry_tag = " \"\"/  {$video_id}   {$video_track_name}   {$video_mix_name}  "; lmb_file_entry_print( $file_tab, "videos5", "videos6", "{$entry_tag}", count( $file_tab)); } } $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "videos", "videos", "r", "{$logo_path}-1-128.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Extra File Tab Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_extra_file_tab_get( $play_type, $play_id, $play_priority, $extra_id, $mode) { global $lmb_url; $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 -nu"; exec( $cmd, $extra_format_tab); $file_tab = array(); $file_tag = ""; for( $i = 0; $i < count($extra_format_tab); $i++) { $extra_format = "{$extra_format_tab[$i]}"; if( "{$extra_format}" != "icon") { $file_url = "{$extra_path}/{$play_id}-{$extra_id}-{$extra_format}.png"; $file_tag = "{$file_tag}"; if( count( glob( "{$file_url}"))) { if( $mode == "MULTI") { $file_tab[$i]["url"] = "{$lmb_url}?page=download&type={$play_type}&id={$play_id}&priority={$play_priority}&dtype=extra&eformat={$extra_id}-{$extra_format}"; $file_size = lmb_download_extras( $play_type, $play_id, $play_priority, $extra_format, "SIZE"); $size_tab = lmb_size_convert( $file_size); } else { $file_tab[$i]["url"] = "{$file_url}"; $size_tab = lmb_size_convert( filesize( "{$file_url}")); } $file_tab[$i]["format"] = "{$extra_format}"; $file_tab[$i]["size"] = "{$size_tab["size"]}"; $file_tab[$i]["unit"] = "{$size_tab["unit"]}"; } } } return( $file_tab); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Extra List */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_extralist( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $extra_path = "{$play_path}/extras"; ob_start(); $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())) { echo "    \"\"/ No extra found...     "; } else { $format_nb = count($format_tab); $title_tag = "   All the Extras  "; $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) { $extra_format = str_replace( "_", "/", "{$format}"); $entry_tag = " ${title_tag}  {$extra_format}  "; 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}-//' | sort "; exec($cmd, $extra_tab); $height = max( 86, ( ( 220 - 30 * $format_nb) / count($extra_tab))); for( $i = 0; $i < count($extra_tab); $i++) { $tab = explode( "-", $extra_tab[$i]); $extra_type = ucwords( $tab[0]); $extra_subid = $tab[1]; $extra_format = str_replace( "_", "/", $tab[2]); $extra_id = "{$tab[0]}-{$tab[1]}-{$tab[2]}"; $extra_prefix = "{$extra_path}/{$play_id}-{$extra_id}"; /* Extra Entry */ $file_tab = lmb_extra_file_tab_get( "{$play_type}", "{$play_id}", "{$play_priority}", "{$extra_id}", "MONO"); $css_row = $i % 2 + 1; $entry_tag = " \"\"/  {$extra_type}   {$extra_subid}   {$extra_format}  "; lmb_file_entry_print( $file_tab, "extras5", "extras6", "{$entry_tag}", $max_file_nb); } } $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "extras", "extras", "l", "/images/lm-logo3-n-96.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Links Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_links_tab( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $global_links_file = ".links"; $local_links_file = "{$play_path}/.links"; $line = array(); $cmd = "cat ${local_links_file} ${global_links_file} | sed -e 's/\t*\t/\t/g'"; exec( $cmd, $line); echo " "; for( $i = 0; $i < count($line); $i++) { $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]}"; if( count( $tab) > 3) { $flag = "{$tab[3]}"; } else { $flag = ""; } if( $flag == "nf") { $attr = "rel=\"nofollow\" "; } else { $attr = ""; } echo " "; } echo "
{$text} \"\"/
Links
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Last */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_last( $play_type, $play_id, $play_priority) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; echo "
Thanks
"; $thanks_file = "{$play_path}/.thanks"; $thanks_string = file_get_contents( "{$thanks_file}"); echo " ".lmb_html_text_format( "{$thanks_string}")."
"; echo "
"; lmb_links_tab( $play_type, $play_id, $play_priority); echo "
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Body */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_body( $play_type, $play_id, $play_priority) { /* --- Introduction --- */ lmb_play_intro( $play_type, $play_id, $play_priority); lmb_spacer(4); /* --- Tracks --- */ lmb_tracklist( $play_type, $play_id, $play_priority); // lmb_tracklist_microdata( $play_type, $play_id, $play_priority); lmb_spacer(5); /* --- Covers --- */ lmb_coverlist( $play_type, $play_id, $play_priority); lmb_spacer(5); /* --- Videos --- */ lmb_videolist( $play_type, $play_id, $play_priority); lmb_spacer(5); /* --- Etras --- */ lmb_extralist( $play_type, $play_id, $play_priority); lmb_spacer(4); /* --- Last --- */ lmb_play_last( $play_type, $play_id, $play_priority); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Type Name Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_type_name_get( $play_type_id) { switch( "{$play_type_id}") { case "ep": { return( "EP"); } case "lp": { return( "LP"); } case "oldies": { return( "Oldies"); } } } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Name Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_name_get( $play_type, $play_id, $play_priority) { $play_info = lmb_play_info_get( $play_type, $play_id, $play_priority); return( "{$play_info["name"]}"); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Title Get */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_title_get( $play_type, $play_id, $play_priority) { $play_name = lmb_play_name_get( $play_type, $play_id, $play_priority); $play_type_name = lmb_play_type_name_get( $play_type); return( "{$play_name} - {$play_type_name}"); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Play Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_play_page( $play_type, $play_id, $play_priority) { global $lmb_tab; $play_info = lmb_play_info_get( $play_type, $play_id, $play_priority); /* $play_name = lmb_play_type_name_get( $play_type); $play_title = "{$play_info["name"]} - {$play_name}"; */ $play_title = lmb_play_title_get( $play_type, $play_id, $play_priority); $play_image = "{$play_type}"; // lmb_header( 3, "Langueur Monotone - {$play_title} Page", "/images/title-{$play_image}.png", "{$play_name}", "Langueur Monotone play page, giving all the information about {$play_info["name"]} {$play_name}", "{$play_type},{$play_info["name"]}", 0); lmb_header( 3, "Langueur Monotone - {$play_title} Page", "/images/title-{$play_image}.png", "{$play_title}", "Langueur Monotone play page, giving all the information about {$play_info["name"]} {$play_name}", "{$play_type},{$play_info["name"]}", 0); lmb_play_body( $play_type, $play_id, $play_priority); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track List Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_tracklist_body() { global $lmb_url; $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path = "{$play_path}/covers/{$play_id}-cover"; $logo_path = "{$play_path}/logos/{$play_id}-logo"; $track_path = "{$play_path}/tracks"; $play_type = "*"; $play_id = "*"; $play_priority = "*"; $track_info_list = lmb_tracklist_info_get( $play_type, $play_id, $play_priority); usort( $track_info_list, lmb_make_comparer( 'title', 'mix')); $track_nb = count($track_info_list); ob_start(); $size = $track_nb + 1; $height = 220/$size; for( $i = 0, $row = 1; $i < $track_nb; $i++, $row++) { $css_row = ($row+1)%2+1; $play_type = "{$track_info_list[$i]["play_type"]}"; $play_type_name = lmb_play_type_name_get( $play_type); $play_id = "{$track_info_list[$i]["play_id"]}"; $play_priority = "{$track_info_list[$i]["play_priority"]}"; $track_id = str_pad( "{$track_info_list[$i]["id"]}", 2, '0', STR_PAD_LEFT); $track_title = "{$track_info_list[$i]["title"]}"; $track_mix = "{$track_info_list[$i]["mix"]}"; $track_length = "{$track_info_list[$i]["length"]}"; $track_album = "{$track_info_list[$i]["album"]}"; $play_url = "{$lmb_url}?page=play&type={$play_type}&id={$play_id}&priority={$play_priority}"; $track_url = "{$lmb_url}?page=track&type={$play_type}&id={$play_id}&priority={$play_priority}&tid={$track_id}"; echo " "; echo " {$row}  {$track_title}  {$track_mix}  {$track_length}  {$play_type_name}  {$track_album}  "; } $data = ob_get_contents(); ob_end_clean(); lmb_make_tab( "tracks", "tracks", "r", "/images/lm-logo4-n-96.png", $data); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track List Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_tracklist_page() { lmb_header( 3, "Langueur Monotone - Track List Page", "", "Track List", "Langueur Monotone track list page, listing all the released tracks", "track list", 0); lmb_tracklist_body(); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Info */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_info( $play_type, $play_id, $play_priority, $track_id) { global $lmb_url; $track_info = lmb_track_info_get( $play_type, $play_id, $play_priority, $track_id); $height=220/8; if ($track_info["safe_creative"] != "") { $rowspan = 9; } else { $rowspan = 8; } /* echo "
"; */ echo "
"; if ($track_info["safe_creative"] != "") { echo " "; } echo "
Group Name {$track_info["artist"]}
Album {$track_info["album"]}
Track Number {$track_info["id"]}
Track Name {$track_info["title"]}
Mix Name {$track_info["mix"]}
Composer {$track_info["composer"]}
Comment {$track_info["comment"]}
Length {$track_info["length"]}
Safe Creative Link
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Lyrics */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_lyrics( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path = "{$play_path}/covers/{$play_id}-cover"; $logo_path = "{$play_path}/logos/{$play_id}-logo"; $track_path = "{$play_path}/tracks"; $lyrics_file = "tracks/{$track_name}/{$track_mix}/lyrics.txt"; echo "

"; if( file_exists( "{$lyrics_file}")) { $lyrics_string = file_get_contents( "{$lyrics_file}"); } else { $lyrics_string = "No lyrics found...\n"; } echo str_replace( "\n", "
\n ", "{$lyrics_string}"); echo "
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* JPlayer Insert */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_jplayer_insert( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix) { global $lmb_cookie_tab; global $lmb_url; $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $track_path = "{$play_path}/tracks"; if( "{$track_mix}" == "") { $track_file_base = "{$track_id}-{$track_name}"; } else { $track_file_base = "{$track_id}-{$track_name}-{$track_mix}"; } $track_file_ogg = "{$track_path}/ogg-256/{$track_file_base}.ogg"; $track_file_mp3 = "{$track_path}/mp3-192/{$track_file_base}.mp3"; $solution_cookie = "jpsolution"; $prefix_url = "{$lmb_url}?cookie_id={$solution_cookie}&cookie_value="; $query_string = preg_replace( "/cookie_id={$solution_cookie}&cookie_value=[^&]*&/", "", "{$_SERVER['QUERY_STRING']}"); $solution_html_url = htmlentities( "{$prefix_url}html, flash&{$query_string}"); $solution_flash_url = htmlentities( "{$prefix_url}flash, html&{$query_string}"); $solution_value = $lmb_cookie_tab[$solution_cookie]; if( "{$solution_value}" == "html, flash") { $html_class = "jp-on"; $flash_class = "jp-off"; } else { $html_class = "jp-off"; $flash_class = "jp-on"; } echo "
 
Update Required To play the media you will need to either update your browser to a recent version or update your Flash plugin.
"; /* echo "
"; */ /* echo " "; */ echo "
 
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Introduction */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_intro( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix) { $play_path="discography/{$play_type}/{$play_priority}-{$play_id}"; $cover_path="{$play_path}/covers/{$play_id}-cover"; $logo_path="{$play_path}/logos/{$play_id}-logo"; $track_path="{$play_path}/tracks"; $cover_size = 400; $border1_size= $cover_size + 30; $border2_size= $cover_size + 10; echo "
\"\"/
Informations
"; lmb_track_info( $play_type, $play_id, $play_priority, $track_id); // echo "
"; echo "
"; lmb_jplayer_insert( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix); echo "
"; lmb_track_lyrics( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix); echo "
Lyrics
\"\"/





"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Download */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_download( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix) { global $lmb_url; $play_path ="discography/{$play_type}/{$play_priority}-{$play_id}"; $logo_path ="{$play_path}/logos/{$play_id}-logo"; $track_path ="{$play_path}/tracks"; $file_tag = lmb_track_file_tag_get( $play_type, $play_id, $play_priority, $track_id); echo "
\"\"/ {$file_tag}
Download 

"; $mix_list = glob( "discography/*/*/tracks/flac/*-{$track_name}*.flac"); for( $i = 0, $k = 0; $i < count( $mix_list); $i++) { $path_tab = explode( "/", $mix_list[$i]); $play_tab = explode( "-", $path_tab[2]); $track_tab = explode( "-", $path_tab[5]); $play_type = $path_tab[1]; $play_pri = $play_tab[0]; $play_id = $play_tab[1]; if( file_exists( "discography/{$play_type}/{$play_pri}-{$play_id}/.hide" )) { $hide = "y"; } else { $hide = "n"; } 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 " "; } echo "
{$mix_tab[$k]["track_name"]}{$hide_flag} {$mix_tab[$k]["mix_name"]} {$mix_tab[$k]["play_type_name"]} {$mix_tab[$k]["play_name"]}
Mixes 
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Body */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_body( $play_type, $play_id, $play_priority, $track_id) { $play_path = "discography/{$play_type}/{$play_priority}-{$play_id}"; $track_path = "{$play_path}/tracks"; $track_file_name = glob( "{$track_path}/flac/$track_id-*.flac"); $tab = explode( "-", basename( "{$track_file_name[0]}", ".flac")); $track_name = $tab[1]; $track_mix = $tab[2]; /* --- Introduction --- */ lmb_track_intro( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix); /* --- Download --- */ lmb_track_download( $play_type, $play_id, $play_priority, $track_id, $track_name, $track_mix); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Track Page */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_track_page( $play_type, $play_id, $play_priority, $track_id) { global $lmb_tab; $track_info = lmb_track_info_get( $play_type, $play_id, $play_priority, $track_id); // lmb_header( 4, "Langueur Monotone - Track Page", "/images/title-track.png", "Track", 962); // lmb_header( 4, "Langueur Monotone - {$track_title} Page", "/images/title-track.png", "Track", "track,{$track_info["title"]},{$track_info["title"]} {$track_info["mix"]}", 1234); if( "{$track_info["mix"]}" == "") { $track_title = "{$track_info["title"]} - Track"; lmb_header( 4, "Langueur Monotone - {$track_title} Page", "/images/title-track.png", "{$track_title}", "Langueur Monotone track page, giving all the information about {$track_info["title"]} track", "track,{$track_info["title"]},{$track_info["title"]}", 962); } else { $track_title = "{$track_info["title"]} ({$track_info["mix"]}) - Track"; lmb_header( 4, "Langueur Monotone - {$track_title} Page", "/images/title-track.png", "{$track_title}", "Langueur Monotone track page, giving all the information about {$track_info["title"]} ({$track_info["mix"]}) track", "track,{$track_info["title"]},{$track_info["title"]} {$track_info["mix"]}", 962); } lmb_track_body( $play_type, $play_id, $play_priority, $track_id); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Download ZIP */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_download_zip( $directory, $file_list, $mode) { switch($mode) { case "SIZE": { return( exec( "cd {$directory}; du -cb ${file_list} | tail -1 | cut -f 1")); } case "RSIZE": { return( exec( "cd {$directory}; zip -0 -j -p - ${file_list} | wc -c")); } case "DUMP": { passthru( "cd {$directory}; zip -0 -j -p - ${file_list}"); break; } } } /*--------------------------------------------------------------------------------------------------------------------*/ /* Download File */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_download_file( $play_dir, $file_list, $mode, $download_name) { if( $mode == "SIZE") { return( lmb_download_zip( "{$play_dir}", $file_list, "SIZE")); } else { $zip_size = lmb_download_zip( "{$play_dir}", $file_list, "RSIZE"); header( "Content-Description: Langueur Monotone - {$download_name}"); header( 'Content-Type: application/zip'); header( 'Content-Disposition: attachment; filename="'."langueur_monotone-{$download_name}.zip".'"'); header( 'Content-Length: ' . $zip_size); $zip_size = lmb_download_zip( "{$play_dir}", $file_list, "DUMP"); } } /*--------------------------------------------------------------------------------------------------------------------*/ /* Download Tracks */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_download_tracks( $play_type, $play_id, $play_priority, $file_type, $mode) { $play_dir = "discography/{$play_type}/{$play_priority}-{$play_id}"; $file_list = "tracks/{$file_type}/* covers/{$play_id}-*-800.png"; return( lmb_download_file( $play_dir, $file_list, $mode, "{$play_id}-{$file_type}")); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Download Covers */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_download_covers( $play_type, $play_id, $play_priority, $cover_format, $mode) { $play_dir = "discography/{$play_type}/{$play_priority}-{$play_id}"; $file_list = "covers/{$play_id}-cover-*-{$cover_format}.png"; return( lmb_download_file( $play_dir, $file_list, $mode, "{$play_id}-{$cover_format}")); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Download Videos */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_download_videos( $play_type, $play_id, $play_priority, $video_format, $mode) { $play_dir = "discography/{$play_type}/{$play_priority}-{$play_id}"; $file_list = "videos/*-{$video_format}.avi"; return( lmb_download_file( $play_dir, $file_list, $mode, "{$play_id}-{$video_format}")); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Download Extras */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_download_extras( $play_type, $play_id, $play_priority, $extra_format, $mode) { $play_dir = "discography/{$play_type}/{$play_priority}-{$play_id}"; $file_list = "extras/{$play_id}-*-{$extra_format}.png"; return( lmb_download_file( $play_dir, $file_list, $mode, "{$play_id}-{$extra_format}")); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_header_old( $id, $name, $summary, $curver, $currel) { $page_name="Rx3 $name Home Page"; $page_title="$page_name !"; global $lmb_url; global $lmb_page_header; global $lmb_keywords; $keywords="$lmb_keywords,$id"; include "$lmb_page_header"; echo " $page_name

$page_title

$summary

$curver-$currel

Rx3.Org Main Page  /  Rx3 Free Software Packaging Main Page

"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_body( $id, $name, $curver, $currel) { global $lmb_download_http_url; global $lmb_download_ftp_url; $description = lmb_tag_get( $id, $curver, $currel, "", "%{DESCRIPTION}"); $change_log = lmb_tag_get( $id, $curver, $currel, "", "%{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}"); echo "



";

  lmb_tab_dump( $description, 0);

  echo "    



"; echo "



Last Release Notes:
"; echo "
";

  lmb_tab_dump( $change_log, 0);

  echo "    
"; $lmb_list = lmb_list_get( $id, $curver, $currel); if( $lmb_list != "") { echo"
Sub-Package List:

"; for( $i = 0; $i < count($lmb_list); $i++) { echo "   $lmb_list[$i]"; } echo "

"; } echo"
"; echo "$name changelog page   "; echo "$name file list page   "; echo "$name HTTP download page   "; echo "$name FTP download page   "; echo "
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_page( $lmb_id, $lmb_name, $lmb_curver, $lmb_currel) { $summary = lmb_tag_get( $lmb_id, $lmb_curver, $lmb_currel, "", "%{SUMMARY}"); $lmb_summary = $summary[0]; lmb_header( $lmb_id, $lmb_name, $lmb_summary, $lmb_curver, $lmb_currel); lmb_body( $lmb_id, $lmb_name, $pkg_curver, $pkg_currel); pkg_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_cl_header( $id, $name, $curver, $currel) { $page_name="Rx3 $name ChangeLog Page"; $page_title="$page_name"; global $lmb_url; global $lmb_header; global $lmb_keywords; $keywords="$lmb_keywords,$id, rx3 $id changelog"; include "$lmb_header"; echo " $page_name

$page_title

$curver-$currel

Rx3.Org Main Page  /  Rx3 Free Software Packaging Main Page  /  Rx3 $name Home Page

"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_cl_body( $id, $curver, $currel) { echo "
";

  $changelog_tab = lmb_tag_get( $id, $curver, $currel, "", "[\n%{CHANGELOGTIME:date}   %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n]");
  lmb_tab_dump( $changelog_tab, 0);

  echo "    
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_cl_page( $lmb_id, $lmb_name, $lmb_curver, $lmb_currel) { lmb_cl_header( $lmb_id, $lmb_name, $lmb_curver, $lmb_currel); lmb_cl_body( $lmb_id, $lmb_curver, $lmb_currel); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_fl_header( $id, $name, $curver, $currel) { $page_name="Rx3 $name File List Page"; $page_title="$page_name"; global $lmb_url; global $lmb_header; global $lmb_keywords; $keywords="$lmb_keywords,$id, rx3 $id file list"; include "$lmb_header"; echo " $page_name

$page_title

$curver-$currel

Rx3.Org Main Page  /  Rx3 Free Software Packaging Main Page  /  $name Home Page

"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_fl_body( $id, $curver, $currel) { $lmb_list = lmb_list_get( $id, $curver, $currel); if( $lmb_list != "") { for( $i = 0; $i < count($lmb_list); $i++) { echo"
Sub-Package $lmb_list[$i]:
";

      $filelist_tab = lmb_tag_get( $id, $curver, $currel, $lmb_list[$i], "[%{FILENAMES}\n]");
      lmb_tab_dump( $filelist_tab, 0);
  
      echo "    
"; if( $i < count($lmb_list) - 1) { echo"
"; } } } else { echo "
";

      $filelist_tab = lmb_tag_get( $id, $curver, $currel, "", "[%{FILENAMES}\n]");
      lmb_tab_dump( $filelist_tab, 0);

      echo "    
"; } } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_fl_page( $lmb_id, $lmb_name, $lmb_curver, $lmb_currel) { lmb_fl_header( $lmb_id, $lmb_name, $lmb_curver, $lmb_currel); lmb_fl_body( $lmb_id, $lmb_curver, $lmb_currel); lmb_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* Get Proceed */ /*--------------------------------------------------------------------------------------------------------------------*/ function lmb_get_proceed( $get_array) { global $lmb_tab; lmb_admin_update(); lmb_cookie_update( $get_array); if( array_key_exists ( "page", $get_array)) { $page_id=$get_array["page"]; } else { $page_id=""; } switch ($page_id) { case "sitemap": { lmb_sitemap_page( ); break; } case "rss": { lmb_rss_page( ); break; } case "about": { lmb_about_page( $lmb_tab); break; } case "discography": { lmb_discography_page( $lmb_tab); break; } case "play": { $play_type=$get_array["type"]; $play_id=$get_array["id"]; $play_priority=$get_array["priority"]; lmb_play_page( $play_type, $play_id, $play_priority); break; } case "tracklist": { lmb_tracklist_page(); break; } case "track": { $play_type=$get_array["type"]; $play_id=$get_array["id"]; $play_priority=$get_array["priority"]; $track_id=$get_array["tid"]; lmb_track_page( $play_type, $play_id, $play_priority, $track_id); break; } case "download": { $play_type=$get_array["type"]; $play_id=$get_array["id"]; $play_priority=$get_array["priority"]; $download_type=$get_array["dtype"]; switch( "{$download_type}") { case "track": { $file_type=$get_array["ftype"]; lmb_download_tracks( $play_type, $play_id, $play_priority, $file_type, "DUMP"); break; } case "cover": { $cover_format=$get_array["cformat"]; lmb_download_covers( $play_type, $play_id, $play_priority, $cover_format, "DUMP"); break; } case "video": { $video_format=$get_array["vformat"]; lmb_download_videos( $play_type, $play_id, $play_priority, $video_format, "DUMP"); break; } case "extra": { $extra_format=$get_array["eformat"]; lmb_download_extras( $play_type, $play_id, $play_priority, $extra_format, "DUMP"); break; } } break; } case "login": { lmb_login_page( $lmb_tab); break; } default: { lmb_main_page( ); break; } } } /*--------------------------------------------------------------------------------------------------------------------*/ /* Main */ /*--------------------------------------------------------------------------------------------------------------------*/ $lmb_cookie_tab = array(); lmb_cookies_load(); lmb_get_proceed( $_GET); ?>