|
From: Jon O. <jon...@us...> - 2006-06-17 20:11:28
|
Update of /cvsroot/mxbb/mx_kb/kb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21631/modules/mx_kb/kb/modules Modified Files: kb_article.php kb_cat.php kb_moderator.php kb_post.php kb_post_comment.php Log Message: Finalizing this module Index: kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_cat.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_cat.php 7 Jun 2006 20:28:54 -0000 1.3 --- kb_cat.php 17 Jun 2006 20:11:24 -0000 1.4 *************** *** 78,82 **** // Validate Comments Setup // ! if ( $this->comments[$category_id]['activated'] && !$this->comments[$category_id]['internal_comments'] && $this->cat_rowset[$category_id]['comments_forum_id'] < 1 ) { // --- 78,82 ---- // Validate Comments Setup // ! if ( $this->comments[$category_id]['activated'] && !$this->comments[$category_id]['internal_comments'] && $this->comments[$category_id]['comments_forum_id'] < 1 ) { // Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_article.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_article.php 7 Jun 2006 20:28:54 -0000 1.4 --- kb_article.php 17 Jun 2006 20:11:24 -0000 1.5 *************** *** 538,544 **** } ! // =================================================== // assign var for top navigation ! // =================================================== $this->generate_navigation( $article_category_id ); --- 538,544 ---- } ! // // assign var for top navigation ! // $this->generate_navigation( $article_category_id ); Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_post.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_post.php 7 Jun 2006 20:28:54 -0000 1.4 --- kb_post.php 17 Jun 2006 20:11:24 -0000 1.5 *************** *** 29,33 **** global $template, $mx_kb_functions, $lang, $board_config, $phpEx, $kb_config, $db, $images, $userdata, $_POST; global $html_entities_match, $html_entities_replace, $unhtml_specialchars_match, $unhtml_specialchars_replace; ! global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars; global $HTTP_POST_VARS; --- 29,33 ---- global $template, $mx_kb_functions, $lang, $board_config, $phpEx, $kb_config, $db, $images, $userdata, $_POST; global $html_entities_match, $html_entities_replace, $unhtml_specialchars_match, $unhtml_specialchars_replace; ! global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $theme; global $HTTP_POST_VARS; *************** *** 85,89 **** $html_entities_replace = array( ); ! $template->assign_block_vars( "tinyMCE", array() ); } else --- 85,94 ---- $html_entities_replace = array( ); ! $langcode = mx_get_langcode(); ! $template->assign_block_vars( "tinyMCE", array( ! 'PATH' => $mx_root_path, ! 'LANG' => !empty($langcode) ? $langcode : $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'], ! 'TEMPLATE' => $phpbb_root_path . 'templates/'. $theme['template_name'] . '/' . $theme['head_stylesheet'] ! )); } else *************** *** 111,116 **** } ! $article_title = ( !empty( $_POST['article_name'] ) ) ? htmlspecialchars( trim ( $_POST['article_name'] ) ) : ''; ! $article_description = ( !empty( $_POST['article_desc'] ) ) ? htmlspecialchars( trim ( $_POST['article_desc'] ) ) : ''; $bbcode_uid = $mx_request_vars->request('bbcode_uid', MX_TYPE_NO_TAGS, ''); --- 116,121 ---- } ! $article_title = ( !empty( $_POST['article_name'] ) ) ? addslashes( htmlspecialchars( trim ( $_POST['article_name'] ) ) ) : ''; ! $article_description = ( !empty( $_POST['article_desc'] ) ) ? addslashes( htmlspecialchars( trim ( $_POST['article_desc'] ) ) ) : ''; $bbcode_uid = $mx_request_vars->request('bbcode_uid', MX_TYPE_NO_TAGS, ''); *************** *** 266,290 **** // Notification // ! if ( $this->notification[$category_id]['activated'] > 0 ) // -1, 0, 1, 2 ! { ! // ! // Instatiate notification ! // ! $mx_kb_notification = new mx_kb_notification(); ! $mx_kb_notification->init( $article_id ); ! ! // ! // Now send notification ! // ! $mx_notification_mode = $this->notification[$category_id]['activated'] == 1 ? MX_PM_MODE : MX_MAIL_MODE; ! $mx_notification_action = $kb_post_mode == 'add' ? MX_NEW_NOTIFICATION : MX_EDITED_NOTIFICATION; ! ! $mx_kb_notification->notify( $mx_notification_mode, $mx_notification_action ); ! ! if ( $this->notification[$category_id]['notify_group'] > 0 ) ! { ! $mx_kb_notification->notify( $mx_notification_mode, $mx_notification_action, - intval($this->notification[$category_id]['notify_group']) ); ! } ! } // --- 271,275 ---- // Notification // ! $this->update_add_article_notify($article_id, $kb_post_mode); // *************** *** 296,313 **** // Autogenerate comment (duplicate the notification message) // ! if (!is_object($mx_kb_notification)) ! { ! // ! // Instatiate notification ! // ! $mx_kb_notification = new mx_kb_notification(); ! $mx_kb_notification->init( $article_id ); ! $mx_kb_notification->_compose_auto_note(); ! } // // Generate comment // ! $this->update_add_comment('', $article_id, 0, $mx_kb_notification->subject, $mx_kb_notification->message); } --- 281,292 ---- // Autogenerate comment (duplicate the notification message) // ! $mx_kb_notification = new mx_kb_notification(); ! $mx_kb_notification->init( $article_id ); ! $mx_kb_notification->_compose_auto_note($kb_post_mode == 'add' ? MX_NEW_NOTIFICATION : MX_EDITED_NOTIFICATION); // // Generate comment // ! $this->update_add_comment('', $article_id, 0, addslashes(trim($mx_kb_notification->subject)), addslashes(trim($mx_kb_notification->message)) ); } *************** *** 615,618 **** --- 594,602 ---- } + if ( $bbcode_on ) + { + $template->assign_block_vars( 'switch_bbcodes', array()); + } + // =================================================== // assign var for top navigation Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_moderator.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_moderator.php 7 Jun 2006 20:28:54 -0000 1.3 --- kb_moderator.php 17 Jun 2006 20:11:24 -0000 1.4 *************** *** 113,116 **** --- 113,121 ---- $this->_kb(); + // + // Notification + // + $this->update_add_article_notify($article_id, 'approve'); + $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start" ) ) . '">', '</a>' ) ; *************** *** 130,133 **** --- 135,143 ---- $this->_kb(); + // + // Notification + // + $this->update_add_article_notify($article_id, 'unapprove'); + $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start") ) . '">', '</a>' ) ; *************** *** 149,160 **** $article_info = $db->sql_fetchrow( $result ); ! if ( $this->comments[$article_info['article_category_id']]['activated'] && !$this->comments[$article_info['article_category_id']]['internal_comments'] && $kb_config['del_topic'] && $article_info['topic_id'] ) { ! include( $module_root_path . 'kb/includes/functions_comment.' . $phpEx ); ! $mx_kb_comments = new mx_kb_comments(); ! $mx_kb_comments->init( $article_info, 'phpbb' ); ! $mx_kb_comments->post('delete', $article_info['topic_id']); } $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; --- 159,193 ---- $article_info = $db->sql_fetchrow( $result ); ! // ! // Comments ! // ! if ( $this->comments[$article_info['article_category_id']]['activated'] && $kb_config['del_topic']) { ! if ( $this->comments[$article_info['article_category_id']]['internal_comments'] ) ! { ! $sql = "DELETE FROM " . KB_COMMENTS_TABLE . " WHERE article_id = " . $article_id; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not delete article comments data", '', __LINE__, __FILE__, $sql ); ! } ! } ! else ! { ! if ( $article_info['topic_id'] ) ! { ! include( $module_root_path . 'kb/includes/functions_comment.' . $phpEx ); ! $mx_kb_comments = new mx_kb_comments(); ! $mx_kb_comments->init( $article_info, 'phpbb' ); ! $mx_kb_comments->post('delete_all', $article_info['topic_id']); ! } ! } } + // + // Notification + // + $this->update_add_article_notify($article_id, 'delete'); + $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; *************** *** 167,171 **** $this->_kb(); ! $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start") ) . '">', '</a>' ) ; } --- 200,204 ---- $this->_kb(); ! $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start") ) . '">', '</a>' ) ; } *************** *** 181,224 **** } - // - // Notification - // - if ( $this->notification[$category_id]['activated'] > 0 ) // -1, 0, 1, 2 - { - // - // Instatiate notification - // - $mx_kb_notification = new mx_kb_notification(); - $mx_kb_notification->init( $article_id ); - - // - // Now send notification - // - $mx_notification_mode = $this->notification[$category_id]['activated'] == 1 ? MX_PM_MODE : MX_MAIL_MODE; - - switch ( $action ) - { - case 'approve': - $mx_notification_action = MX_APPROVED_NOTIFICATION; - break; - case 'unapprove': - $mx_notification_action = MX_UNAPPROVED_NOTIFICATION; - break; - case 'delete': - $mx_notification_action = MX_DELETED_NOTIFICATION; - break; - } - - $html_entities_match = array( ); - $html_entities_replace = array( ); - - $mx_kb_notification->notify( $mx_notification_mode, $mx_notification_action ); - - if ( $this->notification[$category_id]['notify_group'] > 0 ) - { - $mx_kb_notification->notify( $mx_notification_mode, $mx_notification_action, - intval($this->notification[$category_id]['notify_group']) ); - } - } - mx_message_die( GENERAL_MESSAGE, $message ); --- 214,217 ---- Index: kb_post_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_post_comment.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_post_comment.php 7 Jun 2006 20:28:54 -0000 1.3 --- kb_post_comment.php 17 Jun 2006 20:11:24 -0000 1.4 *************** *** 9,14 **** --- 9,28 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + + /** + * Enter description here... + * + */ class mx_kb_post_comment extends mx_kb_public { + /** + * Enter description here... + * + * @param unknown_type $action + */ function main( $action ) { *************** *** 335,339 **** if (!$kb_config['allow_comment_images'] || !$kb_config['allow_comment_links']) { ! $article = $mx_kb_text_tools->remove_images_links( $article, $kb_config['allow_comment_images'], $kb_config['no_comment_image_message'], $kb_config['allow_comment_links'], $kb_config['no_comment_link_message'] ); } --- 349,353 ---- if (!$kb_config['allow_comment_images'] || !$kb_config['allow_comment_links']) { ! $comments_text = $mx_kb_text_tools->remove_images_links( $comments_text, $kb_config['allow_comment_images'], $kb_config['no_comment_image_message'], $kb_config['allow_comment_links'], $kb_config['no_comment_link_message'] ); } |