|
From: OryNider <ory...@us...> - 2007-09-05 23:38:20
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24024 Modified Files: db_install.php music.php Log Message: Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/db_install.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_install.php 30 Aug 2007 03:58:13 -0000 1.5 --- db_install.php 5 Sep 2007 23:37:44 -0000 1.6 *************** *** 167,176 **** $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('music_version', '.0.7')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_size', '10240')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_width', '300')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_height', '200')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('download', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('enable_integration', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('override_default_pages', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('index', '5')"; $sql[] = "UPDATE " . $mx_table_prefix . "module" . " --- 167,177 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('music_version', '.0.7')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_size', '10240')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_width', '800')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_height', '600')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('download', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('enable_integration', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('override_default_pages', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('index', '5')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('img_allowed', '1')"; $sql[] = "UPDATE " . $mx_table_prefix . "module" . " Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** music.php 2 Sep 2007 07:38:19 -0000 1.6 --- music.php 5 Sep 2007 23:37:46 -0000 1.7 *************** *** 106,109 **** --- 106,117 ---- include($module_root_path. 'includes/music_cat.'.$phpEx); } + else if ( $mode == 'music_pic_cat' ) + { + include($module_root_path. 'includes/music_pic_cat.'.$phpEx); + } + else if ( $mode == 'music_media_cat' ) + { + include($module_root_path. 'includes/music_media_cat.'.$phpEx); + } else if ( $mode == 'music_comment' ) { *************** *** 368,371 **** --- 376,381 ---- $template->assign_block_vars('catrow', array( 'U_VIEW_CAT' => append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $catrows[$i]['cat_id'])), + 'U_VIEW_PIC_CAT' => append_sid(this_mo_mxurl("music_mode=music_pic_cat&cat_id=". $catrows[$i]['cat_id'])), + 'U_VIEW_MEDIA_CAT' => append_sid(this_mo_mxurl("music_mode=music_media_cat&cat_id=". $catrows[$i]['cat_id'])), 'CAT_TITLE' => $catrows[$i]['cat_title'], 'CAT_DESC' => $catrows[$i]['cat_desc'], *************** *** 373,379 **** --- 383,658 ---- 'CAT_VIEWS' => $catrows[$i]['cat_views'], 'L_MODERATORS' => $l_moderators, + 'L_ALL_CAT_PICS' => $lang['Category_pics'], + 'L_ALL_CAT_SONGS' => $lang['Category_songs'], 'MODERATORS' => $moderators_list, 'LAST_SONG_INFO' => $last_song_info) ); + + $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 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()); + } + } } else *************** *** 419,422 **** --- 698,703 ---- 'CAT_VIEWS' => $catrows[$i]['cat_views'], 'L_MODERATORS' => $l_moderators, + 'L_ALL_CAT_PICS' => $lang['Category_pics'], + 'L_ALL_CAT_SONGS' => $lang['Category_songs'], 'MODERATORS' => $moderators_list, 'LAST_SONG_INFO' => $last_song_info) *************** *** 540,544 **** // We may do query now // ! if ($allowed_cat != '') { $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, 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 --- 821,825 ---- // We may do query now // ! if ( ($allowed_cat != '') && ($music_config['top'] > '0') ) { $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, 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 *************** *** 653,657 **** } ! if ($allowed_cat != '') { $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, 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 --- 934,938 ---- } ! if ( ($allowed_cat != '') && ($music_config['top'] > '0') ) { $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, 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 |