|
From: OryNider <ory...@us...> - 2007-09-08 13:28:38
|
Update of /cvsroot/mxbb/mx_music/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1601/includes Modified Files: music_cat.php music_comment.php music_comment_delete.php music_comment_edit.php music_download.php music_media_cat.php music_page.php music_pic_cat.php music_rss.php music_song.php music_upload.php Log Message: This will fix many bugs that commed with the new features. If you allready upgraded to 2.0.7 please upgrade manualy the database. :P Index: music_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_upload.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** music_upload.php 5 Sep 2007 23:37:48 -0000 1.5 --- music_upload.php 8 Sep 2007 13:28:29 -0000 1.6 *************** *** 552,556 **** --- 552,564 ---- } } + else + { + $song_filetype = substr($song_url, strlen($song_url) - 3, 3); + if( empty($song_filetype) ) + { + $song_filetype = ''; + } + } // -------------------------------- *************** *** 667,672 **** // -------------------------------- ! $sql = "INSERT INTO ". MUSIC_TABLE ." (song_filename, song_imagename, song_title, song_url, song_desc, song_singer, song_user_id, song_user_ip, song_username, song_time, song_cat_id, song_approval) ! VALUES ('$song_filename', '$song_imagename', '$song_title', '$song_url', '$song_desc', '$song_singer', '$song_user_id', '$song_user_ip', '$song_username', '$song_time', '$cat_id', '$song_approval')"; if( !$result = $db->sql_query($sql) ) { --- 675,680 ---- // -------------------------------- ! $sql = "INSERT INTO ". MUSIC_TABLE ." (song_filename, song_filetype, song_imagename, song_title, song_url, song_desc, song_singer, song_user_id, song_user_ip, song_username, song_time, song_cat_id, song_approval) ! VALUES ('$song_filename', '$song_filetype', '$song_imagename', '$song_title', '$song_url', '$song_desc', '$song_singer', '$song_user_id', '$song_user_ip', '$song_username', '$song_time', '$cat_id', '$song_approval')"; if( !$result = $db->sql_query($sql) ) { Index: music_pic_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_pic_cat.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** music_pic_cat.php 5 Sep 2007 23:37:49 -0000 1.1 --- music_pic_cat.php 8 Sep 2007 13:28:29 -0000 1.2 *************** *** 313,320 **** } - $music_config['cols_per_page'] = $music_config['rows_per_page']; // Added for ministry.ro ! //$music_config['rows_per_page'] = '20'; // Added for ministry.ro --- 313,320 ---- } // Added for ministry.ro ! $music_config['cols_per_page'] = $music_config['cols_per_page_pic']; ! $music_config['rows_per_page'] = $music_config['rows_per_page_pic'] ; // Added for ministry.ro *************** *** 451,454 **** --- 451,468 ---- } + if ( ($thissong['song_filetype'] == '') || ($song_filetype) && ($thissong['song_filetype'] != $song_filetype) ) + { + // + // Update the song filetype + // + $sql = "UPDATE " . MUSIC_TABLE . " + SET song_filetype = '" . $song_filetype . "' + WHERE song_id = '" . $song_id . "'"; + if ( !$db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, "Could not update song filetype.", '', __LINE__, __FILE__, $sql); + } + } + // // Media Center *************** *** 756,762 **** 'POSTER' => $song_poster, ! 'WIDTH' => ( !empty($media_width) ? $media_width : '425' ), ! 'HEIGHT' => ( !empty($media_height) ? $media_height : '350' ), 'TIME' => create_date($board_config['default_dateformat'], $songrow[$j]['song_time'], $board_config['board_timezone']), --- 770,776 ---- 'POSTER' => $song_poster, ! 'WIDTH' => ( !empty($media_width) ? $media_width : '114' ), ! 'HEIGHT' => ( !empty($media_height) ? $media_height : '85' ), 'TIME' => create_date($board_config['default_dateformat'], $songrow[$j]['song_time'], $board_config['board_timezone']), *************** *** 778,788 **** 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($songrow[$j]['song_user_ip']) . '" target="_blank">' . decode_ip($songrow[$j]['song_user_ip']) .'</a><br />' : '', ! 'S_ROW_TYPE' => $row_type) ); } ! } ! ! //$total_media = count($switch_row_type == 'media'); ! //$total_images = count($switch_row_type == 'img'); $total_images = $total_songs; --- 792,801 ---- 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($songrow[$j]['song_user_ip']) . '" target="_blank">' . decode_ip($songrow[$j]['song_user_ip']) .'</a><br />' : '', ! 'S_ROW_TYPE' => $row_type, ! ! 'SWITCH_ROW_TYPE' => $switch_row_type) ); } ! }; $total_images = $total_songs; *************** *** 902,905 **** --- 915,919 ---- 'L_TIME' => $lang['Time'], 'L_SONG_TITLE' => $lang['Song_Title'], + 'L_PIC_TITLE' => $lang['Pic_Title'], 'L_SINGER' => $lang['Singer'], 'L_USERNAME' => $lang['Sort_Username'], *************** *** 931,936 **** 'U_MX_MUSIC' => append_sid(this_mo_portalurl()), ! 'WIDTH' => ( !empty($media_width) ? $media_width : '228' ), ! 'HEIGHT' => ( !empty($media_height) ? $media_height : '300' ), 'S_AUTH_LIST' => $auth_list) --- 945,950 ---- 'U_MX_MUSIC' => append_sid(this_mo_portalurl()), ! 'WIDTH' => ( !empty($media_width) ? $media_width : '114' ), ! 'HEIGHT' => ( !empty($media_height) ? $media_height : '85' ), 'S_AUTH_LIST' => $auth_list) Index: music_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_cat.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** music_cat.php 5 Sep 2007 23:37:46 -0000 1.7 --- music_cat.php 8 Sep 2007 13:28:29 -0000 1.8 *************** *** 448,451 **** --- 448,466 ---- } + if ( ($thissong['song_filetype'] == '') || ($song_filetype) && ($thissong['song_filetype'] != $song_filetype) ) + { + // + // Update the song filetype + // + $sql = "UPDATE " . MUSIC_TABLE . " + SET song_filetype = '" . $song_filetype . "' + WHERE song_id = '" . $song_id . "'"; + + if ( !$db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, "Could not update song filetype.", '', __LINE__, __FILE__, $sql); + } + } + // // Media Center *************** *** 722,725 **** --- 737,750 ---- } + switch ($row_type) + { + case 'img': + $switch_row_type = 'img'; + break; + + default: + $switch_row_type = 'media'; + } + $url_song = append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id, true)); *************** *** 765,769 **** 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($songrow[$j]['song_user_ip']) . '" target="_blank">' . decode_ip($songrow[$j]['song_user_ip']) .'</a><br />' : '', ! 'S_ROW_TYPE' => $row_type) ); } --- 790,796 ---- 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($songrow[$j]['song_user_ip']) . '" target="_blank">' . decode_ip($songrow[$j]['song_user_ip']) .'</a><br />' : '', ! 'S_ROW_TYPE' => $row_type, ! ! 'SWITCH_ROW_TYPE' => $switch_row_type) ); } *************** *** 882,885 **** --- 909,913 ---- 'L_TIME' => $lang['Time'], 'L_SONG_TITLE' => $lang['Song_Title'], + 'L_PIC_TITLE' => $lang['Pic_Title'], 'L_SINGER' => $lang['Singer'], 'L_USERNAME' => $lang['Sort_Username'], Index: music_media_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_media_cat.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** music_media_cat.php 5 Sep 2007 23:37:48 -0000 1.1 --- music_media_cat.php 8 Sep 2007 13:28:29 -0000 1.2 *************** *** 315,318 **** --- 315,323 ---- } + // Added for ministry.ro + $music_config['cols_per_page'] = $music_config['cols_per_page_media']; + $music_config['rows_per_page'] = $music_config['rows_per_page_media'] ; + // Added for ministry.ro + $songs_per_page = $music_config['rows_per_page'] * $music_config['cols_per_page']; *************** *** 321,324 **** --- 326,331 ---- $limit_sql = ($start == 0) ? $songs_per_page : $start .','. $songs_per_page; + $limit_total_sql = ($start == 0) ? $total_songs : $start .','. $total_songs; + $song_approval_sql = 'AND s.song_approval = 1'; if ($thiscat['cat_approval'] != MUSIC_USER) *************** *** 330,334 **** } ! $sql = "SELECT s.song_id, s.song_title, s.song_desc, s.song_singer, s.song_user_id, s.song_user_ip, s.song_username, s.song_time, s.song_cat_id, s.song_view_count, s.song_lock, s.song_approval, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id --- 337,341 ---- } ! $sql = "SELECT s.*, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id *************** *** 336,339 **** --- 343,349 ---- LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE s.song_cat_id = '$cat_id' $song_approval_sql + AND s.song_filetype NOT LIKE 'jpg' + AND s.song_filetype NOT LIKE 'gif' + AND s.song_filetype NOT LIKE 'png' GROUP BY s.song_id ORDER BY $sort_method $sort_order *************** *** 342,366 **** { mx_message_die(GENERAL_ERROR, 'Could not query songs information', '', __LINE__, __FILE__, $sql); } ! // ! // Update the music view counter ! // ! $sql = "UPDATE " . MUSIC_CAT_TABLE . " SET cat_views = cat_views + 1 WHERE cat_id = $cat_id"; ! if ( !$db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not update music views.", '', __LINE__, __FILE__, $sql); ! } ! $songrow = array(); while( $row = $db->sql_fetchrow($result) ) { ! $songrow[] = $row; } ! for ($i = 0; $i < count($songrow); $i += $music_config['cols_per_page']) { $template->assign_block_vars('songrow', array()); --- 352,404 ---- { mx_message_die(GENERAL_ERROR, 'Could not query songs information', '', __LINE__, __FILE__, $sql); + } + + $songrow = array(); + + while( $row = $db->sql_fetchrow($result) ) + { + $songrow[] = $row; } ! // ! // Update the music view counter ! // ! $sql = "UPDATE " . MUSIC_CAT_TABLE . " SET cat_views = cat_views + 1 WHERE cat_id = $cat_id"; ! if ( !$db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not update music views.", '', __LINE__, __FILE__, $sql); ! } ! $sql = "SELECT s.*, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment ! FROM ". MUSIC_TABLE ." AS s ! LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id ! LEFT JOIN ". MUSIC_RATE_TABLE ." AS r ON s.song_id = r.rate_song_id ! LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id ! WHERE s.song_cat_id = '$cat_id' $song_approval_sql ! AND s.song_filetype NOT LIKE 'jpg' ! AND s.song_filetype NOT LIKE 'gif' ! AND s.song_filetype NOT LIKE 'png' ! GROUP BY s.song_id ! ORDER BY $sort_method $sort_order ! LIMIT $limit_total_sql"; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not query songs information', '', __LINE__, __FILE__, $sql); ! } ! ! $totalrow = array(); while( $row = $db->sql_fetchrow($result) ) { ! $totalrow[] = $row; } ! $total_per_page = count($songrow); ! ! $total_media = count($totalrow); ! ! for ($i = 0; $i < $total_per_page; $i += $music_config['cols_per_page']) { $template->assign_block_vars('songrow', array()); *************** *** 398,408 **** } - $template->assign_block_vars('songrow.songcol', array( - 'U_SONG' => append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $songrow[$j]['song_id'])), - 'DESC' => $songrow[$j]['song_desc'], - 'APPROVAL' => $approval_link, - ) - ); - if( ($songrow[$j]['user_id'] == MUSIC_GUEST) or ($songrow[$j]['username'] == '') ) { --- 436,439 ---- *************** *** 447,450 **** --- 478,756 ---- } + if ( ($thissong['song_filetype'] == '') || ($song_filetype) && ($thissong['song_filetype'] != $song_filetype) ) + { + // + // Update the song filetype + // + $sql = "UPDATE " . MUSIC_TABLE . " + SET song_filetype = '" . $song_filetype . "' + WHERE song_id = '" . $song_id . "'"; + if ( !$db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, "Could not update song filetype.", '', __LINE__, __FILE__, $sql); + } + } + + // + // Media Center + // + if ( $song_filetype == 'swf' ) + { + $row_type = 'flash'; + } + else if ( $song_filetype == 'ram' ) + { + $row_type = 'ram'; + } + else if ( $song_filetype == '.rm' ) + { + $row_type = 'rm'; + } + else if ( $song_filetype == '.qt' ) + { + $row_type = 'qt'; + } + else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) + { + $row_type = 'img'; + } + else if ( ( $song_filetype == 'jpg' ) || ( $song_filetype == 'gif' ) || ( $song_filetype == 'png' ) ) + { + $row_type = 'img'; + } + else if( ($song_filetype == 'pls') && !empty($thissong['song_url']) ) + { + $row_type = 'media'; + } + else if(!empty($thissong['song_url'])) + { + $host = explode("//", $thissong['song_url']); + $host = $host[1]; + $host = explode("/", $host); + $domain = $host[0]; + $counthost = count($host) - 1; + $docid2 = $host[$counthost]; + + // $domaintmp = explode(".", $domain, -1); // Php 5 only + // $sitename = implode(".", $domaintmp); + + if( !function_exists('mx_music_sitename') ) + { + function mx_music_sitename($domain) { + $domaintmp = explode(".", $domain); + + $y = count($domaintmp) - 1; + $r = ""; + for ($a = 0; $y > $a; $a++) { + $r .= ".".$domaintmp[$a]; + } + return $r; + } + } + + $sitename = substr(mx_music_sitename($domain), 1); + + if( !function_exists('mx_music_sitesufix') ) + { + function mx_music_sitesufix($domain) { + $domaintmp = explode(".", $domain); + + $y = count($domaintmp) - 1; + $r = $domaintmp[$y];; + return $r; + } + } + + $sitesufix = mx_music_sitesufix($domain); + + if (!empty($sitesufix) ) + { + if ($sitesufix == 'de') + { + $sitelngprefix = 'de.'; + } + else + { + $sitelngprefix = 'en.'; + } + } + else + { + $sitelngprefix = ''; + } + + if ($sitename == 'video.google') + { + $videoid['song_url'] = explode("-", $thissong['song_url']); + + if (empty($videoid['song_url'][1]) ) + { + $docid['song_url'] = explode("?", $thissong['song_url']); + + if (empty($docid['song_url'][1]) ) + { + $row_type = 'flashvideo'; + } + else + { + $row_type = 'youtube'; + } + } + else + { + $row_type = 'youtube'; + } + } + else if ( ($sitename == 'www.youtube') || ($sitename == 'youtube') ) + { + $videoid['song_url'] = explode("=", $thissong['song_url']); + + if (empty($videoid['song_url'][1]) ) + { + $row_type = 'flashvideo'; + } + else + { + $row_type = 'youtube'; + } + } + else if ( ($sitename == 'www.clipfish') || ($sitename == 'clipfish') ) + { + $thisvid['song_url'] = explode("videoid", $thissong['song_url']); + $videoid['song_url'] = explode("=", $thisvid['song_url'][1]); + + if (empty($videoid['song_url'][1]) ) + { + $row_type = 'flashvideo'; + } + else + { + $row_type = 'youtube'; + } + + } + else if ( ($sitename == 'www.myvideo') || ($sitename == 'myvideo') ) + { + if (empty($docid2) ) + { + $row_type = 'flashvideo'; + } + else + { + $row_type = 'youtube'; + } + } + else if ( ($sitename == 'de.sevenload') || ($sitename == 'sevenload') || ($sitename == 'page.sevenload') || ($sitename == 'www.sevenload') ) + { + $videoid['song_url'] = explode("=", $thissong['song_url']); + + if (empty($videoid['song_url'][1]) ) + { + if (empty($docid2) ) + { + $row_type = 'flashvideo'; + } + else + { + $row_type = 'youtube'; + } + } + else + { + $row_type = 'youtube'; + } + + } + else + { + $row_type = 'media'; + } + } + else + { + $row_type = 'media'; + } + + switch ($row_type) + { + case 'flash': + $switch_row_type = 'media'; + break; + + case 'ram': + $switch_row_type = 'media'; + break; + + case 'flashvideo': + $switch_row_type = 'media'; + break; + + case 'youtube': + $switch_row_type = 'media'; + break; + + case 'qt': + $switch_row_type = 'media'; + break; + + case 'media': + $switch_row_type = 'media'; + break; + + case 'img': + $switch_row_type = 'img'; + break; + + default: + $switch_row_type = 'other'; + } + + $url_song = append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id, true)); + + $array_row_type[$j] = $switch_row_type; + + //print_r($array_row_type); + + if (!function_exists('countString')) + { + function countString($buffer, $string) + { + while ($value = current($buffer)) + { + if ($value == $string) + { + $total += 1; + } + next($buffer); + } + return $total; + } + } + + $total_images = $total_songs - $total_media; + + $total_pages = ceil( $total_songs / $songs_per_page ); + + $this_page = floor( $start / $songs_per_page ) + 1; + + for ($x = ($songs_per_page * $this_page) + 1; $x < ($songs_per_page * $this_page); $x++) + { + while($j = $x) + { + $total_page_media = countString($array_row_type, 'media'); + } + + if ($total_page_media == 0) + { + $template->assign_block_vars('no_songs', array()); + } + } + $template->assign_block_vars('songrow.songcol', array( + 'U_SONG' => append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $songrow[$j]['song_id'])), + 'DESC' => $songrow[$j]['song_desc'], + 'APPROVAL' => $approval_link, + ) + ); + // // Media Center *************** *** 455,459 **** $url_download = append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; - $row_type = 'flash'; } else if ( $song_filetype == 'ram' ) --- 761,764 ---- *************** *** 462,466 **** $url_download = append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; - $row_type = 'ram'; } else if ( $song_filetype == '.rm' ) --- 767,770 ---- *************** *** 469,473 **** $url_download = append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; - $row_type = 'rm'; } else if ( $song_filetype == '.qt' ) --- 773,776 ---- *************** *** 476,480 **** $url_download = append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; - $row_type = 'qt'; } else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) --- 779,782 ---- *************** *** 482,486 **** $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; - $row_type = 'img'; $template->assign_block_vars('songrow.img', array( --- 784,787 ---- *************** *** 493,497 **** $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; - $row_type = 'img'; $template->assign_block_vars('songrow.img', array( --- 794,797 ---- *************** *** 506,510 **** $lang['Download'] = ( !empty($lang['Listen']) ? $lang['Listen'] : 'Listen URL' ); $url_video = $url_download; - $row_type = 'media'; } else if(!empty($thissong['song_url'])) --- 806,809 ---- *************** *** 579,583 **** $url_download = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/videoplay?' . $docid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); - $row_type = 'flashvideo'; } else --- 878,881 ---- *************** *** 587,591 **** $url_download = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/videoplay?' . $docid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Watch'] : 'Watch URL' ); - $row_type = 'youtube'; } } --- 885,888 ---- *************** *** 596,600 **** $url_download = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/videoplay?docid=-' . $videoid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Watch']) ? $lang['Watch'] : 'Watch URL' ); - $row_type = 'youtube'; } } --- 893,896 ---- *************** *** 606,610 **** { $template->assign_block_vars('songrow.flashvideo', array()); - $row_type = 'flashvideo'; } else --- 902,905 ---- *************** *** 614,618 **** 'SONG_URL' => $thissong['song_url'] )); - $row_type = 'youtube'; } --- 909,912 ---- *************** *** 633,637 **** $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; - $row_type = 'flashvideo'; } else --- 927,930 ---- *************** *** 642,646 **** $lang['Download'] = ( !empty($lang['Watch']) ? $lang['Watch'] : 'Watch URL' ); $url_video = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/videoplayer.swf?as=0&videoid=' . $videoid['song_url'][1] : $url_download ); - $row_type = 'youtube'; } --- 935,938 ---- *************** *** 655,659 **** $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; - $row_type = 'flashvideo'; } else --- 947,950 ---- *************** *** 664,668 **** $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); $url_video = ( !empty($docid2) ? 'http://' . $domain . '/movie/' . $docid2 : $url_download ); - $row_type = 'youtube'; } } --- 955,958 ---- *************** *** 680,684 **** $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; - $row_type = 'flashvideo'; } else --- 970,973 ---- *************** *** 689,693 **** $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); $url_video = ( !empty($docid2) ? 'http://' . $domain . '/swf/player.swf?id=' . $docid2 : $url_download ); - $row_type = 'youtube'; } } --- 978,981 ---- *************** *** 699,703 **** $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); $url_video = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/swf/player.swf?id=' . $videoid['song_url'][1] : $url_download ); - $row_type = 'youtube'; } --- 987,990 ---- *************** *** 709,713 **** $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; - $row_type = 'media'; } } --- 996,999 ---- *************** *** 718,756 **** $url_download = append_sid(this_mo_mxurl("music_mode=music_download&song_id=" . $song_id)); $url_video = $url_download; - $row_type = 'media'; - } - - switch ($row_type) - { - case 'flash': - $switch_row_type = 'media'; - break; - - case 'ram': - $switch_row_type = 'media'; - break; - - case 'flashvideo': - $switch_row_type = 'media'; - break; - - case 'youtube': - $switch_row_type = 'media'; - break; - - case 'qt': - $switch_row_type = 'media'; - break; - - case 'media': - $switch_row_type = 'media'; - break; - - case 'img': - $switch_row_type = 'img'; - break; - - default: - $switch_row_type = 'other'; } --- 1004,1007 ---- *************** *** 802,813 **** 'SWITCH_ROW_TYPE' => $switch_row_type) ); - - //$total_media = count($switch_row_type == 'media'); - //$total_images = count($switch_row_type == 'img'); } } - $total_media = $total_songs; - $template->assign_vars(array( 'PAGINATION' => generate_pagination(append_sid(this_mo_mxurl("music_mode=music_media_cat&cat_id=$cat_id&sort_method=$sort_method&sort_order=$sort_order")), $total_media, $songs_per_page, $start), --- 1053,1059 ---- *************** *** 924,927 **** --- 1170,1174 ---- 'L_TIME' => $lang['Time'], 'L_SONG_TITLE' => $lang['Song_Title'], + 'L_PIC_TITLE' => $lang['Pic_Title'], 'L_SINGER' => $lang['Singer'], 'L_USERNAME' => $lang['Sort_Username'], Index: music_song.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_song.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** music_song.php 5 Sep 2007 23:37:47 -0000 1.4 --- music_song.php 8 Sep 2007 13:28:29 -0000 1.5 *************** *** 60,63 **** --- 60,77 ---- } + if ( ($thissong['song_filetype'] == '') || ($song_filetype) && ($thissong['song_filetype'] != $song_filetype) ) + { + // + // Update the song filetype + // + $sql = "UPDATE " . MUSIC_TABLE . " + SET song_filetype = '" . $song_filetype . "' + WHERE song_id = '" . $song_id . "'"; + if ( !$db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, "Could not update song filetype.", '', __LINE__, __FILE__, $sql); + } + } + // ------------------------------------ |