|
From: Jon O. <jon...@us...> - 2006-07-03 20:11:35
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30987/modules/mx_linkdb/linkdb/includes Modified Files: functions.php functions_auth.php functions_linkdb.php Log Message: Working... Index: functions_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_auth.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions_auth.php 1 Jul 2006 21:32:19 -0000 1.1 --- functions_auth.php 3 Jul 2006 20:11:30 -0000 1.2 *************** *** 113,120 **** if ( empty($f_access) ) { ! $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.category_id = $cat_id" : ''; ! $sql = "SELECT a.category_id, $a_sql ! FROM " . KB_CATEGORIES_TABLE . " a $forum_match_sql"; if ( !($result = $db->sql_query($sql)) ) --- 113,120 ---- if ( empty($f_access) ) { ! $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.cat_id = $cat_id" : ''; ! $sql = "SELECT a.cat_id, $a_sql ! FROM " . LINK_CATEGORIES_TABLE . " a $forum_match_sql"; if ( !($result = $db->sql_query($sql)) ) *************** *** 139,146 **** if ( empty($f_access_group) ) { ! $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.category_id = $cat_id" : ''; ! $sql = "SELECT a.category_id, $a_sql_groups, a.auth_moderator_groups ! FROM " . KB_CATEGORIES_TABLE . " a $forum_match_sql"; if ( !($result = $db->sql_query($sql)) ) --- 139,146 ---- if ( empty($f_access_group) ) { ! $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.cat_id = $cat_id" : ''; ! $sql = "SELECT a.cat_id, $a_sql_groups, a.auth_moderator_groups ! FROM " . LINK_CATEGORIES_TABLE . " a $forum_match_sql"; if ( !($result = $db->sql_query($sql)) ) *************** *** 221,225 **** $value_groups = $f_access_group[$k][$key_groups]; ! $f_cat_id = $f_access[$k]['category_id']; --- 221,225 ---- $value_groups = $f_access_group[$k][$key_groups]; ! $f_cat_id = $f_access[$k]['cat_id']; *************** *** 275,279 **** for($k = 0; $k < count($f_access); $k++) { ! $f_cat_id = $f_access[$k]['category_id']; $this->auth_user[$f_cat_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access_group[$k]['auth_moderator_groups'] ) || $is_admin : 0; --- 275,279 ---- for($k = 0; $k < count($f_access); $k++) { ! $f_cat_id = $f_access[$k]['cat_id']; $this->auth_user[$f_cat_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access_group[$k]['auth_moderator_groups'] ) || $is_admin : 0; Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** functions.php 1 Jul 2006 21:32:18 -0000 1.8 --- functions.php 3 Jul 2006 20:11:30 -0000 1.9 *************** *** 1534,1538 **** 'S_TIMEZONE' => sprintf( $lang['All_times'], $lang[number_format( $board_config['board_timezone'] )] ), - 'LINKDB_VERSION' => $linkdb_config['linkdb_versions'], //'S_AUTH_LIST' => $mx_kb->modules[$mx_kb->module_name]->auth_can_list, --- 1534,1537 ---- Index: functions_linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_linkdb.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** functions_linkdb.php 3 Jul 2006 12:23:30 -0000 1.10 --- functions_linkdb.php 3 Jul 2006 20:11:30 -0000 1.11 *************** *** 23,29 **** /** ! * Enter description here... * ! * @param unknown_type $module_name */ function adminmodule( $module_name ) --- 23,29 ---- /** ! * load admin module * ! * @param unknown_type $module_name send module name to load it */ function adminmodule( $module_name ) *************** *** 46,52 **** /** ! * Enter description here... * ! * @param unknown_type $module_name */ function module( $module_name ) --- 46,52 ---- /** ! * load module * ! * @param unknown_type $module_name send module name to load it */ function module( $module_name ) *************** *** 68,74 **** } ! // ! // this will be replaced by the loaded module ! // function main( $module_id = false ) { --- 68,77 ---- } ! /** ! * this will be replaced by the loaded module ! * ! * @param unknown_type $module_id ! * @return unknown ! */ function main( $module_id = false ) { *************** *** 76,84 **** } ! // ! // go ahead and output the page ! // $page title : send page title ! // $tpl_name : template file name ! // function display( $page_title1, $tpl_name ) { --- 79,88 ---- } ! /** ! * go ahead and output the page ! * ! * @param unknown_type $page_title send page title ! * @param unknown_type $tpl_name template file name ! */ function display( $page_title1, $tpl_name ) { *************** *** 116,123 **** var $debug_msg = array(); - // Specific for linkdb - var $auth = array(); - var $auth_global = array(); - /** * Prepare data --- 120,123 ---- *************** *** 126,130 **** function init() { ! global $db, $userdata, $debug; unset( $this->cat_rowset ); --- 126,130 ---- function init() { ! global $db, $userdata, $debug, $linkdb_config; unset( $this->cat_rowset ); *************** *** 147,155 **** $db->sql_freeresult( $result ); ! //$this->auth( AUTH_ALL, AUTH_LIST_ALL, $userdata, $cat_rowset ); for( $i = 0; $i < count( $cat_rowset ); $i++ ) { ! if ( $this->auth_user[$cat_rowset[$i]['category_id']]['auth_view'] || true) { $this->cat_rowset[$cat_rowset[$i]['cat_id']] = $cat_rowset[$i]; --- 147,155 ---- $db->sql_freeresult( $result ); ! $this->auth( AUTH_ALL, AUTH_LIST_ALL, $userdata, $cat_rowset ); for( $i = 0; $i < count( $cat_rowset ); $i++ ) { ! if ( $this->auth_user[$cat_rowset[$i]['cat_id']]['auth_view'] ) { $this->cat_rowset[$cat_rowset[$i]['cat_id']] = $cat_rowset[$i]; *************** *** 158,174 **** } - /* // // Comments // 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']]['internal_comments'] && intval($this->comments[$cat_rowset[$i]['category_id']]['comments_forum_id']) < 1) { ! mx_message_die(GENERAL_ERROR, 'Init Failure, phpBB comments with no target forum_id :(<br> Category: ' . $cat_rowset[$i]['category_name'] . ' Forum_id: ' . $this->comments[$cat_rowset[$i]['category_id']]['comments_forum_id']); } --- 158,173 ---- } // // Comments // Note: some settings are category dependent, but may use default config settings // ! $this->comments[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['cat_allow_comments'] == -1 ? ($linkdb_config['use_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_comments'] == 1 ? true : false ); ! $this->comments[$cat_rowset[$i]['cat_id']]['internal_comments'] = $cat_rowset[$i]['internal_comments'] == -1 ? ($linkdb_config['internal_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['internal_comments'] == 1 ? true : false ); // phpBB or internal comments ! $this->comments[$cat_rowset[$i]['cat_id']]['autogenerate_comments'] = $cat_rowset[$i]['autogenerate_comments'] == -1 ? ($linkdb_config['autogenerate_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['autogenerate_comments'] == 1 ? true : false ); // autocreate comments when updated ! $this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id'] = $cat_rowset[$i]['comments_forum_id'] < 1 ? ( intval($linkdb_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]['cat_id']]['internal_comments'] && intval($this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']) < 1) { ! mx_message_die(GENERAL_ERROR, 'Init Failure, phpBB comments with no target forum_id :(<br> Category: ' . $cat_rowset[$i]['cat_name'] . ' Forum_id: ' . $this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']); } *************** *** 176,192 **** // Ratings // ! $this->ratings[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['cat_allow_ratings'] == -1 ? ($kb_config['use_ratings'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_ratings'] == 1 ? true : false ); // // 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 ! */ } } --- 175,190 ---- // Ratings // ! $this->ratings[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['cat_allow_ratings'] == -1 ? ($linkdb_config['use_ratings'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_ratings'] == 1 ? true : false ); // // Information // ! $this->information[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['show_pretext'] == -1 ? ($linkdb_config['show_pretext'] == 1 ? true : false ) : ( $cat_rowset[$i]['show_pretext'] == 1 ? true : false ); // phpBB or internal ratings // // Notification // ! $this->notification[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['notify'] == -1 ? (intval($linkdb_config['notify'])) : ( intval($cat_rowset[$i]['notify']) ); // -1, 0, 1, 2 ! $this->notification[$cat_rowset[$i]['cat_id']]['notify_group'] = $cat_rowset[$i]['notify_group'] == -1 || $cat_rowset[$i]['notify_group'] == 0 ? (intval($linkdb_config['notify_group'])) : ( intval($cat_rowset[$i]['notify_group']) ); // Group_id } } *************** *** 241,244 **** --- 239,246 ---- } + /** + * Enter description here... + * + */ function sync_all() { *************** *** 250,253 **** --- 252,261 ---- } + /** + * Enter description here... + * + * @param unknown_type $cat_id + * @param unknown_type $init + */ function sync( $cat_id, $init = true ) { *************** *** 268,271 **** --- 276,282 ---- $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " SET cat_links = '-1' + cat_last_link_id = '0', + cat_last_link_name = '', + cat_last_link_time = '0' WHERE cat_id = '" . $cat_id . "'"; *************** *** 281,284 **** --- 292,301 ---- } + /** + * Enter description here... + * + * @param unknown_type $parent_id + * @param unknown_type $cat_nav + */ function category_nav( $parent_id, &$cat_nav ) { *************** *** 291,297 **** } ! // ! // if there is no cat ! // function cat_empty() { --- 308,316 ---- } ! /** ! * if there is no cat ! * ! * @return unknown ! */ function cat_empty() { *************** *** 299,302 **** --- 318,326 ---- } + /** + * Enter description here... + * + * @param unknown_type $true_false + */ function modified( $true_false = false ) { *************** *** 304,307 **** --- 328,337 ---- } + /** + * Enter description here... + * + * @param unknown_type $cat_id + * @return unknown + */ function file_in_cat( $cat_id ) { *************** *** 344,357 **** } ! // ! // Jump menu function ! // $cat_id : to handle parent cat_id ! // $depth : related to function to generate tree ! // $default : the cat you wanted to be selected ! // $for_file: TRUE high category ids will be -1 ! // $check_upload: if true permission for upload will be checked ! // function generate_jumpbox( $cat_id = 0, $depth = 0, $default = '', $for_file = false, $check_upload = false ) { static $cat_rowset = false; --- 374,390 ---- } ! /** ! * Jump menu function. ! * ! * @param unknown_type $cat_id to handle parent cat_id ! * @param unknown_type $depth related to function to generate tree ! * @param unknown_type $default the cat you wanted to be selected ! * @param unknown_type $for_file TRUE high category ids will be -1 ! * @param unknown_type $check_upload if true permission for upload will be checked ! * @return unknown ! */ function generate_jumpbox( $cat_id = 0, $depth = 0, $default = '', $for_file = false, $check_upload = false ) { + global $page_id; static $cat_rowset = false; *************** *** 364,368 **** foreach( $this->cat_rowset as $row ) { ! $cat_rowset[$row['cat_id']] = $row; } } --- 397,404 ---- foreach( $this->cat_rowset as $row ) { ! if ( $this->auth_user[$row['cat_id']]['auth_post'] ) ! { ! $cat_rowset[$row['cat_id']] = $row; ! } } } *************** *** 398,402 **** } - $cat['cat_allow_file'] = 1; // added by CRLin $cat_pre = ( !$cat['cat_allow_file'] ) ? '+ ' : '- '; $sub_cat_id = ( $for_file ) ? ( ( !$cat['cat_allow_file'] ) ? -1 : $cat['cat_id'] ) : $cat['cat_id']; --- 434,437 ---- *************** *** 414,428 **** } ! // ! // get all sub category in side certain category ! // $cat_id : category id ! // function get_sub_cat( $cat_id ) { global $mx_root_path, $module_root_path, $is_block, $phpEx; ! $cat_sub .= ''; if ( !empty( $this->subcat_rowset[$cat_id] ) ) { $cat_id1 = $cat_id; $class = "gensmall"; --- 449,512 ---- } ! /** ! * Enter description here... ! * ! * get all sub category in side certain category ! * ! * @param unknown_type $cat_id ! * @return unknown ! */ function get_sub_cat( $cat_id ) { global $mx_root_path, $module_root_path, $is_block, $phpEx; ! $cat_sub = ''; if ( !empty( $this->subcat_rowset[$cat_id] ) ) { + $class = "gensmall"; + $init_link_max = ( count( $this->subcat_rowset[$cat_id] ) > 3 ) ? 3 : count( $this->subcat_rowset[$cat_id] ); + $truncate = false; + $i = 0; + foreach( $this->subcat_rowset[$cat_id] as $cat_id => $cat_row ) + { + if ( $cat_row['cat_allow_file'] ) + { + $i++; + if ($i > $init_link_max) + { + $truncate = true; + break; + } + $cat_sub .= (!empty($cat_sub) ? '<span class=' . $class . '>, </span>' : '') . '<a href="' . append_sid( linkdb_this_mxurl( 'action=category&cat_id=' . $cat_row['cat_id'] ) ) . '" class=' . $class . '>' . $cat_row['cat_name'] . '</a> '; + } + else + { + if ( !empty( $this->subcat_rowset[$cat_row['cat_id']] ) ) + { + foreach( $this->subcat_rowset[$cat_row['cat_id']] as $sub_cat_id => $sub_cat_row ) + { + if ( $sub_cat_row['cat_allow_file'] ) + { + $i++; + if ($i > $init_link_max) + { + $truncate = true; + break; + } + $cat_sub .= (!empty($cat_sub) ? '<span class=' . $class . '>, </span>' : '') . '<a href="' . append_sid( linkdb_this_mxurl( 'action=category&cat_id=' . $sub_cat_row['cat_id'] ) ) . '" class=' . $class . '>' . $sub_cat_row['cat_name'] . '</a> '; + } + } + } + } + } + + if ($truncate) + { + $cat_sub .= '<span class=' . $class . '>, ...</span>'; + } + } + return $cat_sub; + + /* $cat_id1 = $cat_id; $class = "gensmall"; *************** *** 447,454 **** } } ! } ! return $cat_sub; } function generate_navigation( $cat_id ) { --- 531,542 ---- } } ! */ } + /** + * Enter description here... + * + * @param unknown_type $cat_id + */ function generate_navigation( $cat_id ) { *************** *** 499,506 **** * @return unknown */ - /* function new_file_in_cat( $cat_id ) { ! global $pafiledb_config, $board_config, $db, $_COOKIE; $cat_array = explode(',', $this->gen_cat_ids( $cat_id )); --- 587,593 ---- * @return unknown */ function new_file_in_cat( $cat_id ) { ! global $linkdb_config, $board_config, $db, $_COOKIE; $cat_array = explode(',', $this->gen_cat_ids( $cat_id )); *************** *** 508,516 **** $files_new = 0; ! $time = time() - ( $pafiledb_config['settings_newdays'] * 24 * 60 * 60 ); foreach ( $cat_array as $key => $cat_id ) { ! if ( $this->auth[$cat_id]['auth_read'] && $this->cat_rowset[$cat_id]['cat_last_file_time'] > $time) { $files_new++; --- 595,603 ---- $files_new = 0; ! $time = time() - ( $linkdb_config['settings_newdays'] * 24 * 60 * 60 ); foreach ( $cat_array as $key => $cat_id ) { ! if ( $this->auth_user[$cat_id]['auth_view'] && $this->cat_rowset[$cat_id]['cat_last_link_time'] > $time) { $files_new++; *************** *** 520,528 **** return $files_new; } - */ ! /*function last_file_in_cat($cat_id, &$file_info) { ! if((empty($this->cat_rowset[$cat_id]['cat_last_file_id']) && empty($this->cat_rowset[$cat_id]['cat_last_file_name']) && empty($this->cat_rowset[$cat_id]['cat_last_file_time'])) || $this->modified) { global $db; --- 607,620 ---- return $files_new; } ! /** ! * Enter description here... ! * ! * @param unknown_type $cat_id ! * @param unknown_type $file_info ! */ ! function last_file_in_cat( $cat_id, &$file_info ) { ! if ( ( empty( $this->cat_rowset[$cat_id]['cat_last_file_id'] ) && empty( $this->cat_rowset[$cat_id]['cat_last_file_name'] ) && empty( $this->cat_rowset[$cat_id]['cat_last_file_time'] ) ) || $this->modified ) { global $db; *************** *** 531,543 **** FROM ' . LINKS_TABLE . " WHERE file_approved = '1' ! AND file_catid IN (" . $this->gen_cat_ids($cat_id) . ") ORDER BY file_time DESC"; ! if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Couldnt Query Files info', '', __LINE__, __FILE__, $sql); } ! while($row = $db->sql_fetchrow($result)) { $temp_cat[] = $row; --- 623,635 ---- FROM ' . LINKS_TABLE . " WHERE file_approved = '1' ! AND file_catid IN (" . $this->gen_cat_ids( $cat_id ) . ") ORDER BY file_time DESC"; ! if ( !( $result = $db->sql_query( $sql, 300 ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldnt Query Files info', '', __LINE__, __FILE__, $sql ); } ! while ( $row = $db->sql_fetchrow( $result ) ) { $temp_cat[] = $row; *************** *** 545,559 **** $file_info = $temp_cat[0]; ! if(!empty($file_info)) { $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " ! SET cat_last_file_id = " . intval($file_info['file_id']) . ", ! cat_last_file_name = '" . addslashes($file_info['file_name']) . "', ! cat_last_file_time = " . intval($file_info['file_time']) . " WHERE cat_id = $cat_id"; ! if ( !($db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Couldnt Query Files info', '', __LINE__, __FILE__, $sql); } } --- 637,651 ---- $file_info = $temp_cat[0]; ! if ( !empty( $file_info ) ) { $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " ! SET cat_last_file_id = " . intval( $file_info['file_id'] ) . ", ! cat_last_file_name = '" . addslashes( $file_info['file_name'] ) . "', ! cat_last_file_time = " . intval( $file_info['file_time'] ) . " WHERE cat_id = $cat_id"; ! if ( !( $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldnt Query Files info', '', __LINE__, __FILE__, $sql ); } } *************** *** 565,570 **** $file_info['file_time'] = $this->cat_rowset[$cat_id]['cat_last_file_time']; } ! }*/ function gen_cat_ids( $cat_id, $cat_ids = '' ) { --- 657,669 ---- $file_info['file_time'] = $this->cat_rowset[$cat_id]['cat_last_file_time']; } ! } + /** + * Enter description here... + * + * @param unknown_type $cat_id + * @param unknown_type $cat_ids + * @return unknown + */ function gen_cat_ids( $cat_id, $cat_ids = '' ) { *************** *** 584,587 **** --- 683,691 ---- } + /** + * Enter description here... + * + * @param unknown_type $cat_id + */ function display_categories( $cat_id = LINKDB_ROOT_CAT ) { *************** *** 600,610 **** $template->assign_block_vars( 'CAT_PARENT', array() ); - $template->assign_vars( array( 'L_SUB_CAT' => $lang['Sub_category'], 'L_CATEGORY' => $lang['Category'], 'L_FILES' => $lang['Files'] ) ); // output the root level category if ( isset( $this->subcat_rowset[$cat_id] ) ) { --- 704,717 ---- $template->assign_block_vars( 'CAT_PARENT', array() ); $template->assign_vars( array( 'L_SUB_CAT' => $lang['Sub_category'], 'L_CATEGORY' => $lang['Category'], + 'L_LAST_FILE' => $lang['Last_file'], 'L_FILES' => $lang['Files'] ) ); + + // // output the root level category + // if ( isset( $this->subcat_rowset[$cat_id] ) ) { *************** *** 628,634 **** $sub_cat = $this->get_sub_cat( $subcat_id ); ! $template->assign_block_vars( ! 'CAT_PARENT.catcol.no_cat_parent', array( 'U_CAT' => append_sid( linkdb_this_mxurl( 'action=category&cat_id=' . $subcat_id ) ), ! // 'SUB_CAT' => ( !empty($sub_cat) ) ? $sub_cat : $lang['None'], 'SUB_CAT' => ( !empty( $sub_cat ) ) ? " $sub_cat" : "", 'CAT_IMAGE' => $images['linkdb_folder'], --- 735,740 ---- $sub_cat = $this->get_sub_cat( $subcat_id ); ! $template->assign_block_vars( 'CAT_PARENT.catcol.no_cat_parent', array( ! 'U_CAT' => append_sid( linkdb_this_mxurl( 'action=category&cat_id=' . $subcat_id ) ), 'SUB_CAT' => ( !empty( $sub_cat ) ) ? " $sub_cat" : "", 'CAT_IMAGE' => $images['linkdb_folder'], *************** *** 801,805 **** ); ! if ( $linkdb_config['allow_vote'] ) { $template->assign_block_vars( "FILELIST.file_rows.LINK_VOTE", array() ); --- 907,911 ---- ); ! if ( UPDATEUPDATE ) { $template->assign_block_vars( "FILELIST.file_rows.LINK_VOTE", array() ); *************** *** 920,924 **** $cat_order += 10; ! $sql = 'INSERT INTO ' . LINK_CATEGORIES_TABLE . " (cat_name, cat_desc, cat_parent, cat_order, cat_allow_file, cat_allow_ratings, cat_allow_comments, internal_comments, autogenerate_comments, comments_forum_id, show_pretext, notify, notify_group, 'auth_view', 'auth_post', 'auth_rate', 'auth_comment', 'auth_edit', 'auth_delete', 'auth_approval', 'auth_approval_edit') VALUES('$cat_name', '$cat_desc', $cat_parent, $cat_order, $cat_allow_file, $cat_use_ratings, $cat_use_comments, $cat_internal_comments, $cat_autogenerate_comments, $comments_forum_id, $cat_show_pretext, $cat_notify, $cat_notify_group, $view_level, $post_level, $rate_level, $comment_level, $edit_level, $delete_level, $approval_level, $approval_edit_level)"; --- 1026,1030 ---- $cat_order += 10; ! $sql = 'INSERT INTO ' . LINK_CATEGORIES_TABLE . " (cat_name, cat_desc, cat_parent, cat_order, cat_allow_file, cat_allow_ratings, cat_allow_comments, internal_comments, autogenerate_comments, comments_forum_id, show_pretext, notify, notify_group, auth_view, auth_post, auth_rate, auth_comment, auth_edit, auth_delete, auth_approval, auth_approval_edit) VALUES('$cat_name', '$cat_desc', $cat_parent, $cat_order, $cat_allow_file, $cat_use_ratings, $cat_use_comments, $cat_internal_comments, $cat_autogenerate_comments, $comments_forum_id, $cat_show_pretext, $cat_notify, $cat_notify_group, $view_level, $post_level, $rate_level, $comment_level, $edit_level, $delete_level, $approval_level, $approval_edit_level)"; *************** *** 1212,1216 **** $file_long_desc = ( isset( $_POST['long_desc'] ) ) ? $_POST['long_desc'] : ''; ! if ( $linkdb_config['link_validation'] == 1 ) { $file_approved = ( isset( $_POST['approved'] ) ) ? intval( $_POST['approved'] ) : 0; --- 1318,1322 ---- $file_long_desc = ( isset( $_POST['long_desc'] ) ) ? $_POST['long_desc'] : ''; ! if ( UPDATEUPDATE ) { $file_approved = ( isset( $_POST['approved'] ) ) ? intval( $_POST['approved'] ) : 0; *************** *** 1311,1315 **** function update_add_comment($file_data = '', $item_id, $cid, $subject = '', $message = '', $html_on = false, $bbcode_on = true, $smilies_on = false) { ! global $pafiledb_template, $pafiledb_functions, $lang, $board_config, $phpEx, $pafiledb_config, $db, $images, $userdata; global $html_entities_match, $html_entities_replace, $unhtml_specialchars_match, $unhtml_specialchars_replace; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars; --- 1417,1421 ---- function update_add_comment($file_data = '', $item_id, $cid, $subject = '', $message = '', $html_on = false, $bbcode_on = true, $smilies_on = false) { ! global $template, $linkdb_functions, $lang, $board_config, $phpEx, $linkdb_config, $db, $images, $userdata; global $html_entities_match, $html_entities_replace, $unhtml_specialchars_match, $unhtml_specialchars_replace; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars; *************** *** 1361,1367 **** $comment_bbcode_uid = $mx_text->bbcode_uid; ! if ( $length > $pafiledb_config['max_comment_chars'] ) { ! mx_message_die( GENERAL_ERROR, 'Your comment is too long!<br/>The maximum length allowed in characters is ' . $pafiledb_config['max_comment_chars'] . '' ); } --- 1467,1473 ---- $comment_bbcode_uid = $mx_text->bbcode_uid; ! if ( $length > $linkdb_config['max_comment_chars'] ) { ! mx_message_die( GENERAL_ERROR, 'Your comment is too long!<br/>The maximum length allowed in characters is ' . $linkdb_config['max_comment_chars'] . '' ); } *************** *** 1384,1392 **** else { ! include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); ! $pafiledb_comments = new pafiledb_comments(); ! $pafiledb_comments->init( $item_id ); ! $return_data = $pafiledb_comments->post( 'update', $cid, $title, $comments_text, $userdata['user_id'], $userdata['username'], 0, '', '', $comment_bbcode_uid); } --- 1490,1498 ---- else { ! include( $module_root_path . 'linkdb/includes/functions_comment.' . $phpEx ); ! $linkdb_comments = new linkdb_comments(); ! $linkdb_comments->init( $item_id ); ! $return_data = $linkdb_comments->post( 'update', $cid, $title, $comments_text, $userdata['user_id'], $userdata['username'], 0, '', '', $comment_bbcode_uid); } *************** *** 1408,1416 **** else { ! include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); ! $pafiledb_comments = new pafiledb_comments(); ! $pafiledb_comments->init( $item_id ); ! $return_data = $pafiledb_comments->post( 'insert', '', $title, $comments_text, $userdata['user_id'], $userdata['username'], 0, '', '', $comment_bbcode_uid); } } --- 1514,1522 ---- else { ! include( $module_root_path . 'linkdb/includes/functions_comment.' . $phpEx ); ! $linkdb_comments = new linkdb_comments(); ! $linkdb_comments->init( $item_id ); ! $return_data = $linkdb_comments->post( 'insert', '', $title, $comments_text, $userdata['user_id'], $userdata['username'], 0, '', '', $comment_bbcode_uid); } } *************** *** 1451,1463 **** $this->auth_can_list = '<br />' . ( ( $this->auth[$cat_id]['auth_upload'] ) ? $lang['PA_Rules_upload_can'] : $lang['PA_Rules_upload_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->auth[$cat_id]['auth_view_file'] ) ? $lang['PA_Rules_view_file_can'] : $lang['PA_Rules_view_file_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->auth[$cat_id]['auth_edit_file'] ) ? $lang['PA_Rules_edit_file_can'] : $lang['PA_Rules_edit_file_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->auth[$cat_id]['auth_delete_file'] ) ? $lang['PA_Rules_delete_file_can'] : $lang['PA_Rules_delete_file_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->comments[$cat_id]['activated'] ? ( ( $this->auth[$cat_id]['auth_view_comment'] ? $lang['PA_Rules_view_comment_can'] : $lang['PA_Rules_view_comment_cannot'] ) . '<br />') : '')); ! $this->auth_can_list .= ( ( $this->comments[$cat_id]['activated'] ? ( ( $this->auth[$cat_id]['auth_post_comment'] ? $lang['PA_Rules_post_comment_can'] : $lang['PA_Rules_post_comment_cannot'] ) . '<br />') : '')); ! $this->auth_can_list .= ( ( $this->ratings[$cat_id]['activated'] ? ( ( $this->auth[$cat_id]['auth_rate'] ? $lang['PA_Rules_rate_can'] : $lang['PA_Rules_rate_cannot'] ) . '<br />') : '')); ! $this->auth_can_list .= ( ( $this->auth[$cat_id]['auth_download'] ) ? $lang['PA_Rules_download_can'] : $lang['PA_Rules_download_cannot'] ) . '<br />'; ! if ( $this->auth[$cat_id]['auth_mod'] ) { $this->auth_can_list .= $lang['PA_Rules_moderate_can']; --- 1557,1569 ---- $this->auth_can_list = '<br />' . ( ( $this->auth[$cat_id]['auth_upload'] ) ? $lang['PA_Rules_upload_can'] : $lang['PA_Rules_upload_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->auth_user[$cat_id]['auth_view_file'] ) ? $lang['PA_Rules_view_file_can'] : $lang['PA_Rules_view_file_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->auth_user[$cat_id]['auth_edit_file'] ) ? $lang['PA_Rules_edit_file_can'] : $lang['PA_Rules_edit_file_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->auth_user[$cat_id]['auth_delete_file'] ) ? $lang['PA_Rules_delete_file_can'] : $lang['PA_Rules_delete_file_cannot'] ) . '<br />'; ! $this->auth_can_list .= ( ( $this->comments[$cat_id]['activated'] ? ( ( $this->auth_user[$cat_id]['auth_view_comment'] ? $lang['PA_Rules_view_comment_can'] : $lang['PA_Rules_view_comment_cannot'] ) . '<br />') : '')); ! $this->auth_can_list .= ( ( $this->comments[$cat_id]['activated'] ? ( ( $this->auth_user[$cat_id]['auth_post_comment'] ? $lang['PA_Rules_post_comment_can'] : $lang['PA_Rules_post_comment_cannot'] ) . '<br />') : '')); ! $this->auth_can_list .= ( ( $this->ratings[$cat_id]['activated'] ? ( ( $this->auth_user[$cat_id]['auth_rate'] ? $lang['PA_Rules_rate_can'] : $lang['PA_Rules_rate_cannot'] ) . '<br />') : '')); ! $this->auth_can_list .= ( ( $this->auth_user[$cat_id]['auth_download'] ) ? $lang['PA_Rules_download_can'] : $lang['PA_Rules_download_cannot'] ) . '<br />'; ! if ( $this->auth_user[$cat_id]['auth_mod'] ) { $this->auth_can_list .= $lang['PA_Rules_moderate_can']; |