|
From: Jon O. <jon...@us...> - 2006-08-01 21:03:29
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23242/modules/mx_pafiledb/pafiledb/modules Modified Files: pa_category.php pa_download.php pa_email.php pa_file.php pa_license.php pa_main.php pa_mcp.php pa_post_comment.php pa_quickdl.php pa_rate.php pa_search.php pa_toplist.php pa_user_upload.php pa_viewall.php Log Message: massive update Index: pa_viewall.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_viewall.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pa_viewall.php 5 Jul 2006 22:50:22 -0000 1.16 --- pa_viewall.php 1 Aug 2006 21:03:25 -0000 1.17 *************** *** 103,107 **** )); ! $this->display_files( $sort_method, $sort_order, $start, true ); // =================================================== --- 103,107 ---- )); ! $this->display_items( $sort_method, $sort_order, $start, true ); // =================================================== Index: pa_download.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_download.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pa_download.php 5 Jul 2006 22:50:22 -0000 1.17 --- pa_download.php 1 Aug 2006 21:03:24 -0000 1.18 *************** *** 62,66 **** // Check if the user is authorized to download the file // ========================================================================= ! if ( ( !$this->auth[$file_data['file_catid']]['auth_download'] ) ) { if ( !$userdata['session_logged_in'] ) --- 62,66 ---- // Check if the user is authorized to download the file // ========================================================================= ! if ( ( !$this->auth_user[$file_data['file_catid']]['auth_download'] ) ) { if ( !$userdata['session_logged_in'] ) *************** *** 69,73 **** } ! $message = sprintf( $lang['Sorry_auth_download'], $this->auth[$file_data['file_catid']]['auth_download_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 69,73 ---- } ! $message = sprintf( $lang['Sorry_auth_download'], $this->auth_user[$file_data['file_catid']]['auth_download_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } Index: pa_post_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_post_comment.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pa_post_comment.php 5 Jul 2006 22:50:22 -0000 1.19 --- pa_post_comment.php 1 Aug 2006 21:03:24 -0000 1.20 *************** *** 66,70 **** $db->sql_freeresult( $result ); ! if ( ( !$this->auth[$file_data['file_catid']]['auth_post_comment'] ) ) { if ( !$userdata['session_logged_in'] ) --- 66,70 ---- $db->sql_freeresult( $result ); ! if ( ( !$this->auth_user[$file_data['file_catid']]['auth_post_comment'] ) ) { if ( !$userdata['session_logged_in'] ) *************** *** 73,77 **** } ! $message = sprintf( $lang['Sorry_auth_download'], $this->auth[$file_data['file_catid']]['auth_post_comment_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 73,77 ---- } ! $message = sprintf( $lang['Sorry_auth_download'], $this->auth_user[$file_data['file_catid']]['auth_post_comment_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 135,139 **** // Instantiate the mx_text and mx_text_formatting classes // - include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); $mx_text = new mx_text(); $mx_text->init($html_on, $bbcode_on, $smilies_on); --- 135,138 ---- *************** *** 163,167 **** $file_info = $db->sql_fetchrow( $result ); ! if ( ( $this->auth[$file_info['file_catid']]['auth_delete_comment'] && $file_info['user_id'] == $userdata['user_id'] ) || $this->auth[$file_info['file_catid']]['auth_mod'] ) { if ( $this->comments[$file_data['file_catid']]['internal_comments'] ) --- 162,166 ---- $file_info = $db->sql_fetchrow( $result ); ! if ( ( $this->auth_user[$file_info['file_catid']]['auth_delete_comment'] && $file_info['user_id'] == $userdata['user_id'] ) || $this->auth_user[$file_info['file_catid']]['auth_mod'] ) { if ( $this->comments[$file_data['file_catid']]['internal_comments'] ) *************** *** 189,193 **** else { ! $message = sprintf( $lang['Sorry_auth_delete'], $this->auth[$cat_id]['auth_upload_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 188,192 ---- else { ! $message = sprintf( $lang['Sorry_auth_delete'], $this->auth_user[$cat_id]['auth_upload_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 208,212 **** // Generate smilies listing for page output // ! $pafiledb_functions->pa_generate_smilies( 'inline', PAGE_POSTING ); $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; --- 207,211 ---- // Generate smilies listing for page output // ! $pafiledb_functions->generate_smilies( 'inline', PAGE_POSTING ); $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; Index: pa_user_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_user_upload.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** pa_user_upload.php 5 Jul 2006 22:50:22 -0000 1.20 --- pa_user_upload.php 1 Aug 2006 21:03:25 -0000 1.21 *************** *** 27,114 **** function main( $action ) { ! global $_REQUEST, $_POST, $pafiledb_config, $board_config, $phpbb_root_path; global $pafiledb_template, $db, $lang, $userdata, $user_ip, $phpEx, $pafiledb_functions; ! global $mx_root_path, $module_root_path, $is_block, $phpEx; // ======================================================= ! // Get Vars // ======================================================= ! include( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); ! ! // ********************************************************************** ! // Read language definition ! // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) ! { ! include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); ! } ! else ! { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); ! } ! ! $custom_field = new custom_field(); ! $custom_field->init(); - $cat_id = ( isset( $_REQUEST['cat_id'] ) ) ? intval( $_REQUEST['cat_id'] ) : 0; $do = ( isset( $_REQUEST['do'] ) ) ? intval( $_REQUEST['do'] ) : ''; - $file_id = ( isset( $_REQUEST['file_id'] ) ) ? intval( $_REQUEST['file_id'] ) : 0; $mirrors = ( isset( $_POST['mirrors'] ) ) ? true : 0; ! $dropmenu = ( !$cat_id ) ? $this->generate_jumpbox( 0, 0, '', true, true ) : $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true, true ); ! if ( !empty( $cat_id ) ) { ! if ( !$this->auth[$cat_id]['auth_upload'] ) { ! if ( !$userdata['session_logged_in'] ) ! { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=user_upload&cat_id=" . $cat_id), true)); ! } ! ! $message = sprintf( $lang['Sorry_auth_upload'], $this->auth[$cat_id]['auth_upload_type'] ); ! mx_message_die( GENERAL_MESSAGE, $message ); } } else { if ( empty( $dropmenu ) ) { ! if ( !$userdata['session_logged_in'] ) ! { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=user_upload"), true)); ! } ! ! $message = sprintf( $lang['Sorry_auth_upload'], $this->auth[$cat_id]['auth_upload_type'] ); ! mx_message_die( GENERAL_MESSAGE, $message ); } } ! // ======================================================= ! // MX Addon ! // ======================================================= ! if ( $do == 'delete' ) { $sql = 'SELECT * FROM ' . PA_FILES_TABLE . " ! WHERE file_id = $file_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } - $file_info = $db->sql_fetchrow( $result ); ! if ( ( $this->auth[$file_info['file_catid']]['auth_delete_file'] && $file_info['user_id'] == $userdata['user_id'] ) || $this->auth[$file_info['file_catid']]['auth_mod'] ) { // // Notification // ! $this->update_add_file_notify($file_id, 'delete'); // // Comments // ! if ($this->comments[$file_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) { ! if ( $this->comments[$file_info['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " --- 27,128 ---- function main( $action ) { ! global $pafiledb_config, $board_config, $phpbb_root_path; global $pafiledb_template, $db, $lang, $userdata, $user_ip, $phpEx, $pafiledb_functions; ! global $mx_root_path, $module_root_path, $is_block, $phpEx, $mx_request_vars; // ======================================================= ! // Request vars // ======================================================= ! $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, 0); ! $file_id = $mx_request_vars->request('file_id', MX_TYPE_INT, 0); $do = ( isset( $_REQUEST['do'] ) ) ? intval( $_REQUEST['do'] ) : ''; $mirrors = ( isset( $_POST['mirrors'] ) ) ? true : 0; ! // ! // Main Auth ! // if ( !empty( $cat_id ) ) { ! if ( !$this->auth_user[$cat_id]['auth_upload'] ) { ! $message = sprintf( $lang['Sorry_auth_upload'], $this->auth_user[$cat_id]['auth_upload_type'] ); } } else { + $dropmenu = ( !$cat_id ) ? $this->generate_jumpbox( 0, 0, '', true, true, 'auth_upload' ) : $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true, true, 'auth_upload' ); + if ( empty( $dropmenu ) ) { ! $message = sprintf( $lang['Sorry_auth_upload'], $this->auth_user[$cat_id]['auth_upload_type'] ); } } ! ! // ! // Not authorized? Output nice message and die. ! // ! if (!empty($message)) ! { ! mx_message_die( GENERAL_MESSAGE, $message ); ! } ! ! // ! // Load file info...if file_id is set ! // ! if ( $file_id ) { $sql = 'SELECT * FROM ' . PA_FILES_TABLE . " ! WHERE file_id = '".$file_id."'"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldnt query File data', '', __LINE__, __FILE__, $sql ); } ! $file_data = $db->sql_fetchrow( $result ); ! ! $db->sql_freeresult( $result ); ! } ! ! // ! // Further security. ! // Reset vars if no related data exist. ! // ! if ( $file_id && !$file_data['file_catid'] ) ! { ! $file_id = 0; ! } ! ! if ( $cat_id && !$this->cat_rowset[$cat_id]['cat_id'] ) ! { ! $cat_id = 0; ! } ! ! // ! // Load custom fields ! // ! $custom_field = new custom_field(); ! $custom_field->init(); ! ! // ======================================================= ! // Delete ! // ======================================================= ! if ( $do == 'delete' && $file_id ) ! { ! if ( ( $this->auth_user[$file_data['file_catid']]['auth_delete_file'] && $file_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$file_data['file_catid']]['auth_mod'] ) { // // Notification // ! $this->update_add_item_notify($file_id, 'delete'); // // Comments // ! if ($this->comments[$file_data['file_catid']]['activated'] && $pafiledb_config['del_topic']) { ! if ( $this->comments[$file_data['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " *************** *** 122,177 **** else { ! if ( $file_info['topic_id'] ) { include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); $mx_pa_comments = new pafiledb_comments(); ! $mx_pa_comments->init( $file_info, 'phpbb'); ! $mx_pa_comments->post('delete_all', $file_info['topic_id']); } } } ! $this->delete_files( $file_id ); $this->_pafiledb(); ! $message = $lang['Filedeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "" ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } else { ! $message = sprintf( $lang['Sorry_auth_delete'], $this->auth[$cat_id]['auth_upload_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } } // ======================================================= // IF submit then upload the file and update the sql for it // ======================================================= ! if ( isset( $_POST['submit'] ) ) { if ( !$file_id ) { ! $pa_post_mode = 'add'; ! $file_id = $this->update_add_file(); ! $custom_field->file_update_data( $file_id ); ! ! if ( $this->auth[$cat_id]['auth_approval'] || ( $this->auth[$cat_id]['auth_mod'] && $userdata['session_logged_in'] )) { ! $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); } else { ! $message = $lang['Fileadded_not_validated'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=category&cat_id=" . $cat_id ) ) . '">', '</a>' ); } - - $this->_pafiledb(); } else { ! $pa_post_mode = 'edit'; ! $file_id = $this->update_add_file( $file_id ); ! $custom_field->file_update_data( $file_id ); ! $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); ! $this->_pafiledb(); } --- 136,216 ---- else { ! if ( $file_data['topic_id'] ) { include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); $mx_pa_comments = new pafiledb_comments(); ! $mx_pa_comments->init( $file_data, 'phpbb'); ! $mx_pa_comments->post('delete_all', $file_data['topic_id']); } } } ! $this->delete_items( $file_id ); $this->_pafiledb(); ! $message = $lang['Filedeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=category&cat_id=" . $file_data['file_catid'] ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } else { ! $message = sprintf( $lang['Sorry_auth_delete'], $this->auth_user[$cat_id]['auth_delete_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } } + // ======================================================= // IF submit then upload the file and update the sql for it // ======================================================= ! if ( isset( $_POST['submit'] ) && $cat_id ) { if ( !$file_id ) { ! if ( $this->auth_user[$cat_id]['auth_upload'] || $this->auth_user[$cat_id]['auth_mod'] ) { ! $pa_post_mode = 'add'; ! ! $file_id = $this->update_add_item(); ! $custom_field->file_update_data( $file_id ); ! ! if ( $this->auth_user[$cat_id]['auth_approval'] || $this->auth_user[$cat_id]['auth_mod'] ) ! { ! $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); ! } ! else ! { ! $message = $lang['Fileadded_not_validated'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=category&cat_id=" . $cat_id ) ) . '">', '</a>' ); ! } ! ! $this->_pafiledb(); } else { ! $message = sprintf( $lang['Sorry_auth_upload'], $this->auth_user[$cat_id]['auth_upload_type'] ); } } else { ! if ( ($this->auth_user[$cat_id]['auth_edit_file'] && $file_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$cat_id]['auth_mod'] ) ! { ! $pa_post_mode = 'edit'; ! $file_id = $this->update_add_item( $file_id ); ! $custom_field->file_update_data( $file_id ); ! if ( $this->auth_user[$cat_id]['auth_approval_edit'] || $this->auth_user[$cat_id]['auth_mod'] ) ! { ! $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); ! } ! else ! { ! $message = $lang['Fileedited_not_validated'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=category&cat_id=" . $cat_id ) ) . '">', '</a>' ); ! ! } ! ! $this->_pafiledb(); ! } ! else ! { ! $message = sprintf( $lang['Sorry_auth_edit'], $this->auth_user[$cat_id]['auth_edit_type'] ); ! } } *************** *** 179,183 **** // Notification // ! $this->update_add_file_notify($file_id, $pa_post_mode); // --- 218,222 ---- // Notification // ! $this->update_add_item_notify($file_id, $pa_post_mode); // *************** *** 202,359 **** } else ! // ======================================================= ! // IF not submit then load data form ! // ======================================================= { ! if ( !$file_id ) ! { ! $file_name = ''; ! $file_desc = ''; ! $file_long_desc = ''; ! $file_author = ''; ! $file_version = ''; ! $file_website = ''; ! $file_posticons = $pafiledb_functions->post_icons(); ! $file_cat_list = ( !$cat_id ) ? $this->generate_jumpbox( 0, 0, '', true ) : $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true, true ); ! $file_license = $pafiledb_functions->license_list(); ! $pin_checked_yes = ''; ! $pin_checked_no = ' checked'; ! $file_download = 0; ! $approved_checked_yes = ''; ! $approved_checked_no = ' checked'; ! $file_ssurl = ''; ! $ss_checked_yes = ''; ! $ss_checked_no = ' checked'; ! $file_url = ''; ! $custom_exist = $custom_field->display_edit(); ! $mode = 'ADD'; ! $l_title = $lang['Afiletitle']; ! } ! elseif ( $file_id != '' ) { ! $sql = 'SELECT * ! FROM ' . PA_FILES_TABLE . " ! WHERE file_id = $file_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); ! } ! $file_info = $db->sql_fetchrow( $result ); ! ! // AUTH CHECK ! if ( !( ( $this->auth[$file_info['file_catid']]['auth_edit_file'] && $file_info['user_id'] == $userdata['user_id'] ) || $this->auth[$file_info['file_catid']]['auth_mod'] ) ) ! { ! $message = sprintf( $lang['Sorry_auth_edit'], $this->auth[$cat_id]['auth_upload_type'] ); ! mx_message_die( GENERAL_MESSAGE, $message ); ! } ! ! $file_name = $file_info['file_name']; ! $file_desc = $file_info['file_desc']; ! $file_long_desc = $file_info['file_longdesc']; ! $file_author = $file_info['file_creator']; ! $file_version = $file_info['file_version']; ! $file_website = $file_info['file_docsurl']; ! $file_posticons = $pafiledb_functions->post_icons( $file_info['file_posticon'] ); ! $file_cat_list = $this->generate_jumpbox( 0, 0, array( $file_info['file_catid'] => 1 ), true ); ! $file_license = $pafiledb_functions->license_list( $file_info['file_license'] ); ! $pin_checked_yes = ( $file_info['file_pin'] ) ? ' checked' : ''; ! $pin_checked_no = ( !$file_info['file_pin'] ) ? ' checked' : ''; ! $file_download = intval( $file_info['file_dls'] ); ! $approved_checked_yes = ( $file_info['file_approved'] ) ? ' checked' : ''; ! $approved_checked_no = ( !$file_info['file_approved'] ) ? ' checked' : ''; ! $file_approved = ( $file_info['file_approved'] == '1' ) ? 1 : 0; ! $file_ssurl = $file_info['file_ssurl']; ! $ss_checked_yes = ( $file_info['file_sshot_link'] ) ? ' checked' : ''; ! $ss_checked_no = ( !$file_info['file_sshot_link'] ) ? ' checked' : ''; ! $file_url = $file_info['file_dlurl']; ! $file_unique_name = $file_info['unique_name']; ! $file_dir = $file_info['file_dir']; $custom_exist = $custom_field->display_edit( $file_id ); $mode = 'EDIT'; $l_title = $lang['Efiletitle']; $s_hidden_fields = '<input type="hidden" name="file_id" value="' . $file_id . '">'; } ! $s_hidden_fields .= '<input type="hidden" name="action" value="user_upload">'; ! $pafiledb_template->assign_vars( array( ! 'S_ADD_FILE_ACTION' => append_sid( $this->this_mxurl() ), ! 'DOWNLOAD' => $pafiledb_config['module_name'], ! 'FILESIZE' => intval( $pafiledb_config['max_file_size'] ), ! 'FILE_NAME' => $file_name, ! 'FILE_DESC' => $file_desc, ! 'FILE_LONG_DESC' => $file_long_desc, ! 'FILE_AUTHOR' => $file_author, ! 'FILE_VERSION' => $file_version, ! 'FILE_SSURL' => $file_ssurl, ! 'FILE_WEBSITE' => $file_website, ! 'FILE_DLURL' => $file_url, ! 'FILE_DOWNLOAD' => $file_download, ! 'CUSTOM_EXIST' => $custom_exist, ! 'AUTH_APPROVAL' => false, ! 'APPROVED_CHECKED_YES' => $approved_checked_yes, ! 'APPROVED_CHECKED_NO' => $approved_checked_no, ! 'SS_CHECKED_YES' => $ss_checked_yes, ! 'SS_CHECKED_NO' => $ss_checked_no, ! 'PIN_CHECKED_YES' => $pin_checked_yes, ! 'PIN_CHECKED_NO' => $pin_checked_no, ! 'L_INDEX' => "<<", ! 'L_UPLOAD' => $lang['User_upload'], ! 'L_FILE_TITLE' => $l_title, ! 'L_FILE_APPROVED' => $lang['Approved'], ! 'L_FILE_APPROVED_INFO' => $lang['Approved_info'], ! 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'], ! 'L_SCREENSHOT' => $lang['Scrsht'], ! 'L_FILES' => $lang['Files'], ! 'L_FILE_NAME' => $lang['Filename'], ! 'L_FILE_NAME_INFO' => $lang['Filenameinfo'], ! 'L_FILE_SHORT_DESC' => $lang['Filesd'], ! 'L_FILE_SHORT_DESC_INFO' => $lang['Filesdinfo'], ! 'L_FILE_LONG_DESC' => $lang['Fileld'], ! 'L_FILE_LONG_DESC_INFO' => $lang['Fileldinfo'], ! 'L_FILE_AUTHOR' => $lang['Filecreator'], ! 'L_FILE_AUTHOR_INFO' => $lang['Filecreatorinfo'], ! 'L_FILE_VERSION' => $lang['Fileversion'], ! 'L_FILE_VERSION_INFO' => $lang['Fileversioninfo'], ! 'L_FILESS' => $lang['Filess'], ! 'L_FILESSINFO' => $lang['Filessinfo'], ! 'L_FILESS_UPLOAD' => $lang['Filess_upload'], ! 'L_FILESSINFO_UPLOAD' => $lang['Filessinfo_upload'], ! 'L_FILE_SSLINK' => $lang['Filess_link'], ! 'L_FILE_SSLINK_INFO' => $lang['Filess_link_info'], ! 'L_FILESSUPLOAD' => $lang['Filessupload'], ! 'L_FILE_WEBSITE' => $lang['Filedocs'], ! 'L_FILE_WEBSITE_INFO' => $lang['Filedocsinfo'], ! 'L_FILE_URL' => $lang['Fileurl'], ! 'L_FILE_UPLOAD' => $lang['File_upload'], ! 'L_FILEINFO_UPLOAD' => $lang['Fileinfo_upload'], ! 'L_FILE_URL_INFO' => $lang['Fileurlinfo'], ! 'L_FILE_POSTICONS' => $lang['Filepi'], ! 'L_FILE_POSTICONS_INFO' => $lang['Filepiinfo'], ! 'L_FILE_CAT' => $lang['Filecat'], ! 'L_FILE_CAT_INFO' => $lang['Filecatinfo'], ! 'L_FILE_LICENSE' => $lang['Filelicense'], ! 'L_NONE' => $lang['None'], ! 'L_FILE_LICENSE_INFO' => $lang['Filelicenseinfo'], ! 'L_FILE_PINNED' => $lang['Filepin'], ! 'L_FILE_PINNED_INFO' => $lang['Filepininfo'], ! 'L_FILE_DOWNLOAD' => $lang['Filedls'], ! 'L_NO' => $lang['No'], ! 'L_YES' => $lang['Yes'], ! 'S_POSTICONS' => $file_posticons, ! 'S_LICENSE_LIST' => $file_license, ! 'S_CAT_LIST' => $file_cat_list, ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'MODE' => $mode, ! 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ) ! )); ! $this->display( $lang['Download'], 'pa_file_add.tpl' ); ! } } } ?> \ No newline at end of file --- 241,392 ---- } else ! // ======================================================= ! // IF not submit then load data MAIN form ! // ======================================================= ! { ! if ( !$file_id ) { ! $file_name = ''; ! $file_desc = ''; ! $file_long_desc = ''; ! $file_author = ''; ! $file_version = ''; ! $file_website = ''; ! $file_posticons = $pafiledb_functions->post_icons(); ! $file_cat_list = ( !$cat_id ) ? $this->generate_jumpbox( 0, 0, '', true ) : $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true, true ); ! $file_license = $pafiledb_functions->license_list(); ! $pin_checked_yes = ''; ! $pin_checked_no = ' checked'; ! $file_download = 0; ! $approved_checked_yes = ''; ! $approved_checked_no = ' checked'; ! $file_ssurl = ''; ! $ss_checked_yes = ''; ! $ss_checked_no = ' checked'; ! $file_url = ''; ! $custom_exist = $custom_field->display_edit(); ! $mode = 'ADD'; ! $l_title = $lang['Afiletitle']; ! } ! else ! { ! // ! // AUTH CHECK ! // ! if ( ( $this->auth_user[$file_data['file_catid']]['auth_edit_file'] && $file_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$file_data['file_catid']]['auth_mod'] ) { ! $file_name = $file_data['file_name']; ! $file_desc = $file_data['file_desc']; ! $file_long_desc = $file_data['file_longdesc']; ! $file_author = $file_data['file_creator']; ! $file_version = $file_data['file_version']; ! $file_website = $file_data['file_docsurl']; ! $file_posticons = $pafiledb_functions->post_icons( $file_data['file_posticon'] ); ! $file_cat_list = $this->generate_jumpbox( 0, 0, array( $file_data['file_catid'] => 1 ), true ); ! $file_license = $pafiledb_functions->license_list( $file_data['file_license'] ); ! $pin_checked_yes = ( $file_data['file_pin'] ) ? ' checked' : ''; ! $pin_checked_no = ( !$file_data['file_pin'] ) ? ' checked' : ''; ! $file_download = intval( $file_data['file_dls'] ); ! $approved_checked_yes = ( $file_data['file_approved'] ) ? ' checked' : ''; ! $approved_checked_no = ( !$file_data['file_approved'] ) ? ' checked' : ''; ! $file_approved = ( $file_data['file_approved'] == '1' ) ? 1 : 0; ! $file_ssurl = $file_data['file_ssurl']; ! $ss_checked_yes = ( $file_data['file_sshot_link'] ) ? ' checked' : ''; ! $ss_checked_no = ( !$file_data['file_sshot_link'] ) ? ' checked' : ''; ! $file_url = $file_data['file_dlurl']; ! $file_unique_name = $file_data['unique_name']; ! $file_dir = $file_data['file_dir']; $custom_exist = $custom_field->display_edit( $file_id ); $mode = 'EDIT'; $l_title = $lang['Efiletitle']; + $s_hidden_fields = '<input type="hidden" name="file_id" value="' . $file_id . '">'; } + else + { + $message = sprintf( $lang['Sorry_auth_edit'], $this->auth_user[$cat_id]['auth_edit_type'] ); + mx_message_die( GENERAL_MESSAGE, $message ); + } + } ! $s_hidden_fields .= '<input type="hidden" name="action" value="user_upload">'; ! $pafiledb_template->assign_vars( array( ! 'S_ADD_FILE_ACTION' => append_sid( $this->this_mxurl() ), ! 'DOWNLOAD' => $pafiledb_config['module_name'], ! 'FILESIZE' => intval( $pafiledb_config['max_file_size'] ), ! 'FILE_NAME' => $file_name, ! 'FILE_DESC' => $file_desc, ! 'FILE_LONG_DESC' => $file_long_desc, ! 'FILE_AUTHOR' => $file_author, ! 'FILE_VERSION' => $file_version, ! 'FILE_SSURL' => $file_ssurl, ! 'FILE_WEBSITE' => $file_website, ! 'FILE_DLURL' => $file_url, ! 'FILE_DOWNLOAD' => $file_download, ! 'CUSTOM_EXIST' => $custom_exist, ! 'AUTH_APPROVAL' => false, ! 'APPROVED_CHECKED_YES' => $approved_checked_yes, ! 'APPROVED_CHECKED_NO' => $approved_checked_no, ! 'SS_CHECKED_YES' => $ss_checked_yes, ! 'SS_CHECKED_NO' => $ss_checked_no, ! 'PIN_CHECKED_YES' => $pin_checked_yes, ! 'PIN_CHECKED_NO' => $pin_checked_no, ! 'L_UPLOAD' => $lang['User_upload'], ! 'L_FILE_TITLE' => $l_title, ! 'L_FILE_APPROVED' => $lang['Approved'], ! 'L_FILE_APPROVED_INFO' => $lang['Approved_info'], ! 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'], ! 'L_SCREENSHOT' => $lang['Scrsht'], ! 'L_FILES' => $lang['Files'], ! 'L_FILE_NAME' => $lang['Filename'], ! 'L_FILE_NAME_INFO' => $lang['Filenameinfo'], ! 'L_FILE_SHORT_DESC' => $lang['Filesd'], ! 'L_FILE_SHORT_DESC_INFO' => $lang['Filesdinfo'], ! 'L_FILE_LONG_DESC' => $lang['Fileld'], ! 'L_FILE_LONG_DESC_INFO' => $lang['Fileldinfo'], ! 'L_FILE_AUTHOR' => $lang['Filecreator'], ! 'L_FILE_AUTHOR_INFO' => $lang['Filecreatorinfo'], ! 'L_FILE_VERSION' => $lang['Fileversion'], ! 'L_FILE_VERSION_INFO' => $lang['Fileversioninfo'], ! 'L_FILESS' => $lang['Filess'], ! 'L_FILESSINFO' => $lang['Filessinfo'], ! 'L_FILESS_UPLOAD' => $lang['Filess_upload'], ! 'L_FILESSINFO_UPLOAD' => $lang['Filessinfo_upload'], ! 'L_FILE_SSLINK' => $lang['Filess_link'], ! 'L_FILE_SSLINK_INFO' => $lang['Filess_link_info'], ! 'L_FILESSUPLOAD' => $lang['Filessupload'], ! 'L_FILE_WEBSITE' => $lang['Filedocs'], ! 'L_FILE_WEBSITE_INFO' => $lang['Filedocsinfo'], ! 'L_FILE_URL' => $lang['Fileurl'], ! 'L_FILE_UPLOAD' => $lang['File_upload'], ! 'L_FILEINFO_UPLOAD' => $lang['Fileinfo_upload'], ! 'L_FILE_URL_INFO' => $lang['Fileurlinfo'], ! 'L_FILE_POSTICONS' => $lang['Filepi'], ! 'L_FILE_POSTICONS_INFO' => $lang['Filepiinfo'], ! 'L_FILE_CAT' => $lang['Filecat'], ! 'L_FILE_CAT_INFO' => $lang['Filecatinfo'], ! 'L_FILE_LICENSE' => $lang['Filelicense'], ! 'L_NONE' => $lang['None'], ! 'L_FILE_LICENSE_INFO' => $lang['Filelicenseinfo'], ! 'L_FILE_PINNED' => $lang['Filepin'], ! 'L_FILE_PINNED_INFO' => $lang['Filepininfo'], ! 'L_FILE_DOWNLOAD' => $lang['Filedls'], ! 'L_NO' => $lang['No'], ! 'L_YES' => $lang['Yes'], ! 'S_POSTICONS' => $file_posticons, ! 'S_LICENSE_LIST' => $file_license, ! 'S_CAT_LIST' => $file_cat_list, ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'MODE' => $mode, ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ) ! )); ! $this->display( $lang['Download'], 'pa_file_add.tpl' ); } } + } ?> \ No newline at end of file Index: pa_file.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_file.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** pa_file.php 5 Jul 2006 22:50:22 -0000 1.20 --- pa_file.php 1 Aug 2006 21:03:24 -0000 1.21 *************** *** 44,48 **** // ======================================================= - // file id is not set, give him/her a nice error message // ======================================================= switch ( SQL_LAYER ) --- 44,47 ---- *************** *** 90,94 **** // Pafiledb auth for viewing file // =================================================== ! if ( ( !$this->auth[$file_data['file_catid']]['auth_view_file'] ) ) { /* --- 89,93 ---- // Pafiledb auth for viewing file // =================================================== ! if ( ( !$this->auth_user[$file_data['file_catid']]['auth_view_file'] ) ) { /* *************** *** 98,102 **** } */ ! $message = sprintf( $lang['Sorry_auth_view'], $this->auth[$file_data['file_catid']]['auth_view_file_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 97,101 ---- } */ ! $message = sprintf( $lang['Sorry_auth_view'], $this->auth_user[$file_data['file_catid']]['auth_view_file_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 161,168 **** 'FILE_WEBSITE' => $file_website_url, ! 'AUTH_EDIT' => ( ( $this->auth[$file_data['file_catid']]['auth_edit_file'] && $file_data['user_id'] == $userdata['user_id'] ) || $this->auth[$file_data['file_catid']]['auth_mod'] ) ? true : false, ! 'AUTH_DELETE' => ( ( $this->auth[$file_data['file_catid']]['auth_delete_file'] && $file_data['user_id'] == $userdata['user_id'] ) || $this->auth[$file_data['file_catid']]['auth_mod'] ) ? true : false, ! 'AUTH_DOWNLOAD' => ( $this->auth[$file_data['file_catid']]['auth_download'] ) ? true : false, ! 'AUTH_EMAIL' => ( $this->auth[$file_data['file_catid']]['auth_email'] ) ? true : false, 'DELETE_IMG' => $images['pa_icon_delpost'], --- 160,167 ---- 'FILE_WEBSITE' => $file_website_url, ! 'AUTH_EDIT' => ( ( $this->auth_user[$file_data['file_catid']]['auth_edit_file'] && $file_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$file_data['file_catid']]['auth_mod'] ) ? true : false, ! 'AUTH_DELETE' => ( ( $this->auth_user[$file_data['file_catid']]['auth_delete_file'] && $file_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$file_data['file_catid']]['auth_mod'] ) ? true : false, ! 'AUTH_DOWNLOAD' => ( $this->auth_user[$file_data['file_catid']]['auth_download'] ) ? true : false, ! 'AUTH_EMAIL' => ( $this->auth_user[$file_data['file_catid']]['auth_email'] ) ? true : false, 'DELETE_IMG' => $images['pa_icon_delpost'], *************** *** 183,187 **** )); - include( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); $custom_field = new custom_field(); $custom_field->init(); --- 182,185 ---- *************** *** 193,199 **** if ( $this->ratings[$file_data['file_catid']]['activated'] ) { ! $file_rating = ( $file_data['rating'] != 0 ) ? round( $file_data['rating'], 2 ) . ' / 10' : $lang['Not_rated']; ! if ( $this->auth[$file_data['file_catid']]['auth_rate'] ) { $rate_img = $images['pa_rate']; --- 191,197 ---- if ( $this->ratings[$file_data['file_catid']]['activated'] ) { ! $file_rating = ( $file_data['rating'] != 0 ) ? round( $file_data['rating'], 2 ) . '/10' : $lang['Not_rated']; ! if ( $this->auth_user[$file_data['file_catid']]['auth_rate'] ) { $rate_img = $images['pa_rate']; *************** *** 218,222 **** // Comments // ! if ( $this->comments[$file_data['file_catid']]['activated'] && $this->auth[$file_data['file_catid']]['auth_view_comment']) { $comments_type = $this->comments[$file_data['file_catid']]['internal_comments'] ? 'internal' : 'phpbb'; --- 216,220 ---- // Comments // ! if ( $this->comments[$file_data['file_catid']]['activated'] && $this->auth_user[$file_data['file_catid']]['auth_view_comment']) { $comments_type = $this->comments[$file_data['file_catid']]['internal_comments'] ? 'internal' : 'phpbb'; Index: pa_license.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_license.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pa_license.php 5 Jul 2006 22:50:22 -0000 1.17 --- pa_license.php 1 Aug 2006 21:03:24 -0000 1.18 *************** *** 65,69 **** $db->sql_freeresult( $result ); ! if ( ( !$this->auth[$file_data['file_catid']]['auth_download'] ) ) { if ( !$userdata['session_logged_in'] ) --- 65,69 ---- $db->sql_freeresult( $result ); ! if ( ( !$this->auth_user[$file_data['file_catid']]['auth_download'] ) ) { if ( !$userdata['session_logged_in'] ) *************** *** 72,76 **** } ! $message = sprintf( $lang['Sorry_auth_download'], $this->auth[$file_data['file_catid']]['auth_download_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 72,76 ---- } ! $message = sprintf( $lang['Sorry_auth_download'], $this->auth_user[$file_data['file_catid']]['auth_download_type'] ); mx_message_die( GENERAL_MESSAGE, $message ); } Index: pa_mcp.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_mcp.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pa_mcp.php 5 Jul 2006 22:50:22 -0000 1.14 --- pa_mcp.php 1 Aug 2006 21:03:24 -0000 1.15 *************** *** 27,76 **** function main( $action ) { ! global $pafiledb_template, $lang, $board_config, $phpEx, $pafiledb_config, $db, $images, $debug;; ! global $_REQUEST, $phpbb_root_path, $userdata, $db, $pafiledb_functions; ! global $mx_root_path, $module_root_path, $is_block, $phpEx; ! // ********************************************************************** ! // Read language definition ! // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) ! { ! include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); ! } ! else ! { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); ! } ! $this->init(); ! $file_id = ( isset( $_REQUEST['file_id'] ) ) ? intval( $_REQUEST['file_id'] ) : 0; ! $file_ids = ( isset( $_POST['file_ids'] ) ) ? array_map( 'intval', $_POST['file_ids'] ) : array(); ! $start = ( isset( $_REQUEST['start'] ) ) ? intval( $_REQUEST['start'] ) : 0; ! $mode = ( isset( $_REQUEST['mode'] ) ) ? htmlspecialchars( $_REQUEST['mode'] ) : ''; ! $mode_notification = ( isset( $_REQUEST['mode'] ) ) ? htmlspecialchars( $_REQUEST['mode'] ) : ''; ! $mode_js = ( isset( $_REQUEST['mode_js'] ) ) ? htmlspecialchars( $_REQUEST['mode_js'] ) : ''; ! $mode = ( isset( $_POST['approve'] ) ) ? 'do_approve' : $mode; ! $mode = ( isset( $_POST['unapprove'] ) ) ? 'do_unapprove' : $mode; ! if ( empty( $mode ) ) { ! $mode = $mode_js; ! $cat_id = ( isset( $_REQUEST['cat_js_id'] ) ) ? intval( $_REQUEST['cat_js_id'] ) : intval( $_REQUEST['cat_id'] ); } ! else { ! $cat_id = ( isset( $_REQUEST['cat_id'] ) ) ? intval( $_REQUEST['cat_id'] ) : 0; } ! $mirrors = ( isset( $_POST['mirrors'] ) ) ? true : 0; ! // =================================================== ! // Pafiledb auth for mcp ! // =================================================== ! if ( !($this->auth[$cat_id]['auth_mod'] && $userdata['session_logged_in']) ) { ! $message = sprintf( $lang['Sorry_auth_mcp'], $this->auth[$cat_id]['auth_mod'] ); ! mx_message_die( GENERAL_MESSAGE, $message ); } --- 27,79 ---- function main( $action ) { ! global $db, $lang, $userdata, $board_config, $phpEx, $images, $debug; ! global $mx_root_path, $phpbb_root_path, $module_root_path, $is_block, $phpEx; ! global $pafiledb_functions, $pafiledb_template, $pafiledb_config; ! $cat_id = ( isset( $_REQUEST['cat_id'] ) ) ? intval( $_REQUEST['cat_id'] ) : 0; ! $id = ( isset( $_REQUEST['id'] ) ) ? intval( $_REQUEST['id'] ) : 0; ! $ids = ( isset( $_POST['ids'] ) ) ? array_map( 'intval', $_POST['ids'] ) : array(); ! $start = ( isset( $_REQUEST['start'] ) ) ? intval( $_REQUEST['start'] ) : 0; ! $mode = $mode_notification = ( isset( $_REQUEST['mode_mcp'] ) ) ? htmlspecialchars( $_REQUEST['mode_mcp'] ) : 'all'; ! $do_mode = ( isset( $_REQUEST['do_mode'] ) ) ? htmlspecialchars( $_REQUEST['do_mode'] ) : ''; ! $do_mode = ( isset( $_POST['do_approve'] ) ) ? 'do_approve' : $do_mode; ! $do_mode = ( isset( $_POST['do_unapprove'] ) ) ? 'do_unapprove' : $do_mode; ! $do_mode = ( isset( $_POST['do_delete'] ) ) ? 'do_delete' : $do_mode; ! //echo('mode: '.$mode.'do_mode: '.$do_mode); ! // ! // PafileDB specific ! // ! $mirrors = ( isset( $_POST['mirrors'] ) ) ? true : 0; ! // =================================================== ! // Auth for mcp ! // =================================================== ! if ( !($this->auth_user[$cat_id]['auth_mod']) && $mode == 'cat') { ! $message = sprintf( $lang['Sorry_auth_mcp'], $this->auth_user[$cat_id]['auth_mod'] ); ! mx_message_die( GENERAL_MESSAGE, $message ); } ! ! // ! // Determine all categories in which user is moderator ! // ! $moderator_cat_ids = ''; ! if ( isset( $this->cat_rowset ) ) { ! foreach( $this->cat_rowset as $auth_cat_id => $cat_row ) ! { ! if ($this->auth_user[$auth_cat_id]['auth_mod']) ! { ! $moderator_cat_ids .= !empty($moderator_cat_ids) ? ',' . $auth_cat_id : $auth_cat_id; ! } ! } } ! if (empty($moderator_cat_ids)) { ! mx_message_die( GENERAL_MESSAGE, 'Sorry, you have no moderator permissions...' ); } *************** *** 79,95 **** switch ( $_REQUEST['sort_method'] ) { ! case 'file_name': $sort_method = 'file_name'; break; ! case 'file_time': $sort_method = 'file_time'; break; ! case 'file_dls': $sort_method = 'file_dls'; break; ! case 'file_rating': $sort_method = 'rating'; break; ! case 'file_update_time': $sort_method = 'file_update_time'; break; --- 82,98 ---- switch ( $_REQUEST['sort_method'] ) { ! case 'Alphabetic': $sort_method = 'file_name'; break; ! case 'Latest': $sort_method = 'file_time'; break; ! case 'Downloads': $sort_method = 'file_dls'; break; ! case 'Rating': $sort_method = 'rating'; break; ! case 'Updated': $sort_method = 'file_update_time'; break; *************** *** 122,357 **** } ! $s_file_actions = array( 'approved' => $lang['Approved_files'], ! 'broken' => $lang['Broken_files'], ! 'file_cat' => $lang['File_cat'], ! 'all_file' => $lang['All_files'] ); switch ( $mode ) { case '': ! case 'approved': case 'broken': ! case 'do_approve': ! case 'do_unapprove': ! // case 'delete': ! case 'file_cat': ! case 'all_file': default: ! $template_file = 'pa_mcp.tpl'; $l_title = $lang['MCP_title']; $l_explain = $lang['MCP_title_explain']; - // $s_hidden_fields = '<input type="hidden" name="mode" value="add">'; break; } ! if ( $mode == 'do_approve' || $mode == 'do_unapprove' ) { ! if ( $this->auth[$cat_id]['auth_mod'] || $userdata['user_level'] == ADMIN ) { ! $mode_temp = $mode == 'do_approve' ? 'approved' : 'unapproved'; ! ! if ( is_array( $file_ids ) && !empty( $file_ids ) ) { ! foreach( $file_ids as $temp_file_id ) ! { ! $this->file_approve( $mode, $temp_file_id ); ! } } ! else { ! $this->file_approve( $mode, $file_id ); ! } ! $this->_pafiledb(); } else { ! $message = sprintf( $lang['Sorry_auth_approve'], $this->auth[$cat_id]['auth_mod'] ); ! mx_message_die( GENERAL_MESSAGE, $message ); } } ! $pafiledb_template->set_filenames( array( 'admin' => $template_file ) ); ! $s_hidden_fields = '<input type="hidden" name="cat_id" value="' . $cat_id . '">'; $pafiledb_template->assign_vars( array( ! 'L_INDEX' => "<<", ! 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), ! 'DOWNLOAD' => $pafiledb_config['module_name'], 'L_MCP_TITLE' => $l_title, 'L_MCP_EXPLAIN' => $l_explain, - 'L_ADD_FILE' => $lang['Afiletitle'], 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FILE_ACTION' => append_sid( $this->this_mxurl( "action=mcp" ) ) )); ! if ( in_array( $mode, array( '', 'approved', 'broken', 'do_approve', 'do_unapprove', 'file_cat', 'all_file' ) ) ) { ! $mode = ( in_array( $mode, array( 'do_approve', 'do_unapprove' ) ) ) ? '' : $mode; ! ! if ( $mode != 'approved' && $mode != 'broken' ) { ! // $where_sql = ($mode == 'file_cat') ? "AND file_catid = '$cat_id'" : ''; ! $where_sql = "AND file_catid = '$cat_id'" ; $sql = "SELECT file_name, file_approved, file_id, file_broken FROM " . PA_FILES_TABLE . " as f1 WHERE file_approved = '1' ! $where_sql ORDER BY file_time DESC"; ! if ( $mode == '' || $mode == 'file_cat' || $mode == 'all_file' ) { ! if ( ( !$result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); ! } ! ! $total_files = $db->sql_numrows( $result ); } if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $pafiledb_config['pagination'], $start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { ! $all_file_rowset[] = $row; } } ! if ( $mode == '' || $mode == 'approved' || $mode == 'broken' || $mode == 'file_cat' || $mode == 'all_file' ) { ! if ( $mode == '' ) ! { ! $limit = 5; ! $temp_start = 0; ! } ! else ! { ! $limit = $pafiledb_config['pagination']; ! $temp_start = $start; ! } ! if ( $mode == '' || $mode == 'approved' ) { ! $sql = "SELECT file_name, file_approved, file_id, file_broken ! FROM " . PA_FILES_TABLE . " ! WHERE file_approved = '0' ! AND file_catid = '$cat_id' ! ORDER BY file_time DESC"; ! ! if ( $mode == 'approved' ) ! { ! if ( ( !$result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); ! } ! ! $total_files = $db->sql_numrows( $result ); ! } ! ! if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $limit, $temp_start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } ! ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $approved_file_rowset[] = $row; } } ! if ( $mode == '' || $mode == 'broken' ) { ! $sql = "SELECT file_name, file_approved, file_id, file_broken ! FROM " . PA_FILES_TABLE . " ! WHERE file_broken = '1' ! AND file_catid = '$cat_id' ! ORDER BY file_time DESC"; ! ! if ( $mode == 'broken' ) ! { ! if ( ( !$result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); ! } ! $total_files = $db->sql_numrows( $result ); ! } ! if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $limit, $temp_start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } ! ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $broken_file_rowset[] = $row; } } ! if ( $mode == '' ) ! { ! $global_array = array( ! 0 => array( 'lang_var' => $lang['Approved_files'], ! 'row_set' => $approved_file_rowset, ! 'approval' => 'approve' ), ! 1 => array( 'lang_var' => $lang['Broken_files'], ! 'row_set' => $broken_file_rowset, ! 'approval' => 'both' ), ! 2 => array( 'lang_var' => $lang['All_files'], ! 'row_set' => $all_file_rowset, ! 'approval' => 'unapprove' ) ); ! } ! elseif ( $mode == 'all_file' ) ! { ! $global_array = array( ! 0 => array( 'lang_var' => $lang['Approved_files'], ! 'row_set' => $approved_file_rowset, ! 'approval' => 'approve' ), ! 1 => array( 'lang_var' => $lang['Broken_files'], ! 'row_set' => $broken_file_rowset, ! 'approval' => 'both' ), ! 2 => array( 'lang_var' => $lang['All_files'], ! 'row_set' => $all_file_rowset, ! 'approval' => 'unapprove' ) ); ! } ! elseif ( $mode == 'file_cat' ) ! { ! $global_array = array( 0 => array( 'lang_var' => $lang['All_files'], ! 'row_set' => $all_file_rowset, ! 'approval' => 'unapprove' ) ); ! } ! elseif ( $mode == 'approved' ) ! { ! $global_array = array( 0 => array( 'lang_var' => $lang['Approved_files'], ! 'row_set' => $approved_file_rowset, ! 'approval' => 'approve' ) ); ! } ! elseif ( $mode == 'broken' ) { ! $global_array = array( 0 => array( 'lang_var' => $lang['Broken_files'], ! 'row_set' => $broken_file_rowset, ! 'approval' => 'both' ) ); } } ! $s_file_list = ''; ! foreach( $s_file_actions as $file_mode => $lang_var ) { $s = ''; ! if ( $mode == $file_mode ) { $s = ' selected="selected"'; } ! $s_file_list .= '<option value="' . $file_mode . '"' . $s . '>' . $lang_var . '</option>'; } ! $cat_list = '<select name="cat_js_id">'; if ( !$this->cat_rowset[$cat_id]['cat_parent'] ) { --- 125,474 ---- } ! $s_actions = array( ! 'unapproved' => $lang['Unapproved_items'], ! 'broken' => $lang['Broken_items'], ! 'cat' => $lang['Item_cat'], ! 'all' => $lang['All_items'] ); switch ( $mode ) { case '': ! case 'unapproved': case 'broken': ! case 'cat': ! case 'all': ! default: ! $template_item = 'pa_mcp.tpl'; $l_title = $lang['MCP_title']; $l_explain = $lang['MCP_title_explain']; break; } ! // ! // Approve/Unapprove ! // ! if ( $do_mode == 'do_approve' || $do_mode == 'do_unapprove' ) { ! if ( is_array( $ids ) && !empty( $ids ) ) { ! foreach( $ids as $temp_id ) { ! $this->approve_item( $do_mode, $temp_id ); } ! // ! // Notification ! // ! $this->update_add_item_notify($ids, $do_mode); ! } ! else ! { ! $this->approve_item( $do_mode, $id ); ! // ! // Notification ! // ! $this->update_add_item_notify($id, $do_mode); ! } ! $this->_pafiledb(); ! } ! // ! // Delete ! // ! else if ( $do_mode == 'do_delete' ) ! { ! if ( is_array( $ids ) && !empty( $ids ) ) ! { ! foreach( $ids as $temp_id ) { ! $sql = 'SELECT * ! FROM ' . PA_FILES_TABLE . " ! WHERE file_id = $temp_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get item info', '', __LINE__, __FILE__, $sql ); ! } ! $item_info = $db->sql_fetchrow( $result ); ! // ! // Notification ! // ! $this->update_add_item_notify($temp_id, 'delete'); ! ! // ! // Comments ! // ! if ($this->comments[$item_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) ! { ! if ( $this->comments[$item_info['file_catid']]['internal_comments'] ) ! { ! $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " ! WHERE file_id = '" . $temp_id . "'"; ! ! if ( !( $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldnt delete comments', '', __LINE__, __FILE__, $sql ); ! } ! } ! else ! { ! if ( $item_info['topic_id'] ) ! { ! include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); ! $mx_pa_comments = new pafiledb_comments(); ! $mx_pa_comments->init( $item_info, 'phpbb'); ! $mx_pa_comments->post('delete_all', $item_info['topic_id']); ! } ! } ! } ! ! $this->delete_items( $temp_id ); ! } } else { ! $sql = 'SELECT * ! FROM ' . PA_FILES_TABLE . " ! WHERE file_id = $id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); ! } ! $item_info = $db->sql_fetchrow( $result ); ! ! // ! // Notification ! // ! $this->update_add_item_notify($id, 'delete'); ! ! // ! // Comments ! // ! if ($this->comments[$item_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) ! { ! if ( $this->comments[$item_info['file_catid']]['internal_comments'] ) ! { ! $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " ! WHERE file_id = '" . $id . "'"; ! ! if ( !( $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldnt delete comments', '', __LINE__, __FILE__, $sql ); ! } ! } ! else ! { ! if ( $item_info['topic_id'] ) ! { ! include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); ! $mx_pa_comments = new pafiledb_comments(); ! $mx_pa_comments->init( $item_info, 'phpbb'); ! $mx_pa_comments->post('delete_all', $item_info['topic_id']); ! } ! } ! } ! ! $this->delete_items( $id ); } + + $this->_pafiledb(); } ! $pafiledb_template->set_filenames( array( 'admin' => $template_item ) ); ! if ($mode == 'cat') ! { ! //$s_hidden_fields = '<input type="hidden" name="cat_id" value="' . $cat_id . '">'; ! } $pafiledb_template->assign_vars( array( ! 'DOWNLOAD' => $pafiledb_config['module_name'], // Module specific ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), // Module specific 'L_MCP_TITLE' => $l_title, 'L_MCP_EXPLAIN' => $l_explain, 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_ACTION' => append_sid( $this->this_mxurl( "action=mcp" ) ) )); ! // ! // Lets start displaying... ! // ! if ( in_array( $mode, array( 'unapproved', 'broken', 'cat', 'all' ) ) ) { ! // ! // All items (or all items in cat) ! // ! if ( $mode == 'all' || $mode == 'cat' ) { ! $where_sql = ($mode == 'cat') ? "AND file_catid = '$cat_id'" : ''; $sql = "SELECT file_name, file_approved, file_id, file_broken FROM " . PA_FILES_TABLE . " as f1 WHERE file_approved = '1' ! ".$where_sql." ! AND file_catid IN (".$moderator_cat_ids.") ORDER BY file_time DESC"; ! if ( ( !$result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get item info', '', __LINE__, __FILE__, $sql ); } + $total_num = $db->sql_numrows( $result ); + if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $pafiledb_config['pagination'], $start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get item info', '', __LINE__, __FILE__, $sql ); } + while ( $row = $db->sql_fetchrow( $result ) ) { ! $all_rowset[] = $row; } } ! // ! // Unapproved files only ! // ! if ( $mode == 'unapproved' || $mode == 'all' || $mode == 'cat') { ! $sql = "SELECT file_name, file_approved, file_id, file_broken ! FROM " . PA_FILES_TABLE . " ! WHERE file_approved = '0' ! AND file_catid IN (".$moderator_cat_ids.") ! ORDER BY file_time DESC"; ! if ($mode == 'unapproved') { ! if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $pafiledb_config['pagination'], $start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get item info', '', __LINE__, __FILE__, $sql ); } ! $total_num = $db->sql_numrows( $result ); ! } ! else ! { ! if ( ( !$result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get item info', '', __LINE__, __FILE__, $sql ); } } ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $unapproved_rowset[] = $row; ! } ! } ! // ! // Broken files only ! // ! if ( $mode == 'broken' || $mode == 'all' || $mode == 'cat') ! { ! $sql = "SELECT file_name, file_approved, file_id, file_broken ! FROM " . PA_FILES_TABLE . " ! WHERE file_broken = '1' ! AND file_catid IN (".$moderator_cat_ids.") ! ORDER BY file_time DESC"; ! if ($mode == 'broken') ! { ! if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $pafiledb_config['pagination'], $start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get item info', '', __LINE__, __FILE__, $sql ); } ! $total_num = $db->sql_numrows( $result ); ! } ! else ! { ! if ( ( !$result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get item info', '', __LINE__, __FILE__, $sql ); } } ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $broken_rowset[] = $row; } } ! // ! // Ensure $total_num nonzero to validate pagination ! // ! $total_num = empty($total_num) ? 1 : $total_num; ! ! // ! // Define display sets ! // ! if ( $mode == '' ) ! { ! $global_array = array( ! 0 => array( 'lang_var' => $lang['Unapproved_items'], ! 'row_set' => $unapproved_rowset, ! 'approval' => 'approve' ), ! 1 => array( 'lang_var' => $lang['Broken_items'], ! 'row_set' => $broken_rowset, ! 'approval' => 'both' ), ! 2 => array( 'lang_var' => $lang['Approved_items'], ! 'row_set' => $all_rowset, ! 'approval' => 'unapprove' ) ); ! } ! elseif ( $mode == 'all' ) ! { ! $global_array = array( ! 0 => array( 'lang_var' => $lang['Unapproved_items'], ! 'row_set' => $unapproved_rowset, ! 'approval' => 'approve' ), ! 1 => array( 'lang_var' => $lang['Broken_items'], ! 'row_set' => $broken_rowset, ! 'approval' => 'both' ), ! 2 => array( 'lang_var' => $lang['Approved_items'], ! 'row_set' => $all_rowset, ! 'approval' => 'unapprove' ) ); ! } ! elseif ( $mode == 'cat' ) ! { ! $global_array = array( ! 0 => array( 'lang_var' => $lang['Unapproved_items'], ! 'row_set' => $unapproved_rowset, ! 'approval' => 'approve' ), ! 1 => array( 'lang_var' => $lang['Broken_items'], ! 'row_set' => $broken_rowset, ! 'approval' => 'both' ), ! 2 => array( 'lang_var' => $lang['Approved_items'], ! 'row_set' => $all_rowset, ! 'approval' => 'unapprove' ) ); ! } ! elseif ( $mode == 'unapproved' ) ! { ! $global_array = array( ! 0 => array( 'lang_var' => $lang['Unapproved_items'], ! 'row_set' => $unapproved_rowset, ! 'approval' => 'approve' ) ); ! } ! elseif ( $mode == 'broken' ) ! { ! $global_array = array( ! 0 => array( 'lang_var' => $lang['Broken_items'], ! 'row_set' => $broken_rowset, ! 'approval' => 'both' ) ); ! } ! ! // ! // Generate Select dropdown navigation ! // ! $s_list = ''; ! foreach( $s_actions as $item_mode => $lang_var ) { $s = ''; ! if ( $mode == $item_mode ) { $s = ' selected="selected"'; } ! $s_list .= '<option value="' . $item_mode . '"' . $s . '>' . $lang_var . '</option>'; } ! $cat_list = '<select name="cat_id">'; if ( !$this->cat_rowset[$cat_id]['cat_parent'] ) { *************** *** 362,366 **** $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } ! $cat_list .= $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true ); $cat_list .= '</select>'; --- 479,483 ---- $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } ! $cat_list .= $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true, true, 'auth_mod' ); $cat_list .= '</select>'; *************** *** 371,426 **** 'L_MODE' => $lang['View'], 'L_GO' => $lang['Go'], ! 'L_DELETE_FILE' => $lang['Delete_selected'], 'L_APPROVE' => $lang['Approve'], 'L_UNAPPROVE' => $lang['Unapprove'], ! 'L_APPROVE_FILE' => $lang['Approve_selected'], ! 'L_UNAPPROVE_FILE' => $lang['Unapprove_selected'], ! 'L_NO_FILES' => $lang['No_file'], ! 'PAGINATION' => generate_pagination( append_sid( $this->this_mxur... [truncated message content] |