|
From: Jon O. <jon...@us...> - 2006-06-25 21:55:16
|
Update of /cvsroot/mxbb/mx_kb/kb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26394/modules/mx_kb/kb/modules Modified Files: kb_article.php kb_post.php kb_post_comment.php Log Message: Implementing a new mx_post class, to handle all kind of html, bbcode, smilies, links, images etc Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_article.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kb_article.php 17 Jun 2006 20:11:24 -0000 1.5 --- kb_article.php 25 Jun 2006 21:55:12 -0000 1.6 *************** *** 38,63 **** $page_num = $mx_request_vars->request('page_num', MX_TYPE_INT, 1) - 1; if ( empty( $article_id ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Article_not_exsist'] ); } - - // - // Instatiate text tools - // - $mx_kb_text_tools = new mx_kb_text_tools(); - $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; - if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } - - // =================================================== - // article doesn't exist' - // =================================================== if ( !$kb_row = $db->sql_fetchrow( $result ) ) { --- 38,55 ---- $page_num = $mx_request_vars->request('page_num', MX_TYPE_INT, 1) - 1; + // =================================================== + // article doesn't exist' + // =================================================== if ( empty( $article_id ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Article_not_exsist'] ); } $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } if ( !$kb_row = $db->sql_fetchrow( $result ) ) { *************** *** 92,193 **** $date = create_date( $board_config['default_dateformat'], $kb_row['article_date'], $board_config['board_timezone'] ); ! // ! // wysiwyg ! // ! if ( $kb_config['allow_wysiwyg'] && file_exists( $mx_root_path . $kb_config['wysiwyg_path'] . 'tinymce/jscripts/tiny_mce/blank.htm' )) ! { ! $wysiwygMode = true; ! $bbcode_on = false; ! $html_on = true; ! $smilies_on = false; ! $html_entities_match = array( ); ! $html_entities_replace = array( ); ! } ! else ! { ! $wysiwygMode = false; ! $bbcode_on = $kb_config['allow_bbcode'] ? true : false; ! $html_on = $kb_config['allow_html'] ? true : false; ! $smilies_on = $kb_config['allow_smilies'] ? true : false; ! $board_config['allow_html_tags'] = $kb_config['allowed_html_tags']; ! } // ! // Define censored word matches // ! $orig_word = array(); ! $replacement_word = array(); ! obtain_word_list($orig_word, $replacement_word); // ! // Get vars // ! $temp_url = append_sid( this_kb_mxurl( "mode=cat&cat=$article_category_id" ) ); ! $category = '<a href="' . $temp_url . '" class="gensmall">' . $article_category_name . '</a>'; ! if ( $author_id == -1 ) ! { ! $author_kb_art = ( $kb_row['username'] == '' ) ? $lang['Guest'] : $kb_row['username']; ! } ! else ! { ! $author_name = $this->get_kb_author( $author_id ); ! $temp_url = append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$author_id" ); ! $author_kb_art = '<a href="' . $temp_url . '" class="gensmall">' . $author_name . '</a>'; ! } - $art_pages = explode( '[page]', stripslashes( $kb_row['article_body'] ) ); - $article = trim( $art_pages[$page_num] ); - $article = str_replace( '[toc]', '', $article ); $article = $this->article_formatting( $article ); - $type_id = $kb_row['article_type']; - $type = $this->get_kb_type( $type_id ); - $new_views = $kb_row['views'] + 1; - $views = '<b>' . $lang['Views'] . '</b> ' . $new_views; - - if ( $page_num == 0 ) - { - $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET - views = '" . $new_views . "' - WHERE article_id = " . $article_id; - } - if ( !( $result2 = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not update article's views", '', __LINE__, __FILE__, $sql ); - } - // ! // Was a highlight request part of the URI? // ! $original_highlight = ''; ! $highlight_match = $highlight = ''; ! if (isset($HTTP_GET_VARS['highlight'])) ! { ! // ! // Split words and phrases ! // ! $original_highlight = '&highlight='.trim(htmlspecialchars($HTTP_GET_VARS['highlight'])); ! $words = explode(' ', trim(htmlspecialchars($HTTP_GET_VARS['highlight']))); ! ! for($i = 0; $i < sizeof($words); $i++) ! { ! if (trim($words[$i]) != '') ! { ! $highlight_match .= (($highlight_match != '') ? '|' : '') . str_replace('*', '\w*', phpbb_preg_quote($words[$i], '#')); ! } ! } ! unset($words); ! ! $highlight = urlencode($HTTP_GET_VARS['highlight']); ! $highlight_match = phpbb_rtrim($highlight_match, "\\"); ! } ! ! if ( !$html_on ) ! { ! $article = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $article ); ! } // --- 84,128 ---- $date = create_date( $board_config['default_dateformat'], $kb_row['article_date'], $board_config['board_timezone'] ); ! $type_id = $kb_row['article_type']; ! $type = $this->get_kb_type( $type_id ); ! $new_views = $kb_row['views'] + 1; ! $board_config['allow_html_tags'] = $kb_config['allowed_html_tags']; ! $art_pages = explode( '[page]', stripslashes( $kb_row['article_body'] ) ); ! $article = trim( $art_pages[$page_num] ); ! $article = str_replace( '[toc]', '', $article ); ! $bbcode_uid = $kb_row['bbcode_uid']; // ! // Toggles // ! $bbcode_on = !$kb_config['allow_wysiwyg'] ? ($kb_config['allow_bbcode'] ? true : false) : false; ! $html_on = !$kb_config['allow_wysiwyg'] ? ($kb_config['allow_html'] ? true : false) : true; ! $smilies_on = !$kb_config['allow_wysiwyg'] ? ($kb_config['allow_smilies'] ? true : false) : false; ! ! $this->page_title = $article_title; // ! // Instantiate the mx_text class // ! include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); ! $mx_text = new mx_text(); ! $mx_text->init($html_on, $bbcode_on, $smilies_on); // Note: allowed_html_tags is altered above ! $mx_text->allow_all_html_tags = $kb_config['allow_wysiwyg'] ? true : false; ! // ! // Decode article for display ! // ! $article_title = $mx_text->display_simple($article_title); ! $article_description = $mx_text->display_simple($article_description); ! $article = $mx_text->display($article, $bbcode_uid); $article = $this->article_formatting( $article ); // ! // Instatiate text tools // ! $mx_kb_text_tools = new mx_kb_text_tools(); // *************** *** 200,287 **** // ! // Parse message // ! $bbcode_uid = $kb_row['bbcode_uid']; ! if ( $bbcode_on ) { ! if ( $bbcode_uid != '' ) ! { ! $article = ( $bbcode_on ) ? bbencode_second_pass( $article, $bbcode_uid ) : preg_replace( '/\:[0-9a-z\:]+\]/si', ']', $article ); ! } } - $article = make_clickable( $article ); ! // ! // Parse smilies ! // ! if ( $smilies_on ) { ! $article = mx_smilies_pass( $article ); } ! // ! // Highlight active words (primarily for search) ! // ! if ($highlight_match) { ! // ! // This was shamelessly 'borrowed' from volker at multiartstudio dot de ! // via php.net's annotated manual ! // ! $article = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $article . '<'), 1, -1)); } ! // ! // Replace naughty words ! // ! if ( count( $orig_word ) ) { ! $article_title = preg_replace( $orig_word, $replacement_word, $article_title ); ! $article_description = preg_replace( $orig_word, $replacement_word, $article_description ); ! ! $article = str_replace( '\"', '"', substr( preg_replace( '#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $article . '<' ), 1, -1 ) ); } // ! // Replace newlines (we use this rather than nl2br because ! // till recently it wasn't XHTML compliant) // ! $article = str_replace( "\n", "\n<br />\n", $article ); ! // ! // Highlight active words (primarily for search) ! // ! if ( $highlight_match ) { ! // ! // This was shamelessly 'borrowed' from volker at multiartstudio dot de ! // via php.net's annotated manual ! // ! $article = str_replace( '\"', '"', substr( preg_replace( '#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $article . '<' ), 1, -1 ) ); } ! ! $this->page_title = $article_title; ! ! // ! // Text formatting ! // ! if ( $kb_config['max_subject_chars'] > 0 ) { ! $article_title = $mx_kb_text_tools->truncate_text( $article_title, $kb_config['max_subject_chars'], true ); } ! if ( $kb_config['max_description_chars'] > 0 ) ! { ! $article_description = $mx_kb_text_tools->truncate_text( $article_description, $kb_config['max_description_chars'], true ); ! } ! if ( $kb_config['max_chars'] > 0 ) { ! $article = $mx_kb_text_tools->truncate_text( $article, $kb_config['max_chars'], true ); } ! ! if ( $kb_config['formatting_truncate_links'] || $kb_config['formatting_image_resize'] > 0 || $kb_config['formatting_wordwrap'] ) { ! $article = $mx_kb_text_tools->decode( $article, $kb_config['formatting_truncate_links'], intval($kb_config['formatting_image_resize']), $kb_config['formatting_wordwrap'] ); } --- 135,188 ---- // ! // Text formatting // ! if ( $kb_config['max_subject_chars'] > 0 ) { ! $article_title = $mx_kb_text_tools->truncate_text( $article_title, $kb_config['max_subject_chars'], true ); } ! if ( $kb_config['max_description_chars'] > 0 ) { ! $article_description = $mx_kb_text_tools->truncate_text( $article_description, $kb_config['max_description_chars'], true ); } ! if ( $kb_config['max_chars'] > 0 ) { ! $article = $mx_kb_text_tools->truncate_text( $article, $kb_config['max_chars'], true ); } ! if ( $kb_config['formatting_truncate_links'] || $kb_config['formatting_image_resize'] > 0 || $kb_config['formatting_wordwrap'] ) { ! $article = $mx_kb_text_tools->decode( $article, $kb_config['formatting_truncate_links'], intval($kb_config['formatting_image_resize']), $kb_config['formatting_wordwrap'] ); } // ! // Format text and data // ! $temp_url = append_sid( this_kb_mxurl( "mode=cat&cat=$article_category_id" ) ); ! $category = '<a href="' . $temp_url . '" class="gensmall">' . $article_category_name . '</a>'; ! if ( $author_id == -1 ) { ! $author_kb_art = ( $kb_row['username'] == '' ) ? $lang['Guest'] : $kb_row['username']; } ! else { ! $author_name = $this->get_kb_author( $author_id ); ! $temp_url = append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$author_id" ); ! $author_kb_art = '<a href="' . $temp_url . '" class="gensmall">' . $author_name . '</a>'; } ! $views = '<b>' . $lang['Views'] . '</b> ' . $new_views; ! if ( $page_num == 0 ) { ! $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET ! views = '" . $new_views . "' ! WHERE article_id = " . $article_id; } ! if ( !( $result2 = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update article's views", '', __LINE__, __FILE__, $sql ); } Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_post.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kb_post.php 17 Jun 2006 20:11:24 -0000 1.5 --- kb_post.php 25 Jun 2006 21:55:12 -0000 1.6 *************** *** 33,48 **** // - // Includes - // - include_once( $phpbb_root_path . 'includes/bbcode.'.$phpEx); - include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); - - // // Request vars // $article_id = $mx_request_vars->request('k', MX_TYPE_INT, ''); ! $kb_post_mode = empty( $article_id ) ? 'add' : 'edit'; $this->page_title = $kb_post_mode == 'add' ? $lang['Add_article'] : $lang['Edit_article']; if ( $mx_request_vars->is_request('cat') ) { --- 33,47 ---- // // Request vars // $article_id = $mx_request_vars->request('k', MX_TYPE_INT, ''); ! $kb_post_mode = empty( $article_id ) ? 'add' : 'edit'; //Main mode toggle $this->page_title = $kb_post_mode == 'add' ? $lang['Add_article'] : $lang['Edit_article']; + $delete = $mx_request_vars->request('delete', MX_TYPE_NO_TAGS, ''); + $submit = $mx_request_vars->is_request('article_submit'); + $preview = $mx_request_vars->is_request('preview'); + $cancel = $mx_request_vars->is_request('cancel'); + if ( $mx_request_vars->is_request('cat') ) { *************** *** 59,66 **** } ! $delete = $mx_request_vars->request('delete', MX_TYPE_NO_TAGS, ''); ! $submit = $mx_request_vars->is_request('article_submit'); ! $preview = $mx_request_vars->is_request('preview'); ! $cancel = $mx_request_vars->is_request('cancel'); // --- 58,86 ---- } ! // ! // First (re)declare basic variables ! // ! $kb_row = array(); ! if ( $kb_post_mode == 'edit' ) ! { ! $sql = "SELECT * ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = '" . $article_id . "'"; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); ! } ! ! $kb_row = $db->sql_fetchrow( $result ); ! } ! ! $kb_title = $preview || isset($HTTP_POST_VARS['article_name']) ? $HTTP_POST_VARS['article_name'] : $kb_row['article_title']; ! $kb_desc = $preview || isset($HTTP_POST_VARS['article_desc']) ? $HTTP_POST_VARS['article_desc'] : $kb_row['article_description']; ! $kb_text = $preview || isset($HTTP_POST_VARS['message']) ? $HTTP_POST_VARS['message'] : $kb_row['article_body']; ! $bbcode_uid = $preview ? '' : $kb_row['bbcode_uid']; ! ! $username = $preview || isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : $kb_row['username']; ! $type_id = $preview || isset($HTTP_POST_VARS['type_id']) ? intval($HTTP_POST_VARS['type_id']) : $kb_row['article_type']; // *************** *** 76,79 **** --- 96,100 ---- if ( $kb_config['allow_wysiwyg'] && file_exists( $mx_root_path . $kb_config['wysiwyg_path'] . 'tinymce/jscripts/tiny_mce/blank.htm' )) { + $allow_wysiwyg = true; $bbcode_on = false; $html_on = true; *************** *** 82,88 **** $images_on = false; - $html_entities_match = array( ); - $html_entities_replace = array( ); - $langcode = mx_get_langcode(); $template->assign_block_vars( "tinyMCE", array( --- 103,106 ---- *************** *** 94,97 **** --- 112,116 ---- else { + $allow_wysiwyg = false; $bbcode_on = $kb_config['allow_bbcode'] ? true : false; $html_on = $kb_config['allow_html'] ? true : false; *************** *** 106,109 **** --- 125,141 ---- // + // Instantiate the mx_text class + // + include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); + $mx_text = new mx_text(); + $mx_text->init($html_on, $bbcode_on, $smilies_on); + + // + // Allow all html tags + // Fix: Setting 'emtpy' enables all + // + $mx_text->allow_all_html_tags = $allow_wysiwyg; + + // // post article ----------------------------------------------------------------------------ADD/EDIT // *************** *** 116,180 **** } - $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, ''); - if ( empty( $bbcode_uid ) ) - { - $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; - } - - $article_text = str_replace( '<br />', "\n", $_POST['message'] ); - $article_text = prepare_message( trim($article_text), $html_on, $bbcode_on, $smilies_on, $bbcode_uid ); - $article_text = bbencode_first_pass( $article_text, $bbcode_uid ); - - /* - $article_title = ( !empty( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim ( $HTTP_POST_VARS['article_name'] ) ) : ''; - $article_description = ( !empty( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim ( $HTTP_POST_VARS['article_desc'] ) ) : ''; - $article_text = ( !empty( $HTTP_POST_VARS['message'] ) ) ? $HTTP_POST_VARS['message'] : ''; - // ! // Check message // ! if ( !empty( $article_text ) ) ! { ! if ( empty( $bbcode_uid ) ) ! { ! $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; ! } ! $article_text = prepare_message( trim( $article_text ), $html_on, $bbcode_on, $smilies_on, $bbcode_uid ); ! } ! */ $date = time(); $author_id = $userdata['user_id'] > 0 ? intval( $userdata['user_id'] ) : '-1'; - $type_id = $mx_request_vars->request('type_id', MX_TYPE_INT, ''); - - $username = $HTTP_POST_VARS['username']; - - // - // Check username - // - if (!empty($username)) - { - $username = phpbb_clean_username($username); - - if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['username'])) - { - include($phpbb_root_path . 'includes/functions_validate.'.$phpEx); - - $result = validate_username($username); - if ($result['error']) - { - $error_msg = (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg']; - - mx_message_die(GENERAL_MESSAGE, $error_msg ); - } - } - else - { - $username = ''; - } - } switch ( $kb_post_mode ) --- 148,162 ---- } // ! // Encode for db storage // ! $article_title = $mx_text->encode_simple($kb_title); ! $article_description = $mx_text->encode_simple($kb_desc); ! $article_text = $mx_text->encode($kb_text); ! $bbcode_uid = $mx_text->bbcode_uid; + $username = $mx_text->encode_username($username); $date = time(); $author_id = $userdata['user_id'] > 0 ? intval( $userdata['user_id'] ) : '-1'; switch ( $kb_post_mode ) *************** *** 191,202 **** // Approve // ! if ( $this->auth_user[$category_id]['auth_mod'] || $this->auth_user[$category_id]['auth_approval_edit'] ) // approval auth ! { ! $approve = 1; // approved ! } ! else ! { ! $approve = 2; // edited unapproved ! } $sql = "UPDATE " . KB_ARTICLES_TABLE . " --- 173,177 ---- // Approve // ! $approve = $this->auth_user[$category_id]['auth_mod'] || $this->auth_user[$category_id]['auth_approval_edit'] ? 1 : 2; // approved $sql = "UPDATE " . KB_ARTICLES_TABLE . " *************** *** 228,242 **** } ! if ( $this->auth_user[$category_id]['auth_approval'] || $this->auth_user[$category_id]['auth_mod'] ) ! { ! $approve = 1; // approved ! } ! else ! { ! $approve = 0; // unapproved ! } $sql = "INSERT INTO " . KB_ARTICLES_TABLE . " ( article_category_id , article_title , article_description , article_date , article_author_id , username , bbcode_uid , article_body , article_type , approved, views ) ! VALUES ( '$category_id', '" . str_replace( "\'", "''", $article_title ) . "', '" . str_replace( "\'", "''", $article_description ) . "', '$date', '$author_id', '$username', '$bbcode_uid', '" . str_replace( "\'", "''", $article_text ) . "', '$type_id', '$approve', '0')"; if ( !( $results = $db->sql_query( $sql ) ) ) --- 203,213 ---- } ! // ! // Approve ! // ! $approve = $this->auth_user[$category_id]['auth_approval'] || $this->auth_user[$category_id]['auth_mod'] ? 1 : 0; // approved $sql = "INSERT INTO " . KB_ARTICLES_TABLE . " ( article_category_id , article_title , article_description , article_date , article_author_id , username , bbcode_uid , article_body , article_type , approved, views ) ! VALUES ( '$category_id', '" . str_replace( "\'", "''", $article_title ) . "', '" . str_replace( "\'", "''", $article_description ) . "', '$date', '$author_id', '" . str_replace( "\'", "''", $username ) . "', '$bbcode_uid', '" . str_replace( "\'", "''", $article_text ) . "', '$type_id', '$approve', '0')"; if ( !( $results = $db->sql_query( $sql ) ) ) *************** *** 289,293 **** // $this->update_add_comment('', $article_id, 0, addslashes(trim($mx_kb_notification->subject)), addslashes(trim($mx_kb_notification->message)) ); - } --- 260,263 ---- *************** *** 348,394 **** } - // - // First (re)declare basic variables - // - if ( $kb_post_mode == 'edit' ) - { - $sql = "SELECT * - FROM " . KB_ARTICLES_TABLE . " - WHERE article_id = '" . $article_id . "'"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); - } - - $kb_row = $db->sql_fetchrow( $result ); - } - - $kb_title = ( isset( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_name'] ) ) ) : $kb_row['article_title']; - $kb_desc = ( isset( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_desc'] ) ) ): $kb_row['article_description']; - $kb_text = ( isset( $HTTP_POST_VARS['message'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['message'] ) ) ) : $kb_row['article_body']; - - $type_id = ( isset( $HTTP_POST_VARS['type_id'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['type_id'] ) ) ) : $kb_row['article_type']; - $bbcode_uid = ( isset( $HTTP_POST_VARS['bbcode_uid'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['bbcode_uid'] ) ) ) : $kb_row['bbcode_uid']; - $username = ( isset( $HTTP_POST_VARS['username'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['username'] ) ) ) : $kb_row['username']; - if ( $preview ) { ! $preview_title = $kb_title; ! $preview_desc = $kb_desc; ! $preview_text = $kb_text; ! ! $orig_word = array(); ! $replacement_word = array(); ! obtain_word_list( $orig_word, $replacement_word ); ! ! $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; ! $preview_text = stripslashes(prepare_message(addslashes(unprepare_message($preview_text)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); - // Now we run comment suite before checking for smilies - // so admins can add them in messages if they like - // and so smilies are not counted as images in sigs. - // this is done here again incase above conditions are - // not met. if (!$kb_config['allow_images'] || !$kb_config['allow_links']) { --- 318,330 ---- } if ( $preview ) { ! // ! // Encode for preview ! // ! $preview_title = $mx_text->encode_preview_simple($kb_title); ! $preview_desc = $mx_text->encode_preview_simple($kb_desc); ! $preview_text = $mx_text->encode_preview($kb_text); if (!$kb_config['allow_images'] || !$kb_config['allow_links']) { *************** *** 396,420 **** } - if ( $bbcode_on ) - { - $preview_text = bbencode_second_pass( $preview_text, $bbcode_uid ); - } - - if ( count( $orig_word ) ) - { - $preview_title = preg_replace( $orig_word, $replacement_word, $preview_title ); - $preview_desc = preg_replace( $orig_word, $replacement_word, $preview_desc ); - $preview_text = preg_replace( $orig_word, $replacement_word, $preview_text ); - } - - if ( $smilies_on ) - { - $preview_text = mx_smilies_pass( $preview_text ); - } - - $preview_text = make_clickable( $preview_text ); - - $preview_text = str_replace( "\n", '<br />', $preview_text ); - $template->set_filenames( array( 'preview' => 'kb_post_preview.tpl' ) ); --- 332,335 ---- *************** *** 428,431 **** --- 343,363 ---- $template->assign_var_from_handle( 'KB_PREVIEW_BOX', 'preview' ); + + // + // Decode for form editing + // + $kb_title = $mx_text->decode_simple($kb_title, true); + $kb_desc = $mx_text->decode_simple($kb_desc, true); + $kb_text = $mx_text->decode($kb_text, '', true); + } + else + { + // + // Decode for form editing + // + $kb_title = $mx_text->decode_simple($kb_title, true); + $kb_desc = $mx_text->decode_simple($kb_desc, true); + $kb_text = $mx_text->decode($kb_text, $bbcode_uid, true); + } *************** *** 442,454 **** } - if ( $bbcode_uid != '' ) - { - $kb_text = preg_replace('/\:(([a-z0-9]:)?)' . $bbcode_uid . '/s', '', $kb_text); - } - - $kb_text = str_replace('<', '<', $kb_text); - $kb_text = str_replace('>', '>', $kb_text); - $kb_text = str_replace('<br />', "\n", $kb_text); - // // Toggle selection --- 374,377 ---- *************** *** 456,477 **** $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; $bbcode_status = ( $bbcode_on ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; $links_status = ( $links_on ) ? $lang['Links_are_ON'] : $lang['Links_are_OFF']; $images_status = ( $images_on ) ? $lang['Images_are_ON'] : $lang['Images_are_OFF']; // - // Smilies toggle selection - // - if ( $smilies_on ) - { - $smilies_status = $lang['Smilies_are_ON']; - - mx_generate_smilies( 'inline', PAGE_POSTING ); - } - else - { - $smilies_status = $lang['Smilies_are_OFF']; - } - - // // set up page // --- 379,387 ---- $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; $bbcode_status = ( $bbcode_on ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; + $smilies_status = ( $smilies_on ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; $links_status = ( $links_on ) ? $lang['Links_are_ON'] : $lang['Links_are_OFF']; $images_status = ( $images_on ) ? $lang['Images_are_ON'] : $lang['Images_are_OFF']; // // set up page // Index: kb_post_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_post_comment.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_post_comment.php 17 Jun 2006 20:11:24 -0000 1.4 --- kb_post_comment.php 25 Jun 2006 21:55:12 -0000 1.5 *************** *** 32,41 **** // - // Includes - // - include_once( $phpbb_root_path . 'includes/bbcode.'.$phpEx); - include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); - - // // Request vars // --- 32,35 ---- *************** *** 56,62 **** $preview = $mx_request_vars->is_request('preview'); - $subject = ( !empty( $_POST['subject'] ) ) ? htmlspecialchars( trim( stripslashes( $_POST['subject'] ) ) ) : ''; - $message = ( !empty( $_POST['message'] ) ) ? htmlspecialchars( trim( stripslashes( $_POST['message'] ) ) ) : ''; - $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " --- 50,53 ---- *************** *** 86,89 **** --- 77,129 ---- } + if ( $mx_request_vars->is_get('cid') ) + { + if ( $this->comments[$article_data['article_category_id']]['internal_comments'] ) + { + // + // Query internal comment to edit + // + $sql = 'SELECT c.*, u.* + FROM ' . KB_COMMENTS_TABLE . ' AS c + LEFT JOIN ' . USERS_TABLE . " AS u ON c.poster_id = u.user_id + WHERE c.article_id = '" . $item_id . "' + AND c.comments_id = '" . $mx_request_vars->request('cid', MX_TYPE_INT, '') . "'"; + + $comment_arg_title = 'comments_title'; + $comment_arg_message = 'comments_text'; + $comment_arg_bbcode_uid = 'comment_bbcode_uid'; + } + else + { + // + // Query internal comment to edit + // Note: cid = post_id + // + $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid + FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt + WHERE pt.post_id = p.post_id + AND u.user_id = p.poster_id + AND p.post_id = '" . $mx_request_vars->request('cid', MX_TYPE_INT, '') . "'"; + + $comment_arg_title = 'post_subject'; + $comment_arg_message = 'post_text'; + $comment_arg_bbcode_uid = 'bbcode_uid'; + } + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt select comments', '', __LINE__, __FILE__, $sql ); + } + + $comment_row = $db->sql_fetchrow( $result ); + } + + $comment_title = $preview || isset($_POST['subject']) ? $_POST['subject'] : $comment_row[$comment_arg_title]; + $comment_body = $preview || isset($_POST['message']) ? $_POST['message'] : $comment_row[$comment_arg_message]; + $bbcode_uid = $preview ? '' : $comment_row[$comment_arg_bbcode_uid]; + + // + // Toggles + // $html_on = ( $kb_config['allow_comment_html'] ) ? true : 0; $bbcode_on = ( $kb_config['allow_comment_bbcode'] ) ? true : 0; *************** *** 92,95 **** --- 132,148 ---- $images_on = ( $kb_config['allow_comment_images'] ) ? true : 0; + // + // Instantiate the mx_text class + // + include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); + $mx_text = new mx_text(); + $mx_text->init($html_on, $bbcode_on, $smilies_on); + + // + // Allow all html tags + // Fix: Setting 'emtpy' enables all + // + //$mx_text->allow_all_html_tags = $allow_wysiwyg; // Not yet implemented for comments + // ======================================================= // Delete *************** *** 139,403 **** // ======================================================= ! // Main // ======================================================= ! if ( !$submit ) { ! // ! // Instatiate text tools ! // ! $mx_kb_text_tools = new mx_kb_text_tools(); ! ! // ! // Generate smilies listing for page output ! // ! $mx_kb_functions->kb_generate_smilies( 'inline', PAGE_POSTING ); ! ! $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; ! $bbcode_status = ( $bbcode_on ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; ! $smilies_status = ( $smilies_on ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; ! $links_status = ( $links_on ) ? $lang['Links_are_ON'] : $lang['Links_are_OFF']; ! $images_status = ( $images_on ) ? $lang['Images_are_ON'] : $lang['Images_are_OFF']; ! ! if ( $mx_request_vars->is_get('cid') ) ! { ! if ( $this->comments[$article_data['article_category_id']]['internal_comments'] ) ! { ! // ! // Query internal comment to edit ! // ! $sql = 'SELECT c.*, u.* ! FROM ' . KB_COMMENTS_TABLE . ' AS c ! LEFT JOIN ' . USERS_TABLE . " AS u ON c.poster_id = u.user_id ! WHERE c.article_id = '" . $item_id . "' ! AND c.comments_id = '" . $mx_request_vars->request('cid', MX_TYPE_INT, '') . "'"; ! ! $comment_arg_title = 'comments_title'; ! $comment_arg_message = 'comments_text'; ! $comment_arg_bbcode_uid = 'comment_bbcode_uid'; ! } ! else ! { ! // ! // Query internal comment to edit ! // Note: cid = post_id ! // ! $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid ! FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt ! WHERE pt.post_id = p.post_id ! AND u.user_id = p.poster_id ! AND p.post_id = '" . $mx_request_vars->request('cid', MX_TYPE_INT, '') . "'"; ! ! $comment_arg_title = 'post_subject'; ! $comment_arg_message = 'post_text'; ! $comment_arg_bbcode_uid = 'bbcode_uid'; ! ! } ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldnt select comments', '', __LINE__, __FILE__, $sql ); ! } ! $comment_row = $db->sql_fetchrow( $result ); ! // ! // Edit comment ! // ! $comment_title = stripslashes($comment_row[$comment_arg_title]); ! $comment_body = $comment_row[$comment_arg_message]; ! if ( $comment_row[$comment_arg_bbcode_uid] != '' ) ! { ! $comment_body = preg_replace('/\:(([a-z0-9]:)?)' . $comment_row[$comment_arg_bbcode_uid] . '/s', '', $comment_body); ! } ! $comment_body = str_replace('<', '<', $comment_body); ! $comment_body = str_replace('>', '>', $comment_body); ! $comment_body = str_replace('<br />', "\n", $comment_body); ! $hidden_form_fields = '<input type="hidden" name="mode" value="post_comment"> ! <input type="hidden" name="cat_id" value="' . $cat_id . '"> ! <input type="hidden" name="item_id" value="' . $item_id . '"> ! <input type="hidden" name="cid" value="' . $mx_request_vars->request('cid', MX_TYPE_INT, '') . '"> ! <input type="hidden" name="comment" value="post">'; ! } ! else { ! // ! // New comment ! // ! $comment_title = ''; ! $comment_body = ''; ! ! $hidden_form_fields = '<input type="hidden" name="mode" value="post_comment"> ! <input type="hidden" name="cat_id" value="' . $cat_id . '"> ! <input type="hidden" name="item_id" value="' . $item_id . '"> ! <input type="hidden" name="comment" value="post">'; } ! $template->set_filenames( array( 'body' => 'kb_comment_posting.tpl' ) ); - // - // Output the data to the template - // $template->assign_vars( array( - 'HTML_STATUS' => $html_status, - 'BBCODE_STATUS' => sprintf( $bbcode_status, '<a href="' . append_sid( "faq.$phpEx?mode=bbcode" ) . '" target="_phpbbcode">', '</a>' ), - 'SMILIES_STATUS' => $smilies_status, - 'LINKS_STATUS' => $links_status, - 'IMAGES_STATUS' => $images_status, - 'FILE_NAME' => $article_data['file_name'], - 'DOWNLOAD' => $kb_config['module_name'], - 'MESSAGE_LENGTH' => $kb_config['max_comment_chars'], - - 'TITLE' => $comment_title, - 'COMMENT' => $comment_body, - - 'L_COMMENT_ADD' => $lang['Comment_add'], - 'L_COMMENT' => $lang['Message_body'], - 'L_COMMENT_TITLE' => $lang['Subject'], - 'L_OPTIONS' => $lang['Options'], - 'L_COMMENT_EXPLAIN' => sprintf( $lang['Comment_explain'], $kb_config['max_comment_chars'] ), 'L_PREVIEW' => $lang['Preview'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_DOWNLOAD' => $lang['Download'], ! ! 'L_INDEX' => "<<", ! 'L_CHECK_MSG_LENGTH' => $lang['Check_message_length'], ! 'L_MSG_LENGTH_1' => $lang['Msg_length_1'], ! 'L_MSG_LENGTH_2' => $lang['Msg_length_2'], ! 'L_MSG_LENGTH_3' => $lang['Msg_length_3'], ! 'L_MSG_LENGTH_4' => $lang['Msg_length_4'], ! 'L_MSG_LENGTH_5' => $lang['Msg_length_5'], ! 'L_MSG_LENGTH_6' => $lang['Msg_length_6'], ! ! 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], ! 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], ! 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], ! 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], ! 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], ! 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], ! 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], ! 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], ! 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], ! 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], ! 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], ! 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], ! 'L_EMPTY_MESSAGE' => $lang['Empty_message'], ! ! 'L_FONT_COLOR' => $lang['Font_color'], ! 'L_COLOR_DEFAULT' => $lang['color_default'], ! 'L_COLOR_DARK_RED' => $lang['color_dark_red'], ! 'L_COLOR_RED' => $lang['color_red'], ! 'L_COLOR_ORANGE' => $lang['color_orange'], ! 'L_COLOR_BROWN' => $lang['color_brown'], ! 'L_COLOR_YELLOW' => $lang['color_yellow'], ! 'L_COLOR_GREEN' => $lang['color_green'], ! 'L_COLOR_OLIVE' => $lang['color_olive'], ! 'L_COLOR_CYAN' => $lang['color_cyan'], ! 'L_COLOR_BLUE' => $lang['color_blue'], ! 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'], ! 'L_COLOR_INDIGO' => $lang['color_indigo'], ! 'L_COLOR_VIOLET' => $lang['color_violet'], ! 'L_COLOR_WHITE' => $lang['color_white'], ! 'L_COLOR_BLACK' => $lang['color_black'], ! ! 'L_FONT_SIZE' => $lang['Font_size'], ! 'L_FONT_TINY' => $lang['font_tiny'], ! 'L_FONT_SMALL' => $lang['font_small'], ! 'L_FONT_NORMAL' => $lang['font_normal'], ! 'L_FONT_LARGE' => $lang['font_large'], ! 'L_FONT_HUGE' => $lang['font_huge'], ! 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], ! 'L_STYLES_TIP' => $lang['Styles_tip'], ! ! 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( this_kb_mxurl() ), ! 'U_FILE_NAME' => append_sid( this_kb_mxurl( 'mode=article&item_id=' . $item_id ) ), ! ! 'S_POST_ACTION' => append_sid( this_kb_mxurl() ), ! 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields ) ); // ! // Show preview stuff if user clicked preview // ! if ( $preview ) ! { ! $orig_word = array(); ! $replacement_word = array(); ! obtain_word_list( $orig_word, $replacement_word ); ! $comment_bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; ! $comments_text = stripslashes( prepare_message( addslashes( unprepare_message( $message ) ), $html_on, $bbcode_on, $smilies_on, $comment_bbcode_uid ) ); ! $title = $subject; ! if ( !$html_on ) ! { ! // ! // ! // ! $comments_text = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $comments_text ); ! } ! // Now we run comment suite before checking for smilies ! // so admins can add them in messages if they like ! // and so smilies are not counted as images in sigs. ! // this is done here again incase above conditions are ! // not met. ! 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'] ); ! } ! if ( $bbcode_on ) ! { ! // ! // ! // ! $comments_text = bbencode_second_pass( $comments_text, $comment_bbcode_uid ); // : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $comments_text); ! } ! if ( !empty( $orig_word ) ) ! { ! $title = ( !empty( $title ) ) ? preg_replace( $orig_word, $replacement_word, $title ) : ''; ! $comments_text = ( !empty( $comments_text ) ) ? preg_replace( $orig_word, $replacement_word, $comments_text ) : ''; ! } ! // ! // Make clickable ! // ! $comments_text = make_clickable( $comments_text ); ! // ! // Parse smilies ! // ! if ( $smilies_on ) ! { ! $comments_text = smilies_pass( $comments_text ); ! } ! $comments_text = str_replace( "\n", '<br />', $comments_text ); ! $template->assign_vars( array( ! 'PREVIEW' => true, ! 'COMMENT' => stripslashes( $_POST['message'] ), ! 'SUBJECT' => stripslashes( $_POST['subject'] ), ! 'PRE_COMMENT' => $comments_text ) ! ); ! } ! } ! // ======================================================= ! // Submit ! // ======================================================= ! if ( $submit ) ! { ! $this->update_add_comment($article_data, $item_id, $cid, '', '', $html_on, $bbcode_on, $smilies_on); ! $message = $lang['Comment_posted'] . '<br /><br />' . sprintf( $lang['Click_return_article'], '<a href="' . append_sid( this_kb_mxurl( 'mode=article&k=' . $item_id ) ) . '">', '</a>' ); ! mx_message_die( GENERAL_MESSAGE, $message ); ! } // =================================================== --- 192,367 ---- // ======================================================= ! // Submit // ======================================================= ! if ( $submit ) { ! $this->update_add_comment($article_data, $item_id, $cid, '', '', $html_on, $bbcode_on, $smilies_on); ! $message = $lang['Comment_posted'] . '<br /><br />' . sprintf( $lang['Click_return_article'], '<a href="' . append_sid( this_kb_mxurl( 'mode=article&k=' . $item_id ) ) . '">', '</a>' ); ! mx_message_die( GENERAL_MESSAGE, $message ); ! } ! // ======================================================= ! // Main ! // ======================================================= ! // ! // Instatiate text tools ! // ! $mx_kb_text_tools = new mx_kb_text_tools(); ! // ! // Generate smilies listing for page output ! // ! $mx_kb_functions->kb_generate_smilies( 'inline', PAGE_POSTING ); ! $html_status = ( $html_on ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; ! $bbcode_status = ( $bbcode_on ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; ! $smilies_status = ( $smilies_on ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; ! $links_status = ( $links_on ) ? $lang['Links_are_ON'] : $lang['Links_are_OFF']; ! $images_status = ( $images_on ) ? $lang['Images_are_ON'] : $lang['Images_are_OFF']; ! if ( $preview ) ! { ! // ! // Encode for preview ! // ! $preview_title = $mx_text->encode_preview_simple($comment_title); ! $preview_text = $mx_text->encode_preview($comment_body); ! if (!$kb_config['allow_images'] || !$kb_config['allow_links']) { ! $preview_text = $mx_kb_text_tools->remove_images_links( $preview_text, $kb_config['allow_images'], $kb_config['no_image_message'], $kb_config['allow_links'], $kb_config['no_link_message'] ); } ! $template->set_filenames( array( 'preview' => 'kb_post_preview.tpl' ) ); $template->assign_vars( array( 'L_PREVIEW' => $lang['Preview'], ! 'PREVIEW' => true, ! 'COMMENT' => $preview_text, ! 'SUBJECT' => $preview_title, ! 'PRE_COMMENT' => $comments_text ) ); // ! // Decode for form editing // ! $comment_title = $mx_text->decode_simple($comment_title, true); ! $comment_body = $mx_text->decode($comment_body, '', true); ! } ! else ! { ! // ! // Decode for form editing ! // ! $comment_title = $mx_text->decode_simple($comment_title); ! $comment_body = $mx_text->decode($comment_body, $bbcode_uid); ! } ! if ( $mx_request_vars->is_get('cid') ) ! { ! $hidden_form_fields = '<input type="hidden" name="mode" value="post_comment"> ! <input type="hidden" name="cat_id" value="' . $cat_id . '"> ! <input type="hidden" name="item_id" value="' . $item_id . '"> ! <input type="hidden" name="cid" value="' . $mx_request_vars->request('cid', MX_TYPE_INT, '') . '"> ! <input type="hidden" name="comment" value="post">'; ! } ! else ! { ! // ! // New comment ! // ! $comment_title = ''; ! $comment_body = ''; ! $hidden_form_fields = '<input type="hidden" name="mode" value="post_comment"> ! <input type="hidden" name="cat_id" value="' . $cat_id . '"> ! <input type="hidden" name="item_id" value="' . $item_id . '"> ! <input type="hidden" name="comment" value="post">'; ! } ! $template->set_filenames( array( 'body' => 'kb_comment_posting.tpl' ) ); ! // ! // Output the data to the template ! // ! $template->assign_vars( array( ! 'HTML_STATUS' => $html_status, ! 'BBCODE_STATUS' => sprintf( $bbcode_status, '<a href="' . append_sid( "faq.$phpEx?mode=bbcode" ) . '" target="_phpbbcode">', '</a>' ), ! 'SMILIES_STATUS' => $smilies_status, ! 'LINKS_STATUS' => $links_status, ! 'IMAGES_STATUS' => $images_status, ! 'FILE_NAME' => $article_data['file_name'], ! 'DOWNLOAD' => $kb_config['module_name'], ! 'MESSAGE_LENGTH' => $kb_config['max_comment_chars'], ! 'TITLE' => $comment_title, ! 'COMMENT' => $comment_body, ! 'L_COMMENT_ADD' => $lang['Comment_add'], ! 'L_COMMENT' => $lang['Message_body'], ! 'L_COMMENT_TITLE' => $lang['Subject'], ! 'L_OPTIONS' => $lang['Options'], ! 'L_COMMENT_EXPLAIN' => sprintf( $lang['Comment_explain'], $kb_config['max_comment_chars'] ), ! 'L_PREVIEW' => $lang['Preview'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_DOWNLOAD' => $lang['Download'], ! 'L_INDEX' => "<<", ! 'L_CHECK_MSG_LENGTH' => $lang['Check_message_length'], ! 'L_MSG_LENGTH_1' => $lang['Msg_length_1'], ! 'L_MSG_LENGTH_2' => $lang['Msg_length_2'], ! 'L_MSG_LENGTH_3' => $lang['Msg_length_3'], ! 'L_MSG_LENGTH_4' => $lang['Msg_length_4'], ! 'L_MSG_LENGTH_5' => $lang['Msg_length_5'], ! 'L_MSG_LENGTH_6' => $lang['Msg_length_6'], ! 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], ! 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], ! 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], ! 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], ! 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], ! 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], ! 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], ! 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], ! 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], ! 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], ! 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], ! 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], ! 'L_EMPTY_MESSAGE' => $lang['Empty_message'], ! 'L_FONT_COLOR' => $lang['Font_color'], ! 'L_COLOR_DEFAULT' => $lang['color_default'], ! 'L_COLOR_DARK_RED' => $lang['color_dark_red'], ! 'L_COLOR_RED' => $lang['color_red'], ! 'L_COLOR_ORANGE' => $lang['color_orange'], ! 'L_COLOR_BROWN' => $lang['color_brown'], ! 'L_COLOR_YELLOW' => $lang['color_yellow'], ! 'L_COLOR_GREEN' => $lang['color_green'], ! 'L_COLOR_OLIVE' => $lang['color_olive'], ! 'L_COLOR_CYAN' => $lang['color_cyan'], ! 'L_COLOR_BLUE' => $lang['color_blue'], ! 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'], ! 'L_COLOR_INDIGO' => $lang['color_indigo'], ! 'L_COLOR_VIOLET' => $lang['color_violet'], ! 'L_COLOR_WHITE' => $lang['color_white'], ! 'L_COLOR_BLACK' => $lang['color_black'], ! 'L_FONT_SIZE' => $lang['Font_size'], ! 'L_FONT_TINY' => $lang['font_tiny'], ! 'L_FONT_SMALL' => $lang['font_small'], ! 'L_FONT_NORMAL' => $lang['font_normal'], ! 'L_FONT_LARGE' => $lang['font_large'], ! 'L_FONT_HUGE' => $lang['font_huge'], ! 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], ! 'L_STYLES_TIP' => $lang['Styles_tip'], ! 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( this_kb_mxurl() ), ! 'U_FILE_NAME' => append_sid( this_kb_mxurl( 'mode=article&item_id=' . $item_id ) ), ! 'S_POST_ACTION' => append_sid( this_kb_mxurl() ), ! 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields ) ! ); // =================================================== *************** *** 405,412 **** // =================================================== $this->generate_navigation( $article_data['article_category_id'] ); - } - } - ?> \ No newline at end of file --- 369,373 ---- |