You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(95) |
Apr
(270) |
May
(111) |
Jun
|
Jul
|
Aug
(64) |
Sep
(130) |
Oct
(319) |
Nov
(17) |
Dec
(191) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(387) |
Jul
(102) |
Aug
(247) |
Sep
(120) |
Oct
(1) |
Nov
(8) |
Dec
(21) |
| 2007 |
Jan
(38) |
Feb
(36) |
Mar
|
Apr
(32) |
May
(135) |
Jun
(523) |
Jul
(192) |
Aug
(103) |
Sep
(533) |
Oct
(77) |
Nov
(23) |
Dec
(203) |
| 2008 |
Jan
(312) |
Feb
(1193) |
Mar
(404) |
Apr
(67) |
May
(62) |
Jun
(497) |
Jul
(297) |
Aug
(110) |
Sep
(335) |
Oct
(256) |
Nov
(50) |
Dec
(118) |
| 2009 |
Jan
(67) |
Feb
(10) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(10) |
Jul
(61) |
Aug
|
Sep
(16) |
Oct
(45) |
Nov
(12) |
Dec
(14) |
| 2010 |
Jan
(30) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(7) |
Aug
(7) |
Sep
(5) |
Oct
(5) |
Nov
|
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(89) |
Apr
(11) |
May
(5) |
Jun
|
Jul
(8) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(89) |
| 2012 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(42) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(19) |
Apr
(90) |
May
(38) |
Jun
(235) |
Jul
(38) |
Aug
(10) |
Sep
|
Oct
(29) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(52) |
Jun
|
Jul
(7) |
Aug
|
Sep
(17) |
Oct
|
Nov
|
Dec
|
|
From: OryNider <ory...@us...> - 2008-01-18 10:25:30
|
Update of /cvsroot/mxbb/core/install/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14809 Modified Files: Tag: core28x functions_install.php Log Message: fixing errors with @ Index: functions_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/includes/functions_install.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** functions_install.php 11 Aug 2007 03:49:32 -0000 1.2 --- functions_install.php 18 Jan 2008 10:25:25 -0000 1.2.2.1 *************** *** 759,763 **** if( $tmpary[$i] == '.' || $tmpary[$i] == '..' ) continue; $fullname = $cwd.$tmpary[$i]; ! if( is_dir($fullname) ) { if( $cur_level < $max_levels ) --- 759,763 ---- if( $tmpary[$i] == '.' || $tmpary[$i] == '..' ) continue; $fullname = $cwd.$tmpary[$i]; ! if( @is_dir($fullname) ) { if( $cur_level < $max_levels ) |
|
From: OryNider <ory...@us...> - 2008-01-18 10:25:18
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14792 Modified Files: Tag: core28x mx_functions_phpbb.php Log Message: fixing errors with @ Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.32.2.6 retrieving revision 1.32.2.7 diff -C2 -d -r1.32.2.6 -r1.32.2.7 *** mx_functions_phpbb.php 16 Jan 2008 04:26:02 -0000 1.32.2.6 --- mx_functions_phpbb.php 18 Jan 2008 10:25:13 -0000 1.32.2.7 *************** *** 118,127 **** global $mx_starttime, $mx_page, $mx_block, $mx_user, $mx_request_vars, $mx_cache; ! //$default_lang = $board_config['default_lang']; $default_lang = $mx_user->lang['default_lang']; if(defined('HAS_DIED')) { ! print_r("mx_message_die() was called multiple times. This isn't supposed to happen. Was mx_message_die() used in page_tail.php? <br /><br />"); } --- 118,175 ---- global $mx_starttime, $mx_page, $mx_block, $mx_user, $mx_request_vars, $mx_cache; ! static $msg_history; ! ! //$default_lang = $mx_user->get_old_lang($board_config['default_lang']); $default_lang = $mx_user->lang['default_lang']; + if( !isset($msg_history) ) + { + $msg_history = array(); + } + $msg_history[] = array( + 'msg_code' => $msg_code, + 'msg_text' => $msg_text, + 'msg_title' => $msg_title, + 'err_line' => $err_line, + 'err_file' => $err_file, + 'sql' => $sql + ); + if(defined('HAS_DIED')) { ! // ! // This message is printed at the end of the report. ! // Of course, you can change it to suit your own needs. ;-) ! // ! $custom_error_message = 'Please, contact the %swebmaster%s. Thank you.'; ! if ( !empty($board_config) && !empty($board_config['board_email']) ) ! { ! $custom_error_message = sprintf($custom_error_message, '<a href="mailto:' . $board_config['board_email'] . '">', '</a>'); ! } ! else ! { ! $custom_error_message = sprintf($custom_error_message, '', ''); ! } ! echo "<html>\n<body>\n<b>Critical Error!</b><br />\nmx_message_die() was called multiple times.<br /> <hr />"; ! for( $i = 0; $i < count($msg_history); $i++ ) ! { ! echo '<b>Error #' . ($i+1) . "</b>\n<br />\n"; ! if( !empty($msg_history[$i]['msg_title']) ) ! { ! echo '<b>' . $msg_history[$i]['msg_title'] . "</b>\n<br />\n"; ! } ! echo $msg_history[$i]['msg_text'] . "\n<br /><br />\n"; ! if( !empty($msg_history[$i]['err_line']) ) ! { ! echo '<b>Line :</b> ' . $msg_history[$i]['err_line'] . '<br /><b>File :</b> ' . $msg_history[$i]['err_file'] . "</b>\n<br />\n"; ! } ! if( !empty($msg_history[$i]['sql']) ) ! { ! echo '<b>SQL :</b> ' . $msg_history[$i]['sql'] . "\n<br />\n"; ! } ! echo " <hr />\n"; ! } ! echo $custom_error_message . '<hr /><br clear="all">'; ! die("</body>\n</html>"); } |
|
From: OryNider <ory...@us...> - 2008-01-18 08:17:38
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8066 Modified Files: common.php Log Message: missing function Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** common.php 15 Jan 2008 17:09:49 -0000 1.72 --- common.php 18 Jan 2008 08:17:30 -0000 1.73 *************** *** 172,175 **** --- 172,246 ---- } + /* + * Remove variables created by register_globals from the global scope + * Thanks to Matt Kavanagh + */ + function deregister_globals() + { + $not_unset = array( + 'GLOBALS' => true, + '_GET' => true, + '_POST' => true, + '_COOKIE' => true, + '_REQUEST' => true, + '_SERVER' => true, + '_SESSION' => true, + '_ENV' => true, + '_FILES' => true, + 'phpEx' => true, + 'phpbb_root_path' => true + ); + + // Not only will array_merge and array_keys give a warning if + // a parameter is not an array, array_merge will actually fail. + // So we check if _SESSION has been initialised. + if (!isset($_SESSION) || !is_array($_SESSION)) + { + $_SESSION = array(); + } + + // Merge all into one extremely huge array; unset this later + $input = array_merge( + array_keys($_GET), + array_keys($_POST), + array_keys($_COOKIE), + array_keys($_SERVER), + array_keys($_SESSION), + array_keys($_ENV), + array_keys($_FILES) + ); + + foreach ($input as $varname) + { + if (isset($not_unset[$varname])) + { + // Hacking attempt. No point in continuing unless it's a COOKIE + if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS'])) + { + exit; + } + else + { + $cookie = &$_COOKIE; + while (isset($cookie['GLOBALS'])) + { + foreach ($cookie['GLOBALS'] as $registered_var => $value) + { + if (!isset($not_unset[$registered_var])) + { + unset($GLOBALS[$registered_var]); + } + } + $cookie = &$cookie['GLOBALS']; + } + } + } + + unset($GLOBALS[$varname]); + } + + unset($input); + } + // If we are on PHP >= 6.0.0 we do not need some code if (version_compare(PHP_VERSION, '6.0.0-dev', '>=')) |
|
From: OryNider <ory...@us...> - 2008-01-18 08:16:26
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8012 Modified Files: Tag: core28x common.php Log Message: missing function Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.67.2.3 retrieving revision 1.67.2.4 diff -C2 -d -r1.67.2.3 -r1.67.2.4 *** common.php 15 Jan 2008 17:09:08 -0000 1.67.2.3 --- common.php 18 Jan 2008 08:16:04 -0000 1.67.2.4 *************** *** 169,172 **** --- 169,243 ---- } + /* + * Remove variables created by register_globals from the global scope + * Thanks to Matt Kavanagh + */ + function deregister_globals() + { + $not_unset = array( + 'GLOBALS' => true, + '_GET' => true, + '_POST' => true, + '_COOKIE' => true, + '_REQUEST' => true, + '_SERVER' => true, + '_SESSION' => true, + '_ENV' => true, + '_FILES' => true, + 'phpEx' => true, + 'phpbb_root_path' => true + ); + + // Not only will array_merge and array_keys give a warning if + // a parameter is not an array, array_merge will actually fail. + // So we check if _SESSION has been initialised. + if (!isset($_SESSION) || !is_array($_SESSION)) + { + $_SESSION = array(); + } + + // Merge all into one extremely huge array; unset this later + $input = array_merge( + array_keys($_GET), + array_keys($_POST), + array_keys($_COOKIE), + array_keys($_SERVER), + array_keys($_SESSION), + array_keys($_ENV), + array_keys($_FILES) + ); + + foreach ($input as $varname) + { + if (isset($not_unset[$varname])) + { + // Hacking attempt. No point in continuing unless it's a COOKIE + if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS'])) + { + exit; + } + else + { + $cookie = &$_COOKIE; + while (isset($cookie['GLOBALS'])) + { + foreach ($cookie['GLOBALS'] as $registered_var => $value) + { + if (!isset($not_unset[$registered_var])) + { + unset($GLOBALS[$registered_var]); + } + } + $cookie = &$cookie['GLOBALS']; + } + } + } + + unset($GLOBALS[$varname]); + } + + unset($input); + } + // If we are on PHP >= 6.0.0 we do not need some code if (version_compare(PHP_VERSION, '6.0.0-dev', '>=')) |
|
From: OryNider <ory...@us...> - 2008-01-16 19:56:33
|
Update of /cvsroot/mxbb/mx_music/language/lang_romanian In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19872 Modified Files: Tag: core28x lang_admin_music.php Log Message: |
Update of /cvsroot/mxbb/mx_music/music_box/modules In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18200/modules Added Files: Tag: core28x index.htm music_cat.php music_comment.php music_comment_delete.php music_comment_edit.php music_delete.php music_download.php music_edit.php music_list.php music_media_cat.php music_modcp.php music_page.php music_pic_cat.php music_rate.php music_rss.php music_song.php music_stream.php music_upload.php Log Message: --- NEW FILE: music_upload.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_upload.php,v 1.1.2.1 2008/01/16 19:53:16 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } $music_root_path = $module_root_path . 'music_box/'; $song_image_path = MUSIC_IMAGE_PATH; /* +---------------------------------------------------------- | Common Check +---------------------------------------------------------- */ // ------------------------------------ // Check the request // for this Upload script, we prefer POST to GET // ------------------------------------ if( isset($HTTP_POST_VARS['cat_id']) ) { $cat_id = intval($HTTP_POST_VARS['cat_id']); } else if( isset($HTTP_GET_VARS['cat_id']) ) { $cat_id = intval($HTTP_GET_VARS['cat_id']); } else { mx_message_die(GENERAL_ERROR, 'No categories specified'); } // ------------------------------------ // Get the current Category Info // ------------------------------------ $sql = "SELECT c.*, COUNT(s.song_id) AS count FROM ". MUSIC_CAT_TABLE ." AS c LEFT JOIN ". MUSIC_TABLE ." AS s ON c.cat_id = s.song_cat_id WHERE c.cat_id = '$cat_id' GROUP BY c.cat_id LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); $current_songs = $thiscat['count']; if (empty($thiscat)) { mx_message_die(GENERAL_ERROR, $lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $music_user_access = music_user_access($cat_id, $thiscat, 0, 1, 0, 0, 0, 0); // UPLOAD if ($music_user_access['upload'] == 0) { if (!$userdata['session_logged_in']) { mx_redirect(append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_upload&cat_id=$cat_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } /* +---------------------------------------------------------- | Upload Quota Check +---------------------------------------------------------- */ // ------------------------------------ // Check music Configuration Quota // ------------------------------------ if ($music_config['max_songs'] >= 0) { // // $current_songs was set at "Get the current Category Info" // if( $current_songs >= $music_config['max_songs'] ) { mx_message_die(GENERAL_MESSAGE, $lang['Music_reached_quota']); } } // ------------------------------------ // Check User Limit // ------------------------------------ $check_user_limit = FALSE; if( ($userdata['user_level'] != ADMIN) and ($userdata['session_logged_in']) ) { if ($music_user_access['moderator']) { if ($music_config['mod_songs_limit'] >= 0) { $check_user_limit = 'mod_songs_limit'; } } else { if ($music_config['user_songs_limit'] >= 0) { $check_user_limit = 'user_songs_limit'; } } } // Do the check here if ($check_user_limit != FALSE) { $sql = "SELECT COUNT(song_id) AS count FROM ". MUSIC_TABLE ." WHERE song_user_id = '". $userdata['user_id'] ."' AND song_cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not count your song', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $own_songs = $row['count']; if( $own_songs >= $music_config[$check_user_limit] ) { mx_message_die(GENERAL_MESSAGE, $lang['User_reached_songs_quota']); } } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ if( !isset($HTTP_POST_VARS['song_title']) ) // is it not submitted? { // -------------------------------- // Build categories select // -------------------------------- $sql = "SELECT * FROM " . MUSIC_CAT_TABLE ." ORDER BY cat_order ASC"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); } $catrows = array(); while( $row = $db->sql_fetchrow($result) ) { $thiscat_access = music_user_access($row['cat_id'], $row, 0, 1, 0, 0, 0, 0); // UPLOAD if ($thiscat_access['upload'] == 1) { $catrows[] = $row; } } $select_cat = '<select name="cat_id">'; for ($i = 0; $i < count($catrows); $i++) { $select_cat .= '<option value="'. $catrows[$i]['cat_id'] .'" '; $select_cat .= ($cat_id == $catrows[$i]['cat_id']) ? 'selected="selected"' : ''; $select_cat .= '>'. $catrows[$i]['cat_title'] .'</option>'; } $select_cat .= '</select>'; // // Start output of page // $page_title = $lang['Music']; if ( !$is_block ) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array( 'body' => 'music_upload_body.tpl') ); $template->assign_vars(array( 'U_VIEW_CAT' => append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")), 'CAT_TITLE' => $thiscat['cat_title'], 'L_UPLOAD_SONG' => $lang['Upload_Song'], 'L_USERNAME' => $lang['Username'], 'L_SONG_TITLE' => $lang['Song_Title'], 'L_SONG_URL' => $lang['Song_url'], 'L_SONG_DESC' => $lang['Song_Desc'], 'L_SINGER' => $lang['Singer'], 'L_PLAIN_TEXT_ONLY' => $lang['Plain_text_only'], 'L_MAX_LENGTH' => $lang['Max_length'], 'S_SONG_DESC_MAX_LENGTH' => $music_config['desc_length'], 'L_UPLOAD_SONG_FROM_MACHINE' => $lang['Upload_song_from_machine'], 'L_SONG_IMAGE' => $lang['Song_image'], 'L_SONG_IMAGE_DESC' => $lang['Song_image_desc'], 'L_NO_IMAGE' => $lang['No_image'], 'L_UPLOAD_IMAGE' => $lang['Upload_image'], 'L_UPLOAD_TO_CATEGORY' => $lang['Upload_to_Category'], 'SELECT_CAT' => $select_cat, 'L_MAX_FILESIZE' => $lang['Max_file_size'], 'S_MAX_FILESIZE' => $music_config['max_file_size'], // Media Center 'L_ALLOWED_FILE' => $lang['Allowed_file'], 'S_MP3' => ($music_config['mp3_allowed'] == 1) ? 'MP3,' : '', 'S_WAV' => ($music_config['wav_allowed'] == 1) ? 'WAV,' : '', 'S_WMA' => ($music_config['wma_allowed'] == 1) ? 'WMA,' : '', 'S_WMV' => ($music_config['wmv_allowed'] == 1) ? 'WMV,' : '', 'S_MIDI' => ($music_config['mid_allowed'] == 1) ? 'MIDI,' : '', 'S_RAM' => ($music_config['ram_allowed'] == 1) ? 'RAM,' : '', 'S_AU' => ($music_config['au_allowed'] == 1) ? 'AU,' : '', 'S_MPEG' => ($music_config['mpeg_allowed'] == 1) ? 'MPEG,' : '', 'S_AVI' => ($music_config['avi_allowed'] == 1) ? 'AVI,' : '', 'S_SWF' => ($music_config['swf_allowed'] == 1) ? 'SWF,' : '', 'S_QT' => ($music_config['qt_allowed'] == 1) ? 'QT,' : '', 'S_FLV' => ($music_config['flv_allowed'] == 1) ? 'FLV,' : '', 'S_IMG' => ($music_config['img_allowed'] == 1) ? 'IMG,' : '', 'S_RM' => ($music_config['rm_allowed'] == 1) ? 'RM,' : '', // Media Center 'L_UPLOAD_NO_TITLE' => $lang['Upload_no_title'], 'L_UPLOAD_NO_FILE' => $lang['Upload_no_file'], 'L_UPLOAD_BOTH_FILE' => $lang['Upload_both_file'], 'L_DESC_TOO_LONG' => $lang['Desc_too_long'], 'L_RESET' => $lang['Reset'], 'L_SUBMIT' => $lang['Submit'], 'NAV_SEP' => $lang['Nav_Separator'], 'NAV_DOT' => '•', 'MUSIC_VERSION' => '2' . $music_config['music_version'], 'L_INDEX' => '<<', 'U_INDEX' => append_sid($mx_root_path . "index.".$phpEx), 'L_MUSIC_INDEX' => $lang['Music'], 'L_MUSIC' => $lang['Music'], 'U_MUSIC' => append_sid(this_mo_mxurl()), 'U_MX_MUSIC' => append_sid(this_mo_portalurl()), 'S_MUSIC_ACTION' => append_sid(this_mo_mxurl("music_mode=music_upload&cat_id=$cat_id")), ) ); // // Generate the page // $template->pparse('body'); if ( !$is_block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } } else { // -------------------------------- // Check posted info // -------------------------------- $song_title = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['song_title']))); $song_url = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['song_url']))); $image_system = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['image_system']))); $song_desc = str_replace("\'", "''", htmlspecialchars(substr(trim($HTTP_POST_VARS['song_desc']), 0, $music_config['desc_length']))); $song_singer = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['song_singer']))); $song_username = (!$userdata['session_logged_in']) ? substr(str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['song_username']))), 0, 32) : str_replace("'", "''", $userdata['username']); if( empty($song_title) ) { mx_message_die(GENERAL_ERROR, $lang['Missed_song_title']); } // -------------------------------- // Check username for guest posting // -------------------------------- if (!$userdata['session_logged_in']) { if ($song_username != '') { $result = validate_username($song_username); if ( $result['error'] ) { mx_message_die(GENERAL_MESSAGE, $result['error_msg']); } } } // -------------------------------- // Get File Upload Info // -------------------------------- $filetype = $HTTP_POST_FILES['song_file']['type']; $filesize = $HTTP_POST_FILES['song_file']['size']; $filetmp = $HTTP_POST_FILES['song_file']['tmp_name']; // -------------------------------- // Get Song Image Upload Info // -------------------------------- $imagetype = ( !empty($HTTP_POST_FILES['song_image']['type']) ) ? $HTTP_POST_FILES['song_image']['type'] : ''; $imagesize = ( !empty($HTTP_POST_FILES['song_image']['size']) ) ? $HTTP_POST_FILES['song_image']['size'] : 0; $imagetmp = ( !empty($HTTP_POST_FILES['song_image']['tmp_name']) ) ? $HTTP_POST_FILES['song_image']['tmp_name'] : ''; // -------------------------------- // Check image size // -------------------------------- if( $image_system == '1' ) { if( $imagesize > $music_config['max_image_size'] ) { mx_message_die(GENERAL_MESSAGE, $lang['Bad_upload_image_size']); } } // -------------------------------- // Check image type // -------------------------------- if( $image_system == '1' ) { switch ($imagetype) { case 'image/jpeg': case 'image/jpg': case 'image/pjpeg': $song_imagetype = '.jpg'; break; case 'image/gif': $song_imagetype = '.gif'; break; case 'image/png': case 'image/x-png': $song_imagetype = '.png'; break; default: mx_message_die(GENERAL_ERROR, $lang['Not_allowed_image_type']); } } // -------------------------------- // Prepare variables // -------------------------------- $song_time = time(); $song_user_id = $userdata['user_id']; $song_user_ip = $userdata['session_ip']; // -------------------------------- // Check file size // -------------------------------- if( empty($song_url) ) { if( ($filesize == 0) or ($filesize > $music_config['max_file_size']) ) { mx_message_die(GENERAL_MESSAGE, $lang['Bad_upload_file_size']); } } // -------------------------------- // Check file type // -------------------------------- if( empty($song_url) ) { switch ($filetype) { case 'audio/mpeg': case 'audio/x-mpeg': case 'audio/mp3': case 'audio/mpg': if ($music_config['mp3_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.mp3'; break; case 'audio/wav': if ($music_config['wav_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.wav'; break; case 'audio/x-ms-wma': if ($music_config['wma_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.wma'; break; // // Extra extensions // case 'video/x-ms-wmv': if ($music_config['wmv_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.wmv'; break; case 'video/mpeg': if ($music_config['mpeg_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.mpeg'; break; case 'video/avi': case 'video/x-msvideo': if ($music_config['avi_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.avi'; break; case 'application/x-shockwave-flash': if ($music_config['swf_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.swf'; break; case 'video/quicktime': if ($music_config['qt_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.qt'; break; case 'video/x-flv': case 'video/flv': case 'application/octet-stream': if ($music_config['flv_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.flv'; break; case 'audio/x-midi': case 'audio/mid': case 'audio/midi': if ($music_config['mid_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.mid'; break; case 'audio/x-pn-realaudio': if ($music_config['ram_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.ram'; break; case 'audio/basic': if ($music_config['au_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.au'; break; case 'audio/vnd.rn-realmedia': case 'application/vnd.rn-realmedia': case 'video/vnd.rn-realvideo': case 'application/vnd': if ($music_config['rm_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.rm'; break; case 'image/jpeg': case 'image/jpg': case 'image/pjpeg': if ($music_config['img_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.jpg'; break; case 'image/gif': if ($music_config['img_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.gif'; break; case 'image/png': case 'image/x-png': if ($music_config['img_allowed'] == 0) { mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $song_filetype = '.png'; break; // End extra default: mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type'] . ': ' . $filetype); } } else { $song_filetype = substr($song_url, strlen($song_url) - 3, 3); if( empty($song_filetype) ) { $song_filetype = ''; } } // -------------------------------- // Generate filename // -------------------------------- srand((double)microtime()*1000000); // for older than version 4.2.0 of PHP do { $song_filename = md5(uniqid(rand())) . $song_filetype; } while( file_exists(MUSIC_UPLOAD_PATH . $song_filename) ); // -------------------------------- // Generate imagename // -------------------------------- if( $image_system == '1' ) { do { $song_imagename = md5(uniqid(rand())) . $song_imagetype; } while( file_exists($song_image_path . $song_imagename) ); } // -------------------------------- // Move this file to upload directory // -------------------------------- if( empty($song_url) ) { $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; if ( @$ini_val('open_basedir') != '' ) { if ( @phpversion() < '4.0.3' ) { mx_message_die(GENERAL_ERROR, 'open_basedir is set and your PHP version does not allow move_uploaded_file<br /><br />Please contact your server admin', '', __LINE__, __FILE__); } $move_file = 'move_uploaded_file'; } else { $move_file = 'copy'; } $move_file($filetmp, MUSIC_UPLOAD_PATH . $song_filename); @chmod(MUSIC_UPLOAD_PATH . $song_filename, 0777); } // -------------------------------- // Move song image to directory // -------------------------------- if( $image_system == '1' ) { if( !empty($HTTP_POST_FILES['song_image']['tmp_name']) ) { $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; if ( @$ini_val('open_basedir') != '' ) { if ( @phpversion() < '4.0.3' ) { message_die(GENERAL_ERROR, 'open_basedir is set and your PHP version does not allow move_uploaded_file<br /><br />Please contact your server admin', '', __LINE__, __FILE__); } $move_file = 'move_uploaded_file'; } else { $move_file = 'copy'; } $move_file($imagetmp, $song_image_path . $song_imagename); @chmod($song_image_path . $song_imagename, 0777); } } // -------------------------------- // Check its image size // -------------------------------- if( $image_system == '1' ) { if( !empty($HTTP_POST_FILES['song_image']['size']) ) { $image_size = getimagesize($song_image_path . $song_imagename); $image_width = $image_size[0]; $image_height = $image_size[1]; if ( ($image_width > $music_config['max_image_width']) or ($image_height > $music_config['max_image_height']) ) { @unlink($song_image_path . $song_imagename); message_die(GENERAL_ERROR, 'Your uploaded image size is too big'); } } } // -------------------------------- // Check song Approval // -------------------------------- $song_approval = ($thiscat['cat_approval'] == 0) ? 1 : 0; // -------------------------------- // Insert into DB // -------------------------------- $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) ) { mx_message_die(GENERAL_ERROR, 'Could not insert new entry', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Complete... now send a message to user // -------------------------------- if ($thiscat['cat_approval'] == 0) { $message = $lang['Music_upload_successful']; } else { $message = $lang['Music_upload_need_approval']; } if ($thiscat['cat_approval'] == 0) { $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . '">') ); } //$message .= $sql; $message .= "<br /><br />" . sprintf($lang['Click_return_category'], "<a href=\"" . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . "\">", "</a>"); $message .= "<br /><br />" . sprintf($lang['Click_return_music_index'], "<a href=\"" . append_sid(this_mo_mxurl()) . "\">", "</a>"); mx_message_die(GENERAL_MESSAGE, $message); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> --- NEW FILE: music_delete.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_delete.php,v 1.1.2.1 2008/01/16 19:53:12 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } $music_root_path = $module_root_path . 'music_box/'; // ------------------------------------ // Check the request // ------------------------------------ if( isset($HTTP_GET_VARS['song_id']) ) { $song_id = intval($HTTP_GET_VARS['song_id']); } else if( isset($HTTP_POST_VARS['song_id']) ) { $song_id = intval($HTTP_POST_VARS['song_id']); } else { mx_message_die(GENERAL_ERROR, 'No songs specified'); } // ------------------------------------ // Get this song info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_TABLE ." WHERE song_id = '$song_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $thissong = $db->sql_fetchrow($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; $song_filename = $thissong['song_filename']; if( empty($thissong) ) { mx_message_die(GENERAL_ERROR, $lang['Song_not_exist']); } // ------------------------------------ // Get the current Category Info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); if (empty($thiscat)) { mx_message_die(GENERAL_ERROR, $lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $music_user_access = music_user_access($cat_id, $thiscat, 0, 0, 0, 0, 0, 1); // DELETE if ($music_user_access['delete'] == 0) { if (!$userdata['session_logged_in']) { mx_redirect(append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_delete&song_id=$song_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } else { if( (!$music_user_access['moderator']) or ($userdata['user_level'] != ADMIN) ) { if ($thissong['song_user_id'] != $userdata['user_id']) { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ if( !isset($HTTP_POST_VARS['confirm']) ) { // -------------------------------- // If user give up deleting... // -------------------------------- if( isset($HTTP_POST_VARS['cancel']) ) { mx_redirect(append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id"))); exit; } // // Start output of page // $page_title = $lang['Music']; if ( !$is_block ) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array( 'body' => 'confirm_body.tpl') ); $template->assign_vars(array( 'MESSAGE_TITLE' => $lang['Confirm'], 'MESSAGE_TEXT' => $lang['Music_delete_confirm'], 'L_NO' => $lang['No'], 'L_YES' => $lang['Yes'], 'S_CONFIRM_ACTION' => append_sid(this_mo_mxurl("music_mode=music_delete&song_id=$song_id")), ) ); // // Generate the page // $template->pparse('body'); if ( !$is_block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } } else { // -------------------------------- // It's confirmed. First delete all comments // -------------------------------- $sql = "DELETE FROM ". MUSIC_COMMENT_TABLE ." WHERE comment_song_id = '$song_id'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not delete related comments', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Delete all ratings // -------------------------------- $sql = "DELETE FROM ". MUSIC_RATE_TABLE ." WHERE rate_song_id = '$song_id'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not delete related ratings', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Delete File // -------------------------------- @unlink(MUSIC_UPLOAD_PATH . $thissong['song_filename']); // -------------------------------- // Delete DB entry // -------------------------------- $sql = "DELETE FROM ". MUSIC_TABLE ." WHERE song_id = '$song_id'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not delete DB entry', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Complete... now send a message to user // -------------------------------- $message = $lang['Songs_deleted_successfully']; $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . '">') ); $message .= "<br /><br />" . sprintf($lang['Click_return_category'], "<a href=\"" . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . "\">", "</a>"); $message .= "<br /><br />" . sprintf($lang['Click_return_music_index'], "<a href=\"" . append_sid(this_mo_mxurl()) . "\">", "</a>"); mx_message_die(GENERAL_MESSAGE, $message); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> --- NEW FILE: music_comment_edit.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_comment_edit.php,v 1.1.2.1 2008/01/16 19:53:12 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // ------------------------------------ // Check feature enabled // ------------------------------------ if( $music_config['comment'] == 0 ) { mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } // ------------------------------------ // Check the request // ------------------------------------ if( isset($HTTP_GET_VARS['comment_id']) ) { $comment_id = intval($HTTP_GET_VARS['comment_id']); } else if( isset($HTTP_POST_VARS['comment_id']) ) { $comment_id = intval($HTTP_POST_VARS['comment_id']); } else { mx_message_die(GENERAL_ERROR, 'No comment_id specified'); } // ------------------------------------ // Get the comment info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_COMMENT_TABLE ." WHERE comment_id = '$comment_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query this comment information', '', __LINE__, __FILE__, $sql); } $thiscomment = $db->sql_fetchrow($result); if( empty($thiscomment) ) { mx_message_die(GENERAL_ERROR, 'This comment does not exist'); } // ------------------------------------ // Get $song_id from $comment_id // ------------------------------------ $sql = "SELECT comment_id, comment_song_id FROM ". MUSIC_COMMENT_TABLE ." WHERE comment_id = '$comment_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query comment and song information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $song_id = $row['comment_song_id']; // ------------------------------------ // Get this song info // ------------------------------------ $sql = "SELECT s.*, u.user_id, u.username, COUNT(c.comment_id) as comments_count FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE song_id = '$song_id' GROUP BY s.song_id LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $thissong = $db->sql_fetchrow($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; $total_comments = $thissong['comments_count']; $comments_per_page = $board_config['posts_per_page']; $song_filename = $thissong['song_filename']; if( empty($thissong) ) { mx_message_die(GENERAL_ERROR, $lang['Song_not_exist']); } // ------------------------------------ // Get the current Category Info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); if (empty($thiscat)) { mx_message_die(GENERAL_ERROR, $lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $music_user_access = music_user_access($thissong['song_cat_id'], $thiscat, 0, 0, 0, 1, 1, 0); if( ($music_user_access['comment'] == 0) or ($music_user_access['edit'] == 0) ) { if (!$userdata['session_logged_in']) { mx_redirect(append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_comment_edit&comment_id=$comment_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } else { if( (!$music_user_access['moderator']) or ($userdata['user_level'] != ADMIN) ) { if ($thiscomment['comment_user_id'] != $userdata['user_id']) { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ if( !isset($HTTP_POST_VARS['comment']) ) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Comments Screen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if( ($thissong['song_user_id'] == MUSIC_GUEST) or ($thissong['username'] == '') ) { $poster = ($thissong['song_username'] == '') ? $lang['Guest'] : $thissong['song_username']; } else { $poster = '<a href="'. append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thissong['user_id']) .'">'. $thissong['username'] .'</a>'; } // // Start output of page // $page_title = $lang['Music']; if ( !$is_block ) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array( 'body' => 'music_comment_body.tpl') ); $template->assign_block_vars('switch_comment_post', array()); $template->assign_vars(array( 'CAT_TITLE' => $thiscat['cat_title'], 'U_VIEW_CAT' => append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")), 'U_SONG' => append_sid(this_mo_mxurl("music_mode=music_song&song_id=$song_id")), 'SONG_TITLE' => $thissong['song_title'], 'POSTER' => $poster, 'SONG_TIME' => create_date($board_config['default_dateformat'], $thissong['song_time'], $board_config['board_timezone']), 'SONG_VIEW' => $thissong['song_view_count'], 'SONG_COMMENTS' => $total_comments, 'S_MESSAGE' => $thiscomment['comment_text'], 'L_SONG_TITLE' => $lang['Song_Title'], 'L_POSTER' => $lang['Poster'], 'L_POSTED' => $lang['Posted'], 'L_VIEW' => $lang['View'], 'L_COMMENTS' => $lang['Comments'], 'L_POST_YOUR_COMMENT' => $lang['Post_your_comment'], 'L_MESSAGE' => $lang['Message'], 'L_USERNAME' => $lang['Username'], 'L_COMMENT_NO_TEXT' => $lang['Comment_no_text'], 'L_COMMENT_TOO_LONG' => $lang['Comment_too_long'], 'L_MAX_LENGTH' => $lang['Max_length'], 'S_MAX_LENGTH' => $music_config['desc_length'], 'L_SUBMIT' => $lang['Submit'], 'S_MUSIC_ACTION' => append_sid(this_mo_mxurl("music_mode=music_comment_edit&comment_id=$comment_id")) ) ); // // Generate the page // $template->pparse('body'); if ( !$is_block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } } else { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Comment Submited ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ $comment_text = str_replace("\'", "''", htmlspecialchars(substr(trim($HTTP_POST_VARS['comment']), 0, $music_config['desc_length']))); if( empty($comment_text) ) { mx_message_die(GENERAL_ERROR, $lang['Comment_no_text']); } // -------------------------------- // Prepare variables // -------------------------------- $comment_edit_time = time(); $comment_edit_user_id = $userdata['user_id']; // -------------------------------- // Update the DB // -------------------------------- $sql = "UPDATE ". MUSIC_COMMENT_TABLE ." SET comment_text = '$comment_text', comment_edit_time = '$comment_edit_time', comment_edit_count = comment_edit_count + 1, comment_edit_user_id = '$comment_edit_user_id' WHERE comment_id = '$comment_id'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not update comment data', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Complete... now send a message to user // -------------------------------- $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid(this_mo_mxurl("music_mode=music_comment&comment_id=$comment_id")) . '#'.$comment_id.'">') ); $message = $lang['Stored'] . "<br /><br />" . sprintf($lang['Click_view_message'], "<a href=\"" . append_sid(this_mo_mxurl("music_mode=music_comment&comment_id=$comment_id")) . "#$comment_id\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_music_index'], "<a href=\"" . append_sid(this_mo_mxurl()) . "\">", "</a>"); mx_message_die(GENERAL_MESSAGE, $message); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> --- NEW FILE: music_pic_cat.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_pic_cat.php,v 1.1.2.1 2008/01/16 19:53:15 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ //mxBB if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // ------------------------------------ // Check the request // ------------------------------------ [...976 lines suppressed...] ); // // Generate the page // $template->pparse('body'); if ( !$is_block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ // // That's all Folks! // -------------------- ?> --- NEW FILE: music_cat.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_cat.php,v 1.1.2.1 2008/01/16 19:53:11 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ //mxBB if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } $music_root_path = $module_root_path . 'music_box/'; // ------------------------------------ [...981 lines suppressed...] ); // // Generate the page // $template->pparse('body'); if ( !$is_block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ // // That's all Folks! // -------------------- ?> --- NEW FILE: music_modcp.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_modcp.php,v 1.1.2.1 2008/01/16 19:53:14 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } $music_root_path = $module_root_path . 'music_box/'; [...1019 lines suppressed...] } $message = $lang['Songs_deleted_successfully'] .'<br /><br />'. sprintf($lang['Click_return_category'], "<a href=\"" . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . "\">", "</a>") .'<br /><br />'. sprintf($lang['Click_return_modcp'], "<a href=\"" . append_sid(this_mo_mxurl("music_mode=music_modcp&cat_id=$cat_id")) . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_music_index'], "<a href=\"" . append_sid(this_mo_mxurl()) . "\">", "</a>"); mx_message_die(GENERAL_MESSAGE, $message); } } else { mx_message_die(GENERAL_ERROR, 'Invalid_mode'); } } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> --- NEW FILE: music_comment_delete.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_comment_delete.php,v 1.1.2.1 2008/01/16 19:53:12 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // ------------------------------------ // Check feature enabled // ------------------------------------ if( $music_config['comment'] == 0 ) { mx_message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } // ------------------------------------ // Check the request // ------------------------------------ if( isset($HTTP_GET_VARS['comment_id']) ) { $comment_id = intval($HTTP_GET_VARS['comment_id']); } else if( isset($HTTP_POST_VARS['comment_id']) ) { $comment_id = intval($HTTP_POST_VARS['comment_id']); } else { mx_message_die(GENERAL_ERROR, 'No comment_id specified'); } // ------------------------------------ // Get the comment info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_COMMENT_TABLE ." WHERE comment_id = '$comment_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query this comment information', '', __LINE__, __FILE__, $sql); } $thiscomment = $db->sql_fetchrow($result); if( empty($thiscomment) ) { mx_message_die(GENERAL_ERROR, 'This comment does not exist'); } // ------------------------------------ // Get $song_id from $comment_id // ------------------------------------ $sql = "SELECT comment_id, comment_song_id FROM ". MUSIC_COMMENT_TABLE ." WHERE comment_id = '$comment_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query comment and song information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); if( empty($row) ) { mx_message_die(GENERAL_ERROR, 'This comment does not exist'); } $song_id = $row['comment_song_id']; // ------------------------------------ // Get this song info // ------------------------------------ $sql = "SELECT s.*, u.user_id, u.username, COUNT(c.comment_id) as comments_count FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE song_id = '$song_id' GROUP BY s.song_id LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $thissong = $db->sql_fetchrow($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; $total_comments = $thissong['comments_count']; $comments_per_page = $board_config['posts_per_page']; $song_filename = $thissong['song_filename']; if( empty($thissong) ) { mx_message_die(GENERAL_ERROR, $lang['Song_not_exist']); } // ------------------------------------ // Get the current Category Info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); if (empty($thiscat)) { mx_message_die(GENERAL_ERROR, $lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $music_user_access = music_user_access($thissong['song_cat_id'], $thiscat, 0, 0, 0, 1, 0, 1); if( ($music_user_access['comment'] == 0) or ($music_user_access['delete'] == 0) ) { if (!$userdata['session_logged_in']) { mx_redirect(append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_comment_delete&comment_id=$comment_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } else { if( (!$music_user_access['moderator']) or ($userdata['user_level'] != ADMIN) ) { if ($thiscomment['comment_user_id'] != $userdata['user_id']) { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ if( !isset($HTTP_POST_VARS['confirm']) ) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Confirm Screen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ // -------------------------------- // If user give up deleting... // -------------------------------- if( isset($HTTP_POST_VARS['cancel']) ) { mx_redirect(append_sid(this_mo_mxurl("music_mode=music_comment&comment_id=$comment_id"))); exit; } // // Start output of page // $page_title = $lang['Music']; if ( !$is_block ) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array( 'body' => 'confirm_body.tpl') ); $template->assign_vars(array( 'MESSAGE_TITLE' => $lang['Confirm'], 'MESSAGE_TEXT' => $lang['Comment_delete_confirm'], 'L_NO' => $lang['No'], 'L_YES' => $lang['Yes'], 'S_CONFIRM_ACTION' => append_sid(this_mo_mxurl("music_mode=music_comment_delete&comment_id=$comment_id")), ) ); // // Generate the page // $template->pparse('body'); if ( !$is_block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } } else { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Do the deleting ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ $sql = "DELETE FROM ". MUSIC_COMMENT_TABLE ." WHERE comment_id = '$comment_id'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not delete this comment', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Complete... now send a message to user // -------------------------------- $message = $lang['Deleted']; $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . '">') ); $message .= "<br /><br />" . sprintf($lang['Click_return_category'], "<a href=\"" . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . "\">", "</a>"); $message .= "<br /><br />" . sprintf($lang['Click_return_music_index'], "<a href=\"" . append_sid(this_mo_mxurl()) . "\">", "</a>"); mx_message_die(GENERAL_MESSAGE, $message); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> --- NEW FILE: music_edit.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_edit.php,v 1.1.2.1 2008/01/16 19:53:13 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } $music_root_path = $module_root_path . 'music_box/'; //Image Edit Added by OryNider $song_image_path = MUSIC_IMAGE_PATH; // ------------------------------------ // Check the request // ------------------------------------ if( isset($HTTP_GET_VARS['song_id']) ) { $song_id = intval($HTTP_GET_VARS['song_id']); } else if( isset($HTTP_POST_VARS['song_id']) ) { $song_id = intval($HTTP_POST_VARS['song_id']); } else { mx_message_die(GENERAL_ERROR, 'No songs specified'); } // ------------------------------------ // Get this song info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_TABLE ." WHERE song_id = '$song_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $thissong = $db->sql_fetchrow($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; $song_filename = $thissong['song_filename']; if( empty($thissong) ) { mx_message_die(GENERAL_ERROR, $lang['Song_not_exist']); } //Image Edit Added by OryNider if( !empty($thissong['song_imagename']) ) { $old_pic_filename = $thissong['song_imagename']; $no_image = ( !empty($lang['No_change']) ? $lang['No_change'] : 'No Change' ); } else { $old_pic_filename = ''; $no_image = $lang['No_image']; } // ------------------------------------ // Get the current Category Info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); if (empty($thiscat)) { mx_message_die(GENERAL_ERROR, $lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $music_user_access = music_user_access($cat_id, $thiscat, 0, 0, 0, 0, 1, 0); // EDIT if ($music_user_access['edit'] == 0) { if (!$userdata['session_logged_in']) { mx_redirect(append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_edit&song_id=$song_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } else { if( (!$music_user_access['moderator']) or ($userdata['user_level'] != ADMIN) ) { if ($thissong['song_user_id'] != $userdata['user_id']) { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ if( !isset($HTTP_POST_VARS['song_title']) ) { // // Start output of page // $page_title = $lang['Music']; if ( !$is_block ) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array( 'body' => 'music_edit_body.tpl') ); $template->assign_vars(array( 'L_EDIT_SONG_INFO' => $lang['Edit_Song_Info'], 'CAT_TITLE' => $thiscat['cat_title'], 'U_VIEW_CAT' => append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")), 'L_SONG_TITLE' => $lang['Song_Title'], 'SONG_TITLE' => $thissong['song_title'], 'L_SONG_URL' => $lang['Song_url'], 'SONG_URL' => $thissong['song_url'], 'SONG_SINGER' => $thissong['song_singer'], 'SONG_DESC' => $thissong['song_desc'], 'L_SINGER' => $lang['Singer'], 'L_SONG_DESC' => $lang['Song_Desc'], 'L_PLAIN_TEXT_ONLY' => $lang['Plain_text_only'], 'L_MAX_LENGTH' => $lang['Max_length'], 'L_UPLOAD_NO_TITLE' => $lang['Upload_no_title'], 'L_DESC_TOO_LONG' => $lang['Desc_too_long'], 'S_SONG_DESC_MAX_LENGTH' => $music_config['desc_length'], 'L_RESET' => $lang['Reset'], 'L_SUBMIT' => $lang['Submit'], 'NAV_SEP' => $lang['Nav_Separator'], 'NAV_DOT' => '•', 'MUSIC_VERSION' => '2' . $music_config['music_version'], 'L_INDEX' => '<<', 'U_INDEX' => append_sid($mx_root_path . "index.".$phpEx), 'L_MUSIC_INDEX' => $lang['Music'], 'L_MUSIC' => $lang['Music'], 'U_MUSIC' => append_sid(this_mo_mxurl()), 'U_MX_MUSIC' => append_sid(this_mo_portalurl()), //Image Edit Added by OryNider 'L_SONG_IMAGE' => $lang['Song_image'], 'L_SONG_IMAGE_DESC' => $lang['Song_image_desc'], 'L_NO_IMAGE' => $no_image, 'L_UPLOAD_IMAGE' => $lang['Upload_image'], 'S_MUSIC_ACTION' => append_sid(this_mo_mxurl("music_mode=music_edit&song_id=$song_id")), ) ); // // Generate the page // $template->pparse('body'); if ( !$is_block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } } else { // -------------------------------- // Check posted info // -------------------------------- $song_title = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['song_title']))); $song_url = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['song_url']))); //Image Edit Added by OryNider $image_system = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['image_system']))); $song_singer = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['song_singer']))); $song_desc = str_replace("\'", "''", htmlspecialchars(substr(trim($HTTP_POST_VARS['song_desc']), 0, $music_config['desc_length']))); if( empty($song_title) ) { mx_message_die(GENERAL_ERROR, $lang['Missed_song_title']); } if ( $thissong['song_url'] != '' ) { if( empty($song_url) ) { mx_message_die(GENERAL_ERROR, $lang['Missed_song_url']); } } else { if( $song_url != '' ) { mx_message_die(GENERAL_ERROR, 'Bad edit'); } } //Image Edit Added by OryNider // -------------------------------- // Get Song Image Upload Info // -------------------------------- $imagetype = ( !empty($HTTP_POST_FILES['song_image']['type']) ) ? $HTTP_POST_FILES['song_image']['type'] : ''; $imagesize = ( !empty($HTTP_POST_FILES['song_image']['size']) ) ? $HTTP_POST_FILES['song_image']['size'] : 0; $imagetmp = ( !empty($HTTP_POST_FILES['song_image']['tmp_name']) ) ? $HTTP_POST_FILES['song_image']['tmp_name'] : ''; //Image Edit Added by OryNider // -------------------------------- // Check image size // -------------------------------- if( $image_system == '1' ) { // -------------------------------- // Check image type // -------------------------------- switch ($imagetype) { case 'image/jpeg': case 'image/jpg': case 'image/pjpeg': $song_imagetype = '.jpg'; break; case 'image/gif': $song_imagetype = '.gif'; break; case 'image/png': case 'image/x-png': $song_imagetype = '.png'; break; default: mx_message_die(GENERAL_ERROR, $lang['Not_allowed_image_type'] . ': ' . $imagetype); } if( $imagesize > $music_config['max_image_size'] ) { mx_message_die(GENERAL_MESSAGE, $lang['Bad_upload_image_size']); } // -------------------------------- // If exits old image deleate it // -------------------------------- if( !empty($old_pic_filename) && file_exists($song_image_path . $old_pic_filename) ) { @unlink($song_image_path . $old_pic_filename); } // -------------------------------- // Generate imagename // -------------------------------- do { $song_imagename = md5(uniqid(rand())) . $song_imagetype; } while( file_exists($song_image_path . $song_imagename) ); // -------------------------------- // Move song image to directory // -------------------------------- if( !empty($HTTP_POST_FILES['song_image']['tmp_name']) ) { $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; if ( @$ini_val('open_basedir') != '' ) { if ( @phpversion() < '4.0.3' ) { mx_message_die(GENERAL_ERROR, 'open_basedir is set and your PHP version does not allow move_uploaded_file<br /><br />Please contact your server admin', '', __LINE__, __FILE__); } $move_file = 'move_uploaded_file'; } else { $move_file = 'copy'; } $move_file($imagetmp, $song_image_path . $song_imagename); @chmod($song_image_path . $song_imagename, 0777); } // -------------------------------- // Check its image size // -------------------------------- if( !empty($HTTP_POST_FILES['song_image']['size']) ) { $image_size = getimagesize($song_image_path . $song_imagename); $image_width = $image_size[0]; $image_height = $image_size[1]; if ( ($image_width > $music_config['max_image_width']) or ($image_height > $music_config['max_image_height']) ) { @unlink($song_image_path . $song_imagename); mx_message_die(GENERAL_ERROR, 'Your uploaded image size is too big'); } } } else if( !empty($old_pic_filename) ) { $song_imagename = $old_pic_filename; } else { $song_imagename = ''; } //mx_message_die(GENERAL_ERROR, 'Could not update ' . 'song_imagename: ' . $song_imagename); // -------------------------------- // Update the DB // -------------------------------- //Image Edit Altered by OryNider $sql = "UPDATE ". MUSIC_TABLE ." SET song_imagename = '$song_imagename', song_title = '$song_title', song_url = '$song_url', song_singer = '$song_singer', song_desc = '$song_desc' WHERE song_id = '$song_id'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not update song information', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Complete... now send a message to user // -------------------------------- $message = $lang['Songs_updated_successfully']; $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . '">') ); $message .= "<br /><br />" . sprintf($lang['Click_return_category'], "<a href=\"" . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")) . "\">", "</a>"); $message .= "<br /><br />" . sprintf($lang['Click_return_music_index'], "<a href=\"" . append_sid(this_mo_mxurl()) . "\">", "</a>"); mx_message_die(GENERAL_MESSAGE, $message); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> --- NEW FILE: music_stream.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_stream.php,v 1.1.2.1 2008/01/16 19:53:16 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ /********************************************************************** * MODIFICATIONS * --------------- * started : Saturday, February 28, 2007 * copyright : © OryNider * web : http://pubory.uv.ro/ * version : 2.0.4 * * Credits: * -Getting ip and port in settings by lsn (http://botland.org/) * ***********************************************************************/ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // // Let's include some stuff... // $phpEx = substr(strrchr(__FILE__, '.'), 1); if ( !defined('TEMPLATE_ROOT_PATH') ) { include_once($mx_root_path . 'common.' . $phpEx); // // Start session management // $mx_user->init($user_ip, PAGE_INDEX); // // End session management // } $music_root_path = $module_root_path . 'music_box/'; // // Get general music information // include_once($music_root_path . 'music_common.'.$phpEx); // ------------------------------------ // Check the request // ------------------------------------ if( isset($HTTP_GET_VARS['song_id']) ) { $song_id = intval($HTTP_GET_VARS['song_id']); } else if( isset($HTTP_POST_VARS['song_id']) ) { $song_id = intval($HTTP_POST_VARS['song_id']); } else { die('No songs specified'); } // ------------------------------------ // Get this song info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_TABLE ." WHERE song_id = '$song_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $thissong = $db->sql_fetchrow($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; if ( $thissong['song_url'] == '' ) { $song_filetype = substr($thissong['song_filename'], strlen($thissong['song_filename']) - 3, 3); $song_filename = $thissong['song_filename']; } else { $song_filetype = substr($thissong['song_url'], strlen($thissong['song_url']) - 3, 3); $song_url = $thissong['song_url']; } // ------------------------------------ // Get the current Category Info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); if (empty($thiscat)) { die($lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $music_user_access = music_user_access($cat_id, $thiscat, 1, 0, 0, 0, 0, 0); // VIEW if ($music_user_access['view'] == 0) { die($lang['Not_Authorised']); } // ------------------------------------ // Check hotlink // ------------------------------------ if( ($music_config['hotlink_prevent'] == 1) and (isset($HTTP_SERVER_VARS['HTTP_REFERER'])) ) { $check_referer = explode('?', $HTTP_SERVER_VARS['HTTP_REFERER']); $check_referer = trim($check_referer[0]); $good_referers = array(); if ($music_config['hotlink_allowed'] != '') { $good_referers = explode(',', $music_config['hotlink_allowed']); } $good_referers[] = $board_config['server_name'] . $board_config['script_path']; $errored = TRUE; for ($i = 0; $i < count($good_referers); $i++) { $good_referers[$i] = trim($good_referers[$i]); if( (strstr($check_referer, $good_referers[$i])) and ($good_referers[$i] != '') ) { $errored = FALSE; } } if ($errored) { die($lang['Not_Authorised']); } } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ // Settings by lsn $host = explode("//", $thissong['song_url']); $host = $host[1]; $host = explode(":", $host); $ip = $host[0]; // Shoutcast Ip or Host $port = explode("/", $host[1]); $port = $port[0]; // Shoutcast Port $mount = "/"; // Used for alternate path to "Streaming URL" -- leave as "/" for the default setup. $artist = "Shotcast Steam -via- Mx Music Center"; $title = "Radio Steam - Mx Music Center!"; $album = "Live"; if ( $port == '' ) { $port = '80'; } // Make socket connection $errno = "errno"; $errstr = "errstr"; $fp = fsockopen($ip, $port, $errno, $errstr, 30); // Establish response headers header("HTTP/1.0 200 OK"); header("Content-Type: audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3"); header("Content-Transfer-Encoding: binary"); // Content-Length is required for Internet Explorer: // - Set to a rediculous number // = I think the limit is somewhere around 420 MB header("Content-Length: 100000000"); header("Content-Disposition: attachment; filename=$title")."\n"; // Create send headers $out = "GET $mount HTTP/1.1\r\n"; $out .= "Host: $ip\r\n"; $out .= "Connection: Close\r\n\r\n"; // Write the returned data back to the resource fwrite($fp, $out); // Read resource while (!feof($fp)) { // Get data in 2048 chuncks $outData = fgets($fp, 2048); // Removing shoutcast headers. if (!stristr($outData, "icy") && !stristr($outData, "content")){ echo $outData; } } fclose($fp); // +------------------------------------------------------+ // | Powered by Mx Music Center 2.0.1 (c) 2007 OryNider| // +------------------------------------------------------+ ?> --- NEW FILE: music_rss.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_rss.php,v 1.1.2.1 2008/01/16 19:53:15 orynider Exp $ * @copyright (c) 2007 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // MX if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // ------- // Begin Page specific functions // function make_xml_compatible($text, $bbcode_uid = '', $use_bbcode = 0) { global $board_config, $base_url; if($use_bbcode) { if($bbcode_uid != '') { $text = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($text, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $text); } else { $text = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $text); } $text = m... [truncated message content] |
|
From: OryNider <ory...@us...> - 2008-01-16 19:53:17
|
Update of /cvsroot/mxbb/mx_music/music_box/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18200/includes Added Files: Tag: core28x index.htm music_constants.php music_functions.php music_integration.php Log Message: --- NEW FILE: music_functions.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_functions.php,v 1.1.2.1 2008/01/16 19:53:10 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // ------------------------------------ // All common functions are here! // ------------------------------------ // You cannot call this file directly from your browser // if ( !defined('IN_PORTAL') ) { die('Hacking attempt'); } // ---------------------------------------------------------------------------- // This function will return the access data of the current user for a category // Default returning value is "0" (means NOT AUTHORISED) // // All $*_check must be "1" or "0" // // $passed_auth must be a full row from MUSIC_CAT_TABLE. This function still works without // ... but $passed_auth will make it worked very much faster (because this function is often // called in a loop) // function music_user_access($cat_id, $passed_auth = 0, $view_check, $upload_check, $rate_check, $comment_check, $edit_check, $delete_check) { global $db, $music_config, $userdata; // -------------------------------- // Force to check moderator status // -------------------------------- $moderator_check = 1; // -------------------------------- // Here the array which this function would return. Now we initiate it! // -------------------------------- $music_user_access = array( 'view' => 0, 'upload' => 0, 'rate' => 0, 'comment' => 0, 'edit' => 0, 'delete' => 0, 'moderator' => 0 ); $music_user_access_keys = array_keys($music_user_access); // // END initiation $music_user_access // // -------------------------------- // Check $cat_id // -------------------------------- if ($cat_id < 0) { message_die(GENERAL_ERROR, 'Bad cat_id arguments for function music_user_access()'); } // // END check $cat_id // // -------------------------------- // If the current user is an ADMIN (MUSIC_ADMIN == ADMIN) // -------------------------------- if ($userdata['user_level'] == ADMIN) { for ($i = 0; $i < count($music_user_access); $i++) { $music_user_access[$music_user_access_keys[$i]] = 1; // Authorised All } // // Function EXIT here // return $music_user_access; } // // END check ADMIN // // -------------------------------- // if this is a GUEST, we will ignore some checking // -------------------------------- if (!$userdata['session_logged_in']) { $edit_check = 0; $delete_check = 0; $moderator_check = 0; } // // END check GUEST // // -------------------------------- // check if RATE or COMMENT are turned off by music Config, so we can ignore them // -------------------------------- if ($music_config['rate'] == 0) { $rate_check = 0; } if ($music_config['comment'] == 0) { $comment_check = 0; } // // END Check RATE & COMMENT // // -------------------------------- // The array that list all access type this function will look for (except MODERATOR) // -------------------------------- $access_type = array(); if ($view_check != 0) { $access_type[] = 'view'; } if ($upload_check != 0) { $access_type[] = 'upload'; } if ($rate_check != 0) { $access_type[] = 'rate'; } if ($comment_check != 0) { $access_type[] = 'comment'; } if ($edit_check != 0) { $access_type[] = 'edit'; } if ($delete_check != 0) { $access_type[] = 'delete'; } // // END generating array $access_type // // -------------------------------- // If everything is empty // -------------------------------- if( empty($access_type) and (!$moderator_check) ) { // // Function EXIT here // return $music_user_access; } // // END check empty // // -------------------------------- // Generate the SQL query based on $access_type and $moderator_check // -------------------------------- $sql = 'SELECT cat_id'; for ($i = 0; $i < count($access_type); $i++) { $sql .= ', cat_'. $access_type[$i] .'_level, cat_'. $access_type[$i] .'_groups'; } if ($moderator_check) { $sql .= ', cat_moderator_groups'; } $sql .= " FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = '$cat_id'"; // // END SQL query generating // // -------------------------------- // Query the $sql then Fetchrow if $passed_auth == 0 // -------------------------------- if( !is_array($passed_auth) ) { if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not query music Category information' ,'' , __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); } else { $thiscat = $passed_auth; } // // END Query and Fetchrow // // -------------------------------- // Maybe the access level is not PRIVATE or the groups list is empty // ... so we can skip some queries ;) // -------------------------------- $groups_access = array(); for ($i = 0; $i < count($access_type); $i++) { switch ($thiscat['cat_'. $access_type[$i] .'_level']) { case MUSIC_GUEST: $music_user_access[$access_type[$i]] = 1; break; case MUSIC_USER: if ($userdata['session_logged_in']) { $music_user_access[$access_type[$i]] = 1; } break; case MUSIC_PRIVATE: if( ($thiscat['cat_'. $access_type[$i] .'_groups'] != '') and ($userdata['session_logged_in']) ) { $groups_access[] = $access_type[$i]; } break; case MUSIC_MOD: // this will be checked later break; case MUSIC_ADMIN: // ADMIN already returned before at the checking code // at the top of this function. So this user cannot be authorised $music_user_access[$access_type[$i]] = 0; break; default: $music_user_access[$access_type[$i]] = 0; } } // // END Check Access Level // // -------------------------------- // We can return now if $groups_access is empty AND $moderator_check == 0 // -------------------------------- if( ($moderator_check == 1) and ($thiscat['cat_moderator_groups'] != '') ) { // We can merge them now $groups_access[] = 'moderator'; } if (empty($groups_access)) { // // Function EXIT here // return $music_user_access; } // -------------------------------- // Now we have the list of usergroups have PRIVATE/MODERATOR access // So we will check if this user is in these usergroups or not... // -------------------------------- // upto (6 + 1) loops maximum when this user logged in and All Levels // are set to PRIVATE and this function was called to check all. // So avoiding PRIVATE will speed up your music. However, these queries are very fast for ($i = 0; $i < count($groups_access); $i++) { $sql = "SELECT group_id, user_id FROM ". USER_GROUP_TABLE ." WHERE user_id = '". $userdata['user_id'] ."' AND user_pending = 0 AND group_id IN (". $thiscat['cat_'. $groups_access[$i] .'_groups'] .")"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not query User-Group information' ,'' , __LINE__, __FILE__, $sql); } if( $db->sql_numrows($result) > 0 ) { $music_user_access[$groups_access[$i]] = 1; } } // // END check PRIVATE/MODERATOR groups // // -------------------------------- // If $moderator_check was called and this user is a MODERATOR he // will be authorised for all accesses which were not set to ADMIN // -------------------------------- if( ($music_user_access['moderator'] == 1) and ($moderator_check == 1) ) { for ($i = 0; $i < count($music_user_access); $i++) { if( $thiscat['cat_'. $music_user_access_keys[$i] .'_level'] != MUSIC_ADMIN ) { $music_user_access[$music_user_access_keys[$i]] = 1; } } } // // END Moderator // // -------------------------------- // Return result... // -------------------------------- return $music_user_access; } // // END function music_user_access() // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // You must retain the full copyright notice below including the link to my site. // This not only gives respect to the large amount of time given freely // but also helps promoting my scripts. If you refuse to include this then // support by me may be affected. And Do NOT modify anything!!! function music_end() { global $music_config; echo '<div align="center" style="font-family: Verdana; font-size: 10px; letter-spacing: -1px">Powered by Music Online 2' . $music_config['music_version'] . ' © 2003 <a href="http://cfmanager.net.tf" target="_blank">Cf Manager</a></div>'; } // // OR you can pay me for the copyright notice removal. Contact me! // ---------------------------------------------------------------------------- // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> --- NEW FILE: music_integration.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_integration.php,v 1.1.2.1 2008/01/16 19:53:11 orynider Exp $ * @copyright (c) 2002-2006 [OryNider, ory...@rd...] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /* if( defined('music_CONFIG_TABLE') ) { $music_config = array(); $sql = "SELECT * FROM " . MUSIC_CONFIG_TABLE; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Couldn't query radio config table", "", __LINE__, __FILE__, $sql); } else { while( $row = $db->sql_fetchrow($result) ) { $config_name = $row['config_name']; $config_value = $row['config_value']; $music_config[$row['config_name']] = $row['config_value']; } } } */ $music_index = $music_config['index']; $override_default_pages = $music_config['override_default_pages']; $integration_enabled = $music_config['enable_integration']; // MX add-on // Generate paths for page and standalone mode // ...function based on original function written by Markus :-) function this_mo_mxurl($args = '', $force_standalone_mode = false) { global $mx_root_path, $phpbb_root_path, $module_root_path, $page_id, $music_index, $phpEx, $integration_enabled, $is_block; if( $force_standalone_mode || !$is_block ) { $mxurl = ( !MXBB_MODULE ) ? $phpbb_root_path . 'music.' . $phpEx . ($args == '' ? '' : '?' . $args) : $mx_root_path . 'modules/mx_music/' . 'music.' . $phpEx . ($args == '' ? '' : '?' . $args); } else { $mxurl = $mx_root_path . 'index.' . $phpEx; if( is_numeric($page_id) && !empty($page_id) ) { $mxurl .= '?page=' . $page_id . ($args == '' ? '' : '&' . $args); } else { $mxurl .= '?page=' . $music_index . ($args == '' ? '' : '&' . $args); } } return $mxurl; } function this_mo_portalurl($args = '', $force_standalone_mode = false) { global $mx_root_path, $phpbb_root_path, $module_root_path, $page_id, $music_index, $phpEx, $integration_enabled, $is_block; if( $force_standalone_mode || !$integration_enabled ) { $mxurl = ( !MXBB_MODULE ) ? $phpbb_root_path . 'music.' . $phpEx . ($args == '' ? '' : '?' . $args) : $mx_root_path . 'modules/mx_music/' . 'music.' . $phpEx . ($args == '' ? '' : '?' . $args); } else { $mxurl = $mx_root_path . 'index.' . $phpEx . '?page=' . $music_index . ($args == '' ? '' : '&' . $args); } return $mxurl; } function this_mo_loginurl($args = '') { global $mx_root_path, $module_root_path, $page_id, $music_index, $phpEx, $integration_enabled, $is_block; $mxurl = ( !MXBB_MODULE ) ? $phpbb_root_path . 'music.' . $phpEx : $mx_root_path . 'modules/mx_music/' . 'music.' . $phpEx; if( is_numeric($page_id) && !empty($page_id) ) { $mxurl .= ($args == '' ? '' : '&' . $args) . '&page=' . $page_id; } else { $mxurl .= ($args == '' ? '' : '&' . $args) . '&page=' . $music_index; } return $mxurl; } function this_mo_rssurl($args = '', $force_standalone_mode = false) { global $music_index, $phpEx; if( $force_standalone_mode ) { $mxurl = ( !MXBB_MODULE ) ? 'music.' . $phpEx . ($args == '' ? '' : '?' . $args) : 'modules/mx_music/' . 'music.' . $phpEx . ($args == '' ? '' : '?' . $args); } else { $mxurl = ( !MXBB_MODULE ) ? 'music.' . $phpEx . ($args == '' ? '' : '?' . $args) : 'music.' . $phpEx . ($args == '' ? '' : '?' . $args); } return $mxurl; } // -------------------------------------------------------------------------------- // That's all Folks! // -------------------------------------------------------------------------------- ?> --- NEW FILE: music_constants.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_constants.php,v 1.1.2.1 2008/01/16 19:53:10 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined('IN_PORTAL') ) { die('Hacking attempt'); } if ( !MXBB_MODULE ) { $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])); $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : ''; $script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])); $script_name = ($script_name == '') ? $script_name : '/' . $script_name; define( 'PORTAL_URL', $server_protocol . $server_name . $server_port . $script_name . '/' ); define( 'PHPBB_URL', PORTAL_URL ); $mx_table_prefix = $table_prefix; $is_block = false; // This also makes the script work for phpBB ;) } define('PAGE_MUSIC', -19); // for Session Handling // User Levels for Music system <- do NOT change these values define('MUSIC_ANONYMOUS', -1); define('MUSIC_GUEST', -1); define('MUSIC_USER', 0); define('MUSIC_ADMIN', 1); define('MUSIC_MOD', 2); define('MUSIC_PRIVATE', 3); if ( !MXBB_MODULE ) { // Path (trailing slash required) define('MUSIC_UPLOAD_PATH', $module_root_path . 'music_box/upload/'); define('MUSIC_IMAGE_PATH', $module_root_path . 'muisc_box/upload/song_image/'); } else { // Path (trailing slash required) define('MUSIC_UPLOAD_PATH', $module_root_path . 'upload/'); define('MUSIC_IMAGE_PATH', $module_root_path . 'upload/song_image/'); } // Table names !defined('MUSIC_TABLE') ? define('MUSIC_TABLE', $mx_table_prefix.'music') : false; !defined('MUSIC_CAT_TABLE') ? define('MUSIC_CAT_TABLE', $mx_table_prefix.'music_cat') : false; !defined('MUSIC_CONFIG_TABLE') ? define('MUSIC_CONFIG_TABLE', $mx_table_prefix.'music_config') : false; !defined('MUSIC_COMMENT_TABLE') ? define('MUSIC_COMMENT_TABLE', $mx_table_prefix.'music_comment') : false; !defined('MUSIC_RATE_TABLE') ? define('MUSIC_RATE_TABLE', $mx_table_prefix.'music_rate') : false; ?> |
|
From: OryNider <ory...@us...> - 2008-01-16 19:52:10
|
Update of /cvsroot/mxbb/mx_music/language/lang_english In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18093 Modified Files: Tag: core28x lang_admin_music.php lang_main_music.php Log Message: |
|
From: OryNider <ory...@us...> - 2008-01-16 19:51:34
|
Update of /cvsroot/mxbb/mx_music/templates In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17712/templates Added Files: Tag: core28x index.htm Log Message: --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |
|
From: OryNider <ory...@us...> - 2008-01-16 19:51:34
|
Update of /cvsroot/mxbb/mx_music/language In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17712/language Added Files: Tag: core28x index.htm Log Message: --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |
|
From: OryNider <ory...@us...> - 2008-01-16 19:50:37
|
Update of /cvsroot/mxbb/mx_music/music_box/modules In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17287/modules Log Message: Directory /cvsroot/mxbb/mx_music/music_box/modules added to the repository --> Using per-directory sticky tag `core28x' |
|
From: OryNider <ory...@us...> - 2008-01-16 19:50:37
|
Update of /cvsroot/mxbb/mx_music/music_box/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17287/includes Log Message: Directory /cvsroot/mxbb/mx_music/music_box/includes added to the repository --> Using per-directory sticky tag `core28x' |
|
From: OryNider <ory...@us...> - 2008-01-16 19:50:03
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16748 Modified Files: Tag: core28x music.php mx_install_readme.htm Log Message: Index: mx_install_readme.htm =================================================================== RCS file: /cvsroot/mxbb/mx_music/mx_install_readme.htm,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** mx_install_readme.htm 2 Nov 2007 00:13:12 -0000 1.1.2.3 --- mx_install_readme.htm 16 Jan 2008 19:49:26 -0000 1.1.2.4 *************** *** 5,9 **** <head> <meta name="generator" content= ! "HTML Tidy for Windows (vers 19 September 2007), see www.w3.org" /> <title>mxBB Portal installation - readme</title> <meta http-equiv="Content-Type" content= --- 5,9 ---- <head> <meta name="generator" content= ! "Microsoft FrontPage 5.0" /> <title>mxBB Portal installation - readme</title> <meta http-equiv="Content-Type" content= *************** *** 270,274 **** src="http://www.mx-system.com/forum/images/smiles/icon_biggrin.gif" border="0" width="15" height="15" /><br /> !  </span></p> </li> <li> --- 270,274 ---- src="http://www.mx-system.com/forum/images/smiles/icon_biggrin.gif" border="0" width="15" height="15" /><br /> ! </span></p> </li> <li> *************** *** 277,281 **** you find the song by Song Title, Singer or Song Poster quickly and easily.<br /> !  </p> </li> <li> --- 277,281 ---- you find the song by Song Title, Singer or Song Poster quickly and easily.<br /> ! </p> </li> <li> *************** *** 283,287 **** "TEXT-DECORATION: underline">Music Cat Views</span> - is adding a viewed counter of each Category;<br /> !  </p> </li> <li> --- 283,287 ---- "TEXT-DECORATION: underline">Music Cat Views</span> - is adding a viewed counter of each Category;<br /> ! </p> </li> <li> *************** *** 344,350 **** "postbody"><span style="COLOR: red">If you upgrade from 2.7.x and you have mx_musiconline, the posibility of migration to mx_music ! it's just teoretical with unknown rezult, and you do it at your own ! risc!!! A mx_musiconline module for 2.8.0 may be relesed by ! Selven.</span></span><span style="font-size: 9pt"><br /> <br /> <a href="#top">Back to Top</a><br /> --- 344,349 ---- "postbody"><span style="COLOR: red">If you upgrade from 2.7.x and you have mx_musiconline, the posibility of migration to mx_music ! it's just teoretical with unknown rezult, and you do it at your own risc!!! You ! will have to move the mx_musiconline/upload/ folder to mx_music/upload/</span></span><span style="font-size: 9pt"><br /> <br /> <a href="#top">Back to Top</a><br /> Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -C2 -d -r1.8.2.2 -r1.8.2.3 *** music.php 21 Sep 2007 22:25:22 -0000 1.8.2.2 --- music.php 16 Jan 2008 19:49:26 -0000 1.8.2.3 *************** *** 15,68 **** ini_set( 'display_errors', '1' ); ! ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! define('IN_PORTAL', true); ! $mx_root_path = '../../'; ! $module_root_path = $mx_root_path . 'modules/mx_music/'; // ! // Let's include some stuff... // ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! include_once($mx_root_path . 'common.' . $phpEx); // ! // Start session management // ! $mx_user->init($user_ip, PAGE_INDEX); // ! // End session management // ! $block_id = ( !empty($HTTP_GET_VARS['block_id']) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if( empty($block_id) ) { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'Media Center' LIMIT 1"; ! if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, "Could not query Music Center module information", "", __LINE__, __FILE__, $sql); } ! $row = $db->sql_fetchrow($result); ! $block_id = $row['block_id']; } ! $is_block = FALSE; ! } ! else ! { ! // ! // Read block Configuration ! // ! $title = $mx_block->block_info['block_title']; ! $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); ! if( is_object($mx_block)) ! { ! $is_block = TRUE; ! } ! global $images, $mx_images; } - $music_root_path = $module_root_path . 'music_box/'; --- 15,111 ---- ini_set( 'display_errors', '1' ); ! if ( file_exists( './viewtopic.php' ) ) // -------------------------------------------- phpBB MOD MODE { ! define( 'MXBB_MODULE', false ); ! define( 'IN_PHPBB', true ); ! define( 'IN_PORTAL', true ); ! define( 'IN_DOWNLOAD', true ); ! ! // When run as a phpBB mod these paths are identical ;) ! $phpbb_root_path = $module_root_path = $mx_root_path = './'; ! $mx_mod_path = $phpbb_root_path . 'mx_mod/'; ! ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! include( $phpbb_root_path . 'common.' . $phpEx ); ! ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! include_once( $mx_mod_path . 'includes/functions_required.' . $phpEx ); ! include_once( $mx_mod_path . 'includes/functions_core.' . $phpEx ); ! ! define( 'PAGE_DOWNLOAD', -501 ); // If this id generates a conflict with other mods, change it ;) ! ! // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_DOWNLOAD ); ! init_userprefs( $userdata ); ! ! // End session management // ! // Instatiate the mx_cache class // ! $mx_cache = new mx_cache(); ! // ! // Get mxBB config settings // ! $portal_config = $mx_cache->obtain_mxbb_config(); ! // ! // instatiate the mx_request_vars class // ! $mx_request_vars = new mx_request_vars(); ! ! $is_block = false; ! } ! else ! { ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! define('IN_PORTAL', true); ! $mx_root_path = '../../'; ! // ! // Let's include some stuff... ! // ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! include_once($mx_root_path . 'common.' . $phpEx); ! // ! // Start session management ! // ! $mx_user->init($user_ip, PAGE_INDEX); ! // ! // End session management ! // ! $block_id = ( !empty($HTTP_GET_VARS['block_id']) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if( empty($block_id) ) { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'Music Center' LIMIT 1"; ! if(!$result = $db->sql_query($sql)) ! { ! message_die(GENERAL_ERROR, "Could not query Music Center module information", "", __LINE__, __FILE__, $sql); ! } ! $row = $db->sql_fetchrow($result); ! $block_id = $row['block_id']; } ! $is_block = FALSE; } ! else ! { ! // ! // Read block Configuration ! // ! $title = $mx_block->block_info['block_title']; ! $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); ! if( is_object($mx_block)) ! { ! $is_block = TRUE; ! } ! global $images, $mx_images; ! } } $music_root_path = $module_root_path . 'music_box/'; *************** *** 105,177 **** if ( $mode == 'music_cat' ) { ! 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' ) { ! include($module_root_path. 'includes/music_comment.'.$phpEx); } else if ( $mode == 'music_comment_delete' ) { ! include($module_root_path. 'includes/music_comment_delete.'.$phpEx); } else if ( $mode == 'music_comment_edit' ) { ! include($module_root_path. 'includes/music_comment_edit.'.$phpEx); } else if ( $mode == 'music_delete' ) { ! include($module_root_path. 'includes/music_delete.'.$phpEx); } else if ( $mode == 'music_download' ) { ! include($module_root_path. 'includes/music_download.'.$phpEx); } else if ( $mode == 'music_edit' ) { ! include($module_root_path. 'includes/music_edit.'.$phpEx); } else if ( $mode == 'music_list' ) { ! include($module_root_path. 'includes/music_list.'.$phpEx); } else if ( $mode == 'music_modcp' ) { ! include($module_root_path. 'includes/music_modcp.'.$phpEx); } else if ( $mode == 'music_page' ) { ! include($module_root_path. 'includes/music_page.'.$phpEx); } else if ( $mode == 'music_rate' ) { ! include($module_root_path. 'includes/music_rate.'.$phpEx); } else if ( $mode == 'music_song' ) { ! include($module_root_path. 'includes/music_song.'.$phpEx); } else if ( $mode == 'music_upload' ) { ! include($module_root_path. 'includes/music_upload.'.$phpEx); } else if ( $mode == 'music_stream' ) { ! include($module_root_path. 'includes/music_stream.'.$phpEx); } else if ( $mode == 'music_rss' ) { ! include($module_root_path. 'includes/music_rss.'.$phpEx); ! } ! else if( !is_object($mx_block)) ! { ! die("Hacking attempt"); } else --- 148,216 ---- if ( $mode == 'music_cat' ) { ! include($module_root_path. 'music_box/modules/music_cat.'.$phpEx); } else if ( $mode == 'music_pic_cat' ) { ! include($module_root_path. 'music_box/modules/music_pic_cat.'.$phpEx); } else if ( $mode == 'music_media_cat' ) { ! include($module_root_path. 'music_box/modules/music_media_cat.'.$phpEx); } else if ( $mode == 'music_comment' ) { ! include($module_root_path. 'music_box/modules/music_comment.'.$phpEx); } else if ( $mode == 'music_comment_delete' ) { ! include($module_root_path. 'music_box/modules/music_comment_delete.'.$phpEx); } else if ( $mode == 'music_comment_edit' ) { ! include($module_root_path. 'music_box/modules/music_comment_edit.'.$phpEx); } else if ( $mode == 'music_delete' ) { ! include($module_root_path. 'music_box/modules/music_delete.'.$phpEx); } else if ( $mode == 'music_download' ) { ! include($module_root_path. 'music_box/modules/music_download.'.$phpEx); } else if ( $mode == 'music_edit' ) { ! include($module_root_path. 'music_box/modules/music_edit.'.$phpEx); } else if ( $mode == 'music_list' ) { ! include($module_root_path. 'music_box/modules/music_list.'.$phpEx); } else if ( $mode == 'music_modcp' ) { ! include($module_root_path. 'music_box/modules/music_modcp.'.$phpEx); } else if ( $mode == 'music_page' ) { ! include($module_root_path. 'music_box/modules/music_page.'.$phpEx); } else if ( $mode == 'music_rate' ) { ! include($module_root_path. 'music_box/modules/music_rate.'.$phpEx); } else if ( $mode == 'music_song' ) { ! include($module_root_path. 'music_box/modules/music_song.'.$phpEx); } else if ( $mode == 'music_upload' ) { ! include($module_root_path. 'music_box/modules/music_upload.'.$phpEx); } else if ( $mode == 'music_stream' ) { ! include($module_root_path. 'music_box/modules/music_stream.'.$phpEx); } else if ( $mode == 'music_rss' ) { ! include($module_root_path. 'music_box/modules/music_rss.'.$phpEx); } else |
|
From: OryNider <ory...@us...> - 2008-01-16 19:50:03
|
Update of /cvsroot/mxbb/mx_music/music_box In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16748/music_box Modified Files: Tag: core28x index.htm music_common.php Removed Files: Tag: core28x music_constants.php music_functions.php music_integration.php Log Message: Index: music_common.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/music_common.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** music_common.php 8 Sep 2007 13:28:29 -0000 1.5 --- music_common.php 16 Jan 2008 19:49:26 -0000 1.5.2.1 *************** *** 26,30 **** } ! include_once($music_root_path . 'music_constants.'.$phpEx); // ********************************************************************** --- 26,30 ---- } ! include_once($music_root_path . 'includes/' . 'music_constants.'.$phpEx); // ********************************************************************** *************** *** 32,61 **** // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_music.' . $phpEx ) ) { ! include_once( $module_root_path . 'language/lang_english/lang_main_music.' . $phpEx ); ! $link_language='lang_english'; ! } else { ! include_once( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_music.' . $phpEx ); ! $link_language='lang_' . $board_config['default_lang']; ! } // ********************************************************************** // Read theme definition and language in theme definition // ********************************************************************** ! ! if ( file_exists( $module_root_path . "templates/" . $theme['template_name'] . '/' . $theme['template_name'] . ".cfg" ) ) { ! // ---------- ! include($module_root_path . "templates/" . $theme['template_name'] . '/' . $theme['template_name'] . ".cfg"); ! // ---------- ! } else { ! // ---------- ! include($module_root_path . "templates/" . "subSilver/" . "subSilver.cfg"); ! // ---------- } --- 32,167 ---- // ********************************************************************** ! if ( !MXBB_MODULE ) { ! if ( !file_exists( $module_root_path . 'music_box/language/lang_' . $board_config['default_lang'] . '/lang_main_music.' . $phpEx ) ) ! { ! include_once( $module_root_path . 'music_box/language/lang_english/lang_main_music.' . $phpEx ); ! $link_language='lang_english'; ! } ! else ! { ! include_once( $module_root_path . 'music_box/language/lang_' . $board_config['default_lang'] . '/lang_main_music.' . $phpEx ); ! $link_language='lang_' . $board_config['default_lang']; ! } ! } else { ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_music.' . $phpEx ) ) ! { ! include_once( $module_root_path . 'language/lang_english/lang_main_music.' . $phpEx ); ! $link_language='lang_english'; ! } ! else ! { ! include_once( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_music.' . $phpEx ); ! $link_language='lang_' . $board_config['default_lang']; ! } ! } // ********************************************************************** // Read theme definition and language in theme definition // ********************************************************************** ! if ( !MXBB_MODULE ) { ! $sql = 'SELECT * ! FROM ' . THEMES_TABLE . ' ! WHERE themes_id = ' . (int) $userdata['user_style']; ! if ( !($result = $db->sql_query($sql)) ) ! { ! message_die(CRITICAL_ERROR, 'Could not query database for theme info'); ! } ! ! if ( $row = $db->sql_fetchrow($result) ) ! { ! $db->sql_freeresult($result); ! $template_name = $row['template_name'] ; ! } ! else ! { ! // We are trying to setup a style which does not exist in the database ! // Try to fallback to the board default (if the user had a custom style) ! // and then any users using this style to the default if it succeeds ! if ( $userdata['user_style'] != $board_config['default_style']) ! { ! $sql = 'SELECT * ! FROM ' . THEMES_TABLE . ' ! WHERE themes_id = ' . (int) $board_config['default_style']; ! if ( !($result = $db->sql_query($sql)) ) ! { ! message_die(CRITICAL_ERROR, 'Could not query database for theme info'); ! } ! ! if ( $row = $db->sql_fetchrow($result) ) ! { ! $db->sql_freeresult($result); ! $template_name = $row['template_name'] ; ! } ! else ! { ! message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]"); ! } ! } ! else ! { ! message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]"); ! } ! } ! ! $template_path = 'templates/' ; ! //$template_name = $row['template_name'] ; ! ! //$template = new Template($phpbb_root_path . $template_path . $template_name); ! ! if ( $template ) ! { ! $current_template_path = $template_path . $template_name; ! } ! else ! { ! $current_template_path = $template_path . 'subSilver'; ! } ! ! // ------------------------------------------------------------------------- ! // Prefix with PORTAL_URL ! // ------------------------------------------------------------------------- ! $current_template_images = $phpbb_root_path . $current_template_path . "/images"; ! ! @include($phpbb_root_path . $template_path . $template_name . '/' . 'music.cfg'); ! ! $img_lang = ( file_exists($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; ! ! while( list($key, $value) = @each($mx_images) ) ! { ! if (is_array($value)) ! { ! foreach( $value as $key2 => $val2 ) ! { ! $images[$key][$key2] = $val2; ! $mx_images[$key][$key2] = $val2; ! } ! } ! else ! { ! $images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! $mx_images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! //$mx_images[$key] = str_replace('admin/templates/','templates/',$mx_images[$key]); ! } ! ! } ! } else { ! if ( file_exists( $module_root_path . "templates/" . $theme['template_name'] . '/' . $theme['template_name'] . ".cfg" ) ) ! { ! // ---------- ! include($module_root_path . "templates/" . $theme['template_name'] . '/' . $theme['template_name'] . ".cfg"); ! // ---------- ! } ! else ! { ! // ---------- ! include($module_root_path . "templates/" . "subSilver/" . "subSilver.cfg"); ! // ---------- ! } } *************** *** 76,81 **** } ! include($music_root_path . 'music_functions.' . $phpEx); ! include($music_root_path . 'music_integration.' . $phpEx); // --- 182,193 ---- } ! include($music_root_path . 'includes/' . 'music_functions.' . $phpEx); ! include($music_root_path . 'includes/' . 'music_integration.' . $phpEx); ! ! if (defined( 'IN_ADMIN' )) ! { ! //include_once( $module_root_path . 'music_box/includes/music_admin.' . $phpEx ); ! //$music_box = new music_admin(); ! } // *************** *** 85,88 **** --- 197,201 ---- $module_name = 'Music Center'; + /* $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_name = '$module_name'"; *************** *** 98,101 **** --- 211,215 ---- $music_module_version = $module['module_version']; } + */ *************** *** 103,107 **** { $music_module_copyright = '<div align="center" class="gensmall" style="font-family: Verdana, Arial, Helvetica, sans-serif; letter-spacing: -1px">'; ! $music_module_copyright .= 'Media Center Powered by: <a href="http://pubory.uv.ro/" target="_blank">OryNider</a>, mxBB <i> - ' . $music_module_name . '</i> ' . $music_module_version . ' © 2007 is modified by <a href="http://www.mx-system.com/">MX-Team</a><br />'; $music_module_copyright .= '[based on © 2003 <a href="http://cfmanager.net.tf" target="_blank">Cf Manager</a> - <i>Music Online</i> v2.' . $music_config['music_version'] . ']'; $music_module_copyright .= '</div>'; --- 217,221 ---- { $music_module_copyright = '<div align="center" class="gensmall" style="font-family: Verdana, Arial, Helvetica, sans-serif; letter-spacing: -1px">'; ! $music_module_copyright .= 'Media Center Powered by: <a href="http://mxbb.net" target="_blank">OryNider</a>, mxBB <i> - ' . $music_module_name . '</i> ' . $music_module_version . ' © 2007 is modified by <a href="http://www.mx-system.com/">MX-Team</a><br />'; $music_module_copyright .= '[based on © 2003 <a href="http://cfmanager.net.tf" target="_blank">Cf Manager</a> - <i>Music Online</i> v2.' . $music_config['music_version'] . ']'; $music_module_copyright .= '</div>'; *************** *** 110,114 **** { $music_module_copyright = '<div align="center" class="gensmall" style="font-family: Verdana, Arial, Helvetica, sans-serif; letter-spacing: -1px">'; ! $music_module_copyright .= 'Media Center Powered by: <a href="http://pubory.uv.ro/" target="_blank">OryNider</a>, mxBB <i> - Music Center</i> v2.0.x © 2007 is modified by <a href="http://www.mx-system.com/">MX-Team</a><br />'; $music_module_copyright .= '[based on © 2003 <a href="http://cfmanager.net.tf" target="_blank">Cf Manager</a> - <i>Music Online</i> v2.' . $music_config['music_version'] . ']'; $music_module_copyright .= '</div>'; --- 224,228 ---- { $music_module_copyright = '<div align="center" class="gensmall" style="font-family: Verdana, Arial, Helvetica, sans-serif; letter-spacing: -1px">'; ! $music_module_copyright .= 'Media Center Powered by: <a href="http://mxbb.net" target="_blank">OryNider</a>, mxBB <i> - Music Center</i> v2.1.x © 2007 is modified by <a href="http://www.mx-system.com/">MX-Team</a><br />'; $music_module_copyright .= '[based on © 2003 <a href="http://cfmanager.net.tf" target="_blank">Cf Manager</a> - <i>Music Online</i> v2.' . $music_config['music_version'] . ']'; $music_module_copyright .= '</div>'; --- music_constants.php DELETED --- --- music_functions.php DELETED --- --- music_integration.php DELETED --- Index: index.htm =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/index.htm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** index.htm 13 Sep 2007 00:19:03 -0000 1.1.2.1 --- index.htm 16 Jan 2008 19:49:26 -0000 1.1.2.2 *************** *** 7,10 **** --- 7,11 ---- <body bgcolor="#FFFFFF" text="#000000"> + </body> </html> |
|
From: OryNider <ory...@us...> - 2008-01-16 19:49:59
|
Update of /cvsroot/mxbb/mx_music/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16748/admin Modified Files: Tag: core28x admin_music_cfg.php Log Message: |
Update of /cvsroot/mxbb/mx_music/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16748/includes Removed Files: Tag: core28x index.htm music_cat.php music_comment.php music_comment_delete.php music_comment_edit.php music_delete.php music_download.php music_edit.php music_list.php music_media_cat.php music_modcp.php music_page.php music_pic_cat.php music_rate.php music_rss.php music_song.php music_stream.php music_upload.php Log Message: --- music_upload.php DELETED --- --- music_delete.php DELETED --- --- music_comment_edit.php DELETED --- --- music_pic_cat.php DELETED --- --- music_cat.php DELETED --- --- music_modcp.php DELETED --- --- music_comment_delete.php DELETED --- --- music_edit.php DELETED --- --- music_stream.php DELETED --- --- music_rss.php DELETED --- --- music_list.php DELETED --- --- music_comment.php DELETED --- --- index.htm DELETED --- --- music_media_cat.php DELETED --- --- music_song.php DELETED --- --- music_download.php DELETED --- --- music_page.php DELETED --- --- music_rate.php DELETED --- |
|
From: OryNider <ory...@us...> - 2008-01-16 04:26:09
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27605 Modified Files: Tag: core28x mx_functions_phpbb.php Log Message: typo fixed Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.32.2.5 retrieving revision 1.32.2.6 diff -C2 -d -r1.32.2.5 -r1.32.2.6 *** mx_functions_phpbb.php 16 Jan 2008 04:03:46 -0000 1.32.2.5 --- mx_functions_phpbb.php 16 Jan 2008 04:26:02 -0000 1.32.2.6 *************** *** 27,31 **** global $mx_page, $board_config, $phpbb_root_path, $phpEx; ! if( !function_exists('smilies_pass') && ((PORTAL_BACKEND == 'phpbb2') ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); --- 27,31 ---- global $mx_page, $board_config, $phpbb_root_path, $phpEx; ! if( !function_exists('smilies_pass') && (PORTAL_BACKEND == 'phpbb2') ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); |
|
From: OryNider <ory...@us...> - 2008-01-16 04:04:09
|
Update of /cvsroot/mxbb/core/install/schemas In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19994 Modified Files: Tag: core28x mysql_schema_install.sql mysql_schema_upgrade_to_2.8.1.sql postgres_schema_install.sql Log Message: sincronization with 2.9.2 Index: postgres_schema_install.sql =================================================================== RCS file: /cvsroot/mxbb/core/install/schemas/postgres_schema_install.sql,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** postgres_schema_install.sql 12 Aug 2007 20:48:22 -0000 1.3.2.1 --- postgres_schema_install.sql 16 Jan 2008 04:04:05 -0000 1.3.2.2 *************** *** 573,577 **** "portal_recached" VARCHAR(255) NOT NULL DEFAULT '', "mod_rewrite" SMALLINT NOT NULL DEFAULT '0', ! "portal_backend" VARCHAR(255) NULL DEFAULT 'phpBB2', "portal_status" SMALLINT NOT NULL DEFAULT '1', "disabled_message" VARCHAR(255) NULL DEFAULT '', --- 573,577 ---- "portal_recached" VARCHAR(255) NOT NULL DEFAULT '', "mod_rewrite" SMALLINT NOT NULL DEFAULT '0', ! "portal_backend" VARCHAR(255) NULL DEFAULT 'phpbb2', "portal_status" SMALLINT NOT NULL DEFAULT '1', "disabled_message" VARCHAR(255) NULL DEFAULT '', Index: mysql_schema_install.sql =================================================================== RCS file: /cvsroot/mxbb/core/install/schemas/mysql_schema_install.sql,v retrieving revision 1.41.2.2 retrieving revision 1.41.2.3 diff -C2 -d -r1.41.2.2 -r1.41.2.3 *** mysql_schema_install.sql 15 Jan 2008 11:55:04 -0000 1.41.2.2 --- mysql_schema_install.sql 16 Jan 2008 04:04:04 -0000 1.41.2.3 *************** *** 580,584 **** `portal_recached` varchar(255) NOT NULL default '', `mod_rewrite` smallint(2) NOT NULL default '0', ! `portal_backend` varchar(255) default 'phpBB2', `portal_status` smallint(2) NOT NULL default '1', `disabled_message` varchar(255) default 'We are currenty upgrading this site with latest mxBB software.', --- 580,584 ---- `portal_recached` varchar(255) NOT NULL default '', `mod_rewrite` smallint(2) NOT NULL default '0', ! `portal_backend` varchar(255) default 'phpbb2', `portal_status` smallint(2) NOT NULL default '1', `disabled_message` varchar(255) default 'We are currenty upgrading this site with latest mxBB software.', Index: mysql_schema_upgrade_to_2.8.1.sql =================================================================== RCS file: /cvsroot/mxbb/core/install/schemas/mysql_schema_upgrade_to_2.8.1.sql,v retrieving revision 1.4.2.4 retrieving revision 1.4.2.5 diff -C2 -d -r1.4.2.4 -r1.4.2.5 *** mysql_schema_upgrade_to_2.8.1.sql 15 Jan 2008 11:55:05 -0000 1.4.2.4 --- mysql_schema_upgrade_to_2.8.1.sql 16 Jan 2008 04:04:04 -0000 1.4.2.5 *************** *** 30,34 **** # New Fields in Table `mx_portal` # ! ALTER TABLE mx_table_portal ADD portal_backend varchar(255) default 'phpBB2' AFTER mod_rewrite; ALTER TABLE mx_table_portal ADD portal_status smallint(2) NOT NULL default '1' AFTER portal_backend; ALTER TABLE mx_table_portal ADD disabled_message varchar(255) default 'We are currenty upgrading this site with latest mxBB software.' AFTER portal_status; --- 30,34 ---- # New Fields in Table `mx_portal` # ! ALTER TABLE mx_table_portal ADD portal_backend varchar(255) default 'phpbb2' AFTER mod_rewrite; ALTER TABLE mx_table_portal ADD portal_status smallint(2) NOT NULL default '1' AFTER portal_backend; ALTER TABLE mx_table_portal ADD disabled_message varchar(255) default 'We are currenty upgrading this site with latest mxBB software.' AFTER portal_status; |
|
From: OryNider <ory...@us...> - 2008-01-16 04:03:52
|
Update of /cvsroot/mxbb/core/includes/db In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19942/db Modified Files: Tag: core28x dbal.php firebird.php mssql.php mssql_odbc.php mysql.php mysql4.php mysqli.php oracle.php postgres.php sqlite.php Log Message: sincronization with 2.9.2 Index: mysqli.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysqli.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mysqli.php 6 Aug 2007 20:07:04 -0000 1.8 --- mysqli.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 35,38 **** --- 35,39 ---- class dbal_mysqli extends dbal { + var $multi_insert = true; /** * Connect to server *************** *** 59,62 **** --- 60,71 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL(i) ' . @mysqli_get_server_info($this->db_connect_id); + } + + /** * sql transaction */ Index: sqlite.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/sqlite.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** sqlite.php 6 Aug 2007 20:07:05 -0000 1.8 --- sqlite.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 55,58 **** --- 55,66 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'SQLite ' . @sqlite_libversion(); + } + + /** * sql transaction */ Index: postgres.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/postgres.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** postgres.php 6 Aug 2007 20:07:05 -0000 1.8 --- postgres.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 35,38 **** --- 35,39 ---- { var $last_query_text = ''; + var $pgsql_version; /** *************** *** 88,91 **** --- 89,100 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'PostgreSQL ' . $this->pgsql_version; + } + + /** * sql transaction */ Index: mysql4.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysql4.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mysql4.php 6 Aug 2007 20:07:04 -0000 1.8 --- mysql4.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 37,40 **** --- 37,42 ---- class dbal_mysql4 extends dbal { + var $mysql_version; + var $multi_insert = true; /** * Connect to server *************** *** 61,64 **** --- 63,74 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL ' . $this->mysql_version; + } + + /** * sql transaction */ Index: firebird.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/firebird.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** firebird.php 6 Aug 2007 20:07:04 -0000 1.8 --- firebird.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 52,55 **** --- 52,72 ---- /** + * Connect to server + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $this->persistency = $persistency; + $this->user = $sqluser; + $this->server = $sqlserver . (($port) ? ':' . $port : ''); + $this->dbname = $database; + + $this->db_connect_id = ($this->persistency) ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3); + + $this->service_handle = (function_exists('ibase_service_attach')) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false; + + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); + } + + /** * sql transaction */ Index: mssql.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mssql.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mssql.php 6 Aug 2007 20:07:04 -0000 1.8 --- mssql.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 59,62 **** --- 59,84 ---- /** + * Version information about used database + */ + function sql_server_info() + { + $result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id); + + $row = false; + if ($result_id) + { + $row = @mssql_fetch_assoc($result_id); + @mssql_free_result($result_id); + } + + if ($row) + { + return 'MSSQL<br />' . implode(' ', $row); + } + + return 'MSSQL'; + } + + /** * sql transaction */ Index: mysql.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysql.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mysql.php 6 Aug 2007 20:07:04 -0000 1.8 --- mysql.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 34,37 **** --- 34,39 ---- class dbal_mysql extends dbal { + var $mysql_version; + var $multi_insert = true; /** * Connect to server *************** *** 59,62 **** --- 61,72 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL ' . $this->mysql_version; + } + + /** * sql transaction */ Index: dbal.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/dbal.php,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** dbal.php 6 Aug 2007 20:07:03 -0000 1.6 --- dbal.php 16 Jan 2008 04:03:46 -0000 1.6.2.1 *************** *** 42,45 **** --- 42,65 ---- /** + * Constructor + */ + function dbal() + { + $this->num_queries = array( + 'cached' => 0, + 'normal' => 0, + 'total' => 0, + ); + + // Fill default sql layer based on the class being called. + // This can be changed by the specified layer itself later if needed. + $this->sql_layer = substr(get_class($this), 5); + + // Do not change this please! This variable is used to easy the use of it - and is hardcoded. + $this->any_char = chr(0) . '%'; + $this->one_char = chr(0) . '_'; + } + + /** * return on error or display error message */ Index: oracle.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/oracle.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** oracle.php 6 Aug 2007 20:07:05 -0000 1.8 --- oracle.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 51,54 **** --- 51,62 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return @ociserverversion($this->db_connect_id); + } + + /** * sql transaction */ Index: mssql_odbc.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mssql_odbc.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mssql_odbc.php 6 Aug 2007 20:07:04 -0000 1.8 --- mssql_odbc.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 53,56 **** --- 53,78 ---- /** + * Version information about used database + */ + function sql_server_info() + { + $result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')"); + + $row = false; + if ($result_id) + { + $row = @odbc_fetch_array($result_id); + @odbc_free_result($result_id); + } + + if ($row) + { + return 'MSSQL (ODBC)<br />' . implode(' ', $row); + } + + return 'MSSQL (ODBC)'; + } + + /** * sql transaction */ |
|
From: OryNider <ory...@us...> - 2008-01-16 04:03:52
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19942 Modified Files: Tag: core28x mx_functions_phpbb.php template.php Log Message: sincronization with 2.9.2 Index: template.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/template.php,v retrieving revision 1.18.2.3 retrieving revision 1.18.2.4 diff -C2 -d -r1.18.2.3 -r1.18.2.4 *** template.php 13 Jan 2008 18:38:41 -0000 1.18.2.3 --- template.php 16 Jan 2008 04:03:46 -0000 1.18.2.4 *************** *** 1013,1016 **** --- 1013,1094 ---- /** + * Load a compiled template if possible, if not, recompile it + * @access private + */ + function _tpl_load(&$handle) + { + global $mx_user, $phpEx, $board_config; + + $recompile = (($board_config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle])) || !file_exists($filename) || @filesize($filename) === 0) ? true : false; + + // Recompile page if the original template is newer, otherwise load the compiled version + if (!$recompile) + { + return $filename; + } + + // Just compile if no user object is present (happens within the installer) + $this->loadfile($handle); + return false; + } + + /** + * Display handle + * @access public + */ + function display($handle, $include_once = true) + { + global $mx_user, $phpbb_hook; + + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once)) + { + if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__))) + { + return $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__)); + } + } + + if (defined('IN_ERROR_HANDLER')) + { + if ((E_NOTICE & error_reporting()) == E_NOTICE) + { + error_reporting(error_reporting() ^ E_NOTICE); + } + } + + //if ($filename = $this->_tpl_load($handle)) + if ($filename) + { + ($include_once) ? include_once($filename) : include($filename); + } + else + { + eval(' ?>' . $this->compiled_code[$handle] . '<?php '); + } + + return true; + } + + /** + * Display the handle and assign the output to a template variable or return the compiled result. + * @access public + */ + function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) + { + ob_start(); + $this->display($handle, $include_once); + $contents = ob_get_clean(); + + if ($return_content) + { + return $contents; + } + + $this->assign_var($template_var, $contents); + + return true; + } + + /** * Precompile file */ Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.32.2.4 retrieving revision 1.32.2.5 diff -C2 -d -r1.32.2.4 -r1.32.2.5 *** mx_functions_phpbb.php 15 Jan 2008 10:51:39 -0000 1.32.2.4 --- mx_functions_phpbb.php 16 Jan 2008 04:03:46 -0000 1.32.2.5 *************** *** 27,31 **** global $mx_page, $board_config, $phpbb_root_path, $phpEx; ! if( !function_exists('smilies_pass') && ((PORTAL_BACKEND == 'phpbb2') || (PORTAL_BACKEND == 'phpBB2')) ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); --- 27,31 ---- global $mx_page, $board_config, $phpbb_root_path, $phpEx; ! if( !function_exists('smilies_pass') && ((PORTAL_BACKEND == 'phpbb2') ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); |
|
From: OryNider <ory...@us...> - 2008-01-16 04:01:00
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18744 Modified Files: mx_functions_phpbb.php mx_functions_style.php template.php Log Message: some sincronization with 2.8.1 Index: template.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/template.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** template.php 14 Sep 2007 03:45:01 -0000 1.19 --- template.php 16 Jan 2008 04:00:49 -0000 1.20 *************** *** 381,384 **** --- 381,399 ---- /** + * Set custom template location (able to use directory outside of phpBB) + * @access public + */ + function set_custom_template($template_path, $template_name) + { + global $board_config, $phpbb_root_path, $mx_root_path; + + $this->root = $template_path; + $this->cachepath = $mx_root_path . 'cache/ctpl_' . $template_name . '_'; + $this->cachedir = $mx_root_path . XS_DIR_CACHE . '/'; + + return true; + } + + /** * Destroys this template object. Should be called when you're done with it, in order * to clear out the template data so you can load/parse a new template set. *************** *** 953,957 **** global $lang, $theme, $board_config; ! if ( !defined( 'IN_PHPBB3' ) ) { $template = $theme['template_name']; --- 968,979 ---- global $lang, $theme, $board_config; ! if ( !defined( 'IN_ADMIN' ) && (PORTAL_BACKEND == 'phpbb3') ) ! { ! global $admin_script; ! $admin_script = ($admin_script) ? $admin_script : $filename; ! ! } ! ! if ( !(PORTAL_BACKEND == 'phpbb3') ) { $template = $theme['template_name']; *************** *** 968,974 **** echo '<!-- template ', $this->files[$handle], ' start -->'; } ! if($filename) { ! include($filename); } else --- 990,1001 ---- echo '<!-- template ', $this->files[$handle], ' start -->'; } ! ! if ($filename) { ! ($include_once) ? include_once($filename) : include($filename); ! } ! elseif ($admin_script) ! { ! ($include_once) ? include_once($admin_script) : include($admin_script); } else *************** *** 976,979 **** --- 1003,1007 ---- eval($code); } + if($board_config['xs_add_comments'] && $handle) { *************** *** 1053,1056 **** --- 1081,1162 ---- /** + * Load a compiled template if possible, if not, recompile it + * @access private + */ + function _tpl_load(&$handle) + { + global $mx_user, $phpEx, $board_config; + + $recompile = (($board_config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle])) || !file_exists($filename) || @filesize($filename) === 0) ? true : false; + + // Recompile page if the original template is newer, otherwise load the compiled version + if (!$recompile) + { + return $filename; + } + + // Just compile if no user object is present (happens within the installer) + $this->loadfile($handle); + return false; + } + + /** + * Display handle + * @access public + */ + function display($handle, $include_once = true) + { + global $mx_user, $phpbb_hook; + + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once)) + { + if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__))) + { + return $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__)); + } + } + + if (defined('IN_ERROR_HANDLER')) + { + if ((E_NOTICE & error_reporting()) == E_NOTICE) + { + error_reporting(error_reporting() ^ E_NOTICE); + } + } + + //if ($filename = $this->_tpl_load($handle)) + if ($filename) + { + ($include_once) ? include_once($filename) : include($filename); + } + else + { + eval(' ?>' . $this->compiled_code[$handle] . '<?php '); + } + + return true; + } + + /** + * Display the handle and assign the output to a template variable or return the compiled result. + * @access public + */ + function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) + { + ob_start(); + $this->display($handle, $include_once); + $contents = ob_get_clean(); + + if ($return_content) + { + return $contents; + } + + $this->assign_var($template_var, $contents); + + return true; + } + + /** * Precompile file */ Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** mx_functions_style.php 15 Jan 2008 10:53:13 -0000 1.32 --- mx_functions_style.php 16 Jan 2008 04:00:48 -0000 1.33 *************** *** 379,382 **** --- 379,389 ---- $filename = $phpbb_root_path . $this->root . '/' . $filename; } + if( file_exists($phpbb_root_path . 'adm/style/' . $filename) ) + { + // + // First check ACP template + // + $filename = $phpbb_root_path . 'adm/style/' . $filename; + } else if( file_exists($this->root . '/' . $filename) ) { *************** *** 638,643 **** } $board_config['default_lang'] = $this->get_old_lang($this->lang['default_lang']); // This will expand the lang name ! if( !file_exists(@phpBB2::phpbb_realpath($mx_root_path . 'includes/shared/phpbb2/language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx)) ) { --- 645,651 ---- } + $board_config['phpbb3_lang'] = $this->lang['default_lang']; $board_config['default_lang'] = $this->get_old_lang($this->lang['default_lang']); // This will expand the lang name ! if( !file_exists(@phpBB2::phpbb_realpath($mx_root_path . 'includes/shared/phpbb2/language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx)) ) { Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** mx_functions_phpbb.php 15 Jan 2008 10:53:13 -0000 1.38 --- mx_functions_phpbb.php 16 Jan 2008 04:00:48 -0000 1.39 *************** *** 155,159 **** } ! if( !function_exists('smilies_pass') && ((PORTAL_BACKEND == 'phpbb2') || (PORTAL_BACKEND == 'phpBB2')) ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); --- 155,159 ---- } ! if( !function_exists('smilies_pass') && (PORTAL_BACKEND == 'phpbb2') ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); |
|
From: OryNider <ory...@us...> - 2008-01-15 22:27:14
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11602 Modified Files: functions.php functions_hook.php functions_module.php Added Files: functions_admin.php Log Message: phpbb3 acp stuff Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions.php 15 Dec 2007 08:18:08 -0000 1.2 --- functions.php 15 Jan 2008 22:27:09 -0000 1.3 *************** *** 17,21 **** // ! // Class phpBB2 - function container // class phpBB3_top --- 17,21 ---- // ! // Class phpBB3 - function container // class phpBB3_top *************** *** 4501,4504 **** --- 4501,4515 ---- /** + * custom version of nl2br which takes custom BBCodes into account + */ + function bbcode_nl2br($text) + { + // custom BBCodes might contain carriage returns so they + // are not converted into <br /> so now revert that + $text = str_replace(array("\n", "\r"), array('<br />', "\n"), $text); + return $text; + } + + /** * Closing the cache object and the database * Cool function name, eh? We might want to add operations to it later *************** *** 4506,4515 **** function garbage_collection() { ! global $cache, $db; // Unload cache, must be done before the DB connection if closed if (!empty($cache)) { ! $cache->unload(); } --- 4517,4526 ---- function garbage_collection() { ! global $mx_cache, $db; // Unload cache, must be done before the DB connection if closed if (!empty($cache)) { ! $mx_cache->unload(); } Index: functions_hook.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_hook.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_hook.php 15 Jan 2008 12:32:27 -0000 1.2 --- functions_hook.php 15 Jan 2008 22:27:09 -0000 1.3 *************** *** 61,65 **** function adm_page_header($page_title) { ! global $config, $db, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; --- 61,65 ---- function adm_page_header($page_title) { ! global $board_config, $db, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; *************** *** 72,76 **** // gzip_compression ! if ($config['gzip_compress']) { if (@extension_loaded('zlib') && !headers_sent()) --- 72,76 ---- // gzip_compression ! if ($board_config['gzip_compress']) { if (@extension_loaded('zlib') && !headers_sent()) *************** *** 94,103 **** 'T_IMAGES_PATH' => "{$phpbb_root_path}images/", ! 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/", ! 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/", ! 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/", ! 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/", ! 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/", ! 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/", 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', --- 94,103 ---- 'T_IMAGES_PATH' => "{$phpbb_root_path}images/", ! 'T_SMILIES_PATH' => "{$phpbb_root_path}{$board_config['smilies_path']}/", ! 'T_AVATAR_PATH' => "{$phpbb_root_path}{$board_config['avatar_path']}/", ! 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$board_config['avatar_gallery_path']}/", ! 'T_ICONS_PATH' => "{$phpbb_root_path}{$board_config['icons_path']}/", ! 'T_RANKS_PATH' => "{$phpbb_root_path}{$board_config['ranks_path']}/", ! 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$board_config['upload_path']}/", 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', *************** *** 134,138 **** function adm_page_footer($copyright_html = true) { ! global $db, $config, $template, $user, $auth, $cache; global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; --- 134,138 ---- function adm_page_footer($copyright_html = true) { ! global $db, $board_config, $template, $user, $auth, $cache; global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; *************** *** 148,152 **** } ! $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) --- 148,152 ---- } ! $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($board_config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) *************** *** 172,182 **** 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, ! 'VERSION' => $config['version']) ); ! $template->pparse('body'); ! //garbage_collection(); ! //exit_handler(); } } --- 172,182 ---- 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, ! 'VERSION' => $board_config['version']) ); ! $template->display('body'); ! phpBB3::garbage_collection(); ! //phpBB3::exit_handler(); } } *************** *** 237,243 **** $sql = "SELECT m1.module_langname AS m1_langname, m2.module_langname AS m2_langname, m2.module_basename AS m2_basename, m2.module_mode AS m2_mode ! FROM " . MODULES_TABLE . " AS m1 RIGHT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 ! WHERE m1.parent_id = '$part' AND m1.module_class = 'acp' ! ORDER BY m1.left_id "; if( !( $rs=$db->sql_query( $sql))) --- 237,243 ---- $sql = "SELECT m1.module_langname AS m1_langname, m2.module_langname AS m2_langname, m2.module_basename AS m2_basename, m2.module_mode AS m2_mode ! FROM " . MODULES_TABLE . " AS m1 RIGHT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 ! WHERE m1.parent_id = '$part' AND m1.module_class = 'acp' ! ORDER BY m1.left_id "; if( !( $rs=$db->sql_query( $sql))) *************** *** 262,266 **** } ! function admin_tabs( $curr_tab) { if ( $this->main_part != 'admin') --- 262,266 ---- } ! function admin_tabs($curr_tab) { if ( $this->main_part != 'admin') *************** *** 273,285 **** $this->current_tab = $curr_tab; ! $sql = "SELECT m1.*, count(m2.module_id) AS subcount ! FROM " . MODULES_TABLE . " AS m1 LEFT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 ! WHERE m1.parent_id =0 AND m1.module_class = 'acp' ! GROUP BY m1.module_id ! HAVING count(m2.module_id) > 0 ! ORDER BY m1.left_id "; - if ( !($rs = $db->sql_query( $sql)) ) { --- 273,295 ---- $this->current_tab = $curr_tab; ! //This sintax is not correct ! /* $sql = "SELECT m1.*, count(m2.module_id) AS subcount ! FROM " . MODULES_TABLE . " AS m1 LEFT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 ! WHERE m1.parent_id = 0 AND m1.module_class = 'acp' ! GROUP BY m1.module_id ! HAVING count(m2.module_id) > 0 ! ORDER BY m1.left_id ! "; ! */ ! $sql = "SELECT m1.*, count(m1.module_id) AS subcount ! FROM " . MODULES_TABLE . " AS m1 ! WHERE m1.parent_id = 0 AND m1.module_class = 'acp' ! AND m1.module_enabled = 1 ! AND m1.module_display = 1 ! GROUP BY m1.module_id ! HAVING count(m1.module_id) > 0 ! ORDER BY m1.left_id "; if ( !($rs = $db->sql_query( $sql)) ) { *************** *** 307,310 **** --- 317,321 ---- { global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $mx_user, $mx_cache, $cache, $template; + global $phpbb_auth, $auth; $phpbb_admin_html = "<h1>In Progress</h1><p>Still not done.</p>"; *************** *** 312,321 **** include_once( $phpbb_root_path . 'includes/acp/acp_' . $acp_panel . '.'. $phpEx); $cache = $mx_cache; ! $user = new user(); ! $auth = new phpbb_auth_base(); ! $user->session_begin(); ! $auth->acl($user->data); ! $user->setup('acp/common'); //$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : 'adm/'; $module_id = $acp_panel; --- 323,335 ---- include_once( $phpbb_root_path . 'includes/acp/acp_' . $acp_panel . '.'. $phpEx); + $cache = $mx_cache; ! $user = $mx_user; ! $auth = $phpbb_auth; ! //$auth = new phpbb_auth_base(); ! //$user->session_begin(); ! //$auth->acl($user->data); ! //$user->setup('acp/common'); ! //$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : 'adm/'; $module_id = $acp_panel; Index: functions_module.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_module.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_module.php 15 Jan 2008 12:39:46 -0000 1.2 --- functions_module.php 15 Jan 2008 22:27:09 -0000 1.3 *************** *** 350,357 **** $this->active_module = false; ! if (request_var('icat', '')) { $icat = $id; ! $id = request_var('icat', ''); } --- 350,357 ---- $this->active_module = false; ! if (phpBB3::request_var('icat', '')) { $icat = $id; ! $id = phpBB3::request_var('icat', ''); } *************** *** 408,412 **** $module_path = $phpbb_root_path . 'includes/' . $this->p_class; ! $icat = request_var('icat', ''); if ($this->active_module === false) --- 408,412 ---- $module_path = $phpbb_root_path . 'includes/' . $this->p_class; ! $icat = phpBB3::request_var('icat', ''); if ($this->active_module === false) *************** *** 422,426 **** } ! include("$module_path/{$this->p_class}_$this->p_name.$phpEx"); if (!class_exists("{$this->p_class}_$this->p_name")) --- 422,440 ---- } ! //include("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! $modulecode = file_get_contents("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! ! $modulecode = str_replace('<?php','',$modulecode); ! $modulecode = str_replace('?>','',$modulecode); ! $modulecode = str_replace('$config', '$board_config', $modulecode); ! $modulecode = str_replace('$cache', '$mx_cache', $modulecode); ! $modulecode = str_replace('$user', '$mx_user', $modulecode); ! $modulecode = str_replace('$auth', '$phpbb_auth', $modulecode); ! $modulecode = str_replace('append_sid(', 'mx3_append_sid(', $modulecode); ! $modulecode = str_replace('get_username_string(', 'mx_get_username_string(', $modulecode); ! ! $mx_user = new mx_user(); ! ! eval($modulecode); if (!class_exists("{$this->p_class}_$this->p_name")) --- NEW FILE: functions_admin.php --- <?php /** * * @package acp * @version $Id: functions_admin.php,v 1.1 2008/01/15 22:27:09 orynider Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ if (!defined('IN_PORTAL')) { exit; } // [...3014 lines suppressed...] { if ($file !== 'permissions_phpbb.' . $phpEx && strpos($file, 'permissions_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) { $files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1)); } } closedir($dh); } } if (!sizeof($files_to_add)) { return false; } $mx_user->add_lang($files_to_add); return true; } ?> |
|
From: OryNider <ory...@us...> - 2008-01-15 22:27:14
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes/acp In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11602/acp Added Files: auth.php Log Message: phpbb3 acp stuff --- NEW FILE: auth.php --- <?php /** * * @package phpBB3 * @version $Id: auth.php,v 1.1 2008/01/15 22:27:09 orynider Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ if (!defined('IN_PORTAL')) { exit; } /** [...1240 lines suppressed...] $hold_ary[0]['a_switchperm'] = ACL_YES; $user_permissions = $this->build_bitstring($hold_ary); if (!$user_permissions) { return false; } $sql = 'UPDATE ' . USERS_TABLE . " SET user_permissions = '" . $db->sql_escape($user_permissions) . "', user_perm_from = $from_user_id WHERE user_id = " . $to_user_id; $db->sql_query($sql); return true; } } ?> |
|
From: OryNider <ory...@us...> - 2008-01-15 22:26:51
|
Update of /cvsroot/mxbb/core/includes/sessions/phpbb3 In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11580 Modified Files: session.php Log Message: phpbb3 acp stuff Index: session.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb3/session.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** session.php 13 Jan 2008 12:09:01 -0000 1.4 --- session.php 15 Jan 2008 22:26:48 -0000 1.5 *************** *** 41,44 **** --- 41,57 ---- var $update_session_page = true; + var $lang = array(); + var $help = array(); + var $theme = array(); + var $date_format; + var $timezone; + var $dst; + + var $lang_name; + var $lang_id = false; + var $lang_path; + var $img_lang; + var $img_array = array(); + /** * Extract current session page *************** *** 1266,1285 **** } - //mxBB - //To do - // We include acp language file here to not load it every time a custom language file is included - /* - if (defined('IN_ADMIN')) - { - if ((include $this->lang_path . "acp/common.$phpEx") === false) - { - //this will fix the path for anonymouse users - if ((include $phpbb_root_path . $this->lang_path . "acp/common.$phpEx") === false) - { - die('Language file ' . $phpbb_root_path . $this->lang_path . "acp/common.$phpEx" . " couldn't be opened."); - } - } - }*/ - $this->add_lang($lang_set); unset($lang_set); --- 1279,1282 ---- *************** *** 1578,1582 **** } } - return; } --- 1575,1578 ---- *************** *** 1627,1633 **** } } ! unset($lang_set); } ! else if ($lang_set) { $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help); --- 1623,1629 ---- } } ! //unset($lang_set); } ! elseif ($lang_set) { $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help); *************** *** 1684,1687 **** --- 1680,1686 ---- { static $midnight; + global $lang; + + $this->lang = $lang; $lang_dates = $this->lang['datetime']; *************** *** 1825,1827 **** --- 1824,2516 ---- } + + + /** + * Base user class + * + * This is the overarching class which contains (through session extend) + * all methods utilised for user functionality during a session. + * + * @package phpBB3 + */ + class user extends session + { + var $lang = array(); + var $help = array(); + var $theme = array(); + var $date_format; + var $timezone; + var $dst; + + var $lang_name; + var $lang_id = false; + var $lang_path; + var $img_lang; + var $img_array = array(); + + // Able to add new option (id 7) + var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10); + var $keyvalues = array(); + + /** + * Setup basic user-specific items (style, language, ...) + */ + function setup($lang_set = false, $style = false) + { + global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; + + if ($this->data['user_id'] != ANONYMOUS) + { + $this->lang_name = (file_exists($phpbb_root_path . 'language/' . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']); + $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; + + $this->date_format = $this->data['user_dateformat']; + $this->timezone = $this->data['user_timezone'] * 3600; + $this->dst = $this->data['user_dst'] * 3600; + } + else + { + $this->lang_name = basename($config['default_lang']); + $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; + $this->date_format = $config['default_dateformat']; + $this->timezone = $config['board_timezone'] * 3600; + $this->dst = $config['board_dst'] * 3600; + + /** + * If a guest user is surfing, we try to guess his/her language first by obtaining the browser language + * If re-enabled we need to make sure only those languages installed are checked + * Commented out so we do not loose the code. + + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + { + $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + + foreach ($accept_lang_ary as $accept_lang) + { + // Set correct format ... guess full xx_YY form + $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2)); + $accept_lang = basename($accept_lang); + + if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx")) + { + $this->lang_name = $config['default_lang'] = $accept_lang; + $this->lang_path = $phpbb_root_path . 'language/' . $accept_lang . '/'; + break; + } + else + { + // No match on xx_YY so try xx + $accept_lang = substr($accept_lang, 0, 2); + $accept_lang = basename($accept_lang); + + if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx")) + { + $this->lang_name = $config['default_lang'] = $accept_lang; + $this->lang_path = $phpbb_root_path . 'language/' . $accept_lang . '/'; + break; + } + } + } + } + */ + } + + // We include common language file here to not load it every time a custom language file is included + $lang = &$this->lang; + + if ((@include $this->lang_path . "common.$phpEx") === false) + { + die('Language file ' . $this->lang_name . "/common.$phpEx" . " couldn't be opened."); + } + + $this->add_lang($lang_set); + unset($lang_set); + + if (!empty($_GET['style']) && $auth->acl_get('a_styles')) + { + global $SID, $_EXTRA_URL; + + $style = request_var('style', 0); + $SID .= '&style=' . $style; + $_EXTRA_URL = array('style=' . $style); + } + else + { + // Set up style + $style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']); + } + + $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name + FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i + WHERE s.style_id = $style + AND t.template_id = s.template_id + AND c.theme_id = s.theme_id + AND i.imageset_id = s.imageset_id"; + $result = $db->sql_query($sql, 3600); + $this->theme = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // User has wrong style + if (!$this->theme && $style == $this->data['user_style']) + { + $style = $this->data['user_style'] = $config['default_style']; + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_style = $style + WHERE user_id = {$this->data['user_id']}"; + $db->sql_query($sql); + + $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name + FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i + WHERE s.style_id = $style + AND t.template_id = s.template_id + AND c.theme_id = s.theme_id + AND i.imageset_id = s.imageset_id"; + $result = $db->sql_query($sql, 3600); + $this->theme = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + if (!$this->theme) + { + trigger_error('Could not get style data', E_USER_ERROR); + } + + // Now parse the cfg file and cache it + $parsed_items = $cache->obtain_cfg_items($this->theme); + + // We are only interested in the theme configuration for now + $parsed_items = $parsed_items['theme']; + + $check_for = array( + 'parse_css_file' => (int) 0, + 'pagination_sep' => (string) ', ' + ); + + foreach ($check_for as $key => $default_value) + { + $this->theme[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value; + settype($this->theme[$key], gettype($default_value)); + + if (is_string($default_value)) + { + $this->theme[$key] = htmlspecialchars($this->theme[$key]); + } + } + + // If the style author specified the theme needs to be cached + // (because of the used paths and variables) than make sure it is the case. + // For example, if the theme uses language-specific images it needs to be stored in db. + if (!$this->theme['theme_storedb'] && $this->theme['parse_css_file']) + { + $this->theme['theme_storedb'] = 1; + + $stylesheet = file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/stylesheet.css"); + // Match CSS imports + $matches = array(); + preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches); + + if (sizeof($matches)) + { + $content = ''; + foreach ($matches[0] as $idx => $match) + { + if ($content = @file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/" . $matches[1][$idx])) + { + $content = trim($content); + } + else + { + $content = ''; + } + $stylesheet = str_replace($match, $content, $stylesheet); + } + unset($content); + } + + $stylesheet = str_replace('./', 'styles/' . $this->theme['theme_path'] . '/theme/', $stylesheet); + + $sql_ary = array( + 'theme_data' => $stylesheet, + 'theme_mtime' => time(), + 'theme_storedb' => 1 + ); + + $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE theme_id = ' . $this->theme['theme_id']; + $db->sql_query($sql); + + unset($sql_ary); + } + + $template->set_template(); + + $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang']; + + $sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width + FROM ' . STYLES_IMAGESET_DATA_TABLE . ' + WHERE imageset_id = ' . $this->theme['imageset_id'] . " + AND image_lang IN ('" . $db->sql_escape($this->img_lang) . "', '')"; + $result = $db->sql_query($sql, 3600); + + $localised_images = false; + while ($row = $db->sql_fetchrow($result)) + { + if ($row['image_lang']) + { + $localised_images = true; + } + + $this->img_array[$row['image_name']] = $row; + } + $db->sql_freeresult($result); + + // there were no localised images, try to refresh the localised imageset for the user's language + if (!$localised_images) + { + // Attention: this code ignores the image definition list from acp_styles and just takes everything + // that the config file contains + $sql_ary = array(); + + $db->sql_transaction('begin'); + + $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . ' + WHERE imageset_id = ' . $this->theme['imageset_id'] . ' + AND image_lang = \'' . $db->sql_escape($this->img_lang) . '\''; + $result = $db->sql_query($sql); + + if (@file_exists("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg")) + { + $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg"); + foreach ($cfg_data_imageset_data as $image_name => $value) + { + if (strpos($value, '*') !== false) + { + if (substr($value, -1, 1) === '*') + { + list($image_filename, $image_height) = explode('*', $value); + $image_width = 0; + } + else + { + list($image_filename, $image_height, $image_width) = explode('*', $value); + } + } + else + { + $image_filename = $value; + $image_height = $image_width = 0; + } + + if (strpos($image_name, 'img_') === 0 && $image_filename) + { + $image_name = substr($image_name, 4); + $sql_ary[] = array( + 'image_name' => (string) $image_name, + 'image_filename' => (string) $image_filename, + 'image_height' => (int) $image_height, + 'image_width' => (int) $image_width, + 'imageset_id' => (int) $this->theme['imageset_id'], + 'image_lang' => (string) $this->img_lang, + ); + } + } + } + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert(STYLES_IMAGESET_DATA_TABLE, $sql_ary); + $db->sql_transaction('commit'); + $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE); + + add_log('admin', 'LOG_IMAGESET_LANG_REFRESHED', $this->theme['imageset_name'], $this->img_lang); + } + else + { + $db->sql_transaction('commit'); + add_log('admin', 'LOG_IMAGESET_LANG_MISSING', $this->theme['imageset_name'], $this->img_lang); + } + } + + // Call phpbb_user_session_handler() in case external application want to "bend" some variables or replace classes... + // After calling it we continue script execution... + phpbb_user_session_handler(); + + // If this function got called from the error handler we are finished here. + if (defined('IN_ERROR_HANDLER')) + { + return; + } + + // Disable board if the install/ directory is still present + // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally + if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install')) + { + // Adjust the message slightly according to the permissions + if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) + { + $message = 'REMOVE_INSTALL'; + } + else + { + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + } + trigger_error($message); + } + + // Is board disabled and user not an admin or moderator? + if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + { + header('HTTP/1.1 503 Service Unavailable'); + + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); + } + + // Is load exceeded? + if ($config['limit_load'] && $this->load !== false) + { + if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN')) + { + // Set board disabled to true to let the admins/mods get the proper notification + $config['board_disable'] = '1'; + + if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + { + header('HTTP/1.1 503 Service Unavailable'); + trigger_error('BOARD_UNAVAILABLE'); + } + } + } + + if (isset($this->data['session_viewonline'])) + { + // Make sure the user is able to hide his session + if (!$this->data['session_viewonline']) + { + // Reset online status if not allowed to hide the session... + if (!$auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 1 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 1; + } + } + else if (!$this->data['user_allow_viewonline']) + { + // the user wants to hide and is allowed to -> cloaking device on. + if ($auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 0 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 0; + } + } + } + + + // Does the user need to change their password? If so, redirect to the + // ucp profile reg_details page ... of course do not redirect if we're already in the ucp + if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && $this->data['is_registered'] && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) + { + if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx") + { + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&mode=reg_details')); + } + } + + return; + } + + /** + * Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion) + * + * @param mixed $lang_set specifies the language entries to include + * @param bool $use_db internal variable for recursion, do not use + * @param bool $use_help internal variable for recursion, do not use + * + * Examples: + * <code> + * $lang_set = array('posting', 'help' => 'faq'); + * $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq')) + * $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq')) + * $lang_set = 'posting' + * $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting')) + * </code> + */ + function add_lang($lang_set, $use_db = false, $use_help = false) + { + global $phpEx; + + if (is_array($lang_set)) + { + foreach ($lang_set as $key => $lang_file) + { + // Please do not delete this line. + // We have to force the type here, else [array] language inclusion will not work + $key = (string) $key; + + if ($key == 'db') + { + $this->add_lang($lang_file, true, $use_help); + } + else if ($key == 'help') + { + $this->add_lang($lang_file, $use_db, true); + } + else if (!is_array($lang_file)) + { + $this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help); + } + else + { + $this->add_lang($lang_file, $use_db, $use_help); + } + } + unset($lang_set); + } + else if ($lang_set) + { + $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help); + } + } + + /** + * Set language entry (called by add_lang) + * @access private + */ + function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false) + { + global $phpEx; + + // Make sure the language path is set (if the user setup did not happen it is not set) + if (!$this->lang_path) + { + global $phpbb_root_path, $config; + + $this->lang_path = $phpbb_root_path . 'language/' . basename($config['default_lang']) . '/'; + } + + // $lang == $this->lang + // $help == $this->help + // - add appropriate variables here, name them as they are used within the language file... + if (!$use_db) + { + if ($use_help && strpos($lang_file, '/') !== false) + { + $language_filename = $this->lang_path . substr($lang_file, 0, stripos($lang_file, '/') + 1) . 'help_' . substr($lang_file, stripos($lang_file, '/') + 1) . '.' . $phpEx; + } + else + { + $language_filename = $this->lang_path . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx; + } + + if ((@include $language_filename) === false) + { + trigger_error('Language file ' . basename($language_filename) . ' couldn\'t be opened.', E_USER_ERROR); + } + } + else if ($use_db) + { + // Get Database Language Strings + // Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed + // For example: help:faq, posting + } + } + + /** + * Format user date + */ + function format_date($gmepoch, $format = false, $forcedate = false) + { + static $midnight; + + $lang_dates = $this->lang['datetime']; + $format = (!$format) ? $this->date_format : $format; + + // Short representation of month in format + if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) + { + $lang_dates['May'] = $lang_dates['May_short']; + } + + unset($lang_dates['May_short']); + + if (!$midnight) + { + list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $this->timezone + $this->dst)); + $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $this->timezone - $this->dst; + } + + if (strpos($format, '|') === false || ($gmepoch < $midnight - 86400 && !$forcedate) || ($gmepoch > $midnight + 172800 && !$forcedate)) + { + return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates); + } + + if ($gmepoch > $midnight + 86400 && !$forcedate) + { + $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); + return str_replace('||', $this->lang['datetime']['TOMORROW'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); + } + else if ($gmepoch > $midnight && !$forcedate) + { + $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); + return str_replace('||', $this->lang['datetime']['TODAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); + } + else if ($gmepoch > $midnight - 86400 && !$forcedate) + { + $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); + return str_replace('||', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); + } + + return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates); + } + + /** + * Get language id currently used by the user + */ + function get_iso_lang_id() + { + global $config, $db; + + if (!empty($this->lang_id)) + { + return $this->lang_id; + } + + if (!$this->lang_name) + { + $this->lang_name = $config['default_lang']; + } + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($this->lang_name) . "'"; + $result = $db->sql_query($sql); + $this->lang_id = (int) $db->sql_fetchfield('lang_id'); + $db->sql_freeresult($result); + + return $this->lang_id; + } + + /** + * Get users profile fields + */ + function get_profile_fields($user_id) + { + global $db; + + if (isset($this->profile_fields)) + { + return; + } + + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_DATA_TABLE . " + WHERE user_id = $user_id"; + $result = $db->sql_query_limit($sql, 1); + $this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row; + $db->sql_freeresult($result); + } + + /** + * Specify/Get image + */ + function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag') + { + static $imgs; + global $phpbb_root_path; + + $img_data = &$imgs[$img]; + + if (empty($img_data)) + { + if (!isset($this->img_array[$img])) + { + // Do not fill the image to let designers decide what to do if the image is empty + $img_data = ''; + return $img_data; + } + + $img_data['src'] = $phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename']; + $img_data['width'] = $this->img_array[$img]['image_width']; + $img_data['height'] = $this->img_array[$img]['image_height']; + } + + $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt; + + switch ($type) + { + case 'src': + return $img_data['src']; + break; + + case 'width': + return ($width === false) ? $img_data['width'] : $width; + break; + + case 'height': + return $img_data['height']; + break; + + default: + $use_width = ($width === false) ? $img_data['width'] : $width; + + return '<img src="' . $img_data['src'] . '"' . (($use_width) ? ' width="' . $use_width . '"' : '') . (($img_data['height']) ? ' height="' . $img_data['height'] . '"' : '') . ' alt="' . $alt . '" title="' . $alt . '" />'; + break; + } + } + + /** + * Get option bit field from user options + */ + function optionget($key, $data = false) + { + if (!isset($this->keyvalues[$key])) + { + $var = ($data) ? $data : $this->data['user_options']; + $this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false; + } + + return $this->keyvalues[$key]; + } + + /** + * Set option bit field for user options + */ + function optionset($key, $value, $data = false) + { + $var = ($data) ? $data : $this->data['user_options']; + + if ($value && !($var & 1 << $this->keyoptions[$key])) + { + $var += 1 << $this->keyoptions[$key]; + } + else if (!$value && ($var & 1 << $this->keyoptions[$key])) + { + $var -= 1 << $this->keyoptions[$key]; + } + else + { + return ($data) ? $var : false; + } + + if (!$data) + { + $this->data['user_options'] = $var; + return true; + } + else + { + return $var; + } + } + } + + ?> \ No newline at end of file |
|
From: OryNider <ory...@us...> - 2008-01-15 22:26:38
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11564 Modified Files: pagestart.php Log Message: phpbb3 acp stuff Index: pagestart.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/pagestart.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** pagestart.php 13 Jan 2008 18:36:28 -0000 1.26 --- pagestart.php 15 Jan 2008 22:26:34 -0000 1.27 *************** *** 27,31 **** mx_page::load_file('functions_post', 'phpbb2'); } ! mx_page::load_file('functions_admin', 'phpbb2'); // --- 27,36 ---- mx_page::load_file('functions_post', 'phpbb2'); } ! mx_page::load_file('functions_admin', !(PORTAL_BACKEND == 'internal') ? PORTAL_BACKEND : 'phpbb2'); ! ! if (PORTAL_BACKEND == 'phpbb3') ! { ! mx_page::load_file('functions_module', 'phpbb3'); ! } // *************** *** 37,41 **** if (PORTAL_BACKEND == 'phpbb3') { ! $mx_user->setup('acp/common', false); //Include phpBB3 AdminCP common language file } --- 42,47 ---- if (PORTAL_BACKEND == 'phpbb3') { ! $phpbb_auth->acl($mx_user->data); ! $mx_user->setup('acp/common', false); //Include phpBB3 AdminCP common language file } |