|
From: OryNider <ory...@us...> - 2007-09-12 23:49:21
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29553 Modified Files: Tag: core28x db_install.php db_upgrade.php music.php music_center.pak Log Message: Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/db_install.php,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** db_install.php 8 Sep 2007 13:28:29 -0000 1.7 --- db_install.php 12 Sep 2007 23:49:16 -0000 1.7.2.1 *************** *** 175,178 **** --- 175,179 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('index', '5')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('img_allowed', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('flv_allowed', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('xs_enabled', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('show_index_subcats', '1')"; Index: music_center.pak =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_center.pak,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** music_center.pak 1 Aug 2007 23:33:27 -0000 1.2 --- music_center.pak 12 Sep 2007 23:49:16 -0000 1.2.2.1 *************** *** 1,10 **** ! module=+:57=+:Music Center=+:modules/mx_music/=+:music_center=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:57=+:60=+:music_center=+:Music Center=+:music.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Music Center=+:Demo block=+:60=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:57=+:61=+:Music_list=+:Music toplists=+:music_lists.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Music Toplist=+:Demo block=+:61=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- 1,10 ---- ! module=+:57=+:Media Center=+:modules/mx_music/=+:mxBB Media Center=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:57=+:60=+:music_center=+:Media Center=+:music.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Media Center=+:Demo block=+:60=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:57=+:61=+:Music_list=+:Media toplists=+:music_lists.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Media Toplist=+:Demo block=+:61=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** music.php 8 Sep 2007 13:28:29 -0000 1.8 --- music.php 12 Sep 2007 23:49:16 -0000 1.8.2.1 *************** *** 13,17 **** // //error_reporting( E_ALL ); ! //ini_set( 'display_errors', '1' ); --- 13,17 ---- // //error_reporting( E_ALL ); ! ini_set( 'display_errors', '1' ); *************** *** 20,23 **** --- 20,24 ---- define('IN_PORTAL', true); $mx_root_path = '../../'; + $module_root_path = $mx_root_path . 'modules/mx_music/'; // // Let's include some stuff... *************** *** 35,39 **** if( empty($block_id) ) { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'Music Center' LIMIT 1"; if(!$result = $db->sql_query($sql)) { --- 36,40 ---- if( empty($block_id) ) { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'Media Center' LIMIT 1"; if(!$result = $db->sql_query($sql)) { *************** *** 200,207 **** --- 201,216 ---- 'SUBCAT_NAV' => ' ' . $lang['Nav_Separator'] . ' <a class="nav" href="' . append_sid(this_mo_mxurl("c=" . $thiscat_parent['cat_id'])) . '">' . $thiscat_parent['cat_title'] . '</a>', 'CAT_PARENT_TITLE' => $thiscat_parent['cat_title'], + 'U_RSS' => append_sid(this_mo_mxurl("music_mode=music_rss&c=" . $thiscat_parent['cat_id'] . "&sid=" . $userdata['session_id'], true)), 'CAT_PARENT' => $thiscat_parent['cat_id']) ); } } + else + { + $template->assign_vars(array( + 'U_RSS' => append_sid(this_mo_mxurl("music_mode=music_rss" . "&sid=" . $userdata['session_id'], true)) + )); + + } $sql = "SELECT c.*, COUNT(s.song_id) AS count *************** *** 398,659 **** LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE s.song_cat_id = '". $catrows[$i]['cat_id'] ."' $song_approval_sql GROUP BY s.song_id"; if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); ! } ! $itemrow = $db->sql_fetchrow($result); ! if ( $itemrow['song_url'] == '' ) ! { ! $song_filetype = substr($itemrow['song_filename'], strlen($itemrow['song_filename']) - 3, 3); ! $song_filename = ( !empty($itemrow['song_filename']) ? $itemrow['song_filename'] : '' ); ! } ! else ! { ! $song_filetype = substr($itemrow['song_url'], strlen($itemrow['song_url']) - 3, 3); ! $song_url = $itemrow['song_url']; ! } ! // ! // Media Center ! // ! if ( $song_filetype == 'swf' ) ! { ! $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' ) ! { ! $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' ) ! { ! $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' ) ! { ! $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' ) ) ! { ! $url_download = !empty($itemrow['song_url']) ? $itemrow['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); ! $url_video = $url_download; ! $row_type = 'img'; ! } ! else if ( ( $song_filetype == 'jpg' ) || ( $song_filetype == 'gif' ) || ( $song_filetype == 'png' ) ) ! { ! $url_download = !empty($itemrow['song_url']) ? $itemrow['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); ! $url_video = $url_download; ! $row_type = 'img'; ! } ! else if( ($song_filetype == 'pls') && !empty($itemrow['song_url']) ) { ! $url_download = append_sid($module_root_path . 'galerie_media.' . $phpEx . '?music_mode=music_stream&song_id=' . $song_id); ! $lang['Download'] = ( !empty($lang['Listen']) ? $lang['Listen'] : 'Listen URL' ); ! $url_video = $url_download; ! $row_type = 'media'; } - else if(!empty($itemrow['song_url'])) - { - $host = explode("//", $itemrow['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("-", $itemrow['song_url']); ! ! if (empty($videoid['song_url'][1]) ) ! { ! $docid['song_url'] = explode("?", $itemrow['song_url']); ! ! if (empty($docid['song_url'][1]) ) ! { ! $url_video = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/googleplayer.swf?' . $docid['song_url'][1] : $itemrow['song_url'] ); ! $url_download = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/videoplay?' . $docid['song_url'][1] : $itemrow['song_url'] ); ! $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); ! $row_type = 'flashvideo'; ! } ! else ! { ! $url_video = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/googleplayer.swf?' . $docid['song_url'][1] : $itemrow['song_url'] ); ! $url_download = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/videoplay?' . $docid['song_url'][1] : $itemrow['song_url'] ); ! $lang['Download'] = ( !empty($lang['Share']) ? $lang['Watch'] : 'Watch URL' ); ! $row_type = 'youtube'; ! } ! } ! else ! { ! $url_video = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/googleplayer.swf?docId=-' . $videoid['song_url'][1] : $itemrow['song_url'] ); ! $url_download = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/videoplay?docid=-' . $videoid['song_url'][1] : $itemrow['song_url'] ); ! $lang['Download'] = ( !empty($lang['Watch']) ? $lang['Watch'] : 'Watch URL' ); ! $row_type = 'youtube'; ! } ! } ! else if ( ($sitename == 'www.youtube') || ($sitename == 'youtube') ) ! { ! $videoid['song_url'] = explode("=", $itemrow['song_url']); ! ! if (empty($videoid['song_url'][1]) ) ! { ! $row_type = 'flashvideo'; ! } ! else ! { ! $url_video = 'http://' . $domain . '/v/' . $videoid['song_url'][1]; ! //$url_download = append_sid($itemrow['song_url']); ! $row_type = 'youtube'; ! } ! ! $url_download = append_sid($itemrow['song_url']); ! $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); ! $url_video = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/v/' . $videoid['song_url'][1] : $url_download ); ! } ! else if ( ($sitename == 'www.clipfish') || ($sitename == 'clipfish') ) ! { ! $thisvid['song_url'] = explode("videoid", $itemrow['song_url']); ! $videoid['song_url'] = explode("=", $thisvid['song_url'][1]); ! ! if (empty($videoid['song_url'][1]) ) ! { ! $url_download = append_sid($itemrow['song_url']); ! $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); ! $url_video = $url_download; ! $row_type = 'flashvideo'; ! } ! else ! { ! $url_download = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/player.php?videoid=' . $videoid['song_url'][1] : $itemrow['song_url'] ); ! $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'; ! } ! } ! else if ( ($sitename == 'www.myvideo') || ($sitename == 'myvideo') ) ! { ! if (empty($docid2) ) ! { ! $url_download = append_sid($itemrow['song_url']); ! $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); ! $url_video = $url_download; ! $row_type = 'flashvideo'; ! } ! else ! { ! $url_download = ( !empty($docid2) ? 'http://' . $domain . '/watch/' . $docid2 : $itemrow['song_url'] ); ! $lang['Downlowd'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); ! $url_video = ( !empty($docid2) ? 'http://' . $domain . '/movie/' . $docid2 : $url_download ); ! $row_type = 'youtube'; ! } ! } ! else if ( ($sitename == 'de.sevenload') || ($sitename == 'sevenload') || ($sitename == 'page.sevenload') || ($sitename == 'www.sevenload') ) ! { ! $videoid['song_url'] = explode("=", $itemrow['song_url']); ! ! if (empty($videoid['song_url'][1]) ) ! { ! if (empty($docid2) ) ! { ! $url_download = append_sid($itemrow['song_url']); ! $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); ! $url_video = $url_download; ! $row_type = 'flashvideo'; ! } ! else ! { ! $url_download = ( !empty($docid2) ? 'http://' . $sitelngprefix . 'sevenload.' . 'com' . '/videos/' . $docid2 : $itemrow['song_url'] ); ! $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'; ! } ! } ! else ! { ! $url_download = ( !empty($videoid['song_url'][1]) ? 'http://' . $sitelngprefix . 'sevenload.'. 'com' . '/videos/' . $videoid['song_url'][1] : $itemrow['song_url'] ); ! $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'; ! } ! } ! else { ! $url_download = append_sid($itemrow['song_url']); ! $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); ! $url_video = $url_download; ! $row_type = 'media'; } } ! else { ! //$url_download = append_sid($module_root_path . 'galerie_media.' . $phpEx . '?music_mode=music_download&song_id=' . $song_id); ! $url_download = append_sid(this_mo_mxurl("music_mode=music_download&song_id=" . $song_id)); ! $url_video = $url_download; ! $row_type = 'media'; } if(!empty($template->xs_version)) { ! if ($row_type) { ! $template->assign_block_vars('catrow.virtual', array()); } } --- 407,464 ---- LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE s.song_cat_id = '". $catrows[$i]['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"; if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query songs information', '', __LINE__, __FILE__, $sql); ! } ! $mediarow = array(); ! while( $row = $db->sql_fetchrow($result) ) { ! $mediarow[] = $row; } ! $total_media = count($mediarow); ! if(!empty($template->xs_version)) ! { ! if ($total_media > 0) { ! $template->assign_block_vars('catrow.virtualmediacat', array()); } } ! ! $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 ! 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 = '". $catrows[$i]['cat_id'] ."' $song_approval_sql ! GROUP BY s.song_id"; ! 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_items = count($totalrow); + + $total_images = $total_items - $total_media; + if(!empty($template->xs_version)) { ! if ($total_images > 0) { ! $template->assign_block_vars('catrow.virtualimagecat', array()); } } *************** *** 1129,1132 **** --- 934,939 ---- 'SORT_NEW_COMMENT_OPTION' => $sort_new_comment_option, + 'L_RSS' => ( !empty($lang['Rss_Feed']) ? $lang['Rss_Feed'] : 'RSS Feed' ), + 'L_SORT' => $lang['Sort']) Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/db_upgrade.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** db_upgrade.php 8 Sep 2007 13:28:29 -0000 1.5 --- db_upgrade.php 12 Sep 2007 23:49:16 -0000 1.5.2.1 *************** *** 97,100 **** --- 97,101 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('xs_enabled', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('img_allowed', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('flv_allowed', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('show_index_subcats', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('rows_per_page_pic', '5')"; |