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 @@
// $RCSfile: lmbrowse.php,v $
-// $Revision: 1.6 $
+// $Revision: 1.7 $
// $Name: $
-// $Date: 2013/03/21 16:21:45 $
+// $Date: 2013/08/20 16:32:00 $
// $Author: agibert $
/*
@@ -41,7 +41,7 @@ $time_start = microtime_float();
include "/var/httpd/www.langueur-monotone.com/html/lmbrowse_config.inc";
$lmb_myname="LMBrowse";
-$lmb_tag_tab=explode( " ", "$Name: $");
+$lmb_tag_tab=explode( " ", "\$Name: $");
$lmb_tag_tab=explode( "-", $lmb_tag_tab[1]);
$lmb_myver=strtr( "$lmb_tag_tab[1]-$lmb_tag_tab[2]", "_", ".");
@@ -74,13 +74,16 @@ function lmb_cookie_load( $cookie_id, $cookie_defvalue)
global $lmb_cookie_tab;
- $cookie_value = $_COOKIE[ $cookie_id];
-// echo "load val ($cookie_value) for ($cookie_id)";
+ if( array_key_exists ( $cookie_id, $_COOKIE))
+ {
+ $cookie_value = $_COOKIE[ $cookie_id];
+// echo "load val ($cookie_value) for ($cookie_id)";
+ }
if( ! isset( $cookie_value))
{
- $cookie_value = $cookie_defvalue;
-// echo "set def val ($cookie_defvalue) for ($cookie_id)";
+ $cookie_value = $cookie_defvalue;
+// echo "set def val ($cookie_defvalue) for ($cookie_id)";
}
$lmb_cookie_tab[ $cookie_id] = $cookie_value;
@@ -109,7 +112,14 @@ function lmb_cookies_load()
function lmb_cookie_update( $get_array)
{
- $cookie_id=$get_array["cookie_id"];
+ if( array_key_exists ( "cookie_id", $get_array))
+ {
+ $cookie_id = $get_array["cookie_id"];
+ }
+ else
+ {
+ $cookie_id = "";
+ }
if( $cookie_id != "")
{
@@ -155,7 +165,14 @@ function lmb_admin_update()
global $lmb_cookie_tab;
- $passwd = $_POST["password"];
+ if( array_key_exists ( "password", $_POST))
+ {
+ $passwd = $_POST["password"];
+ }
+ else
+ {
+ $passwd = "";
+ }
if( $passwd != "")
@@ -401,6 +418,59 @@ gapi.plusone.render
*/
+
+/*--------------------------------------------------------------------------------------------------------------------*/
+/* XML Text Format */
+/*--------------------------------------------------------------------------------------------------------------------*/
+
+function lmb_xml_text_format( $input_text)
+{
+ $search_tab = array(
+ "&",
+ "\n",
+ "< >",
+ "
",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "
+ | + | @@ -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=" | {$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]["date"]} | +".lmb_html_text_format( "{$news}")." | +{$play_tag}+ | |||||||||
{$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 " |
+ |
+";
+ }
+
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)
All the Covers | "; - 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){$sheet_name} | "; - 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)All the Videos | "; - 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){$video_mix_name} | "; - 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 = "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) { - $file_tab = lmb_extra_file_tab_get( $play_type, $play_id, $play_priority, "*-{$format}", "MULTI"); $extra_format = str_replace( "_", "/", "{$format}"); - + $entry_tag = "||
{$extra_format} | "; - 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}&nbs $css_row = $i % 2 + 1; $entry_tag = " | |||||||||||
+ | {$extra_type} | {$extra_subid} | {$extra_format} | "; - 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}&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 |
|