|
From: Jon O. <jon...@us...> - 2006-06-27 18:13:50
|
Update of /cvsroot/mxbb/mx_kb/kb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8125/modules/mx_kb/kb/includes Modified Files: functions.php functions_kb.php Log Message: Updating install schemas etc Minor fresh install tweaks Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** functions.php 17 Jun 2006 20:11:23 -0000 1.6 --- functions.php 27 Jun 2006 18:13:45 -0000 1.7 *************** *** 1513,1517 **** { $temp_url = append_sid( this_kb_mxurl() ); ! $block_title = '<td align="center"><a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $title . '"></a></td>'; } else --- 1513,1517 ---- { $temp_url = append_sid( this_kb_mxurl() ); ! $block_title = '<td align="center" class="row1"><a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $title . '"></a></td>'; } else *************** *** 1599,1603 **** 'L_MODULE_ORIG_AUTHOR' => $kb_module_orig_author, 'L_MODULE_AUTHOR' => $kb_module_author, ! 'DEBUG' => !empty($debug_message) ? '<div style="overflow:auto; height:100px;"><span class="gensmall">' . $debug_message . '<br/> -::-</span></div>': '', )); --- 1599,1603 ---- 'L_MODULE_ORIG_AUTHOR' => $kb_module_orig_author, 'L_MODULE_AUTHOR' => $kb_module_author, ! 'DEBUG' => !empty($debug_message) && $mx_kb->debug ? '<div style="overflow:auto; height:100px;"><span class="gensmall">' . $debug_message . '<br/> -::-</span></div>': '', )); Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_kb.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** functions_kb.php 25 Jun 2006 21:55:12 -0000 1.7 --- functions_kb.php 27 Jun 2006 18:13:45 -0000 1.8 *************** *** 87,91 **** var $navigation = ''; ! var $debug = true; var $debug_msg = array(); --- 87,91 ---- var $navigation = ''; ! var $debug = false; // Toggle debug output on/off var $debug_msg = array(); *************** *** 1057,1060 **** --- 1057,1066 ---- $this->debug('mx_kb->display_categories', basename( __FILE__ )); + if ( $this->cat_empty() ) + { + mx_message_die( GENERAL_ERROR, 'Either you are not allowed to view any category, or there is no category in the database' ); + } + + $num_of_cats = 0; foreach( $this->subcat_rowset[$parent] as $category_id => $category ) { *************** *** 1067,1070 **** --- 1073,1077 ---- $show_sub_categories = false; + // // Auth *************** *** 1072,1075 **** --- 1079,1083 ---- if ( $this->ns_auth_cat( $category_id ) && $this->auth_user[$category_id]['auth_view']) { + $num_of_cats++; $show_sub_categories = true; *************** *** 1108,1111 **** --- 1116,1126 ---- } + if ( $num_of_cats == 0 ) + { + $template->assign_block_vars( 'no_cats', array( + 'COMMENT' => 'Either you are not allowed to view any category, or you haven\'t selected any KB categories to use in this block. Admin should validate the blockCP settings. ', + )); + } + if ($show_sub_categories) { |