|
From: Jon O. <jon...@us...> - 2007-07-12 22:44:38
|
Update of /cvsroot/mxbb/mx_bugsbt/bugsbt/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27179/bugsbt/includes Modified Files: functions.php functions_bugsbt.php functions_comment.php Log Message: O yea, finally commenting is activated Also, a bunch of general updates/fixes Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_bugsbt/bugsbt/includes/functions.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.php 16 May 2007 19:36:56 -0000 1.3 --- functions.php 12 Jul 2007 22:43:52 -0000 1.4 *************** *** 569,573 **** break; ! default:s $sql = "SELECT a.*, u.user_id, u.username, c.category_id, c.category_name FROM " . BUGSBT_BUGS_TABLE . " AS a --- 569,573 ---- break; ! default: $sql = "SELECT a.*, u.user_id, u.username, c.category_id, c.category_name FROM " . BUGSBT_BUGS_TABLE . " AS a *************** *** 621,625 **** $this->data['item_editor'] = ( $userdata['user_id'] != '-1' ) ? $userdata['username'] : $lang['Guest']; ! $this->temp_url = PORTAL_URL . $mx_kb->this_mxurl("mode=" . "article&k=" . $this->data['item_id'], false, true); } } --- 621,625 ---- $this->data['item_editor'] = ( $userdata['user_id'] != '-1' ) ? $userdata['username'] : $lang['Guest']; ! $this->temp_url = PORTAL_URL . $mx_bugsbt->this_mxurl("mode=" . "article&k=" . $this->data['item_id'], false, true); } } Index: functions_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_bugsbt/bugsbt/includes/functions_comment.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_comment.php 5 May 2007 20:18:04 -0000 1.2 --- functions_comment.php 12 Jul 2007 22:43:55 -0000 1.3 *************** *** 73,77 **** { $sql = 'SELECT * ! FROM ' . BUGSBT_TABLE . " WHERE bug_id = $item_data"; --- 73,77 ---- { $sql = 'SELECT * ! FROM ' . BUGSBT_BUGS_TABLE . " WHERE bug_id = $item_data"; *************** *** 278,281 **** --- 278,282 ---- $template->assign_block_vars( 'use_comments.text', array( + 'CID' => $this->comments_row['comments_id'], 'L_POSTED' => $lang['Posted'], 'L_COMMENT_SUBJECT' => $lang['Comment_subject'], *************** *** 296,300 **** $template->assign_block_vars( 'use_comments.text.auth_edit', array( 'L_COMMENT_EDIT' => $lang['Comment_edit'], ! 'U_COMMENT_EDIT' => append_sid( $mx_bugsbt->this_mxurl( 'mode=post_comment&item_id=' . $this->item_id . '&cat_id=' . $this->cat_id . '&cid='.$this->comments_row['comments_id'] ) ), 'EDIT_IMG' => $images['bugsbt_icon_edit'], )); --- 297,302 ---- $template->assign_block_vars( 'use_comments.text.auth_edit', array( 'L_COMMENT_EDIT' => $lang['Comment_edit'], ! //'U_COMMENT_EDIT' => append_sid( $mx_bugsbt->this_mxurl( 'mode=post_comment&item_id=' . $this->item_id . '&cat_id=' . $this->cat_id . '&cid='.$this->comments_row['comments_id'] ) ), ! 'U_COMMENT_EDIT' => 'javascript:void(0)" onclick="editComment('.$this->item_id.','.$this->comments_row['comments_id'].');', 'EDIT_IMG' => $images['bugsbt_icon_edit'], )); *************** *** 305,309 **** $template->assign_block_vars( 'use_comments.text.auth_delete', array( 'L_COMMENT_DELETE' => $lang['Comment_delete'], ! 'U_COMMENT_DELETE' => append_sid( $mx_bugsbt->this_mxurl( "mode=post_comment&cid=".$this->comments_row['comments_id']."&delete=do&item_id=".$this->item_id . '&cat_id=' . $this->cat_id )), 'DELETE_IMG' => $images['bugsbt_icon_delpost'], )); --- 307,312 ---- $template->assign_block_vars( 'use_comments.text.auth_delete', array( 'L_COMMENT_DELETE' => $lang['Comment_delete'], ! //'U_COMMENT_DELETE' => append_sid( $mx_bugsbt->this_mxurl( "mode=post_comment&cid=".$this->comments_row['comments_id']."&delete=do&item_id=".$this->item_id . '&cat_id=' . $this->cat_id )), ! 'U_COMMENT_DELETE' => 'javascript:void(0)" onclick="deleteComment('.$this->comments_row['comments_id'].');', 'DELETE_IMG' => $images['bugsbt_icon_delpost'], )); *************** *** 510,513 **** --- 513,517 ---- $template->assign_block_vars( 'use_comments.text', array( + 'CID' => $this->comments_row['post_id'], 'L_POSTED' => $lang['Posted'], 'L_COMMENT_SUBJECT' => $lang['Comment_subject'], *************** *** 528,532 **** $template->assign_block_vars( 'use_comments.text.auth_edit', array( 'L_COMMENT_EDIT' => $lang['Comment_edit'], ! 'U_COMMENT_EDIT' => append_sid( $mx_bugsbt->this_mxurl( 'mode=post_comment&item_id=' . $this->item_id . '&cat_id=' . $this->cat_id . '&cid='.$this->comments_row['post_id'] ) ), 'EDIT_IMG' => $images['bugsbt_icon_edit'], )); --- 532,537 ---- $template->assign_block_vars( 'use_comments.text.auth_edit', array( 'L_COMMENT_EDIT' => $lang['Comment_edit'], ! //'U_COMMENT_EDIT' => append_sid( $mx_bugsbt->this_mxurl( 'mode=post_comment&item_id=' . $this->item_id . '&cat_id=' . $this->cat_id . '&cid='.$this->comments_row['post_id'] ) ), ! 'U_COMMENT_EDIT' => 'javascript:void(0)" onclick="editComment('.$this->item_id.','.$this->comments_row['post_id'].');', 'EDIT_IMG' => $images['bugsbt_icon_edit'], )); *************** *** 537,541 **** $template->assign_block_vars( 'use_comments.text.auth_delete', array( 'L_COMMENT_DELETE' => $lang['Comment_delete'], ! 'U_COMMENT_DELETE' => append_sid( $mx_bugsbt->this_mxurl( "mode=post_comment&cid=".$this->comments_row['post_id']."&delete=do&item_id=".$this->item_id . '&cat_id=' . $this->cat_id )), 'DELETE_IMG' => $images['bugsbt_icon_delpost'], )); --- 542,547 ---- $template->assign_block_vars( 'use_comments.text.auth_delete', array( 'L_COMMENT_DELETE' => $lang['Comment_delete'], ! //'U_COMMENT_DELETE' => append_sid( $mx_bugsbt->this_mxurl( "mode=post_comment&cid=".$this->comments_row['post_id']."&delete=do&item_id=".$this->item_id . '&cat_id=' . $this->cat_id )), ! 'U_COMMENT_DELETE' => 'javascript:void(0)" onclick="deleteComment('.$this->comments_row['post_id'].');', 'DELETE_IMG' => $images['bugsbt_icon_delpost'], )); *************** *** 879,883 **** if ( $mode == 'newtopic' || ($mode == 'editpost' && $is_first_post) ) { ! $mode = 'newtopic'; if ( $mode == 'newtopic' ) --- 885,889 ---- if ( $mode == 'newtopic' || ($mode == 'editpost' && $is_first_post) ) { ! //$mode = 'newtopic'; if ( $mode == 'newtopic' ) Index: functions_bugsbt.php =================================================================== RCS file: /cvsroot/mxbb/mx_bugsbt/bugsbt/includes/functions_bugsbt.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_bugsbt.php 5 May 2007 20:18:04 -0000 1.3 --- functions_bugsbt.php 12 Jul 2007 22:43:55 -0000 1.4 *************** *** 148,155 **** // Note: some settings are category dependent, but may use default config settings // ! $this->comments[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['cat_allow_comments'] == -1 ? ($kb_config['use_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_comments'] == 1 ? true : false ); ! $this->comments[$cat_rowset[$i]['category_id']]['internal_comments'] = $cat_rowset[$i]['internal_comments'] == -1 ? ($kb_config['internal_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['internal_comments'] == 1 ? true : false ); // phpBB or internal comments ! $this->comments[$cat_rowset[$i]['category_id']]['autogenerate_comments'] = $cat_rowset[$i]['autogenerate_comments'] == -1 ? ($kb_config['autogenerate_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['autogenerate_comments'] == 1 ? true : false ); // autocreate comments when updated ! $this->comments[$cat_rowset[$i]['category_id']]['comments_forum_id'] = $cat_rowset[$i]['comments_forum_id'] < 1 ? ( intval($kb_config['comments_forum_id']) ) : ( intval($cat_rowset[$i]['comments_forum_id']) ); // phpBB target forum (only used for phpBB comments) if ($this->comments[$cat_rowset[$i]['category_id']]['activated'] && !$this->comments[$cat_rowset[$i]['category_id']]['internal_comments'] && intval($this->comments[$cat_rowset[$i]['category_id']]['comments_forum_id']) < 1) --- 148,155 ---- // Note: some settings are category dependent, but may use default config settings // ! $this->comments[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['cat_allow_comments'] == -1 ? ($bugsbt_config['use_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_comments'] == 1 ? true : false ); ! $this->comments[$cat_rowset[$i]['category_id']]['internal_comments'] = $cat_rowset[$i]['internal_comments'] == -1 ? ($bugsbt_config['internal_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['internal_comments'] == 1 ? true : false ); // phpBB or internal comments ! $this->comments[$cat_rowset[$i]['category_id']]['autogenerate_comments'] = $cat_rowset[$i]['autogenerate_comments'] == -1 ? ($bugsbt_config['autogenerate_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['autogenerate_comments'] == 1 ? true : false ); // autocreate comments when updated ! $this->comments[$cat_rowset[$i]['category_id']]['comments_forum_id'] = $cat_rowset[$i]['comments_forum_id'] < 1 ? ( intval($bugsbt_config['comments_forum_id']) ) : ( intval($cat_rowset[$i]['comments_forum_id']) ); // phpBB target forum (only used for phpBB comments) if ($this->comments[$cat_rowset[$i]['category_id']]['activated'] && !$this->comments[$cat_rowset[$i]['category_id']]['internal_comments'] && intval($this->comments[$cat_rowset[$i]['category_id']]['comments_forum_id']) < 1) *************** *** 161,171 **** // Information // ! $this->information[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['show_pretext'] == -1 ? ($kb_config['show_pretext'] == 1 ? true : false ) : ( $cat_rowset[$i]['show_pretext'] == 1 ? true : false ); // phpBB or internal ratings // // Notification // ! $this->notification[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['notify'] == -1 ? (intval($kb_config['notify'])) : ( intval($cat_rowset[$i]['notify']) ); // -1, 0, 1, 2 ! $this->notification[$cat_rowset[$i]['category_id']]['notify_group'] = $cat_rowset[$i]['notify_group'] == -1 || $cat_rowset[$i]['notify_group'] == 0 ? (intval($kb_config['notify_group'])) : ( intval($cat_rowset[$i]['notify_group']) ); // Group_id } } --- 161,171 ---- // Information // ! $this->information[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['show_pretext'] == -1 ? ($bugsbt_config['show_pretext'] == 1 ? true : false ) : ( $cat_rowset[$i]['show_pretext'] == 1 ? true : false ); // phpBB or internal ratings // // Notification // ! $this->notification[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['notify'] == -1 ? (intval($bugsbt_config['notify'])) : ( intval($cat_rowset[$i]['notify']) ); // -1, 0, 1, 2 ! $this->notification[$cat_rowset[$i]['category_id']]['notify_group'] = $cat_rowset[$i]['notify_group'] == -1 || $cat_rowset[$i]['notify_group'] == 0 ? (intval($bugsbt_config['notify_group'])) : ( intval($cat_rowset[$i]['notify_group']) ); // Group_id } } *************** *** 971,975 **** // Introduce a style switch for simple/standard category navigation // ! $cat_style = $kb_config['use_simple_navigation'] ? 'CAT_NAV_SIMPLE' : 'CAT_NAV_STANDARD'; $template->assign_block_vars( $cat_style, array() ); --- 971,975 ---- // Introduce a style switch for simple/standard category navigation // ! $cat_style = $bugsbt_config['use_simple_navigation'] ? 'CAT_NAV_SIMPLE' : 'CAT_NAV_STANDARD'; $template->assign_block_vars( $cat_style, array() ); *************** *** 992,996 **** // $catnum = count($this->subcat_rowset[$parent]); ! $catcol = $kb_config['cat_col'] > 0 ? $kb_config['cat_col'] : 1; $num_of_rows = intval( $catnum / $catcol ); --- 992,996 ---- // $catnum = count($this->subcat_rowset[$parent]); ! $catcol = $bugsbt_config['cat_col'] > 0 ? $bugsbt_config['cat_col'] : 1; $num_of_rows = intval( $catnum / $catcol ); *************** *** 1034,1038 **** $last_file_name = ( strlen( stripslashes( $last_file_info['article_title'] ) ) > 20 ) ? substr( stripslashes( $last_file_info['article_title'] ), 0, 20 ) . '...' : stripslashes( $last_file_info['article_title'] ); $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'mode=article&k=' . $last_file_info['article_id'] ) ) . '" alt="' . stripslashes( $last_file_info['article_title'] ) . '" title="' . stripslashes( $last_file_info['article_title'] ) . '">' . $last_file_name . '</a> '; ! $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'mode=article&k=' . $last_file_info['article_id'] ) ) . '"><img src="' . $images['kb_icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_file'] . '" title="' . $lang['View_latest_file'] . '" /></a>'; } else --- 1034,1038 ---- $last_file_name = ( strlen( stripslashes( $last_file_info['article_title'] ) ) > 20 ) ? substr( stripslashes( $last_file_info['article_title'] ), 0, 20 ) . '...' : stripslashes( $last_file_info['article_title'] ); $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'mode=article&k=' . $last_file_info['article_id'] ) ) . '" alt="' . stripslashes( $last_file_info['article_title'] ) . '" title="' . stripslashes( $last_file_info['article_title'] ) . '">' . $last_file_name . '</a> '; ! $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'mode=article&k=' . $last_file_info['article_id'] ) ) . '"><img src="' . $images['bugsbt_icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_file'] . '" title="' . $lang['View_latest_file'] . '" /></a>'; } else *************** *** 1054,1058 **** 'CAT_ARTICLES' => $category_articles, ! 'CAT_IMAGE' => $is_new ? $images['kb_category_new'] : $images['kb_category'], 'SUB_CAT' => ( !empty( $sub_cat ) ) ? " $sub_cat" : "", 'L_SUB_CAT' => $lang['Sub_categories'], --- 1054,1058 ---- 'CAT_ARTICLES' => $category_articles, ! 'CAT_IMAGE' => $is_new ? $images['bugsbt_product_new'] : $images['bugsbt_product'], 'SUB_CAT' => ( !empty( $sub_cat ) ) ? " $sub_cat" : "", 'L_SUB_CAT' => $lang['Sub_categories'], *************** *** 1196,1200 **** // $is_new = FALSE; ! if (time() - ($kb_config['settings_newdays'] * 24 * 60 * 60) < $file_rowset[$i]['article_date']) { $is_new = TRUE; --- 1196,1200 ---- // $is_new = FALSE; ! if (time() - ($bugsbt_config['settings_newdays'] * 24 * 60 * 60) < $file_rowset[$i]['article_date']) { $is_new = TRUE; *************** *** 1250,1254 **** 'U_ARTICLE' => $article_url, ! 'ARTICLE_IMAGE' => $is_new ? $images['kb_article_new'] : $images['kb_article'], 'COLOR' => ( ( $i % 2 ) ? "row2" : "row1" ), 'POSTER' => $file_poster, --- 1250,1254 ---- 'U_ARTICLE' => $article_url, ! 'ARTICLE_IMAGE' => $is_new ? $images['bugsbt_bug_new'] : $images['bugsbt_bug'], 'COLOR' => ( ( $i % 2 ) ? "row2" : "row1" ), 'POSTER' => $file_poster, *************** *** 1293,1298 **** $action = ( empty( $cat_id ) ) ? 'stats' : 'cat&cat=' . $cat_id; ! $sort_method = isset($_REQUEST['sort_method']) ? $_REQUEST['sort_method'] : $kb_config['sort_method']; ! $sort_order = isset($_REQUEST['sort_order']) ? $_REQUEST['sort_order'] : $kb_config['sort_order']; $template->assign_vars( array( --- 1293,1298 ---- $action = ( empty( $cat_id ) ) ? 'stats' : 'cat&cat=' . $cat_id; ! $sort_method = isset($_REQUEST['sort_method']) ? $_REQUEST['sort_method'] : $bugsbt_config['sort_method']; ! $sort_order = isset($_REQUEST['sort_order']) ? $_REQUEST['sort_order'] : $bugsbt_config['sort_order']; $template->assign_vars( array( *************** *** 1339,1344 **** 'SORT_DESC' => ( $sort_order == 'DESC' ) ? 'selected="selected"' : '', ! 'PAGINATION' => generate_pagination( append_sid( $this->this_mxurl( "mode=$action&sort_method=$sort_method&sort_order=$sort_order" ) ), $total_file, $kb_config['pagination'], $start ), ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $kb_config['pagination'] ) + 1 ), ceil( $total_file / $kb_config['pagination'] ) ), 'ID' => $cat_id, 'START' => $start, --- 1339,1344 ---- 'SORT_DESC' => ( $sort_order == 'DESC' ) ? 'selected="selected"' : '', ! 'PAGINATION' => generate_pagination( append_sid( $this->this_mxurl( "mode=$action&sort_method=$sort_method&sort_order=$sort_order" ) ), $total_file, $bugsbt_config['pagination'], $start ), ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $bugsbt_config['pagination'] ) + 1 ), ceil( $total_file / $bugsbt_config['pagination'] ) ), 'ID' => $cat_id, 'START' => $start, *************** *** 1514,1520 **** $comment_bbcode_uid = $mx_text->bbcode_uid; ! if ( $length > $kb_config['max_comment_chars'] ) { ! mx_message_die( GENERAL_ERROR, 'Your comment is too long!<br/>The maximum length allowed in characters is ' . $kb_config['max_comment_chars'] . '' ); } --- 1514,1520 ---- $comment_bbcode_uid = $mx_text->bbcode_uid; ! if ( $length > $bugsbt_config['max_comment_chars'] ) { ! mx_message_die( GENERAL_ERROR, 'Your comment is too long!<br/>The maximum length allowed in characters is ' . $bugsbt_config['max_comment_chars'] . '' ); } |