Update of /cvsroot/mxbb/mx_bugsbt/bugsbt/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7691/bugsbt/modules Added Files: bugsbt_index.php bugsbt_post.php bugsbt_product.php bugsbt_update_tree.php bugsbt_view.php index.htm Log Message: Ok. here we go. This is the cool new mxBB Bugtracker ;) --- NEW FILE: bugsbt_index.php --- <?php /** * * @package mxBB Portal Module - mx_bugsbt * @version $Id: bugsbt_index.php,v 1.1 2007/02/15 12:43:50 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Cezary Tomczak] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if( !defined('IN_PORTAL') ) { die("Hacking attempt"); } class mx_bugsbt_index extends mx_bugsbt_public { function main( $action ) { global $template, $lang, $db, $theme, $board_config, $phpEx, $bugsbt_config, $debug, $mx_root_path, $module_root_path; global $mx_page, $mx_block, $mx_request_vars, $article_path; $current_article_id = $mx_request_vars->is_request('k') ? $mx_request_vars->request('k', MX_TYPE_INT, '') : ''; $template->set_filenames( array( 'body' => 'bugsbt_index.tpl' )); // Also sets $article_path $tree_html = $this->generate_app_tree($current_article_id); $template->assign_vars( array( 'MX_ROOT_PATH' => $mx_root_path, 'MODULE_ROOT_PATH' => $module_root_path, 'TEMPLATE_PATH' => $template->module_template_path, 'BLOCK_ID' => $mx_block->block_id, 'PAGE_ID' => $mx_page->page_id, // // Menu // 'MODE_MANAGE_URL' => $this->this_mxurl('mode=index'), 'MODE_PUBLISH_URL' => $this->this_mxurl('mode=publish'), 'MODE_PUBLISH_EXPORT_URL' => $this->this_mxurl('mode=publish_export'), 'MODE_IMPORT_URL' => $this->this_mxurl('mode=import'), 'MODE_EXPORT_URL' => $this->this_mxurl('mode=export'), 'MODE_SETTINGS_URL' => $this->this_mxurl('mode=settings'), 'MODE_VIEW_URL' => $this->this_mxurl('mode=view'), 'TREE_HTML' => $tree_html, // // Theme // 'T_TR_COLOR1' => '#'.$theme['tr_color1'], // row1 'T_TR_COLOR2' => '#'.$theme['tr_color2'], // row2 'T_TR_COLOR3' => '#'.$theme['tr_color3'], // row3 'T_BODY_TEXT' => '#'.$theme['body_text'], 'T_BODY_LINK' => '#'.$theme['body_link'], 'T_BODY_VLINK' => '#'.$theme['body_vlink'], 'T_BODY_HLINK' => '#'.$theme['body_hlink'], 'T_TH_COLOR1' => '#'.$theme['th_color1'], // Border Colors (main) 'T_TH_COLOR2' => '#'.$theme['th_color2'], // Border Colors (forumline) 'T_TH_COLOR3' => '#'.$theme['th_color3'], // Border Colors (bozes) 'T_FONTFACE1' => $theme['fontface1'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], // Background code/quote 'T_TD_COLOR2' => '#'.$theme['td_color2'], // Background post/input // // Menu langs // 'L_PROJECT' => $lang['sd_Project'], 'L_MANAGEMENT' => $lang['sd_Management'], 'L_PUBLISH' => $lang['sd_Publish'], 'L_IMPORT_CONTENT' => $lang['sd_Import_content'], 'L_EXPORT_CONTENT' => $lang['sd_Export_content'], 'L_OPTIONS' => $lang['sd_Options'], 'L_SETTINGS' => $lang['sd_Settings'], 'L_DOC_VIEW' => $lang['sd_Doc_view'], 'L_HELP' => $lang['sd_Help'], 'L_CONTENTS' => $lang['sd_Contents'], 'L_ABOUT' => $lang['sd_About'], // // Tree // 'L_TREE_VIEW' => $lang['sd_Tree_View'], 'L_TOC' => $lang['sd_Toc'], 'L_WHERE' => $lang['sd_Where'], 'L_BEFORE' => $lang['sd_Before'], 'L_AFTER' => $lang['sd_After'], 'L_TYPE' => $lang['sd_Type'], 'L_NAME' => $lang['sd_Name'], 'L_DOCUMENT' => $lang['sd_Document'], 'L_FOLDER' => $lang['sd_Folder'], 'VIEW_DOC' => ' - <a href="'.$this->this_mxurl('mode=view').'" >[' . $lang['sd_Doc_view'] . ']</a>', )); } } ?> --- NEW FILE: bugsbt_post.php --- <?php /** * * @package mxBBmodule_mx_bugsbt * @version $Id: bugsbt_post.php,v 1.1 2007/02/15 12:43:50 jonohlsson Exp $ * @copyright (c) 2002-2006 [wGEric, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Enter description here... * */ class mx_bugsbt_post extends mx_bugsbt_public { /** * Enter description here... * * @param unknown_type $action */ function main( $action ) { global $template, $mx_bugsbt_functions, $lang, $board_config, $phpEx, $bugsbt_config, $db, $images, $userdata; 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; global $page_id, $block_id; // // Request vars // $article_id = $mx_request_vars->request('k', MX_TYPE_INT, ''); $cat_id = $mx_request_vars->request('cat', MX_TYPE_INT, 0); //die('a'.$article_id.'c'.$cat_id); $do = ( isset( $_REQUEST['do'] ) ) ? intval( $_REQUEST['do'] ) : ''; $bugsbt_post_mode = empty( $article_id ) ? 'add' : 'edit'; //Main mode toggle $this->page_title = $bugsbt_post_mode == 'add' ? $lang['Add_bug'] : $lang['Edit_bug']; $delete = $mx_request_vars->request('delete', MX_TYPE_NO_TAGS, ''); $preview = $mx_request_vars->is_request('preview'); $cancel = $mx_request_vars->is_request('cancel'); // // Main Auth // if ( !empty( $cat_id ) ) { if ( !$this->auth_user[$cat_id]['auth_post'] ) { $this->mx_message_die( GENERAL_ERROR, $lang['Sorry_auth_post'] ); } } else { $dropmenu = ( !$cat_id ) ? $this->generate_jumpbox( 0, 0, '', true, true, 'auth_post' ) : $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true, true, 'auth_post' ); if ( empty( $dropmenu ) ) { $this->mx_message_die( GENERAL_ERROR, $lang['Sorry_auth_post'] ); } } // // Load article info...if $article_id is set // if ( $article_id ) { $sql = 'SELECT * FROM ' . BUGSBT_BUGS_TABLE . " WHERE bug_id = '" . $article_id . "'"; if ( !( $result = $db->sql_query( $sql ) ) ) { $this->mx_message_die( GENERAL_ERROR, 'Couldnt query Article data', '', __LINE__, __FILE__, $sql ); } $article_data = $db->sql_fetchrow( $result ); $cat_id = $article_data['bug_category_id']; $db->sql_freeresult( $result ); } // // Further security. // Reset vars if no related data exist. // if ( $article_id && !$cat_id ) { $article_id = 0; } if ( $cat_id && !$this->cat_rowset[$cat_id]['category_id'] ) { $cat_id = 0; } // ======================================================= // Delete // ======================================================= 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'] ) { // // Notification // $this->update_add_item_notify($article_id, 'delete'); // // Comments // if ($this->comments[$cat_id]['activated'] && $bugsbt_config['del_topic']) { if ( $this->comments[$cat_id]['internal_comments'] ) { $sql = 'DELETE FROM ' . BUGSBT_COMMENTS_TABLE . " WHERE article_id = '" . $article_id . "'"; if ( !( $db->sql_query( $sql ) ) ) { $this->mx_message_die( GENERAL_ERROR, 'Couldnt delete comments', '', __LINE__, __FILE__, $sql ); } } else { if ( $article_data['topic_id'] ) { include( $module_root_path . 'bugsbt/includes/functions_comment.' . $phpEx ); $mx_bugsbt_comments = new mx_bugsbt_comments(); $mx_bugsbt_comments->init( $article_data, 'phpbb'); $mx_bugsbt_comments->post('delete_all', $article_data['topic_id']); } } } $this->delete_items( $article_id ); $this->_bugsbt(); $message = $lang['Bug_Deleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "mode=cat&cat=" . $cat_id ) ) . '">', '</a>' ); $this->mx_message_die( GENERAL_MESSAGE, $message ); } else { $this->mx_message_die( GENERAL_ERROR, $lang['Sorry_auth_delete'] ); } } // // Define more vars // $bugsbt_title = $preview || isset($_POST['article_name']) ? $_POST['article_name'] : $article_data['bug_title']; $bugsbt_desc = $preview || isset($_POST['article_desc']) ? $_POST['article_desc'] : $article_data['bug_description']; $bugsbt_text = $preview || isset($_POST['message']) ? $_POST['message'] : $article_data['bug_body']; $bbcode_uid = $preview ? '' : $article_data['bbcode_uid']; $username = $preview || isset($_POST['username']) ? $_POST['username'] : $article_data['username']; $type_id = $preview || isset($_POST['type_id']) ? intval($_POST['type_id']) : $article_data['bug_type']; $closed = $preview || isset($_POST['closed']) ? intval($_POST['closed']) : $article_data['bug_closed']; $closed_yes = ( $closed ) ? "checked=\"checked\"" : ""; $closed_no = ( !$closed ) ? "checked=\"checked\"" : ""; // // Instatiate custom fields (only used in bugsbt_article) // $mx_bugsbt_custom_field = new mx_custom_field(BUGSBT_CUSTOM_TABLE, BUGSBT_CUSTOM_DATA_TABLE); $mx_bugsbt_custom_field->init(); // // wysiwyg // if ( $bugsbt_config['allow_wysiwyg'] && file_exists( $mx_root_path . $bugsbt_config['wysiwyg_path'] . 'tinymce/jscripts/tiny_mce/blank.htm' )) { $allow_wysiwyg = true; $bbcode_on = false; $html_on = true; $smilies_on = false; $links_on = false; $images_on = false; $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 { $allow_wysiwyg = false; $bbcode_on = $bugsbt_config['allow_bbcode'] ? true : false; $html_on = $bugsbt_config['allow_html'] ? true : false; $smilies_on = $bugsbt_config['allow_smilies'] ? true : false; $links_on = $bugsbt_config['allow_links'] ? true : false; $images_on = $bugsbt_config['allow_images'] ? true : false; $board_config['allow_html_tags'] = $bugsbt_config['allowed_html_tags']; $template->assign_block_vars( 'formatting', array() ); if ($smilies_on) { $mx_bugsbt_functions->generate_smilies( 'inline', PAGE_POSTING ); } } // // Instantiate the mx_text and mx_text_formatting classes // $mx_text = new mx_text(); $mx_text->init($html_on, $bbcode_on, $smilies_on); $mx_text_formatting = new mx_text_formatting(); // // Allow all html tags // Fix: Setting 'emtpy' enables all // $mx_text->allow_all_html_tags = $allow_wysiwyg; // // IF submit then upload the article and update the sql for it // if ( isset( $_POST['submit'] ) && $cat_id ) { if ( !$mx_request_vars->is_request('article_name') || !$mx_request_vars->is_request('article_desc') || !$mx_request_vars->is_request('message') ) { $message = $lang['Empty_fields'] . '<br /><br />' . sprintf( $lang['Empty_fields_return'], '<a href="' . append_sid( $this->this_mxurl( 'mode=add' ) ) . '">', '</a>' ); $this->mx_message_die( GENERAL_ERROR, $message ); } // // Encode for db storage // $article_title = $mx_text->encode_simple($bugsbt_title); $article_description = $mx_text->encode_simple($bugsbt_desc); $article_text = $mx_text->encode($bugsbt_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'; if ( !$article_id ) { if ( $this->auth_user[$cat_id]['auth_post'] || $this->auth_user[$cat_id]['auth_mod'] ) { // // Approve // $approve = $this->auth_user[$cat_id]['auth_approval'] || $this->auth_user[$cat_id]['auth_mod'] ? 1 : 0; // approved $sql = "INSERT INTO " . BUGSBT_BUGS_TABLE . " ( bug_category_id, bug_title, bug_description, bug_date, bug_author_id, username, bbcode_uid, bug_body, bug_type, bug_closed, approved, views ) VALUES ( '$cat_id', '" . str_replace( "\'", "''", $article_title ) . "', '" . str_replace( "\'", "''", $article_description ) . "', '$date', '$author_id', '" . str_replace( "\'", "''", $username ) . "', '$bbcode_uid', '" . str_replace( "\'", "''", $article_text ) . "', '$type_id', '$closed' , '$approve', '0')"; if ( !( $results = $db->sql_query( $sql ) ) ) { $this->mx_message_die( GENERAL_ERROR, "Could not submit aritcle", '', __LINE__, __FILE__, $sql ); } // // Get new article id // $sql = "SELECT MAX(bug_id) AS new_id FROM " . BUGSBT_BUGS_TABLE; if( !($result = $db->sql_query($sql)) ) { $this->mx_message_die(GENERAL_ERROR, "Couldn't find max article_id", "", __LINE__, __FILE__, $sql); } $temp_row = $db->sql_fetchrow($result); $article_id = $temp_row['new_id']; // // Update custom fields // $mx_bugsbt_custom_field->file_update_data( $article_id ); $this->modified( true ); $this->_bugsbt(); } else { $message = $lang['Sorry_auth_post']; } } else { if ( ($this->auth_user[$cat_id]['auth_edit'] && $article_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$cat_id]['auth_mod'] ) { // // Approve // $approve = $this->auth_user[$cat_id]['auth_approval_edit'] || $this->auth_user[$cat_id]['auth_mod'] ? 1 : 0; // approved $sql = "UPDATE " . BUGSBT_BUGS_TABLE . " SET bug_category_id = '$cat_id', bug_title = '" . str_replace( "\'", "''", $article_title ) . "', bug_description = '" . str_replace( "\'", "''", $article_description ) . "', bug_body = '" . str_replace( "\'", "''", $article_text ) . "', bug_type = '" . $type_id . "', bug_closed = '" . $closed . "', approved = '" . $approve . "', bbcode_uid = '" . $bbcode_uid . "' WHERE bug_id = ". $article_id; if ( !( $results = $db->sql_query( $sql ) ) ) { $this->mx_message_die( GENERAL_ERROR, "Could not edit article", '', __LINE__, __FILE__, $sql ); } // // Update custom fields // $mx_bugsbt_custom_field->file_update_data( $article_id ); $this->modified( true ); $this->_bugsbt(); } else { $message = $lang['Sorry_auth_edit']; } } // // Notification // $this->update_add_item_notify($article_id, $bugsbt_post_mode); // // Auto comment // if ( $this->comments[$cat_id]['activated'] && $this->comments[$cat_id]['autogenerate_comments'] ) { // // Autogenerate comment (duplicate the notification message) // $mx_bugsbt_notification = new mx_bugsbt_notification(); $mx_bugsbt_notification->init( $article_id ); $mx_bugsbt_notification->_compose_auto_note($bugsbt_post_mode == 'add' ? MX_NEW_NOTIFICATION : MX_EDITED_NOTIFICATION); // // Generate comment // $this->update_add_comment('', $article_id, 0, addslashes(trim($mx_bugsbt_notification->subject)), addslashes(trim($mx_bugsbt_notification->message)) ); } if ( $approve == 1 ) { $message = $lang['Bug_submitted'] . '<br /><br />' . sprintf( $lang['Click_return_bugsbt'], '<a href="' . append_sid( $this->this_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf($lang['Click_return_bug'], '<a href="' . append_sid($this->this_mxurl("mode=article&k=" . $article_id)). '">', '</a>') . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); } else { $message = $lang['Bug_submitted_Approve'] . '<br /><br />' . sprintf( $lang['Click_return_bugsbt'], '<a href="' . append_sid( $this->this_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); } $this->mx_message_die( GENERAL_MESSAGE, $message ); } else // ======================================================= // IF not submit then load data MAIN form // ======================================================= { if ( !$article_id ) { if ( !$this->auth_user[$cat_id]['auth_post'] ) { $this->mx_message_die( GENERAL_ERROR, $lang['Sorry_auth_post'] ); } } else { if ( !( ( $this->auth_user[$cat_id]['auth_edit'] && $article_data['user_id'] == $userdata['user_id'] ) || $this->auth_user[$cat_id]['auth_mod'] ) ) { $this->mx_message_die( GENERAL_ERROR, $lang['Sorry_auth_edit'] ); } } // // PreText HIDE/SHOW // if ( $bugsbt_config['show_pretext'] ) { // // Pull Header/Body info. // $pt_header = $bugsbt_config['pt_header']; $pt_body = $bugsbt_config['pt_body']; $template->set_filenames( array( 'pretext' => 'bugsbt_post_pretext.tpl' ) ); $template->assign_vars( array( 'PRETEXT_HEADER' => $pt_header, 'PRETEXT_BODY' => $pt_body ) ); $template->assign_var_from_handle( 'KB_PRETEXT_BOX', 'pretext' ); } if ( $preview ) { // // Encode for preview // $preview_title = $mx_text->encode_preview_simple($bugsbt_title); $preview_desc = $mx_text->encode_preview_simple($bugsbt_desc); $preview_text = $mx_text->encode_preview($bugsbt_text); if (!$bugsbt_config['allow_images'] || !$bugsbt_config['allow_links']) { $preview_text = $mx_text_formatting->remove_images_links( $preview_text, $bugsbt_config['allow_images'], $bugsbt_config['no_image_message'], $bugsbt_config['allow_links'], $bugsbt_config['no_link_message'] ); } $template->set_filenames( array( 'preview' => 'bugsbt_post_preview.tpl' ) ); $template->assign_vars( array( 'L_PREVIEW' => $lang['Preview'], 'ARTICLE_TITLE' => $preview_title, 'ARTICLE_DESC' => $preview_desc, 'ARTICLE_BODY' => $preview_text, 'PRE_COMMENT' => $preview_text ) ); $template->assign_var_from_handle( 'KB_PREVIEW_BOX', 'preview' ); // // Decode for form editing // $bugsbt_title = $mx_text->decode_simple($bugsbt_title, true); $bugsbt_desc = $mx_text->decode_simple($bugsbt_desc, true); $bugsbt_text = $mx_text->decode($bugsbt_text, '', true); } else { // // Decode for form editing // $bugsbt_title = $mx_text->decode_simple($bugsbt_title, true); $bugsbt_desc = $mx_text->decode_simple($bugsbt_desc, true); $bugsbt_text = $mx_text->decode($bugsbt_text, $bbcode_uid, true); } // // show article form - MAIN // if ( $bugsbt_post_mode == 'edit' ) { $s_hidden_vars = '<input type="hidden" name="k" value="' . $article_id . '"><input type="hidden" name="bbcode_uid" value="' . $bbcode_uid . '"><input type="hidden" name="author_id" value="' . $author_id . '">'; $s_hidden_vars .= '<input type="hidden" name="block_id" value="' . $block_id . '">'; $s_hidden_vars .= '<input type="hidden" name="page_id" value="' . $page_id . '">'; $s_hidden_vars .= '<input type="hidden" name="mode" value="' . $bugsbt_post_mode . '">'; } else { $s_hidden_vars = '<input type="hidden" name="cat" value="' . $cat_id . '">'; $s_hidden_vars .= '<input type="hidden" name="block_id" value="' . $block_id . '">'; $s_hidden_vars .= '<input type="hidden" name="page_id" value="' . $page_id . '">'; $s_hidden_vars .= '<input type="hidden" name="mode" value="' . $bugsbt_post_mode . '">'; } // // Toggle selection // $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 // $template->set_filenames( array( 'body' => 'bugsbt_post_body.tpl' ) ); if ( !$userdata['session_logged_in'] ) { $template->assign_block_vars( 'switch_name', array() ); } //$bugsbt_action_url = $bugsbt_post_mode == 'add' ? $this->this_tab_mxurl( 'mode=add' ) : $this->this_mxurl( 'mode=edit' ); $bugsbt_action_url = $this->this_tab_mxurl(); $custom_data = $bugsbt_post_mode == 'add' ? $mx_bugsbt_custom_field->display_edit() : $mx_bugsbt_custom_field->display_edit( $article_id ); $build_name = $this->cat_rowset[$cat_id]['category_name']; $edition_name = $this->cat_rowset[$this->cat_rowset[$cat_id]['parent']]['category_name']; $product_name = $this->cat_rowset[$this->cat_rowset[$this->cat_rowset[$this->cat_rowset[$cat_id]['parent']]['category_id']]['parent']]['category_name']; if ( $custom_data ) { $template->assign_block_vars( 'custom_data_fields', array( 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'] )); } $template->assign_vars( array( 'S_ACTION' => $bugsbt_action_url, 'S_HIDDEN_FIELDS' => $s_hidden_vars, 'ARTICLE_TITLE' => $bugsbt_title, 'ARTICLE_DESC' => $bugsbt_desc, 'ARTICLE_BODY' => $bugsbt_text, 'USERNAME' => $username, 'L_ADD_ARTICLE' => $lang['Add_bug'], 'L_ARTICLE_TITLE' => $lang['Bug_title'], 'L_ARTICLE_DESCRIPTION' => $lang['Bug_description'], 'L_ARTICLE_TEXT' => $lang['Bug_text'], 'L_ARTICLE_CATEGORY' => $lang['Category'], 'L_ARTICLE_TYPE' => $lang['Bug_type'], 'L_BUG_PRODUCT' => $lang['Product'], 'L_BUG_EDITION' => $lang['Edition'], 'L_BUG_BUILD' => $lang['Build'], 'L_SUBMIT' => $lang['Submit'], 'L_PREVIEW' => $lang['Preview'], 'L_SELECT_TYPE' => $lang['Select'], 'L_CLOSED' => $lang['Bug_closed'], 'L_NAME' => $lang['Username'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'HTML_STATUS' => $html_status, 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . PHPBB_URL . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), 'SMILIES_STATUS' => $smilies_status, 'LINKS_STATUS' => $links_status, 'IMAGES_STATUS' => $images_status, 'BUG_PRODUCT' => $product_name, 'BUG_EDITION' => $edition_name, 'BUG_BUILD' => $build_name, 'S_BUG_YES' => $closed_yes, 'S_BUG_NO' => $closed_no, '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_EMPTY_ARTICLE_NAME' => $lang['Empty_bug_name'], 'L_EMPTY_ARTICLE_DESC' => $lang['Empty_bug_desc'], 'L_EMPTY_CAT' => $lang['Empty_category'], 'L_EMPTY_TYPE' => $lang['Empty_type'], '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_PAGES' => $lang['L_Pages'], 'L_PAGES_EXPLAIN' => $lang['L_Pages_explain'], 'L_TOC' => $lang['L_Toc'], 'L_TOC_EXPLAIN' => $lang['L_Toc_explain'], 'L_ABSTRACT' => $lang['L_Abstract'], 'L_ABSTRACT_EXPLAIN' => $lang['L_Abstract_explain'], 'L_TITLE_FORMAT' => $lang['L_Title_Format'], 'L_TITLE_FORMAT_EXPLAIN' => $lang['L_Title_Format_explain'], 'L_SUBTITLE_FORMAT' => $lang['L_Subtitle_Format'], 'L_SUBTITLE_FORMAT_EXPLAIN' => $lang['L_Subtitle_Format_explain'], 'L_SUBSUBTITLE_FORMAT' => $lang['L_Subsubtitle_Format'], 'L_SUBSUBTITLE_FORMAT_EXPLAIN' => $lang['L_Subsubtitle_Format_explain'], 'L_OPTIONS' => $lang['L_Options'], 'L_FORMATTING' => $lang['L_Formatting'], 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], 'L_STYLES_TIP' => $lang['Styles_tip'] ) ); $mx_bugsbt_functions->get_bugsbt_type_list( $type_id ); if ( $bugsbt_post_mode == 'edit' ) { $template->assign_block_vars( 'switch_edit', array( 'CAT_LIST' => $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), false, true, 'auth_edit') )); } if ( $bbcode_on ) { $template->assign_block_vars( 'switch_bbcodes', array()); } // =================================================== // assign var for top navigation // =================================================== $this->generate_navigation( $cat_id ); // // User authorisation levels output // $this->auth_can( $cat_id ); // // Get footer quick dropdown jumpbox // $this->generate_jumpbox( 0, 0, array( $cat_id => 1 )); if ( $bugsbt_post_mode == 'edit' ) { $template->assign_block_vars( 'sub_tabs', array()); } } } } ?> --- NEW FILE: bugsbt_update_tree.php --- <?php /** * * @package mxBBmodule_mx_bugsbt * @version $Id: bugsbt_update_tree.php,v 1.1 2007/02/15 12:43:51 jonohlsson Exp $ * @copyright (c) 2002-2006 [wGEric, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Enter description here... * */ class mx_bugsbt_update_tree extends mx_bugsbt_public { /** * Enter description here... * * @param unknown_type $action */ function main( $action ) { global $template, $lang, $db, $phpEx, $bugsbt_config, $mx_request_vars, $userdata; global $mx_root_path, $module_root_path, $is_block, $phpEx; // // Request vars // $category_id = $mx_request_vars->request('cat', MX_TYPE_INT, ''); if ( empty( $category_id ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Product_not_exsist'] ); } // ======================================================= // If user not allowed to view article listing (read) and there is no sub Category // or the user is not allowed to view these category we gave him a nice message. // ======================================================= $show_category = false; if ( isset( $this->subcat_rowset[$category_id] ) ) { foreach( $this->subcat_rowset[$category_id] as $sub_cat_id => $sub_cat_row ) { if ( $this->auth_user[$sub_cat_id]['auth_view'] ) { $show_category = true; break; } } } if ( ( !$this->auth_user[$category_id]['auth_view'] ) && ( !$show_category ) ) { if ( !$userdata['session_logged_in'] ) { // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=". $this->this_mxurl("mode=cat&cat=" . $cat_id, true), true)); } $message = $lang['Not_authorized']; mx_message_die( GENERAL_MESSAGE, $message ); } if ( !isset( $this->cat_rowset[$category_id] ) ) { $message = $lang['Category_not_exsist'] . '<br /><br />' . sprintf( $lang['Click_return_bugsbt'], '<a href="' . append_sid( $this->this_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } // =================================================== // assign var for top navigation // =================================================== $this->generate_navigation( $category_id ); $build_id = $category_id; $new_bugs = $this->new_item_in_cat( $build_id ) > 0; $new_pre = $new_bugs ? '<b>' : ''; $new_post = $new_bugs ? '</b>' : ''; $items_in_cat = $this->items_in_cat( $build_id ); $build_name = $this->cat_rowset[$build_id]['category_name'] . ' (' . $new_pre . $items_in_cat . $new_post . ')' ; $edition_id = $this->cat_rowset[$this->cat_rowset[$build_id]['parent']]['category_id']; $new_bugs = $this->new_item_in_cat( $edition_id ) > 0; $new_pre = $new_bugs ? '<b>' : ''; $new_post = $new_bugs ? '</b>' : ''; $items_in_cat = $this->items_in_cat( $edition_id ); $edition_name = $this->cat_rowset[$edition_id]['category_name'] . ' (' . $new_pre . $items_in_cat . $new_post . ')' ; $product_id = $this->cat_rowset[$this->cat_rowset[$edition_id]['parent']]['category_id'];; $new_bugs = $this->new_item_in_cat( $product_id ) > 0; $new_pre = $new_bugs ? '<b>' : ''; $new_post = $new_bugs ? '</b>' : ''; $items_in_cat = $this->items_in_cat( $product_id ); $product_name = $this->cat_rowset[$product_id]['category_name'] . ' (' . $new_pre . $items_in_cat . $new_post . ')' ; // // Return new tree data for this product // die($build_name . ';' . $edition_name . ';' . $product_name); } } ?> --- NEW FILE: bugsbt_view.php --- <?php /** * * @package mxBBmodule_mx_bugsbt * @version $Id: bugsbt_view.php,v 1.1 2007/02/15 12:43:51 jonohlsson Exp $ * @copyright (c) 2002-2006 [wGEric, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Enter description here... * */ class mx_bugsbt_view extends mx_bugsbt_public { /** * Enter description here... * * @param unknown_type $action */ function main( $action ) { global $template, $lang, $theme, $db, $phpEx, $bugsbt_config, $mx_request_vars, $userdata; global $phpbb_root_path, $mx_root_path, $module_root_path, $is_block, $phpEx, $images; global $mx_bugsbt_custom_field, $mx_bugsbt_functions, $print_version, $board_config, $mx_block; // // Request vars // $start = $mx_request_vars->get('start', MX_TYPE_INT, 0); $bug_id = $mx_request_vars->request('k', MX_TYPE_INT, ''); // =================================================== // article doesn't exist' // =================================================== if ( empty( $bug_id ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Bug_not_exsist'] ); } // ======================================================= // article id is not set, give him/her a nice error message // ======================================================= switch ( SQL_LAYER ) { case 'oracle': $sql = "SELECT f.*, u.user_id, u.username, typ.type FROM " . BUGSBT_BUGS_TABLE . " AS f, " . USERS_TABLE . " AS u, " . BUGSBT_TYPES_TABLE . " AS typ WHERE f.bug_type = typ.id(+) AND f.bug_author_id = u.user_id(+) AND f.bug_id = $bug_id AND f.approved = 1 GROUP BY f.bug_id "; break; default: $sql = "SELECT f.*, u.user_id, u.username, typ.type FROM " . BUGSBT_BUGS_TABLE . " AS f LEFT JOIN " . BUGSBT_TYPES_TABLE . " AS typ ON f.bug_type = typ.id LEFT JOIN " . USERS_TABLE . " AS u ON f.bug_author_id = u.user_id WHERE f.bug_id = $bug_id AND f.approved = 1 GROUP BY f.bug_id "; break; } if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain bug data", '', __LINE__, __FILE__, $sql ); } if ( !$bugsbt_row = $db->sql_fetchrow( $result ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Bug_not_exsist'] ); } $db->sql_freeresult( $result ); // =================================================== // bugsbt auth for viewing article // =================================================== if ( ( !$this->auth_user[$bugsbt_row['bug_category_id']]['auth_view'] ) ) { $message = $lang['Bug_not_exsist'] . '<br /><br />' . sprintf( $lang['Click_return_bugsbt'], '<a href="' . append_sid( $this->this_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $phpbb_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } // =================================================== // Prepare bug info to display them // =================================================== $bug_title = $bugsbt_row['bug_title']; $bug_description = $bugsbt_row['bug_description']; $bug_category_id = $bugsbt_row['bug_category_id']; $build_name = $this->cat_rowset[$bug_category_id]['category_name']; $edition_name = $this->cat_rowset[$this->cat_rowset[$bug_category_id]['parent']]['category_name']; $product_name = $this->cat_rowset[$this->cat_rowset[$this->cat_rowset[$this->cat_rowset[$bug_category_id]['parent']]['category_id']]['parent']]['category_name']; $author_id = $bugsbt_row['bug_author_id']; $approved = $bugsbt_row['approved']; $date = create_date( $board_config['default_dateformat'], $bugsbt_row['bug_date'], $board_config['board_timezone'] ); $bug_type = isset($lang['bugsbt_type_' . $bugsbt_row['type']]) ? $lang['bugsbt_type_' . $bugsbt_row['type']] : $bugsbt_row['type']; $new_views = $bugsbt_row['views'] + 1; $board_config['allow_html_tags'] = $bugsbt_config['allowed_html_tags']; $bug = stripslashes( $bugsbt_row['bug_body'] ); $bbcode_uid = $bugsbt_row['bbcode_uid']; // // Toggles // $bbcode_on = !$bugsbt_config['allow_wysiwyg'] ? ($bugsbt_config['allow_bbcode'] ? true : false) : false; $html_on = !$bugsbt_config['allow_wysiwyg'] ? ($bugsbt_config['allow_html'] ? true : false) : true; $smilies_on = !$bugsbt_config['allow_wysiwyg'] ? ($bugsbt_config['allow_smilies'] ? true : false) : false; $this->page_title = $bug_title; // // Instantiate the mx_text and mx_text_formatting classes // $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 = $bugsbt_config['allow_wysiwyg'] ? true : false; $mx_text_formatting = new mx_text_formatting(); // // Decode bug for display // $bug_title = $mx_text->display_simple($bug_title); $bug_description = $mx_text->display_simple($bug_description); $bug = $mx_text->display($bug, $bbcode_uid); $bug = $mx_bugsbt_functions->article_formatting( $bug ); // // Remove Images and/or links // if (!$bugsbt_config['allow_images'] || !$bugsbt_config['allow_inks']) { $bug = $mx_text_formatting->remove_images_links( $bug, $bugsbt_config['allow_images'], $bugsbt_config['no_image_message'], $bugsbt_config['allow_links'], $bugsbt_config['no_link_message'] ); } // // Text formatting // if ( $bugsbt_config['max_subject_chars'] > 0 ) { $bug_title = $mx_text_formatting->truncate_text( $bug_title, $bugsbt_config['max_subject_chars'], true ); } if ( $bugsbt_config['max_description_chars'] > 0 ) { $bug_description = $mx_text_formatting->truncate_text( $bug_description, $bugsbt_config['max_description_chars'], true ); } if ( $bugsbt_config['max_chars'] > 0 ) { $bug = $mx_text_formatting->truncate_text( $bug, $bugsbt_config['max_chars'], true ); } if ( $bugsbt_config['formatting_truncate_links'] || $bugsbt_config['formatting_image_resize'] > 0 || $bugsbt_config['formatting_wordwrap'] ) { $bug = $mx_text_formatting->decode( $bug, $bugsbt_config['formatting_truncate_links'], intval($bugsbt_config['formatting_image_resize']), $bugsbt_config['formatting_wordwrap'] ); } // // Format text and data // //$temp_url = append_sid( $this->this_mxurl( "mode=cat&cat=$bug_category_id" ) ); //$build_name = '<a href="' . $temp_url . '" class="gensmall">' . $build_name . '</a>'; if ( $author_id == -1 ) { $author_bugsbt_art = ( $bugsbt_row['username'] == '' ) ? $lang['Guest'] : $bugsbt_row['username']; } else { $author_name = $bugsbt_row['username']; $temp_url = append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$author_id" ); $author_bugsbt_art = '<a href="' . $temp_url . '" class="gensmall">' . $author_name . '</a>'; } $views = '<b>' . $lang['Views'] . '</b> ' . $new_views; $sql = "UPDATE " . BUGSBT_BUGS_TABLE . " SET views = '" . $new_views . "' WHERE bug_id = " . $bug_id; if ( !( $result2 = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update bug's views", '', __LINE__, __FILE__, $sql ); } // // Edit buttons // if ( ( $userdata['user_id'] == $author_id && $this->auth_user[$bug_category_id]['auth_edit'] ) || $this->auth_user[$bug_category_id]['auth_mod'] ) { $temp_url = append_sid( $this->this_mxurl( "mode=edit&k=" . $bug_id ) ); $edit_img = '<a href="' . $temp_url . '"><img src="' . $images['bugsbt_icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>'; $edit = '<a href="javascript:editBug(\''.$bug_id.'\');">' . $lang['Edit_delete_post'] . '</a>'; } else { $edit_img = ''; $edit = ''; } // // Delete buttons // if ( ( $userdata['user_id'] == $author_id && $this->auth_user[$bug_category_id]['auth_delete'] ) || $this->auth_user[$bug_category_id]['auth_mod'] ) { $temp_url = append_sid( $this->this_mxurl( "mode=edit&do=delete&k=" . $bug_id ) ); $delete_img = '<a href="javascript:delete_item(\'' . $temp_url . '\')"><img src="' . $images['bugsbt_icon_delpost'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>'; $delete = '<a href="javascript:deleteBug(\''.$bug_id.'\');">' . $lang['Edit_delete_post'] . '</a>'; } else { $delete_img = ''; $delete = ''; } // // If this is an allowed bug, go ahead and display it // if ( !$this->auth_user[$bug_category_id]['auth_view'] || !$bug_title || ( !$approved && !$this->auth_user[$bug_category_id]['auth_mod'] ) ) { $message = $lang['Bug_not_exsist'] . '<br /><br />' . sprintf( $lang['Click_return_bugsbt'], '<a href="' . append_sid( $this->this_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $phpbb_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } else { // // Start output of page // $template->set_filenames( array( 'body' => 'bugsbt_view_body.tpl' ) ); $template->assign_vars( array( 'PAGINATION' => $pagination, 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $bugsbt_config['comments_pagination'] ) + 1 ), ceil( $num_of_replies / $bugsbt_config['comments_pagination'] ) ), 'L_GOTO_PAGE' => $lang['Goto_page'], 'L_BUG_DESCRIPTION' => $lang['Bug_description'], 'L_BUG_DATE' => $lang['Date'], 'L_BUG_TYPE' => $lang['Bug_type'], 'L_BUG_PRODUCT' => $lang['Product'], 'L_BUG_EDITION' => $lang['Edition'], 'L_BUG_BUILD' => $lang['Build'], 'L_BUG_AUTHOR' => $lang['Reporter'], 'L_GOTO_PAGE' => $lang['Goto_page'], 'L_TOC' => $lang['TOC'], 'L_COMMENTS' => $lang['Comments_show_title'], 'BUG_ID' => $bug_id, 'BUG_TITLE' => $bug_title, 'BUG_AUTHOR' => $author_bugsbt_art, 'BUG_PRODUCT' => $product_name, 'BUG_EDITION' => $edition_name, 'BUG_BUILD' => $build_name, 'BUG_TEXT' => $bug, 'BUG_DESCRIPTION' => $bug_description, 'BUG_DATE' => $date, 'BUG_TYPE' => $bug_type, 'EDIT_IMG' => $edit_img, 'DELETE_IMG' => $delete_img, 'EDIT' => $edit, 'DELETE' => $delete, 'VIEWS' => $views, 'T_TH_COLOR1' => '#'.$theme['th_color1'], // Border Colors (main) ) ); } // // Instantiate custom fields // $mx_bugsbt_custom_field = new mx_custom_field(BUGSBT_CUSTOM_TABLE, BUGSBT_CUSTOM_DATA_TABLE); $mx_bugsbt_custom_field->init(); $mx_bugsbt_custom_field->display_data( $bug_id ); // // Comments // if ( $this->comments[$bug_category_id]['activated'] && $this->auth_user[$bug_category_id]['auth_view_comment']) { $comments_type = $this->comments[$bug_category_id]['internal_comments'] ? 'internal' : 'phpbb'; // // Instatiate comments // include_once( $module_root_path . 'bugsbt/includes/functions_comment.' . $phpEx ); $mx_bugsbt_comments = new mx_bugsbt_comments(); $mx_bugsbt_comments->init( $bugsbt_row, $comments_type ); $mx_bugsbt_comments->display_comments(); } // // assign var for top navigation // //$this->generate_navigation( $bug_category_id ); // // User authorisation levels output // //$this->auth_can($bug_category_id); // // Get footer quick dropdown jumpbox // //$this->generate_jumpbox( 'auth_view', $bug_category_id, $bug_category_id, true ); //$this->generate_jumpbox( 0, 0, array( $bug_category_id => 1 )); $template->assign_block_vars( 'sub_tabs', array()); } } ?> --- NEW FILE: bugsbt_product.php --- <?php /** * * @package mxBBmodule_mx_bugsbt * @version $Id: bugsbt_product.php,v 1.1 2007/02/15 12:43:50 jonohlsson Exp $ * @copyright (c) 2002-2006 [wGEric, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Enter description here... * */ class mx_bugsbt_product extends mx_bugsbt_public { /** * Enter description here... * * @param unknown_type $action */ function main( $action ) { global $template, $lang, $db, $phpEx, $bugsbt_config, $mx_request_vars, $userdata; global $mx_root_path, $module_root_path, $is_block, $phpEx; // // Request vars // $start = $mx_request_vars->get('start', MX_TYPE_INT, 0); $category_id = $mx_request_vars->request('cat', MX_TYPE_INT, ''); if ( empty( $category_id ) ) { mx_message_die( GENERAL_MESSAGE, $lang['Product_not_exsist'] ); } // // Sorting of items // if ( isset( $_REQUEST['sort_method'] ) ) { switch ( $_REQUEST['sort_method'] ) { case 'Id': $this->sort_method = 't.article_id'; $this->sort_method_extra = 't.article_type' . " DESC, " ; break; case 'Latest': $this->sort_method = 't.article_date'; $this->sort_method_extra = 't.article_type' . " DESC, " ; break; case 'Toprated': $this->sort_method = 'rating'; $this->sort_method_extra = 't.article_type' . " DESC, " ; break; case 'Most_popular': $this->sort_method = 't.views'; $this->sort_method_extra = 't.article_type' . " DESC, " ; break; case 'Userrank': $this->sort_method = 'u.user_rank'; $this->sort_method_extra = 't.article_type' . " DESC, " ; break; case 'Alphabetic': $this->sort_method = 't.article_title'; $this->sort_method_extra = 't.article_type' . " DESC, " ; break; } } if ( isset( $_REQUEST['sort_order'] ) ) { switch ( $_REQUEST['sort_order'] ) { case 'ASC': $this->sort_order = 'ASC'; break; case 'DESC': $this->sort_order = 'DESC'; break; } } // ======================================================= // If user not allowed to view article listing (read) and there is no sub Category // or the user is not allowed to view these category we gave him a nice message. // ======================================================= $show_category = false; if ( isset( $this->subcat_rowset[$category_id] ) ) { foreach( $this->subcat_rowset[$category_id] as $sub_cat_id => $sub_cat_row ) { if ( $this->auth_user[$sub_cat_id]['auth_view'] ) { $show_category = true; break; } } } if ( ( !$this->auth_user[$category_id]['auth_view'] ) && ( !$show_category ) ) { if ( !$userdata['session_logged_in'] ) { // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=". $this->this_mxurl("mode=cat&cat=" . $cat_id, true), true)); } $message = $lang['Not_authorized']; mx_message_die( GENERAL_MESSAGE, $message ); } if ( !isset( $this->cat_rowset[$category_id] ) ) { $message = $lang['Category_not_exsist'] . '<br /><br />' . sprintf( $lang['Click_return_bugsbt'], '<a href="' . append_sid( $this->this_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } // // Validate Comments Setup // if ( $this->comments[$category_id]['activated'] && !$this->comments[$category_id]['internal_comments'] && $this->comments[$category_id]['comments_forum_id'] < 1 ) { // // Commenting is enabled but no category forum id specified // $message = $lang['No_cat_comments_forum_id']; mx_message_die(GENERAL_MESSAGE, $message); } // // Vars // $category_name = $this->cat_rowset['category_name']; $this->page_title = $category_name; $template->set_filenames( array( 'body' => 'bugsbt_product_body.tpl' ) ); $template->assign_vars( array( // List Header 'L_ID' => $lang['bugsbt_Bug_id'], 'L_CLOSED' => $lang['bugsbt_Bug_closed'], 'L_NAME' => $lang['bugsbt_Bug_name'], 'L_EDITION_BUILD' => $lang['bugsbt_Bug_edition_build'], 'L_STATUS' => $lang['bugsbt_Bug_status'], 'L_REPORTED' => $lang['bugsbt_Bug_reported'], 'U_CAT' => append_sid( $this->this_mxurl( 'mode=cat&cat=' . $category_id ) ) ) ); // =================================================== // assign var for top navigation // =================================================== $this->generate_navigation( $category_id ); // // User authorisation levels output // $this->auth_can($category_id); // // get sub-cats // if ( isset( $this->subcat_rowset[$category_id] ) ) { //$this->display_categories( $category_id ); } // // Get articles // $this->list_items( $category_id ); // // Get footer quick dropdown jumpbox // //$this->generate_jumpbox( 'auth_view', $category_id, $category_id, true ); $this->generate_jumpbox( 0, 0, array( $category_id => 1 )); } } ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |