|
From: Jon O. <jon...@us...> - 2006-08-04 16:30:35
|
Update of /cvsroot/mxbb/mx_kb/kb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25418/modules/mx_kb/kb/modules Modified Files: kb_article.php kb_post.php kb_rate.php Log Message: finetuning of - notifications - approval Index: kb_rate.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_rate.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kb_rate.php 5 Jul 2006 22:48:26 -0000 1.7 --- kb_rate.php 4 Aug 2006 16:30:30 -0000 1.8 *************** *** 97,101 **** $result_msg = str_replace( "{newrating}", $rate_info, $result_msg ); ! $message = $result_msg . '<br /><br />' . sprintf( $lang['Click_return'], "<a href=\"" . append_sid( $this->this_mxurl( "action=link&link_id=$article_id" ) ) . "\">", "</a>" ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 97,101 ---- $result_msg = str_replace( "{newrating}", $rate_info, $result_msg ); ! $message = $result_msg . '<br /><br />' . sprintf( $lang['Click_return'], "<a href=\"" . append_sid( $this->this_mxurl( "mode=article&k=$article_id" ) ) . "\">", "</a>" ); mx_message_die( GENERAL_MESSAGE, $message ); } Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_article.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** kb_article.php 1 Aug 2006 21:00:38 -0000 1.11 --- kb_article.php 4 Aug 2006 16:30:30 -0000 1.12 *************** *** 219,222 **** --- 219,237 ---- // + // Delete buttons + // + if ( ( $userdata['user_id'] == $author_id && $this->auth_user[$article_category_id]['auth_delete'] ) || $this->auth_user[$article_category_id]['auth_mod'] ) + { + $temp_url = append_sid( $this->this_mxurl( "mode=edit&do=delete&k=" . $article_id ) ); + $delete_img = '<a href="javascript:delete_item(\'' . $temp_url . '\')"><img src="' . $images['kb_icon_delpost'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>'; + $delete = '<a href="javascript:delete_item(\'' . $temp_url . '\')">' . $lang['Edit_delete_post'] . '</a>'; + } + else + { + $delete_img = ''; + $delete = ''; + } + + // // If this is an allowed article, go ahead and display it // *************** *** 274,279 **** --- 289,297 ---- 'ARTICLE_DATE' => $date, 'ARTICLE_TYPE' => $article_type, + 'EDIT_IMG' => $edit_img, + 'DELETE_IMG' => $delete_img, 'EDIT' => $edit, + 'DELETE' => $delete, 'VIEWS' => $views Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_post.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** kb_post.php 1 Aug 2006 21:00:38 -0000 1.9 --- kb_post.php 4 Aug 2006 16:30:30 -0000 1.10 *************** *** 30,33 **** --- 30,34 ---- global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $theme; global $html_entities_match, $html_entities_replace, $unhtml_specialchars_match, $unhtml_specialchars_replace; + global $HTTP_SERVER_VARS; // *************** *** 80,83 **** --- 81,85 ---- $article_data = $db->sql_fetchrow( $result ); + $cat_id = $article_data['article_category_id']; $db->sql_freeresult( $result ); *************** *** 88,92 **** // Reset vars if no related data exist. // ! if ( $article_id && !$article_data['article_category_id'] ) { $article_id = 0; --- 90,94 ---- // Reset vars if no related data exist. // ! if ( $article_id && !$cat_id ) { $article_id = 0; *************** *** 103,107 **** if ( $do == 'delete' && $article_id) { ! if ( ( $this->auth_user[$article_data['article_category_id']]['auth_delete'] && $article_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$article_data['article_category_id']]['auth_mod'] ) { // --- 105,109 ---- if ( $do == 'delete' && $article_id) { ! if ( ( $this->auth_user[$cat_id]['auth_delete'] && $article_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$cat_id]['auth_mod'] ) { // *************** *** 113,119 **** // Comments // ! if ($this->comments[$article_data['article_category_id']]['activated'] && $kb_config['del_topic']) { ! if ( $this->comments[$article_data['article_category_id']]['internal_comments'] ) { $sql = 'DELETE FROM ' . KB_COMMENTS_TABLE . " --- 115,121 ---- // Comments // ! if ($this->comments[$cat_id]['activated'] && $kb_config['del_topic']) { ! if ( $this->comments[$cat_id]['internal_comments'] ) { $sql = 'DELETE FROM ' . KB_COMMENTS_TABLE . " *************** *** 139,143 **** $this->delete_items( $article_id ); $this->_kb(); ! $message = $lang['Articledeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "mode=cat&cat=" . $article_data['article_category_id'] ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 141,145 ---- $this->delete_items( $article_id ); $this->_kb(); ! $message = $lang['Article_Deleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "mode=cat&cat=" . $cat_id ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 283,287 **** // Approve // ! $approve = $this->auth_user[$cat_id]['auth_mod'] || $this->auth_user[$cat_id]['auth_approval_edit'] ? 1 : 0; // approved $sql = "UPDATE " . KB_ARTICLES_TABLE . " --- 285,289 ---- // Approve // ! $approve = $this->auth_user[$cat_id]['auth_approval_edit'] || $this->auth_user[$cat_id]['auth_mod'] ? 1 : 0; // approved $sql = "UPDATE " . KB_ARTICLES_TABLE . " *************** *** 291,295 **** article_body = '" . str_replace( "\'", "''", $article_text ) . "', article_type = '" . $type_id . "', - article_date = '" . $date . "', approved = '" . $approve . "', bbcode_uid = '" . $bbcode_uid . "' --- 293,296 ---- *************** *** 356,360 **** if ( !$article_id ) { ! if ( !$this->auth_user[$article_data['article_category_id']]['auth_post'] ) { mx_message_die( GENERAL_MESSAGE, $lang['Sorry_auth_post'] ); --- 357,361 ---- if ( !$article_id ) { ! if ( !$this->auth_user[$cat_id]['auth_post'] ) { mx_message_die( GENERAL_MESSAGE, $lang['Sorry_auth_post'] ); *************** *** 363,368 **** else { ! $cat_id = $article_data['article_category_id']; ! if ( !( ( $this->auth_user[$article_data['article_category_id']]['auth_edit'] && $article_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$article_data['article_category_id']]['auth_mod'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Sorry_auth_edit'] ); --- 364,368 ---- else { ! if ( !( ( $this->auth_user[$cat_id]['auth_edit'] && $article_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$cat_id]['auth_mod'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Sorry_auth_edit'] ); *************** *** 411,415 **** 'ARTICLE_DESC' => $preview_desc, 'ARTICLE_BODY' => $preview_text, ! 'PREVIEW_MESSAGE' => $preview_text ) ); --- 411,415 ---- 'ARTICLE_DESC' => $preview_desc, 'ARTICLE_BODY' => $preview_text, ! 'PRE_COMMENT' => $preview_text ) ); |