|
From: Jon O. <jon...@us...> - 2005-12-11 16:19:29
|
Update of /cvsroot/mxbb/mx_pafiledb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18427/modules/mx_pafiledb/admin Modified Files: admin_pa_catauth.php admin_pa_category.php admin_pa_custom.php admin_pa_fchecker.php admin_pa_file.php admin_pa_license.php admin_pa_settings.php admin_pa_ug_auth.php Log Message: adding php5 support Index: admin_pa_category.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_category.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** admin_pa_category.php 8 Dec 2005 15:15:11 -0000 1.13 --- admin_pa_category.php 11 Dec 2005 16:19:20 -0000 1.14 *************** *** 45,50 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } --- 45,51 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); } *************** *** 75,79 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } --- 76,81 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); } *************** *** 440,505 **** include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - function admin_cat_main( $cat_parent = 0, $depth = 0 ) - { - global $pafiledb, $phpbb_root_path, $pafiledb_template, $phpEx; - - $pre = str_repeat( ' ', $depth ); - if ( isset( $pafiledb->subcat_rowset[$cat_parent] ) ) - { - foreach( $pafiledb->subcat_rowset[$cat_parent] as $subcat_id => $cat_data ) - { - $pafiledb_template->assign_block_vars( 'cat_row', array( 'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] == PA_CAT_ALLOW_FILE ) ? false : true, - 'U_CAT' => append_sid( 'admin_pa_category.php?cat_id=' . $subcat_id ), - 'U_CAT_EDIT' => append_sid( "admin_pa_category.$phpEx?mode=edit&cat_id=$subcat_id" ), - 'U_CAT_DELETE' => append_sid( "admin_pa_category.$phpEx?mode=delete&cat_id=$subcat_id" ), - 'U_CAT_MOVE_UP' => append_sid( "admin_pa_category.$phpEx?mode=cat_order&move=-15&cat_id_other=$subcat_id" ), - 'U_CAT_MOVE_DOWN' => append_sid( "admin_pa_category.$phpEx?mode=cat_order&move=15&cat_id_other=$subcat_id" ), - 'U_CAT_RESYNC' => append_sid( "admin_pa_category.$phpEx?mode=sync&cat_id_other=$subcat_id" ), - 'CAT_NAME' => $cat_data['cat_name'], - 'PRE' => $pre ) - ); - admin_cat_main( $subcat_id, $depth + 1 ); - } - return; - } - return; - } - - function get_forums( $sel_id = 0 ) - { - global $db; - - $sql = "SELECT forum_id, forum_name - FROM " . FORUMS_TABLE; - - if ( !$result = $db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, "Couldn't get list of forums", "", __LINE__, __FILE__, $sql ); - } - - $forumlist = '<select name="forum_id">'; - - if ( $sel_id == 0 ) - { - $forumlist .= '<option value="0" selected > Select a Forum !</option>'; - } - - while ( $row = $db->sql_fetchrow( $result ) ) - { - if ( $sel_id == $row['forum_id'] ) - { - $status = "selected"; - } - else - { - $status = ''; - } - $forumlist .= '<option value="' . $row['forum_id'] . '" ' . $status . '>' . $row['forum_name'] . '</option>'; - } - - $forumlist .= '</select>'; - - return $forumlist; - } - ?> \ No newline at end of file --- 442,444 ---- Index: admin_pa_file.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_file.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** admin_pa_file.php 8 Dec 2005 15:15:11 -0000 1.16 --- admin_pa_file.php 11 Dec 2005 16:19:20 -0000 1.17 *************** *** 45,51 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include( $phpbb_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } else --- 45,51 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } else *************** *** 75,80 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } --- 75,80 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } Index: admin_pa_settings.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_settings.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** admin_pa_settings.php 8 Dec 2005 15:15:11 -0000 1.14 --- admin_pa_settings.php 11 Dec 2005 16:19:20 -0000 1.15 *************** *** 45,50 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } else --- 45,51 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); } else *************** *** 74,78 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } --- 75,81 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); ! } *************** *** 589,613 **** include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - - function pa_size_select( $select_name, $size_compare ) - { - global $lang; - - $size_types_text = array( $lang['Bytes'], $lang['KB'], $lang['MB'] ); - $size_types = array( 'b', 'kb', 'mb' ); - - $select_field = '<select name="' . $select_name . '">'; - - for ( $i = 0; $i < count( $size_types_text ); $i++ ) - { - $selected = ( $size_compare == $size_types[$i] ) ? ' selected="selected"' : ''; - - $select_field .= '<option value="' . $size_types[$i] . '"' . $selected . '>' . $size_types_text[$i] . '</option>'; - } - - $select_field .= '</select>'; - - return ( $select_field ); - } - ?> \ No newline at end of file --- 592,594 ---- Index: admin_pa_catauth.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_catauth.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** admin_pa_catauth.php 8 Dec 2005 15:15:11 -0000 1.12 --- admin_pa_catauth.php 11 Dec 2005 16:19:20 -0000 1.13 *************** *** 45,50 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } else --- 45,51 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); } else *************** *** 74,78 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } --- 75,80 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); } *************** *** 229,267 **** include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - function admin_display_cat_auth( $cat_parent = 0, $depth = 0 ) - { - global $pafiledb, $phpbb_root_path, $pafiledb_template, $phpEx; - global $cat_auth_fields, $cat_auth_const, $cat_auth_levels, $lang; - $pre = str_repeat( ' ', $depth ); - if ( isset( $pafiledb->subcat_rowset[$cat_parent] ) ) - { - foreach( $pafiledb->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data ) - { - $pafiledb_template->assign_block_vars( 'cat_row', array( 'CATEGORY_NAME' => $cat_data['cat_name'], - 'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true, - 'PRE' => $pre, - 'U_CAT' => append_sid( "admin_pa_catauth.$phpEx?cat_parent=$sub_cat_id" ) ) - ); - - for( $j = 0; $j < count( $cat_auth_fields ); $j++ ) - { - $custom_auth[$j] = ' <select name="' . $cat_auth_fields[$j] . '[' . $sub_cat_id . ']' . '">'; - - for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) - { - $selected = ( $cat_data[$cat_auth_fields[$j]] == $cat_auth_const[$k] ) ? ' selected="selected"' : ''; - $custom_auth[$j] .= '<option value="' . $cat_auth_const[$k] . '"' . $selected . '>' . $lang['Category_' . $cat_auth_levels[$k]] . '</option>'; - } - $custom_auth[$j] .= '</select> '; - - $pafiledb_template->assign_block_vars( 'cat_row.cat_auth_data', array( 'S_AUTH_LEVELS_SELECT' => $custom_auth[$j] ) - ); - } - admin_display_cat_auth( $sub_cat_id, $depth + 1 ); - } - return; - } - return; - } - ?> \ No newline at end of file --- 231,233 ---- Index: admin_pa_license.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_license.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** admin_pa_license.php 1 Oct 2005 14:15:19 -0000 1.12 --- admin_pa_license.php 11 Dec 2005 16:19:20 -0000 1.13 *************** *** 45,50 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } else --- 45,50 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } else *************** *** 74,78 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } --- 74,78 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } Index: admin_pa_fchecker.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_fchecker.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** admin_pa_fchecker.php 24 Oct 2005 20:16:56 -0000 1.13 --- admin_pa_fchecker.php 11 Dec 2005 16:19:20 -0000 1.14 *************** *** 45,50 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } else --- 45,50 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); } else *************** *** 74,78 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } --- 74,78 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } Index: admin_pa_custom.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_custom.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** admin_pa_custom.php 8 Dec 2005 15:15:11 -0000 1.14 --- admin_pa_custom.php 11 Dec 2005 16:19:20 -0000 1.15 *************** *** 45,51 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include( $phpbb_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } --- 45,51 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } *************** *** 76,81 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } --- 76,81 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); } Index: admin_pa_ug_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_ug_auth.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_pa_ug_auth.php 8 Dec 2005 15:15:11 -0000 1.10 --- admin_pa_ug_auth.php 11 Dec 2005 16:19:20 -0000 1.11 *************** *** 43,49 **** require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } --- 43,50 ---- require( './pagestart.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $phpbb_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } *************** *** 68,72 **** require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); --- 69,74 ---- require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); ! include_once( $module_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); *************** *** 542,546 **** $optionlist_mod[$cat_id] .= '</select>'; } ! admin_display_cat_auth(); if ( $mode == 'user' ) --- 544,548 ---- $optionlist_mod[$cat_id] .= '</select>'; } ! admin_display_cat_auth_ug(); if ( $mode == 'user' ) *************** *** 949,1035 **** include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - function admin_display_cat_auth( $cat_parent = 0, $depth = 0 ) - { - global $pafiledb, $phpbb_root_path, $pafiledb_template, $phpEx; - global $cat_auth_fields, $optionlist_mod, $optionlist_acl_adv; - $pre = str_repeat( ' ', $depth ); - if ( isset( $pafiledb->subcat_rowset[$cat_parent] ) ) - { - foreach( $pafiledb->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data ) - { - $pafiledb_template->assign_block_vars( 'cat_row', array( 'CAT_NAME' => $cat_data['cat_name'], - 'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true, - 'PRE' => $pre, - - 'U_CAT' => append_sid( "admin_pa_catauth.$phpEx?cat_id=$sub_cat_id" ), - - 'S_MOD_SELECT' => $optionlist_mod[$sub_cat_id] ) - ); - - for( $j = 0; $j < count( $cat_auth_fields ); $j++ ) - { - $pafiledb_template->assign_block_vars( 'cat_row.aclvalues', array( 'S_ACL_SELECT' => $optionlist_acl_adv[$sub_cat_id][$j] ) - ); - } - admin_display_cat_auth( $sub_cat_id, $depth + 1 ); - } - return; - } - return; - } - - function global_auth_check_user( $type, $key, $global_u_access, $is_admin ) - { - $auth_user = 0; - - if ( !empty( $global_u_access ) ) - { - $result = 0; - switch ( $type ) - { - case AUTH_ACL: - $result = $global_u_access[$key]; - - case AUTH_MOD: - $result = $result || is_moderator( $global_u_access['group_id'] ); - - case AUTH_ADMIN: - $result = $result || $is_admin; - break; - } - - $auth_user = $auth_user || $result; - } - else - { - $auth_user = $is_admin; - } - - return $auth_user; - } - - function is_moderator( $group_id ) - { - static $is_mod = false; - - if ( $is_mod !== false ) - { - return $is_mod; - } - - global $db; - - $sql = "SELECT * - FROM " . PA_AUTH_ACCESS_TABLE . " - WHERE group_id = $group_id - AND auth_mod = '1'"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Couldn't check for moderator $sql", "", __LINE__, __FILE__, $sql ); - } - - return ( $is_mod = ( $db->sql_fetchrow( $result ) ) ? 1 : 0 ); - } - ?> \ No newline at end of file --- 951,953 ---- |