|
From: Jon O. <jon...@us...> - 2006-08-01 20:52:48
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18719/modules/mx_linkdb/linkdb/admin Modified Files: admin_link_manage.php Log Message: before removing Index: admin_link_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/admin/admin_link_manage.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** admin_link_manage.php 8 Jul 2006 10:22:38 -0000 1.7 --- admin_link_manage.php 1 Aug 2006 20:52:45 -0000 1.8 *************** *** 9,13 **** */ ! if ( !defined( 'IN_PORTAL' ) || IN_ADMIN != true ) { die( "Hacking attempt" ); --- 9,13 ---- */ ! if ( !defined( 'IN_PORTAL' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); *************** *** 18,25 **** function main( $action ) { ! global $module_root_path, $phpbb_root_path, $db, $template, $lang, $phpEx, $linkdb_functions, $linkdb_config; ! include( $module_root_path . 'linkdb/includes/functions_field.' . $phpEx ); $custom_field = new custom_field(); $custom_field->init(); --- 18,32 ---- function main( $action ) { ! global $db, $images, $template, $lang, $phpEx, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; ! global $linkdb_functions, $linkdb_cache, $linkdb_config; ! // ! // Includes ! // ! include_once( $module_root_path . 'linkdb/includes/functions_field.' . $phpEx ); + // + // Init + // $custom_field = new custom_field(); $custom_field->init(); *************** *** 31,34 **** --- 38,42 ---- $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['addfile'] ) ) ? 'add' : $mode; *************** *** 36,39 **** --- 44,48 ---- $mode = ( isset( $_POST['approve'] ) ) ? 'do_approve' : $mode; $mode = ( isset( $_POST['unapprove'] ) ) ? 'do_unapprove' : $mode; + $mode = ( empty( $mode ) ) ? $mode_js : $mode; *************** *** 123,131 **** if ( $mode == 'do_add' && !$link_id ) { ! $link_id = $this->update_add_link(); $custom_field->file_update_data( $link_id ); $this->_linkdb(); $mode = 'edit'; $message = $lang['Linkadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_linkdb.$phpEx?action=link_manage" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); --- 132,145 ---- if ( $mode == 'do_add' && !$link_id ) { ! $link_id = $this->update_add_item(); $custom_field->file_update_data( $link_id ); $this->_linkdb(); $mode = 'edit'; + // + // Notification + // + $this->update_add_item_notify($link_id, 'add'); + $message = $lang['Linkadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_linkdb.$phpEx?action=link_manage" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 133,141 **** elseif ( $mode == 'do_add' && $link_id ) { ! $link_id = $this->update_add_link( $link_id ); $custom_field->file_update_data( $link_id ); $this->_linkdb(); $mode = 'edit'; ! $message = $lang['Linkeedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_linkdb.$phpEx?action=link_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( "index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 147,161 ---- elseif ( $mode == 'do_add' && $link_id ) { ! $link_id = $this->update_add_item( $link_id ); $custom_field->file_update_data( $link_id ); $this->_linkdb(); $mode = 'edit'; ! ! // ! // Notification ! // ! $this->update_add_item_notify($link_id, 'edit'); ! ! $message = $lang['Linkedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_linkdb.$phpEx?action=link_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( "index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 146,155 **** foreach( $file_ids as $temp_file_id ) { ! $this->delete_links( $temp_file_id ); } } else { ! $this->delete_links( $link_id ); } $this->_linkdb(); --- 166,258 ---- foreach( $file_ids as $temp_file_id ) { ! $sql = 'SELECT * ! FROM ' . LINKS_TABLE . " ! WHERE link_id = $temp_file_id"; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get link info', '', __LINE__, __FILE__, $sql ); ! } ! $file_info = $db->sql_fetchrow( $result ); ! ! // ! // Notification ! // ! $this->update_add_item_notify($temp_file_id, 'delete'); ! ! // ! // Comments ! // ! if ($this->comments[$file_info['link_catid']]['activated'] && $linkdb_config['del_topic']) ! { ! if ( $this->comments[$file_info['link_catid']]['internal_comments'] ) ! { ! $sql = 'DELETE FROM ' . LINK_COMMENTS_TABLE . " ! WHERE link_id = '" . $temp_file_id . "'"; ! ! if ( !( $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldnt delete comments', '', __LINE__, __FILE__, $sql ); ! } ! } ! else ! { ! if ( $file_info['topic_id'] ) ! { ! include( $module_root_path . 'linkdb/includes/functions_comment.' . $phpEx ); ! $linkdb_comments = new linkdb_comments(); ! $linkdb_comments->init( $file_info, 'phpbb'); ! $linkdb_comments->post('delete_all', $file_info['topic_id']); ! } ! } ! } ! ! $this->delete_items( $temp_file_id ); } } else { ! $sql = 'SELECT * ! FROM ' . LINKS_TABLE . " ! WHERE link_id = $link_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get link info', '', __LINE__, __FILE__, $sql ); ! } ! $file_info = $db->sql_fetchrow( $result ); ! ! // ! // Notification ! // ! $this->update_add_item_notify($link_id, 'delete'); ! ! // ! // Comments ! // ! if ($this->comments[$file_info['link_catid']]['activated'] && $linkdb_config['del_topic']) ! { ! if ( $this->comments[$file_info['link_catid']]['internal_comments'] ) ! { ! $sql = 'DELETE FROM ' . LINK_COMMENTS_TABLE . " ! WHERE link_id = '" . $link_id . "'"; ! ! if ( !( $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldnt delete comments', '', __LINE__, __FILE__, $sql ); ! } ! } ! else ! { ! if ( $file_info['topic_id'] ) ! { ! include( $module_root_path . 'linkdb/includes/functions_comment.' . $phpEx ); ! $linkdb_comments = new linkdb_comments(); ! $linkdb_comments->init( $file_info, 'phpbb'); ! $linkdb_comments->post('delete_all', $file_info['topic_id']); ! } ! } ! } ! ! $this->delete_items( $link_id ); } $this->_linkdb(); *************** *** 161,170 **** foreach( $file_ids as $temp_file_id ) { ! $this->link_approve( $mode, $temp_file_id ); } } else { ! $this->link_approve( $mode, $link_id ); } $this->_linkdb(); --- 264,281 ---- foreach( $file_ids as $temp_file_id ) { ! $this->approve_item( $mode, $temp_file_id ); } + // + // Notification + // + $this->update_add_item_notify($file_ids, $mode); } else { ! $this->approve_item( $mode, $link_id ); ! // ! // Notification ! // ! $this->update_add_item_notify($link_id, $mode); } $this->_linkdb(); *************** *** 206,210 **** } ! if ( !( $result = $linkdb_functions->sql_query_limit( $sql, $linkdb_config['settings_link_page'], $start ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); --- 317,321 ---- } ! if ( !( $result = $linkdb_functions->sql_query_limit( $sql, $linkdb_config['pagination'], $start ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); *************** *** 225,229 **** else { ! $limit = $linkdb_config['settings_link_page']; $temp_start = $start; } --- 336,340 ---- else { ! $limit = $linkdb_config['pagination']; $temp_start = $start; } *************** *** 355,360 **** 'L_NO_FILES' => $lang['No_link'], ! 'PAGINATION' => generate_pagination( append_sid( "admin_linkdb.$phpEx?action=link_manage&mode=$mode&sort_method=$sort_method&sort_order=$sort_order&cat_id=$cat_id" ), $total_files, $linkdb_config['settings_link_page'], $start ), ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $linkdb_config['settings_link_page'] ) + 1 ), ceil( $total_files / $linkdb_config['settings_link_page'] ) ), 'S_CAT_LIST' => $cat_list, --- 466,471 ---- 'L_NO_FILES' => $lang['No_link'], ! 'PAGINATION' => generate_pagination( append_sid( "admin_linkdb.$phpEx?action=link_manage&mode=$mode&sort_method=$sort_method&sort_order=$sort_order&cat_id=$cat_id" ), $total_files, $linkdb_config['pagination'], $start ), ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $linkdb_config['pagination'] ) + 1 ), ceil( $total_files / $linkdb_config['pagination'] ) ), 'S_CAT_LIST' => $cat_list, *************** *** 369,376 **** { $approve = $unapprove = true; ! }elseif ( $files_data['approval'] == 'approve' ) { $approve = true; ! }elseif ( $files_data['approval'] == 'unapprove' ) { $unapprove = true; --- 480,489 ---- { $approve = $unapprove = true; ! } ! elseif ( $files_data['approval'] == 'approve' ) { $approve = true; ! } ! elseif ( $files_data['approval'] == 'unapprove' ) { $unapprove = true; *************** *** 414,418 **** } } ! }elseif ( $mode == 'add' || $mode == 'edit' || $mirrors ) { if ( $mode == 'add' ) --- 527,532 ---- } } ! } ! elseif ( $mode == 'add' || $mode == 'edit' || $mirrors ) { if ( $mode == 'add' ) |