You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(95) |
Apr
(270) |
May
(111) |
Jun
|
Jul
|
Aug
(64) |
Sep
(130) |
Oct
(319) |
Nov
(17) |
Dec
(191) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(387) |
Jul
(102) |
Aug
(247) |
Sep
(120) |
Oct
(1) |
Nov
(8) |
Dec
(21) |
| 2007 |
Jan
(38) |
Feb
(36) |
Mar
|
Apr
(32) |
May
(135) |
Jun
(523) |
Jul
(192) |
Aug
(103) |
Sep
(533) |
Oct
(77) |
Nov
(23) |
Dec
(203) |
| 2008 |
Jan
(312) |
Feb
(1193) |
Mar
(404) |
Apr
(67) |
May
(62) |
Jun
(497) |
Jul
(297) |
Aug
(110) |
Sep
(335) |
Oct
(256) |
Nov
(50) |
Dec
(118) |
| 2009 |
Jan
(67) |
Feb
(10) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(10) |
Jul
(61) |
Aug
|
Sep
(16) |
Oct
(45) |
Nov
(12) |
Dec
(14) |
| 2010 |
Jan
(30) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(7) |
Aug
(7) |
Sep
(5) |
Oct
(5) |
Nov
|
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(89) |
Apr
(11) |
May
(5) |
Jun
|
Jul
(8) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(89) |
| 2012 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(42) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(19) |
Apr
(90) |
May
(38) |
Jun
(235) |
Jul
(38) |
Aug
(10) |
Sep
|
Oct
(29) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(52) |
Jun
|
Jul
(7) |
Aug
|
Sep
(17) |
Oct
|
Nov
|
Dec
|
|
From: Jon O. <jon...@us...> - 2006-08-01 20:49:43
|
Update of /cvsroot/mxbb/mx_kb/kb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17472/modules/mx_kb/kb/modules Modified Files: kb_moderator.php Log Message: before removing Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/modules/kb_moderator.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kb_moderator.php 5 Jul 2006 22:48:26 -0000 1.5 --- kb_moderator.php 1 Aug 2006 20:49:40 -0000 1.6 *************** *** 116,120 **** // Notification // ! $this->update_add_article_notify($article_id, 'approve'); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $this->this_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start" ) ) . '">', '</a>' ) ; --- 116,120 ---- // Notification // ! $this->update_add_item_notify($article_id, 'approve'); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $this->this_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start" ) ) . '">', '</a>' ) ; *************** *** 138,142 **** // Notification // ! $this->update_add_article_notify($article_id, 'unapprove'); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $this->this_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start") ) . '">', '</a>' ) ; --- 138,142 ---- // Notification // ! $this->update_add_item_notify($article_id, 'unapprove'); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $this->this_mxurl( "page=$page_id&mode=cat&cat=$category_id&start=$start") ) . '">', '</a>' ) ; *************** *** 188,192 **** // Notification // ! $this->update_add_article_notify($article_id, 'delete'); $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; --- 188,192 ---- // Notification // ! $this->update_add_item_notify($article_id, 'delete'); $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; |
|
From: Jon O. <jon...@us...> - 2006-08-01 20:48:44
|
Update of /cvsroot/mxbb/mx_kb/kb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17041/modules/mx_kb/kb/includes Modified Files: functions_cache.php functions_field.php Log Message: before removing Index: functions_cache.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_cache.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_cache.php 7 Jun 2006 20:28:54 -0000 1.3 --- functions_cache.php 1 Aug 2006 20:48:36 -0000 1.4 *************** *** 15,19 **** /** ! * Enter description here... * */ --- 15,19 ---- /** ! * Generic module cache. * */ *************** *** 29,37 **** * @return mx_kb_cache */ ! function mx_kb_cache() { global $phpbb_root_path; global $mx_root_path, $module_root_path, $is_block, $phpEx; ! $this->cache_dir = $module_root_path . 'kb/cache/'; } --- 29,43 ---- * @return mx_kb_cache */ ! function mx_kb_cache($dir=false) { global $phpbb_root_path; global $mx_root_path, $module_root_path, $is_block, $phpEx; ! ! if (!$dir) ! { ! mx_message_die(GENERAL_ERROR, 'The module cache need a init dir.'); ! } ! ! $this->cache_dir = $dir . 'cache/'; } Index: functions_field.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_field.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_field.php 7 Jun 2006 20:28:54 -0000 1.3 --- functions_field.php 1 Aug 2006 20:48:36 -0000 1.4 *************** *** 15,19 **** /** ! * Enter description here... * */ --- 15,19 ---- /** ! * This is a generic class for custom fields. * */ *************** *** 23,28 **** var $field_data_rowset = array(); /** ! * Enter description here... * */ --- 23,31 ---- var $field_data_rowset = array(); + var $custom_table = KB_CUSTOM_TABLE; + var $custom_data_table = KB_CUSTOM_DATA_TABLE; + /** ! * prepare data * */ *************** *** 32,36 **** $sql = "SELECT * ! FROM " . KB_CUSTOM_TABLE . " ORDER BY field_order ASC"; --- 35,39 ---- $sql = "SELECT * ! FROM " . $this->custom_table . " ORDER BY field_order ASC"; *************** *** 48,52 **** $sql = "SELECT * ! FROM " . KB_CUSTOM_DATA_TABLE; if ( !( $result = $db->sql_query( $sql ) ) ) --- 51,55 ---- $sql = "SELECT * ! FROM " . $this->custom_data_table; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 130,134 **** global $db; ! $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; --- 133,137 ---- global $db; ! $sql = "DELETE FROM " . $this->custom_data_table . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; *************** *** 184,190 **** } ! $template->assign_block_vars( 'custom_field', array( 'CUSTOM_NAME' => $this->field_rowset[$field_id]['custom_name'], ! 'DATA' => $field_data ) ! ); } else --- 187,194 ---- } ! $template->assign_block_vars( 'custom_field', array( ! 'CUSTOM_NAME' => $this->field_rowset[$field_id]['custom_name'], ! 'DATA' => $field_data ) ! ); } else *************** *** 192,196 **** global $db; ! $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; --- 196,200 ---- global $db; ! $sql = "DELETE FROM " . $this->custom_data_table . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; *************** *** 222,227 **** function display_edit( $file_id = false ) { - global $template; - $return = false; if ( $this->field_exist() ) --- 226,229 ---- *************** *** 266,277 **** function display_edit_input( $file_id, $field_id, $field_data ) { ! global $template, $_POST; $field_value_temp = (!empty( $this->field_data_rowset[$file_id][$field_id]['data'] )) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; $field_value = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $field_value_temp ; ! $template->assign_block_vars( 'input', array( 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'], ! 'FIELD_VALUE' => $field_value ) ! ); } --- 268,280 ---- function display_edit_input( $file_id, $field_id, $field_data ) { ! global $template; $field_value_temp = (!empty( $this->field_data_rowset[$file_id][$field_id]['data'] )) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; $field_value = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $field_value_temp ; ! $template->assign_block_vars( 'input', array( ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'], ! 'FIELD_VALUE' => $field_value ) ! ); } *************** *** 288,296 **** $field_value_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; $field_value = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $field_value_temp ; ! $template->assign_block_vars( 'textarea', array( 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'], ! 'FIELD_VALUE' => $field_value ) ! ); } --- 291,300 ---- $field_value_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; $field_value = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $field_value_temp ; ! $template->assign_block_vars( 'textarea', array( ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'], ! 'FIELD_VALUE' => $field_value ) ! ); } *************** *** 305,312 **** { global $template; ! $template->assign_block_vars( 'radio', array( 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : array(); --- 309,317 ---- { global $template; ! $template->assign_block_vars( 'radio', array( ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : array(); *************** *** 318,324 **** foreach( $field_datas as $key => $value ) { ! $template->assign_block_vars( 'radio.row', array( 'FIELD_VALUE' => $value, ! 'FIELD_SELECTED' => ( $data == $value ) ? ' checked="checked"' : '' ) ! ); } } --- 323,330 ---- foreach( $field_datas as $key => $value ) { ! $template->assign_block_vars( 'radio.row', array( ! 'FIELD_VALUE' => $value, ! 'FIELD_SELECTED' => ( $data == $value ) ? ' checked="checked"' : '' ) ! ); } } *************** *** 335,342 **** { global $template; ! $template->assign_block_vars( 'select', array( 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; --- 341,349 ---- { global $template; ! $template->assign_block_vars( 'select', array( ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; *************** *** 348,354 **** foreach( $field_datas as $key => $value ) { ! $template->assign_block_vars( 'select.row', array( 'FIELD_VALUE' => $value, ! 'FIELD_SELECTED' => ( $data == $value ) ? ' selected="selected"' : '' ) ! ); } } --- 355,362 ---- foreach( $field_datas as $key => $value ) { ! $template->assign_block_vars( 'select.row', array( ! 'FIELD_VALUE' => $value, ! 'FIELD_SELECTED' => ( $data == $value ) ? ' selected="selected"' : '' ) ! ); } } *************** *** 365,372 **** { global $template; ! $template->assign_block_vars( 'select_multiple', array( 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); --- 373,381 ---- { global $template; ! $template->assign_block_vars( 'select_multiple', array( ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); *************** *** 387,393 **** } } ! $template->assign_block_vars( 'select_multiple.row', array( 'FIELD_VALUE' => $value, ! 'FIELD_SELECTED' => $selected ) ! ); } } --- 396,403 ---- } } ! $template->assign_block_vars( 'select_multiple.row', array( ! 'FIELD_VALUE' => $value, ! 'FIELD_SELECTED' => $selected ) ! ); } } *************** *** 404,411 **** { global $template; ! $template->assign_block_vars( 'checkbox', array( 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); --- 414,422 ---- { global $template; ! $template->assign_block_vars( 'checkbox', array( ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_ID' => $field_data['custom_id'], ! 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ! ); $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); *************** *** 426,432 **** } } ! $template->assign_block_vars( 'checkbox.row', array( 'FIELD_VALUE' => $value, ! 'FIELD_CHECKED' => $checked ) ! ); } } --- 437,444 ---- } } ! $template->assign_block_vars( 'checkbox.row', array( ! 'FIELD_VALUE' => $value, ! 'FIELD_CHECKED' => $checked ) ! ); } } *************** *** 477,481 **** if ( !$field_id ) { ! $sql = "INSERT INTO " . KB_CUSTOM_TABLE . " (custom_name, custom_description, data, regex, field_type) VALUES('" . $field_name . "', '" . $field_desc . "', '" . $data . "', '" . $regex . "', '" . $field_type . "')"; --- 489,493 ---- if ( !$field_id ) { ! $sql = "INSERT INTO " . $this->custom_table . " (custom_name, custom_description, data, regex, field_type) VALUES('" . $field_name . "', '" . $field_desc . "', '" . $data . "', '" . $regex . "', '" . $field_type . "')"; *************** *** 487,491 **** $field_id = $db->sql_nextid(); ! $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET field_order = '$field_id' WHERE custom_id = $field_id"; --- 499,503 ---- $field_id = $db->sql_nextid(); ! $sql = "UPDATE " . $this->custom_table . " SET field_order = '$field_id' WHERE custom_id = $field_id"; *************** *** 498,502 **** else { ! $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET custom_name = '$field_name', custom_description = '$field_desc', data = '$data', regex = '$regex', field_order='$field_order' WHERE custom_id = $field_id"; --- 510,514 ---- else { ! $sql = "UPDATE " . $this->custom_table . " SET custom_name = '$field_name', custom_description = '$field_desc', data = '$data', regex = '$regex', field_order='$field_order' WHERE custom_id = $field_id"; *************** *** 518,522 **** global $db; ! $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_custom = '$field_id'"; --- 530,534 ---- global $db; ! $sql = "DELETE FROM " . $this->custom_data_table . " WHERE customdata_custom = '$field_id'"; *************** *** 526,530 **** } ! $sql = "DELETE FROM " . KB_CUSTOM_TABLE . " WHERE custom_id = '$field_id'"; --- 538,542 ---- } ! $sql = "DELETE FROM " . $this->custom_table . " WHERE custom_id = '$field_id'"; *************** *** 583,587 **** } ! $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; --- 595,599 ---- } ! $sql = "DELETE FROM " . $this->custom_data_table . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; *************** *** 594,598 **** if ( !empty( $data ) ) { ! $sql = "INSERT INTO " . KB_CUSTOM_DATA_TABLE . " (customdata_file, customdata_custom, data) VALUES('$file_id', '$field_id', '$data')"; --- 606,610 ---- if ( !empty( $data ) ) { ! $sql = "INSERT INTO " . $this->custom_data_table . " (customdata_file, customdata_custom, data) VALUES('$file_id', '$field_id', '$data')"; |
|
From: Jon O. <jon...@us...> - 2006-08-01 20:47:24
|
Update of /cvsroot/mxbb/mx_kb/kb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16593/modules/mx_kb/kb/admin Modified Files: admin_article_manage.php Log Message: before removing Index: admin_article_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/admin/admin_article_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_article_manage.php 8 Jul 2006 10:21:36 -0000 1.1 --- admin_article_manage.php 1 Aug 2006 20:47:18 -0000 1.2 *************** *** 82,86 **** // Notification // ! $this->update_add_article_notify($article_id, 'approve'); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=article_manage" ) . "&start=" . $start . '">', '</a>' ) ; --- 82,86 ---- // Notification // ! $this->update_add_item_notify($article_id, 'approve'); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=article_manage" ) . "&start=" . $start . '">', '</a>' ) ; *************** *** 105,109 **** // Notification // ! $this->update_add_article_notify($article_id, 'unapprove'); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=article_manage" ) . "&start=" . $start . '">', '</a>' ) ; --- 105,109 ---- // Notification // ! $this->update_add_item_notify($article_id, 'unapprove'); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=article_manage" ) . "&start=" . $start . '">', '</a>' ) ; *************** *** 156,160 **** // Notification // ! $this->update_add_article_notify($article_id, 'delete'); $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; --- 156,160 ---- // Notification // ! $this->update_add_item_notify($article_id, 'delete'); $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; *************** *** 188,202 **** // edited articles // ! $this->display_articles( $start, '', 'editrow', 2 ); // // need to be approved // ! $this->display_articles( $start, '', 'notrow', 0 ); // // Articles that are approved // ! $total_articles = $this->display_articles( $start, '', 'approverow', 1 ); // --- 188,202 ---- // edited articles // ! $this->display_items( $start, '', 'editrow', 2 ); // // need to be approved // ! $this->display_items( $start, '', 'notrow', 0 ); // // Articles that are approved // ! $total_articles = $this->display_items( $start, '', 'approverow', 1 ); // |
|
From: Jon O. <jon...@us...> - 2006-07-08 16:28:50
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15070/modules/mx_pafiledb/pafiledb/includes Modified Files: functions_admin.php functions_pafiledb.php Log Message: moved functions and removed files Index: functions_admin.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_admin.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions_admin.php 8 Jul 2006 10:23:34 -0000 1.5 --- functions_admin.php 8 Jul 2006 16:28:46 -0000 1.6 *************** *** 45,54 **** 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( --- 45,54 ---- function admin_display_cat_auth( $cat_parent = 0, $depth = 0 ) { ! global $phpbb_root_path, $pafiledb_template, $phpEx; global $cat_auth_fields, $cat_auth_const, $cat_auth_levels, $lang; $pre = str_repeat( ' ', $depth ); ! if ( isset( $this->subcat_rowset[$cat_parent] ) ) { ! foreach( $this->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data ) { $pafiledb_template->assign_block_vars( 'cat_row', array( *************** *** 56,60 **** '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" ) )); --- 56,60 ---- 'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true, 'PRE' => $pre, ! 'U_CAT' => append_sid( "admin_pafiledb.$phpEx?action=catauth_manage&cat_parent=$sub_cat_id" ) )); *************** *** 72,76 **** $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; --- 72,76 ---- $pafiledb_template->assign_block_vars( 'cat_row.cat_auth_data', array( 'S_AUTH_LEVELS_SELECT' => $custom_auth[$j] ) ); } ! $this->admin_display_cat_auth( $sub_cat_id, $depth + 1 ); } return; *************** *** 81,90 **** function admin_display_cat_auth_ug( $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( --- 81,90 ---- function admin_display_cat_auth_ug( $cat_parent = 0, $depth = 0 ) { ! global $phpbb_root_path, $pafiledb_template, $phpEx; global $cat_auth_fields, $optionlist_mod, $optionlist_acl_adv; $pre = str_repeat( ' ', $depth ); ! if ( isset( $this->subcat_rowset[$cat_parent] ) ) { ! foreach( $this->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data ) { $pafiledb_template->assign_block_vars( 'cat_row', array( *************** *** 92,96 **** '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] )); --- 92,96 ---- 'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true, 'PRE' => $pre, ! 'U_CAT' => append_sid( "admin_pafiledb.$phpEx?action=catauth&cat_id=$sub_cat_id" ), 'S_MOD_SELECT' => $optionlist_mod[$sub_cat_id] )); *************** *** 100,104 **** $pafiledb_template->assign_block_vars( 'cat_row.aclvalues', array( 'S_ACL_SELECT' => $optionlist_acl_adv[$sub_cat_id][$j] ) ); } ! admin_display_cat_auth_ug( $sub_cat_id, $depth + 1 ); } return; --- 100,104 ---- $pafiledb_template->assign_block_vars( 'cat_row.aclvalues', array( 'S_ACL_SELECT' => $optionlist_acl_adv[$sub_cat_id][$j] ) ); } ! $this->admin_display_cat_auth_ug( $sub_cat_id, $depth + 1 ); } return; *************** *** 109,131 **** 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; --- 109,131 ---- function admin_cat_main( $cat_parent = 0, $depth = 0 ) { ! global $phpbb_root_path, $pafiledb_template, $phpEx; $pre = str_repeat( ' ', $depth ); ! if ( isset( $this->subcat_rowset[$cat_parent] ) ) { ! foreach( $this->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_pafiledb.$phpEx?action=cat_manage&cat_id=$subcat_id" ), ! 'U_CAT_EDIT' => append_sid( "admin_pafiledb.$phpEx?action=cat_manage&mode=edit&cat_id=$subcat_id" ), ! 'U_CAT_DELETE' => append_sid( "admin_pafiledb.$phpEx?action=cat_manage&mode=delete&cat_id=$subcat_id" ), ! 'U_CAT_MOVE_UP' => append_sid( "admin_pafiledb.$phpEx?action=cat_manage&mode=cat_order&move=-15&cat_id_other=$subcat_id" ), ! 'U_CAT_MOVE_DOWN' => append_sid( "admin_pafiledb.$phpEx?action=cat_manage&mode=cat_order&move=15&cat_id_other=$subcat_id" ), ! 'U_CAT_RESYNC' => append_sid( "admin_pafiledb.$phpEx?action=cat_manage&mode=sync&cat_id_other=$subcat_id" ), 'CAT_NAME' => $cat_data['cat_name'], 'PRE' => $pre )); ! $this->admin_cat_main( $subcat_id, $depth + 1 ); } return; *************** *** 259,262 **** --- 259,585 ---- return ( $is_mod = ( $db->sql_fetchrow( $result ) ) ? 1 : 0 ); } + + /** + * Enter description here... + * + * @param unknown_type $cat_id + * @return unknown + */ + function update_add_cat( $cat_id = false ) + { + global $db, $_POST, $lang; + + $cat_name = ( isset( $_POST['cat_name'] ) ) ? htmlspecialchars( $_POST['cat_name'] ) : ''; + $cat_desc = ( isset( $_POST['cat_desc'] ) ) ? htmlspecialchars( $_POST['cat_desc'] ) : ''; + $cat_parent = ( isset( $_POST['cat_parent'] ) ) ? intval( $_POST['cat_parent'] ) : 0; + $cat_allow_file = ( isset( $_POST['cat_allow_file'] ) ) ? intval( $_POST['cat_allow_file'] ) : 0; + + $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; + $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; + $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; + $comments_forum_id = intval( $_POST['comments_forum_id'] ); + + $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; + + $cat_use_ratings = ( isset( $_POST['cat_allow_ratings'] ) ) ? intval( $_POST['cat_allow_ratings'] ) : 0; + + $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; + $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; + + if ( empty( $cat_name ) ) + { + $this->error[] = $lang['Cat_name_missing']; + } + + if ( $cat_parent ) + { + if ( !$this->cat_rowset[$cat_parent]['cat_allow_file'] && !$cat_allow_file ) + { + $this->error[] = $lang['Cat_conflict']; + } + } + + if ( sizeof( $this->error ) ) + { + return; + } + + $cat_name = str_replace( "\'", "''", $cat_name ); + $cat_desc = str_replace( "\'", "''", $cat_desc ); + + if ( !$cat_id ) + { + $cat_order = 0; + if ( !empty( $this->subcat_rowset[$cat_parent] ) ) + { + foreach( $this->subcat_rowset[$cat_parent] as $cat_data ) + { + if ( $cat_order < $cat_data['cat_order'] ) + { + $cat_order = $cat_data['cat_order']; + } + } + } + + $cat_order += 10; + + $sql = 'INSERT INTO ' . PA_CATEGORY_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) + 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)"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldn\'t add a new category', '', __LINE__, __FILE__, $sql ); + } + } + else + { + $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " + SET cat_name = '$cat_name', cat_desc = '$cat_desc', cat_parent = $cat_parent, cat_allow_file = $cat_allow_file, cat_allow_ratings = $cat_use_ratings, cat_allow_comments = $cat_use_comments, internal_comments = $cat_internal_comments, autogenerate_comments = $cat_autogenerate_comments, comments_forum_id = $comments_forum_id, show_pretext = $cat_show_pretext, notify = $cat_notify, notify_group = $cat_notify_group + WHERE cat_id = $cat_id"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldn\'t Edit this category', '', __LINE__, __FILE__, $sql ); + } + + if ( $cat_parent != $this->cat_rowset[$cat_id]['cat_parent'] ) + { + $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); + $this->reorder_cat( $cat_parent ); + } + $this->modified( true ); + } + + if ( $cat_id ) + { + return $cat_id; + } + else + { + return $db->sql_nextid(); + } + } + + /** + * Enter description here... + * + * @param unknown_type $cat_id + */ + function delete_cat( $cat_id = false ) + { + global $db, $_POST, $lang; + + $file_to_cat_id = ( isset( $_POST['file_to_cat_id'] ) ) ? intval( $_POST['file_to_cat_id'] ) : ''; + $subcat_to_cat_id = ( isset( $_POST['subcat_to_cat_id'] ) ) ? intval( $_POST['subcat_to_cat_id'] ) : ''; + $file_mode = ( isset( $_POST['file_mode'] ) ) ? htmlspecialchars( $_POST['file_mode'] ) : 'move'; + $subcat_mode = ( isset( $_POST['subcat_mode'] ) ) ? htmlspecialchars( $_POST['subcat_mode'] ) : 'move'; + + if ( empty( $cat_id ) ) + { + $this->error[] = $lang['Cdelerror']; + } + else + { + if ( ( $file_to_cat_id == -1 || empty( $file_to_cat_id ) ) && $file_mode == 'move' ) + { + $this->error[] = $lang['Cdelerror']; + } + + if ( $subcat_mode == 'move' && empty( $subcat_to_cat_id ) ) + { + $this->error[] = $lang['Cdelerror']; + } + + if ( sizeof( $this->error ) ) + { + return; + } + + $sql = 'DELETE FROM ' . PA_CATEGORY_TABLE . " + WHERE cat_id = $cat_id"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); + } + + $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); + + if ( $file_mode == 'delete' ) + { + $this->delete_files( $cat_id, 'category' ); + } + else + { + $this->move_files( $cat_id, $file_to_cat_id ); + } + + if ( $subcat_mode == 'delete' ) + { + $this->delete_subcat( $cat_id, $file_mode, $file_to_cat_id ); + } + else + { + $this->move_subcat( $cat_id, $subcat_to_cat_id ); + } + $this->modified( true ); + } + } + + /** + * Enter description here... + * + * @param unknown_type $from_cat + * @param unknown_type $to_cat + */ + function move_files( $from_cat, $to_cat ) + { + global $db; + + $sql = 'UPDATE ' . PA_FILES_TABLE . " + SET file_catid = $to_cat + WHERE file_catid = $from_cat"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt move files', '', __LINE__, __FILE__, $sql ); + } + + $this->modified( true ); + return; + } + + /** + * Enter description here... + * + * @param unknown_type $cat_id + * @param unknown_type $file_mode + * @param unknown_type $to_cat + */ + function delete_subcat( $cat_id, $file_mode = 'delete', $to_cat = false ) + { + global $db; + + if ( empty( $this->subcat_rowset[$cat_id] ) || count( $this->subcat_rowset[$cat_id] ) <= 0 ) + { + return; + } + + foreach( $this->subcat_rowset[$cat_id] as $sub_cat_id => $subcat_data ) + { + $this->delete_subcat( $sub_cat_id, $file_mode, $to_cat ); + + $sql = 'DELETE FROM ' . PA_CATEGORY_TABLE . " + WHERE cat_id = $sub_cat_id"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); + } + + if ( $file_mode == 'delete' ) + { + $this->delete_files( $sub_cat_id, 'category' ); + } + else + { + $this->move_files( $sub_cat_id, $to_cat ); + } + } + $this->modified( true ); + return; + } + + /** + * Enter description here... + * + * @param unknown_type $from_cat + * @param unknown_type $to_cat + */ + function move_subcat( $from_cat, $to_cat ) + { + global $db; + + $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " + SET cat_parent = $to_cat + WHERE cat_parent = $from_cat"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt move Sub Category', '', __LINE__, __FILE__, $sql ); + } + $this->modified( true ); + return; + } + + /** + * Enter description here... + * + * @param unknown_type $cat_parent + */ + function reorder_cat( $cat_parent ) + { + global $db; + + $sql = 'SELECT cat_id, cat_order + FROM ' . PA_CATEGORY_TABLE . " + WHERE cat_parent = $cat_parent + ORDER BY cat_order ASC"; + + if ( !$result = $db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not get list of Categories', '', __LINE__, __FILE__, $sql ); + } + + $i = 10; + while ( $row = $db->sql_fetchrow( $result ) ) + { + $cat_id = $row['cat_id']; + + $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " + SET cat_order = $i + WHERE cat_id = $cat_id"; + if ( !$db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not update order fields', '', __LINE__, __FILE__, $sql ); + } + $i += 10; + } + } + + /** + * Enter description here... + * + * @param unknown_type $cat_id + */ + function order_cat( $cat_id ) + { + global $db, $_GET; + + $move = ( isset( $_GET['move'] ) ) ? intval( $_GET['move'] ) : 15; + $cat_parent = $this->cat_rowset[$cat_id]['cat_parent']; + + $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " + SET cat_order = cat_order + $move + WHERE cat_id = $cat_id"; + + if ( !$result = $db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not change category order', '', __LINE__, __FILE__, $sql ); + } + + $this->reorder_cat( $cat_parent ); + $this->init(); + } + + /** + * Enter description here... + * + * @return unknown + */ + function file_mainenance() + { + return false; + } } ?> \ No newline at end of file Index: functions_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** functions_pafiledb.php 8 Jul 2006 10:23:34 -0000 1.35 --- functions_pafiledb.php 8 Jul 2006 16:28:46 -0000 1.36 *************** *** 1869,2287 **** * Enter description here... * - * @param unknown_type $cat_id - * @return unknown - */ - function update_add_cat( $cat_id = false ) - { - global $db, $_POST, $lang; - - $cat_name = ( isset( $_POST['cat_name'] ) ) ? htmlspecialchars( $_POST['cat_name'] ) : ''; - $cat_desc = ( isset( $_POST['cat_desc'] ) ) ? htmlspecialchars( $_POST['cat_desc'] ) : ''; - $cat_parent = ( isset( $_POST['cat_parent'] ) ) ? intval( $_POST['cat_parent'] ) : 0; - $cat_allow_file = ( isset( $_POST['cat_allow_file'] ) ) ? intval( $_POST['cat_allow_file'] ) : 0; - - $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; - $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; - $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; - $comments_forum_id = intval( $_POST['comments_forum_id'] ); - - $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; - - $cat_use_ratings = ( isset( $_POST['cat_allow_ratings'] ) ) ? intval( $_POST['cat_allow_ratings'] ) : 0; - - $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; - $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; - - if ( empty( $cat_name ) ) - { - $this->error[] = $lang['Cat_name_missing']; - } - - if ( $cat_parent ) - { - if ( !$this->cat_rowset[$cat_parent]['cat_allow_file'] && !$cat_allow_file ) - { - $this->error[] = $lang['Cat_conflict']; - } - } - - if ( sizeof( $this->error ) ) - { - return; - } - - $cat_name = str_replace( "\'", "''", $cat_name ); - $cat_desc = str_replace( "\'", "''", $cat_desc ); - - if ( !$cat_id ) - { - $cat_order = 0; - if ( !empty( $this->subcat_rowset[$cat_parent] ) ) - { - foreach( $this->subcat_rowset[$cat_parent] as $cat_data ) - { - if ( $cat_order < $cat_data['cat_order'] ) - { - $cat_order = $cat_data['cat_order']; - } - } - } - - $cat_order += 10; - - $sql = 'INSERT INTO ' . PA_CATEGORY_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) - 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)"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldn\'t add a new category', '', __LINE__, __FILE__, $sql ); - } - } - else - { - $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " - SET cat_name = '$cat_name', cat_desc = '$cat_desc', cat_parent = $cat_parent, cat_allow_file = $cat_allow_file, cat_allow_ratings = $cat_use_ratings, cat_allow_comments = $cat_use_comments, internal_comments = $cat_internal_comments, autogenerate_comments = $cat_autogenerate_comments, comments_forum_id = $comments_forum_id, show_pretext = $cat_show_pretext, notify = $cat_notify, notify_group = $cat_notify_group - WHERE cat_id = $cat_id"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldn\'t Edit this category', '', __LINE__, __FILE__, $sql ); - } - - if ( $cat_parent != $this->cat_rowset[$cat_id]['cat_parent'] ) - { - $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); - $this->reorder_cat( $cat_parent ); - } - $this->modified( true ); - } - - if ( $cat_id ) - { - return $cat_id; - } - else - { - return $db->sql_nextid(); - } - } - - /** - * Enter description here... - * - * @param unknown_type $cat_id - */ - function delete_cat( $cat_id = false ) - { - global $db, $_POST, $lang; - - $file_to_cat_id = ( isset( $_POST['file_to_cat_id'] ) ) ? intval( $_POST['file_to_cat_id'] ) : ''; - $subcat_to_cat_id = ( isset( $_POST['subcat_to_cat_id'] ) ) ? intval( $_POST['subcat_to_cat_id'] ) : ''; - $file_mode = ( isset( $_POST['file_mode'] ) ) ? htmlspecialchars( $_POST['file_mode'] ) : 'move'; - $subcat_mode = ( isset( $_POST['subcat_mode'] ) ) ? htmlspecialchars( $_POST['subcat_mode'] ) : 'move'; - - if ( empty( $cat_id ) ) - { - $this->error[] = $lang['Cdelerror']; - } - else - { - if ( ( $file_to_cat_id == -1 || empty( $file_to_cat_id ) ) && $file_mode == 'move' ) - { - $this->error[] = $lang['Cdelerror']; - } - - if ( $subcat_mode == 'move' && empty( $subcat_to_cat_id ) ) - { - $this->error[] = $lang['Cdelerror']; - } - - if ( sizeof( $this->error ) ) - { - return; - } - - $sql = 'DELETE FROM ' . PA_CATEGORY_TABLE . " - WHERE cat_id = $cat_id"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); - } - - $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); - - if ( $file_mode == 'delete' ) - { - $this->delete_files( $cat_id, 'category' ); - } - else - { - $this->move_files( $cat_id, $file_to_cat_id ); - } - - if ( $subcat_mode == 'delete' ) - { - $this->delete_subcat( $cat_id, $file_mode, $file_to_cat_id ); - } - else - { - $this->move_subcat( $cat_id, $subcat_to_cat_id ); - } - $this->modified( true ); - } - } - - /** - * Enter description here... - * - * @param unknown_type $id - * @param unknown_type $mode - */ - function delete_files( $id, $mode = 'file' ) - { - global $db, $phpbb_root_path, $pafiledb_functions; - - if ( $mode == 'category' ) - { - $file_ids = array(); - $files_data = array(); - - $sql = 'SELECT file_id, unique_name, file_dir - FROM ' . PA_FILES_TABLE . " - WHERE file_catid = $id"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); - } - - while ( $row = $db->sql_fetchrow( $result ) ) - { - $file_ids[] = $row['file_id']; - $files_data[] = $row; - } - - $where_sql = "WHERE file_catid = $id"; - } - else - { - $sql = 'SELECT file_id, unique_name, file_dir - FROM ' . PA_FILES_TABLE . " - WHERE file_id = $id"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); - } - - $file_data = $db->sql_fetchrow( $result ); - - $where_sql = "WHERE file_id = $id"; - } - - $sql = 'DELETE FROM ' . PA_FILES_TABLE . " - $where_sql"; - - unset( $where_sql ); - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt delete files', '', __LINE__, __FILE__, $sql ); - } - - $where_sql = ( $mode != 'file' && !empty( $file_ids ) ) ? ' IN (' . implode( ', ', $file_ids ) . ') ' : " = $id"; - - $sql = 'DELETE FROM ' . PA_CUSTOM_DATA_TABLE . " - WHERE customdata_file$where_sql"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt delete custom data', '', __LINE__, __FILE__, $sql ); - } - - $sql = 'DELETE FROM ' . PA_MIRRORS_TABLE . " - WHERE file_id$where_sql"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt delete mirror for this file', '', __LINE__, __FILE__, $sql ); - } - - if ( $mode == 'category' ) - { - foreach( $files_data as $file_data ) - { - if ( !empty( $file_data['unique_name'] ) ) - { - $pafiledb_functions->pafiledb_unlink( $phpbb_root_path . $file_data['file_dir'] . $file_data['unique_name'] ); - } - } - } - else - { - if ( !empty( $file_data['unique_name'] ) ) - { - $pafiledb_functions->pafiledb_unlink( $phpbb_root_path . $file_data['file_dir'] . $file_data['unique_name'] ); - } - } - - if ( $mode == 'file' ) - { - $this->modified( true ); - } - - return; - } - - /** - * Enter description here... - * - * @param unknown_type $from_cat - * @param unknown_type $to_cat - */ - function move_files( $from_cat, $to_cat ) - { - global $db; - - $sql = 'UPDATE ' . PA_FILES_TABLE . " - SET file_catid = $to_cat - WHERE file_catid = $from_cat"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt move files', '', __LINE__, __FILE__, $sql ); - } - - $this->modified( true ); - return; - } - - /** - * Enter description here... - * - * @param unknown_type $cat_id - * @param unknown_type $file_mode - * @param unknown_type $to_cat - */ - function delete_subcat( $cat_id, $file_mode = 'delete', $to_cat = false ) - { - global $db; - - if ( empty( $this->subcat_rowset[$cat_id] ) || count( $this->subcat_rowset[$cat_id] ) <= 0 ) - { - return; - } - - foreach( $this->subcat_rowset[$cat_id] as $sub_cat_id => $subcat_data ) - { - $this->delete_subcat( $sub_cat_id, $file_mode, $to_cat ); - - $sql = 'DELETE FROM ' . PA_CATEGORY_TABLE . " - WHERE cat_id = $sub_cat_id"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); - } - - if ( $file_mode == 'delete' ) - { - $this->delete_files( $sub_cat_id, 'category' ); - } - else - { - $this->move_files( $sub_cat_id, $to_cat ); - } - } - $this->modified( true ); - return; - } - - /** - * Enter description here... - * - * @param unknown_type $from_cat - * @param unknown_type $to_cat - */ - function move_subcat( $from_cat, $to_cat ) - { - global $db; - - $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " - SET cat_parent = $to_cat - WHERE cat_parent = $from_cat"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt move Sub Category', '', __LINE__, __FILE__, $sql ); - } - $this->modified( true ); - return; - } - - /** - * Enter description here... - * - * @param unknown_type $cat_parent - */ - function reorder_cat( $cat_parent ) - { - global $db; - - $sql = 'SELECT cat_id, cat_order - FROM ' . PA_CATEGORY_TABLE . " - WHERE cat_parent = $cat_parent - ORDER BY cat_order ASC"; - - if ( !$result = $db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not get list of Categories', '', __LINE__, __FILE__, $sql ); - } - - $i = 10; - while ( $row = $db->sql_fetchrow( $result ) ) - { - $cat_id = $row['cat_id']; - - $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " - SET cat_order = $i - WHERE cat_id = $cat_id"; - if ( !$db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not update order fields', '', __LINE__, __FILE__, $sql ); - } - $i += 10; - } - } - - /** - * Enter description here... - * - * @param unknown_type $cat_id - */ - function order_cat( $cat_id ) - { - global $db, $_GET; - - $move = ( isset( $_GET['move'] ) ) ? intval( $_GET['move'] ) : 15; - $cat_parent = $this->cat_rowset[$cat_id]['cat_parent']; - - $sql = 'UPDATE ' . PA_CATEGORY_TABLE . " - SET cat_order = cat_order + $move - WHERE cat_id = $cat_id"; - - if ( !$result = $db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not change category order', '', __LINE__, __FILE__, $sql ); - } - - $this->reorder_cat( $cat_parent ); - $this->init(); - } - - /** - * Enter description here... - * * @param unknown_type $file_id * @return unknown --- 1869,1872 ---- *************** *** 2581,2584 **** --- 2166,2271 ---- * Enter description here... * + * @param unknown_type $id + * @param unknown_type $mode + */ + function delete_files( $id, $mode = 'file' ) + { + global $db, $phpbb_root_path, $pafiledb_functions; + + if ( $mode == 'category' ) + { + $file_ids = array(); + $files_data = array(); + + $sql = 'SELECT file_id, unique_name, file_dir + FROM ' . PA_FILES_TABLE . " + WHERE file_catid = $id"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); + } + + while ( $row = $db->sql_fetchrow( $result ) ) + { + $file_ids[] = $row['file_id']; + $files_data[] = $row; + } + + $where_sql = "WHERE file_catid = $id"; + } + else + { + $sql = 'SELECT file_id, unique_name, file_dir + FROM ' . PA_FILES_TABLE . " + WHERE file_id = $id"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); + } + + $file_data = $db->sql_fetchrow( $result ); + + $where_sql = "WHERE file_id = $id"; + } + + $sql = 'DELETE FROM ' . PA_FILES_TABLE . " + $where_sql"; + + unset( $where_sql ); + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt delete files', '', __LINE__, __FILE__, $sql ); + } + + $where_sql = ( $mode != 'file' && !empty( $file_ids ) ) ? ' IN (' . implode( ', ', $file_ids ) . ') ' : " = $id"; + + $sql = 'DELETE FROM ' . PA_CUSTOM_DATA_TABLE . " + WHERE customdata_file$where_sql"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt delete custom data', '', __LINE__, __FILE__, $sql ); + } + + $sql = 'DELETE FROM ' . PA_MIRRORS_TABLE . " + WHERE file_id$where_sql"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt delete mirror for this file', '', __LINE__, __FILE__, $sql ); + } + + if ( $mode == 'category' ) + { + foreach( $files_data as $file_data ) + { + if ( !empty( $file_data['unique_name'] ) ) + { + $pafiledb_functions->pafiledb_unlink( $phpbb_root_path . $file_data['file_dir'] . $file_data['unique_name'] ); + } + } + } + else + { + if ( !empty( $file_data['unique_name'] ) ) + { + $pafiledb_functions->pafiledb_unlink( $phpbb_root_path . $file_data['file_dir'] . $file_data['unique_name'] ); + } + } + + if ( $mode == 'file' ) + { + $this->modified( true ); + } + + return; + } + + /** + * Enter description here... + * * @param unknown_type $file_id * @param unknown_type $file_upload *************** *** 2710,2723 **** * Enter description here... * - * @return unknown - */ - function file_mainenance() - { - return false; - } - - /** - * Enter description here... - * * @param unknown_type $mode * @param unknown_type $file_id --- 2397,2400 ---- |
|
From: Jon O. <jon...@us...> - 2006-07-08 16:28:50
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15070/modules/mx_pafiledb/pafiledb/admin Modified Files: admin_cat_manage.php admin_catauth_manage.php admin_custom_manage.php admin_fchecker_manage.php admin_file_manage.php admin_license_manage.php admin_settings.php admin_ug_auth_manage.php Log Message: moved functions and removed files Index: admin_cat_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_cat_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_cat_manage.php 8 Jul 2006 10:23:34 -0000 1.1 --- admin_cat_manage.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 18,22 **** function main( $action ) { ! global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // --- 18,22 ---- function main( $action ) { ! global $db, $images, $template, $pafiledb_template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // *************** *** 31,40 **** if ( $mode == 'do_add' && !$cat_id ) { ! $new_cat_id = $pafiledb->update_add_cat(); $mode = 'add'; ! if ( !sizeof( $pafiledb->error ) ) { ! $pafiledb->_pafiledb(); ! $message = $lang['Catadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_category.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_edit_permissions'], '<a href="' . append_sid( "admin_pa_catauth.$phpEx?cat_id=$new_cat_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 31,40 ---- if ( $mode == 'do_add' && !$cat_id ) { ! $new_cat_id = $this->update_add_cat(); $mode = 'add'; ! if ( !sizeof( $this->error ) ) { ! $this->_pafiledb(); ! $message = $lang['Catadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_edit_permissions'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=catauth_manage&cat_id=$new_cat_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 43,51 **** elseif ( $mode == 'do_add' && $cat_id ) { ! $new_cat_id = $pafiledb->update_add_cat( $cat_id ); ! if ( !sizeof( $pafiledb->error ) ) { ! $pafiledb->_pafiledb(); ! $message = $lang['Catedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_category.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_edit_permissions'], '<a href="' . append_sid( "admin_pa_catauth.$phpEx?cat_id=$new_cat_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 43,51 ---- elseif ( $mode == 'do_add' && $cat_id ) { ! $new_cat_id = $this->update_add_cat( $cat_id ); ! if ( !sizeof( $this->error ) ) { ! $this->_pafiledb(); ! $message = $lang['Catedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_edit_permissions'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=catauth_manage&cat_id=$new_cat_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 54,62 **** elseif ( $mode == 'do_delete' ) { ! $pafiledb->delete_cat( $cat_id ); ! if ( !sizeof( $pafiledb->error ) ) { ! $pafiledb->_pafiledb(); ! $message = $lang['Catsdeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_category.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 54,62 ---- elseif ( $mode == 'do_delete' ) { ! $this->delete_cat( $cat_id ); ! if ( !sizeof( $this->error ) ) { ! $this->_pafiledb(); ! $message = $lang['Catsdeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 64,76 **** elseif ( $mode == 'cat_order' ) { ! $pafiledb->order_cat( $cat_id_other ); } elseif ( $mode == 'sync' ) { ! $pafiledb->sync( $cat_id_other ); } elseif ( $mode == 'sync_all' ) { ! $pafiledb->sync_all(); } --- 64,76 ---- elseif ( $mode == 'cat_order' ) { ! $this->order_cat( $cat_id_other ); } elseif ( $mode == 'sync' ) { ! $this->sync( $cat_id_other ); } elseif ( $mode == 'sync_all' ) { ! $this->sync_all(); } *************** *** 109,113 **** $pafiledb_template->set_filenames( array( 'admin' => $template_file ) ); ! if ( sizeof( $pafiledb->error ) ) $pafiledb_template->assign_block_vars( 'pafiledb_error', array() ); $pafiledb_template->assign_vars( array( --- 109,113 ---- $pafiledb_template->set_filenames( array( 'admin' => $template_file ) ); ! if ( sizeof( $this->error ) ) $pafiledb_template->assign_block_vars( 'pafiledb_error', array() ); $pafiledb_template->assign_vars( array( *************** *** 115,121 **** 'L_CAT_EXPLAIN' => $l_explain, ! 'ERROR' => ( sizeof( $pafiledb->error ) ) ? implode( '<br />', $pafiledb->error ) : '', 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_CAT_ACTION' => append_sid( "admin_pa_category.$phpEx" ) )); --- 115,121 ---- 'L_CAT_EXPLAIN' => $l_explain, ! 'ERROR' => ( sizeof( $this->error ) ) ? implode( '<br />', $this->error ) : '', 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_CAT_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=cat_manage" ) )); *************** *** 131,135 **** 'L_RESYNC' => $lang['Resync'] )); ! admin_cat_main( $cat_id ); } elseif ( $mode == 'add' || $mode == 'edit' ) --- 131,135 ---- 'L_RESYNC' => $lang['Resync'] )); ! $this->admin_cat_main( $cat_id ); } elseif ( $mode == 'add' || $mode == 'edit' ) *************** *** 146,150 **** } ! $cat_list .= ( !$_POST['cat_parent'] ) ? $pafiledb->generate_jumpbox() : $pafiledb->generate_jumpbox( 0, 0, array( $_POST['cat_parent'] => 1 ) ); $checked_yes = ( $_POST['cat_allow_file'] ) ? ' checked' : ''; $checked_no = ( !$_POST['cat_allow_file'] ) ? ' checked' : ''; --- 146,150 ---- } ! $cat_list .= ( !$_POST['cat_parent'] ) ? $this->generate_jumpbox() : $this->generate_jumpbox( 0, 0, array( $_POST['cat_parent'] => 1 ) ); $checked_yes = ( $_POST['cat_allow_file'] ) ? ' checked' : ''; $checked_no = ( !$_POST['cat_allow_file'] ) ? ' checked' : ''; *************** *** 195,199 **** else { ! if ( !$pafiledb->cat_rowset[$cat_id]['cat_parent'] ) { $cat_list .= '<option value="0" selected>' . $lang['None'] . '</option>\n'; --- 195,199 ---- else { ! if ( !$this->cat_rowset[$cat_id]['cat_parent'] ) { $cat_list .= '<option value="0" selected>' . $lang['None'] . '</option>\n'; *************** *** 203,209 **** $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } ! $cat_list .= $pafiledb->generate_jumpbox( 0, 0, array( $pafiledb->cat_rowset[$cat_id]['cat_parent'] => 1 ) ); ! if ( $pafiledb->cat_rowset[$cat_id]['cat_allow_file'] ) { $checked_yes = ' checked'; --- 203,209 ---- $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } ! $cat_list .= $this->generate_jumpbox( 0, 0, array( $this->cat_rowset[$cat_id]['cat_parent'] => 1 ) ); ! if ( $this->cat_rowset[$cat_id]['cat_allow_file'] ) { $checked_yes = ' checked'; *************** *** 216,262 **** } ! $cat_name = $pafiledb->cat_rowset[$cat_id]['cat_name']; ! $cat_desc = $pafiledb->cat_rowset[$cat_id]['cat_desc']; // // Comments // ! $use_comments_yes = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_comments'] == 1 ) ? "checked=\"checked\"" : ""; ! $use_comments_no = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_comments'] == 0 ) ? "checked=\"checked\"" : ""; ! $use_comments_default = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_comments'] == -1 ) ? "checked=\"checked\"" : ""; ! $internal_comments_internal = ( $pafiledb->cat_rowset[$cat_id]['internal_comments'] == 1 ) ? "checked=\"checked\"" : ""; ! $internal_comments_phpbb = ( $pafiledb->cat_rowset[$cat_id]['internal_comments'] == 0 ) ? "checked=\"checked\"" : ""; ! $internal_comments_default = ( $pafiledb->cat_rowset[$cat_id]['internal_comments'] == -1 ) ? "checked=\"checked\"" : ""; ! $comments_forum_id = $pafiledb->cat_rowset[$cat_id]['comments_forum_id']; ! $autogenerate_comments_yes = ( $pafiledb->cat_rowset[$cat_id]['autogenerate_comments'] == 1 ) ? "checked=\"checked\"" : ""; ! $autogenerate_comments_no = ( $pafiledb->cat_rowset[$cat_id]['autogenerate_comments'] == 0 ) ? "checked=\"checked\"" : ""; ! $autogenerate_comments_default = ( $pafiledb->cat_rowset[$cat_id]['autogenerate_comments'] == -1 ) ? "checked=\"checked\"" : ""; // // Ratings // ! $use_ratings_yes = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_ratings'] == 1 ) ? "checked=\"checked\"" : ""; ! $use_ratings_no = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_ratings'] == 0 ) ? "checked=\"checked\"" : ""; ! $use_ratings_default = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_ratings'] == -1 ) ? "checked=\"checked\"" : ""; // // Instructions // ! $pretext_show = ( $pafiledb->cat_rowset[$cat_id]['show_pretext'] == 1 ) ? "checked=\"checked\"" : ""; ! $pretext_hide = ( $pafiledb->cat_rowset[$cat_id]['show_pretext'] == 0 ) ? "checked=\"checked\"" : ""; ! $pretext_default = ( $pafiledb->cat_rowset[$cat_id]['show_pretext'] == -1 ) ? "checked=\"checked\"" : ""; // // Notification // ! $notify_none = ( $pafiledb->cat_rowset[$cat_id]['notify'] == 0 ) ? "checked=\"checked\"" : ""; ! $notify_pm = ( $pafiledb->cat_rowset[$cat_id]['notify'] == 1 ) ? "checked=\"checked\"" : ""; ! $notify_email = ( $pafiledb->cat_rowset[$cat_id]['notify'] == 2 ) ? "checked=\"checked\"" : ""; ! $notify_default = ( $pafiledb->cat_rowset[$cat_id]['notify'] == -1 ) ? "checked=\"checked\"" : ""; ! $notify_group_list = mx_get_groups($pafiledb->cat_rowset[$cat_id]['notify_group'], 'notify_group'); } --- 216,262 ---- } ! $cat_name = $this->cat_rowset[$cat_id]['cat_name']; ! $cat_desc = $this->cat_rowset[$cat_id]['cat_desc']; // // Comments // ! $use_comments_yes = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 1 ) ? "checked=\"checked\"" : ""; ! $use_comments_no = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 0 ) ? "checked=\"checked\"" : ""; ! $use_comments_default = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == -1 ) ? "checked=\"checked\"" : ""; ! $internal_comments_internal = ( $this->cat_rowset[$cat_id]['internal_comments'] == 1 ) ? "checked=\"checked\"" : ""; ! $internal_comments_phpbb = ( $this->cat_rowset[$cat_id]['internal_comments'] == 0 ) ? "checked=\"checked\"" : ""; ! $internal_comments_default = ( $this->cat_rowset[$cat_id]['internal_comments'] == -1 ) ? "checked=\"checked\"" : ""; ! $comments_forum_id = $this->cat_rowset[$cat_id]['comments_forum_id']; ! $autogenerate_comments_yes = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 1 ) ? "checked=\"checked\"" : ""; ! $autogenerate_comments_no = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 0 ) ? "checked=\"checked\"" : ""; ! $autogenerate_comments_default = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == -1 ) ? "checked=\"checked\"" : ""; // // Ratings // ! $use_ratings_yes = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == 1 ) ? "checked=\"checked\"" : ""; ! $use_ratings_no = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == 0 ) ? "checked=\"checked\"" : ""; ! $use_ratings_default = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == -1 ) ? "checked=\"checked\"" : ""; // // Instructions // ! $pretext_show = ( $this->cat_rowset[$cat_id]['show_pretext'] == 1 ) ? "checked=\"checked\"" : ""; ! $pretext_hide = ( $this->cat_rowset[$cat_id]['show_pretext'] == 0 ) ? "checked=\"checked\"" : ""; ! $pretext_default = ( $this->cat_rowset[$cat_id]['show_pretext'] == -1 ) ? "checked=\"checked\"" : ""; // // Notification // ! $notify_none = ( $this->cat_rowset[$cat_id]['notify'] == 0 ) ? "checked=\"checked\"" : ""; ! $notify_pm = ( $this->cat_rowset[$cat_id]['notify'] == 1 ) ? "checked=\"checked\"" : ""; ! $notify_email = ( $this->cat_rowset[$cat_id]['notify'] == 2 ) ? "checked=\"checked\"" : ""; ! $notify_default = ( $this->cat_rowset[$cat_id]['notify'] == -1 ) ? "checked=\"checked\"" : ""; ! $notify_group_list = mx_get_groups($this->cat_rowset[$cat_id]['notify_group'], 'notify_group'); } *************** *** 288,292 **** 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], --- 288,292 ---- 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => $this->get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], *************** *** 363,368 **** elseif ( $mode == 'delete' ) { ! $select_cat = $pafiledb->generate_jumpbox( 0, 0, array( $cat_id => 1 ) ); ! $file_to_select_cat = $pafiledb->generate_jumpbox( 0, 0, '', true ); $pafiledb_template->assign_vars( array( --- 363,368 ---- elseif ( $mode == 'delete' ) { ! $select_cat = $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ) ); ! $file_to_select_cat = $this->generate_jumpbox( 0, 0, '', true ); $pafiledb_template->assign_vars( array( *************** *** 382,386 **** $pafiledb_template->display( 'admin' ); ! $pafiledb->_pafiledb(); $pafiledb_cache->unload(); } --- 382,386 ---- $pafiledb_template->display( 'admin' ); ! $this->_pafiledb(); $pafiledb_cache->unload(); } Index: admin_file_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_file_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_file_manage.php 8 Jul 2006 10:23:35 -0000 1.1 --- admin_file_manage.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 18,22 **** function main( $action ) { ! global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // --- 18,22 ---- function main( $action ) { ! global $db, $images, $template, $pafiledb_template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // *************** *** 24,27 **** --- 24,28 ---- // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); + include_once( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); // *************** *** 31,36 **** $custom_field->init(); - $pafiledb->init(); - $cat_id = ( isset( $_REQUEST['cat_id'] ) ) ? intval( $_REQUEST['cat_id'] ) : 0; $file_id = ( isset( $_REQUEST['file_id'] ) ) ? intval( $_REQUEST['file_id'] ) : 0; --- 32,35 ---- *************** *** 152,158 **** if ( $mode == 'do_add' && !$file_id ) { ! $file_id = $pafiledb->update_add_file(); $custom_field->file_update_data( $file_id ); ! $pafiledb->_pafiledb(); $mode = 'edit'; --- 151,157 ---- if ( $mode == 'do_add' && !$file_id ) { ! $file_id = $this->update_add_file(); $custom_field->file_update_data( $file_id ); ! $this->_pafiledb(); $mode = 'edit'; *************** *** 162,168 **** // Notification // ! $pafiledb->update_add_file_notify($file_id, 'add'); ! $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_file.php" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 161,167 ---- // Notification // ! $this->update_add_file_notify($file_id, 'add'); ! $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=file_manage" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 170,176 **** elseif ( $mode == 'do_add' && $file_id ) { ! $file_id = $pafiledb->update_add_file( $file_id ); $custom_field->file_update_data( $file_id ); ! $pafiledb->_pafiledb(); $mode = 'edit'; --- 169,175 ---- elseif ( $mode == 'do_add' && $file_id ) { ! $file_id = $this->update_add_file( $file_id ); $custom_field->file_update_data( $file_id ); ! $this->_pafiledb(); $mode = 'edit'; *************** *** 180,186 **** // Notification // ! $pafiledb->update_add_file_notify($file_id, 'edit'); ! $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_file.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 179,185 ---- // Notification // ! $this->update_add_file_notify($file_id, 'edit'); ! $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=file_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 205,216 **** // Notification // ! $pafiledb->update_add_file_notify($temp_file_id, 'delete'); // // Comments // ! if ($pafiledb->comments[$file_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) { ! if ( $pafiledb->comments[$file_info['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " --- 204,215 ---- // Notification // ! $this->update_add_file_notify($temp_file_id, 'delete'); // // Comments // ! if ($this->comments[$file_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) { ! if ( $this->comments[$file_info['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " *************** *** 234,238 **** } ! $pafiledb->delete_files( $temp_file_id ); } } --- 233,237 ---- } ! $this->delete_files( $temp_file_id ); } } *************** *** 251,262 **** // Notification // ! $pafiledb->update_add_file_notify($file_id, 'delete'); // // Comments // ! if ($pafiledb->comments[$file_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) { ! if ( $pafiledb->comments[$file_info['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " --- 250,261 ---- // Notification // ! $this->update_add_file_notify($file_id, 'delete'); // // Comments // ! if ($this->comments[$file_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) { ! if ( $this->comments[$file_info['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " *************** *** 280,291 **** } ! $pafiledb->delete_files( $file_id ); } ! $pafiledb->_pafiledb(); } elseif ( $mode == 'do_maintenace' ) { ! $pafiledb->file_mainenance(); } elseif ( $mode == 'do_approve' || $mode == 'do_unapprove' ) --- 279,290 ---- } ! $this->delete_files( $file_id ); } ! $this->_pafiledb(); } elseif ( $mode == 'do_maintenace' ) { ! $this->file_mainenance(); } elseif ( $mode == 'do_approve' || $mode == 'do_unapprove' ) *************** *** 295,314 **** foreach( $file_ids as $temp_file_id ) { ! $pafiledb->file_approve( $mode, $temp_file_id ); } // // Notification // ! $pafiledb->update_add_file_notify($file_ids, $mode); } else { ! $pafiledb->file_approve( $mode, $file_id ); // // Notification // ! $pafiledb->update_add_file_notify($file_id, $mode); } ! $pafiledb->_pafiledb(); } --- 294,313 ---- foreach( $file_ids as $temp_file_id ) { ! $this->file_approve( $mode, $temp_file_id ); } // // Notification // ! $this->update_add_file_notify($file_ids, $mode); } else { ! $this->file_approve( $mode, $file_id ); // // Notification // ! $this->update_add_file_notify($file_id, $mode); } ! $this->_pafiledb(); } *************** *** 321,325 **** 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FILE_ACTION' => append_sid( "admin_pa_file.$phpEx" ) )); --- 320,324 ---- 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FILE_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=file_manage" ) )); *************** *** 476,480 **** $cat_list = '<select name="cat_id">'; ! if ( !$pafiledb->cat_rowset[$cat_id]['cat_parent'] ) { $cat_list .= '<option value="0" selected>' . $lang['None'] . '</option>\n'; --- 475,479 ---- $cat_list = '<select name="cat_id">'; ! if ( !$this->cat_rowset[$cat_id]['cat_parent'] ) { $cat_list .= '<option value="0" selected>' . $lang['None'] . '</option>\n'; *************** *** 484,488 **** $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } ! $cat_list .= $pafiledb->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true ); $cat_list .= '</select>'; --- 483,487 ---- $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } ! $cat_list .= $this->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true ); $cat_list .= '</select>'; *************** *** 500,504 **** 'L_NO_FILES' => $lang['No_file'], ! 'PAGINATION' => generate_pagination( append_sid( "admin_pa_file.$phpEx?mode=$mode&sort_method=$sort_method&sort_order=$sort_order&cat_id=$cat_id" ), $total_files, $pafiledb_config['pagination'], $start ), 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $pafiledb_config['pagination'] ) + 1 ), ceil( $total_files / $pafiledb_config['pagination'] ) ), --- 499,503 ---- 'L_NO_FILES' => $lang['No_file'], ! 'PAGINATION' => generate_pagination( append_sid( "admin_pafiledb.$phpEx?action=file_manage&mode=$mode&sort_method=$sort_method&sort_order=$sort_order&cat_id=$cat_id" ), $total_files, $pafiledb_config['pagination'], $start ), 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $pafiledb_config['pagination'] ) + 1 ), ceil( $total_files / $pafiledb_config['pagination'] ) ), *************** *** 509,513 **** if ( $total_files > 0 ) { ! $template->assign_block_vars( 'pagination', array() ); } --- 508,512 ---- if ( $total_files > 0 ) { ! $pafiledb_template->assign_block_vars( 'pagination', array() ); } *************** *** 546,552 **** 'FILE_NUMBER' => $i++, 'FILE_ID' => $file_data['file_id'], ! 'U_FILE_EDIT' => append_sid( "admin_pa_file.$phpEx?mode=edit&file_id={$file_data['file_id']}" ), ! 'U_FILE_DELETE' => append_sid( "admin_pa_file.$phpEx?mode=delete&file_id={$file_data['file_id']}" ), ! 'U_FILE_APPROVE' => append_sid( "admin_pa_file.$phpEx?mode=$approve_mode&file_id={$file_data['file_id']}" ), 'L_APPROVE' => ( $file_data['file_approved'] ) ? $lang['Unapprove'] : $lang['Approve'] )); --- 545,551 ---- 'FILE_NUMBER' => $i++, 'FILE_ID' => $file_data['file_id'], ! 'U_FILE_EDIT' => append_sid( "admin_pafiledb.$phpEx?action=file_manage&mode=edit&file_id={$file_data['file_id']}" ), ! 'U_FILE_DELETE' => append_sid( "admin_pafiledb.$phpEx?action=file_manage&mode=delete&file_id={$file_data['file_id']}" ), ! 'U_FILE_APPROVE' => append_sid( "admin_pafiledb.$phpEx?action=file_manage&mode=$approve_mode&file_id={$file_data['file_id']}" ), 'L_APPROVE' => ( $file_data['file_approved'] ) ? $lang['Unapprove'] : $lang['Approve'] )); *************** *** 566,570 **** $file_website = ''; $file_posticons = $pafiledb_functions->post_icons(); ! $file_cat_list = $pafiledb->generate_jumpbox( 0, 0, '', true ); $file_license = $pafiledb_functions->license_list(); $pin_checked_yes = ''; --- 565,569 ---- $file_website = ''; $file_posticons = $pafiledb_functions->post_icons(); ! $file_cat_list = $this->generate_jumpbox( 0, 0, '', true ); $file_license = $pafiledb_functions->license_list(); $pin_checked_yes = ''; *************** *** 597,601 **** $file_website = $file_info['file_docsurl']; $file_posticons = $pafiledb_functions->post_icons( $file_info['file_posticon'] ); ! $file_cat_list = $pafiledb->generate_jumpbox( 0, 0, array( $file_info['file_catid'] => 1 ), true ); $file_license = $pafiledb_functions->license_list( $file_info['file_license'] ); $pin_checked_yes = ( $file_info['file_pin'] ) ? ' checked' : ''; --- 596,600 ---- $file_website = $file_info['file_docsurl']; $file_posticons = $pafiledb_functions->post_icons( $file_info['file_posticon'] ); ! $file_cat_list = $this->generate_jumpbox( 0, 0, array( $file_info['file_catid'] => 1 ), true ); $file_license = $pafiledb_functions->license_list( $file_info['file_license'] ); $pin_checked_yes = ( $file_info['file_pin'] ) ? ' checked' : ''; *************** *** 614,618 **** $pafiledb_template->assign_vars( array( ! 'U_MIRRORS_PAGE' => append_sid( "admin_pa_file.$phpEx?mode=mirrors&file_id=$file_id" ), 'ADD_MIRRORS' => $mirrors, --- 613,617 ---- $pafiledb_template->assign_vars( array( ! 'U_MIRRORS_PAGE' => append_sid( "admin_pafiledb.$phpEx?action=file_manage&mode=mirrors&file_id=$file_id" ), 'ADD_MIRRORS' => $mirrors, *************** *** 698,702 **** if ( !empty( $mirror_ids ) ) { ! $pafiledb->delete_mirror( $mirror_ids ); } } --- 697,701 ---- if ( !empty( $mirror_ids ) ) { ! $this->delete_mirror( $mirror_ids ); } } *************** *** 711,715 **** $mirror_location = ( !empty( $_POST['new_location'] ) ) ? $_POST['new_location'] : ''; ! $pafiledb->mirror_add_update( $file_id, $file_upload, $file_remote_url, $file_local, $file_realname, $file_size, $file_type, $mirror_location ); } --- 710,714 ---- $mirror_location = ( !empty( $_POST['new_location'] ) ) ? $_POST['new_location'] : ''; ! $this->mirror_add_update( $file_id, $file_upload, $file_remote_url, $file_local, $file_realname, $file_size, $file_type, $mirror_location ); } *************** *** 755,759 **** $mirror_location = ( !empty( $mirror_data['location'] ) ) ? $mirror_data['location'] : ''; ! $pafiledb->mirror_add_update( $file_id, $file_upload, $file_remote_url, $file_local, $file_realname, $file_size, $file_type, $mirror_location, $mirror_id ); } --- 754,758 ---- $mirror_location = ( !empty( $mirror_data['location'] ) ) ? $mirror_data['location'] : ''; ! $this->mirror_add_update( $file_id, $file_upload, $file_remote_url, $file_local, $file_realname, $file_size, $file_type, $mirror_location, $mirror_id ); } *************** *** 806,819 **** } ! $pafiledb_template->assign_vars( array( 'ERROR' => ( sizeof( $pafiledb->error ) ) ? implode( '<br />', $pafiledb->error ) : '' ) ); // // Output // - include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $pafiledb_template->display( 'admin' ); ! $pafiledb->_pafiledb(); $pafiledb_cache->unload(); - include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } } --- 805,816 ---- } ! $pafiledb_template->assign_vars( array( 'ERROR' => ( sizeof( $this->error ) ) ? implode( '<br />', $this->error ) : '' ) ); // // Output // $pafiledb_template->display( 'admin' ); ! $this->_pafiledb(); $pafiledb_cache->unload(); } } Index: admin_ug_auth_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_ug_auth_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_ug_auth_manage.php 8 Jul 2006 10:23:35 -0000 1.1 --- admin_ug_auth_manage.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 18,22 **** function main( $action ) { ! global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // --- 18,23 ---- function main( $action ) { ! global $db, $images, $template, $pafiledb_template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; ! global $cat_auth_fields, $cat_auth_const, $cat_auth_levels; // *************** *** 62,70 **** $permissions_menu = array( ! append_sid( "admin_pa_catauth.$phpEx" ) => $lang['Cat_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=user" ) => $lang['User_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=group" ) => $lang['Group_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=global_user" ) => $lang['User_Global_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=global_group" ) => $lang['Group_Global_Permissions'] ); --- 63,71 ---- $permissions_menu = array( ! append_sid( "admin_pafiledb.$phpEx?action=catauth_manage" ) => $lang['Cat_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=user" ) => $lang['User_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=group" ) => $lang['Group_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=global_user" ) => $lang['User_Global_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=global_group" ) => $lang['Group_Global_Permissions'] ); *************** *** 125,129 **** $update_mod_status = array(); ! foreach( $pafiledb->cat_rowset as $cat_id => $cat_data ) { if ( ( isset( $auth_access[$cat_id]['auth_mod'] ) && $change_mod_list[$cat_id]['auth_mod'] != $auth_access[$cat_id]['auth_mod'] ) || --- 126,130 ---- $update_mod_status = array(); ! foreach( $this->cat_rowset as $cat_id => $cat_data ) { if ( ( isset( $auth_access[$cat_id]['auth_mod'] ) && $change_mod_list[$cat_id]['auth_mod'] != $auth_access[$cat_id]['auth_mod'] ) || *************** *** 240,244 **** $l_auth_return = ( $mode == 'user' ) ? $lang['Click_return_userauth'] : $lang['Click_return_groupauth']; ! $message = $lang['Auth_updated'] . '<br /><br />' . sprintf( $l_auth_return, '<a href="' . append_sid( "admin_pa_ug_auth.$phpEx?mode=$mode" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 241,245 ---- $l_auth_return = ( $mode == 'user' ) ? $lang['Click_return_userauth'] : $lang['Click_return_groupauth']; ! $message = $lang['Auth_updated'] . '<br /><br />' . sprintf( $l_auth_return, '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=$mode" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 290,294 **** if ( $pafiledb_config[$auth_field] == AUTH_ACL && isset( $change_acl_list[$auth_field] ) ) { ! if ( ( !is_moderator( $group_id ) && ( isset( $auth_access[$auth_field] ) && $change_acl_list[$auth_field] != $auth_access[$auth_field] ) || ( !isset( $auth_access[$cat_id][$auth_field] ) && !empty( $change_acl_list[$auth_field] ) ) ) --- 291,295 ---- if ( $pafiledb_config[$auth_field] == AUTH_ACL && isset( $change_acl_list[$auth_field] ) ) { ! if ( ( !$this->is_moderator( $group_id ) && ( isset( $auth_access[$auth_field] ) && $change_acl_list[$auth_field] != $auth_access[$auth_field] ) || ( !isset( $auth_access[$cat_id][$auth_field] ) && !empty( $change_acl_list[$auth_field] ) ) ) *************** *** 310,314 **** } } ! else if ( ( !is_moderator( $auth_access['group_id'] ) && ( isset( $auth_access[$auth_field] ) && $change_acl_list[$auth_field] == $auth_access[$auth_field] ) ) && $global_auth_action == 'delete' ) { --- 311,315 ---- } } ! else if ( ( !$this->is_moderator( $auth_access['group_id'] ) && ( isset( $auth_access[$auth_field] ) && $change_acl_list[$auth_field] == $auth_access[$auth_field] ) ) && $global_auth_action == 'delete' ) { *************** *** 370,374 **** $l_auth_return = ( $mode == 'global_user' ) ? $lang['Click_return_userauth'] : $lang['Click_return_groupauth']; ! $message = $lang['Auth_updated'] . '<br /><br />' . sprintf( $l_auth_return, '<a href="' . append_sid( "admin_pa_ug_auth.$phpEx?mode=$mode" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 371,375 ---- $l_auth_return = ( $mode == 'global_user' ) ? $lang['Click_return_userauth'] : $lang['Click_return_groupauth']; ! $message = $lang['Auth_updated'] . '<br /><br />' . sprintf( $l_auth_return, '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=$mode" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 417,421 **** $is_admin = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == ADMIN && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0; ! foreach( $pafiledb->cat_rowset as $cat_id => $cat_data ) { for( $j = 0; $j < count( $cat_auth_fields ); $j++ ) --- 418,422 ---- $is_admin = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == ADMIN && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0; ! foreach( $this->cat_rowset as $cat_id => $cat_data ) { for( $j = 0; $j < count( $cat_auth_fields ); $j++ ) *************** *** 432,441 **** case AUTH_ACL: ! $auth_ug[$cat_id][$key] = ( !empty( $auth_access_count[$cat_id] ) ) ? $pafiledb->auth_check_user( AUTH_ACL, $key, $auth_access[$cat_id], $is_admin ) : 0; $auth_field_acl[$cat_id][$key] = $auth_ug[$cat_id][$key]; break; case AUTH_MOD: ! $auth_ug[$cat_id][$key] = ( !empty( $auth_access_count[$cat_id] ) ) ? $pafiledb->auth_check_user( AUTH_MOD, $key, $auth_access[$cat_id], $is_admin ) : 0; break; --- 433,442 ---- case AUTH_ACL: ! $auth_ug[$cat_id][$key] = ( !empty( $auth_access_count[$cat_id] ) ) ? $this->auth_check_user( AUTH_ACL, $key, $auth_access[$cat_id], $is_admin ) : 0; $auth_field_acl[$cat_id][$key] = $auth_ug[$cat_id][$key]; break; case AUTH_MOD: ! $auth_ug[$cat_id][$key] = ( !empty( $auth_access_count[$cat_id] ) ) ? $this->auth_check_user( AUTH_MOD, $key, $auth_access[$cat_id], $is_admin ) : 0; break; *************** *** 452,456 **** // Is user a moderator? ! $auth_ug[$cat_id]['auth_mod'] = ( !empty( $auth_access_count[$cat_id] ) ) ? $pafiledb->auth_check_user( AUTH_MOD, 'auth_mod', $auth_access[$cat_id], 0 ) : 0; } --- 453,457 ---- // Is user a moderator? ! $auth_ug[$cat_id]['auth_mod'] = ( !empty( $auth_access_count[$cat_id] ) ) ? $this->auth_check_user( AUTH_MOD, 'auth_mod', $auth_access[$cat_id], 0 ) : 0; } *************** *** 464,468 **** $field_name = $cat_auth_fields[$k]; ! if ( $pafiledb->cat_rowset[$cat_id][$field_name] == AUTH_ACL ) { $optionlist_acl_adv[$cat_id][$k] = '<select name="private_' . $field_name . '[' . $cat_id . ']">'; --- 465,469 ---- $field_name = $cat_auth_fields[$k]; ! if ( $this->cat_rowset[$cat_id][$field_name] == AUTH_ACL ) { $optionlist_acl_adv[$cat_id][$k] = '<select name="private_' . $field_name . '[' . $cat_id . ']">'; *************** *** 499,503 **** $optionlist_mod[$cat_id] .= '</select>'; } ! admin_display_cat_auth_ug(); if ( $mode == 'user' ) --- 500,504 ---- $optionlist_mod[$cat_id] .= '</select>'; } ! $this->admin_display_cat_auth_ug(); if ( $mode == 'user' ) *************** *** 528,532 **** $ug = ( $mode == 'user' ) ? 'group&' . POST_GROUPS_URL : 'user&' . POST_USERS_URL; ! $t_usergroup_list .= ( ( $t_usergroup_list != '' ) ? ', ' : '' ) . '<a href="' . append_sid( "admin_pa_ug_auth.$phpEx?mode=$ug=" . $id[$i] ) . '">' . $name[$i] . '</a>'; } } --- 529,533 ---- $ug = ( $mode == 'user' ) ? 'group&' . POST_GROUPS_URL : 'user&' . POST_USERS_URL; ! $t_usergroup_list .= ( ( $t_usergroup_list != '' ) ? ', ' : '' ) . '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=$ug=" . $id[$i] ) . '">' . $name[$i] . '</a>'; } } *************** *** 582,589 **** 'L_CAT' => $lang['Category'], ! 'U_USER_OR_GROUP' => append_sid( "admin_pa_ug_auth.$phpEx" ), 'S_COLUMN_SPAN' => $s_column_span + 2, ! 'S_AUTH_ACTION' => append_sid( "admin_pa_ug_auth.$phpEx" ), 'S_HIDDEN_FIELDS' => $s_hidden_fields )); --- 583,590 ---- 'L_CAT' => $lang['Category'], ! 'U_USER_OR_GROUP' => append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage" ), 'S_COLUMN_SPAN' => $s_column_span + 2, ! 'S_AUTH_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage" ), 'S_HIDDEN_FIELDS' => $s_hidden_fields )); *************** *** 662,671 **** case AUTH_ACL: ! $auth_ug[$key] = ( !empty( $auth_access_count ) ) ? global_auth_check_user( AUTH_ACL, $key, $auth_access, $is_admin ) : 0; $auth_field_acl[$key] = $auth_ug[$key]; break; case AUTH_MOD: ! $auth_ug[$key] = ( !empty( $auth_access_count ) ) ? global_auth_check_user( AUTH_MOD, $key, $auth_access, $is_admin ) : 0; break; --- 663,672 ---- case AUTH_ACL: ! $auth_ug[$key] = ( !empty( $auth_access_count ) ) ? $this->global_auth_check_user( AUTH_ACL, $key, $auth_access, $is_admin ) : 0; $auth_field_acl[$key] = $auth_ug[$key]; break; case AUTH_MOD: ! $auth_ug[$key] = ( !empty( $auth_access_count ) ) ? $this->global_auth_check_user( AUTH_MOD, $key, $auth_access, $is_admin ) : 0; break; *************** *** 688,692 **** $optionlist_acl_adv[$k] = '<select name="private_' . $field_name . '">'; ! if ( isset( $auth_field_acl[$field_name] ) && !( $is_admin || is_moderator( $group_id ) ) ) { if ( !$auth_field_acl[$field_name] ) --- 689,693 ---- $optionlist_acl_adv[$k] = '<select name="private_' . $field_name . '">'; ! if ( isset( $auth_field_acl[$field_name] ) && !( $is_admin || $this->is_moderator( $group_id ) ) ) { if ( !$auth_field_acl[$field_name] ) *************** *** 701,705 **** else { ! if ( $is_admin || is_moderator( $group_id ) ) { $optionlist_acl_adv[$k] .= '<option value="1">' . $lang['ON'] . '</option>'; --- 702,706 ---- else { ! if ( $is_admin || $this->is_moderator( $group_id ) ) { $optionlist_acl_adv[$k] .= '<option value="1">' . $lang['ON'] . '</option>'; *************** *** 720,724 **** 'PRE' => '', ! 'U_CAT' => append_sid( "admin_pa_settings.$phpEx" ) )); --- 721,725 ---- 'PRE' => '', ! 'U_CAT' => append_sid( "admin_pafiledb.$phpEx?action=settings" ) )); *************** *** 755,759 **** $ug = ( $mode == 'global_user' ) ? 'global_group&' . POST_GROUPS_URL : 'global_user&' . POST_USERS_URL; ! $t_usergroup_list .= ( ( $t_usergroup_list != '' ) ? ', ' : '' ) . '<a href="' . append_sid( "admin_pa_ug_auth.$phpEx?mode=$ug=" . $id[$i] ) . '">' . $name[$i] . '</a>'; } } --- 756,760 ---- $ug = ( $mode == 'global_user' ) ? 'global_group&' . POST_GROUPS_URL : 'global_user&' . POST_USERS_URL; ! $t_usergroup_list .= ( ( $t_usergroup_list != '' ) ? ', ' : '' ) . '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=$ug=" . $id[$i] ) . '">' . $name[$i] . '</a>'; } } *************** *** 808,815 **** 'L_CAT' => ( $mode == 'global_user' ) ? $lang['User_Global_Permissions'] : $lang['Group_Global_Permissions'], ! 'U_USER_OR_GROUP' => append_sid( "admin_pa_ug_auth.$phpEx" ), 'S_COLUMN_SPAN' => $s_column_span + 1, ! 'S_AUTH_ACTION' => append_sid( "admin_pa_ug_auth.$phpEx" ), 'S_HIDDEN_FIELDS' => $s_hidden_fields )); --- 809,816 ---- 'L_CAT' => ( $mode == 'global_user' ) ? $lang['User_Global_Permissions'] : $lang['Group_Global_Permissions'], ! 'U_USER_OR_GROUP' => append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage" ), 'S_COLUMN_SPAN' => $s_column_span + 1, ! 'S_AUTH_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage" ), 'S_HIDDEN_FIELDS' => $s_hidden_fields )); *************** *** 866,870 **** 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_' . $l_type . '_ACTION' => append_sid( "admin_pa_ug_auth.$phpEx" ) )); } --- 867,871 ---- 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_' . $l_type . '_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage" ) )); } *************** *** 872,876 **** $pafiledb_template->display( 'body' ); ! $pafiledb->_pafiledb(); $pafiledb_cache->unload(); } --- 873,877 ---- $pafiledb_template->display( 'body' ); ! $this->_pafiledb(); $pafiledb_cache->unload(); } Index: admin_custom_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_custom_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_custom_manage.php 8 Jul 2006 10:23:34 -0000 1.1 --- admin_custom_manage.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 18,22 **** function main( $action ) { ! global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // --- 18,22 ---- function main( $action ) { ! global $db, $images, $template, $pafiledb_template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // *************** *** 24,27 **** --- 24,28 ---- // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); + include_once( $module_root_path . 'pafiledb/includes/functions_field.' . $phpEx ); // *************** *** 65,69 **** $custom_field->update_add_field( $field_type ); ! $message = $lang['Fieldadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_pa_custom.' . $phpEx ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 66,70 ---- $custom_field->update_add_field( $field_type ); ! $message = $lang['Fieldadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_pafiledb.' . $phpEx . '?action=custom_manage' ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 72,76 **** $custom_field->update_add_field( $field_type, $field_id ); ! $message = $lang['Fieldedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_pa_custom.' . $phpEx ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 73,77 ---- $custom_field->update_add_field( $field_type, $field_id ); ! $message = $lang['Fieldedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_pafiledb.' . $phpEx . '?action=custom_manage' ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 82,86 **** } ! $message = $lang['Fieldsdel'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_pa_custom.' . $phpEx ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 83,87 ---- } ! $message = $lang['Fieldsdel'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_pafiledb.' . $phpEx . '?action=custom_manage' ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 134,138 **** 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FIELD_ACTION' => append_sid( "admin_pa_custom.$phpEx" ) )); --- 135,139 ---- 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FIELD_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=custom_manage" ) )); *************** *** 193,197 **** // Output $pafiledb_template->display( 'admin' ); ! $pafiledb->_pafiledb(); $pafiledb_cache->unload(); } --- 194,198 ---- // Output $pafiledb_template->display( 'admin' ); ! $this->_pafiledb(); $pafiledb_cache->unload(); } Index: admin_settings.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_settings.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_settings.php 8 Jul 2006 10:23:35 -0000 1.1 --- admin_settings.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 81,85 **** { $pafiledb_cache->unload(); ! $message = $lang['Settings_changed'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_settings.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 81,85 ---- { $pafiledb_cache->unload(); ! $message = $lang['Settings_changed'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=settings" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 266,270 **** $template->assign_vars( array( ! 'S_SETTINGS_ACTION' => append_sid( "admin_pa_settings.$phpEx" ), 'L_CONFIGURATION_TITLE' => $lang['Panel_config_title'], --- 266,270 ---- $template->assign_vars( array( ! 'S_SETTINGS_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=settings" ), 'L_CONFIGURATION_TITLE' => $lang['Panel_config_title'], *************** *** 325,329 **** 'L_MAX_FILE_SIZE_INFO' => $lang['Max_filesize_explain'], 'MAX_FILE_SIZE' => $max_file_size, ! 'S_FILESIZE' => pa_size_select( 'max_size', $size ), 'L_FORBIDDEN_EXTENSIONS' => $lang['Forbidden_extensions'], --- 325,329 ---- 'L_MAX_FILE_SIZE_INFO' => $lang['Max_filesize_explain'], 'MAX_FILE_SIZE' => $max_file_size, ! 'S_FILESIZE' => $this->pa_size_select( 'max_size', $size ), 'L_FORBIDDEN_EXTENSIONS' => $lang['Forbidden_extensions'], *************** *** 385,389 **** 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( $comments_forum_id, false, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], --- 385,389 ---- 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => $this->get_forums( $comments_forum_id, false, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], Index: admin_fchecker_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_fchecker_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_fchecker_manage.php 8 Jul 2006 10:23:35 -0000 1.1 --- admin_fchecker_manage.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 30,36 **** $html_path = PORTAL_URL . $module_root_path . 'pafiledb/uploads/'; ! if ( isset( $HTTP_GET_VARS['safety'] ) || isset( $HTTP_POST_VARS['safety'] ) ) { ! $safety = ( isset( $HTTP_POST_VARS['safety'] ) ) ? intval( $HTTP_POST_VARS['safety'] ) : intval( $HTTP_GET_VARS['safety'] ); } --- 30,36 ---- $html_path = PORTAL_URL . $module_root_path . 'pafiledb/uploads/'; ! if ( isset( $_GET['safety'] ) || isset( $_POST['safety'] ) ) { ! $safety = ( isset( $_POST['safety'] ) ) ? intval( $_POST['safety'] ) : intval( $_GET['safety'] ); } *************** *** 167,173 **** // Output - include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'admin' ); - include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } } --- 167,171 ---- Index: admin_catauth_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_catauth_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_catauth_manage.php 8 Jul 2006 10:23:34 -0000 1.1 --- admin_catauth_manage.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 18,22 **** function main( $action ) { ! global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // --- 18,23 ---- function main( $action ) { ! global $db, $images, $template, $pafiledb_template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; ! global $cat_auth_fields, $cat_auth_const, $cat_auth_levels; // *************** *** 93,97 **** } ! $message = $lang['Category_auth_updated'] . '<br /><br />' . sprintf( $lang['Click_return_catauth'], '<a href="' . append_sid( "admin_pa_catauth.$phpEx" ) . '">', "</a>" ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 94,98 ---- } ! $message = $lang['Category_auth_updated'] . '<br /><br />' . sprintf( $lang['Click_return_catauth'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=catauth_manage" ) . '">', "</a>" ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 104,112 **** $permissions_menu = array( ! append_sid( "admin_pa_catauth.$phpEx" ) => $lang['Cat_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=user" ) => $lang['User_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=group" ) => $lang['Group_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=global_user" ) => $lang['User_Global_Permissions'], ! append_sid( "admin_pa_ug_auth.$phpEx?mode=global_group" ) => $lang['Group_Global_Permissions'] ); --- 105,113 ---- $permissions_menu = array( ! append_sid( "admin_pafiledb.$phpEx?action=catauth_manage" ) => $lang['Cat_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=user" ) => $lang['User_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=group" ) => $lang['Group_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=global_user" ) => $lang['User_Global_Permissions'], ! append_sid( "admin_pafiledb.$phpEx?action=ug_auth_manage&mode=global_group" ) => $lang['Group_Global_Permissions'] ); *************** *** 131,135 **** if ( empty( $cat_id ) ) { ! admin_display_cat_auth( $cat_parent ); $cat_name = ''; } --- 132,136 ---- if ( empty( $cat_id ) ) { ! $this->admin_display_cat_auth( $cat_parent ); $cat_name = ''; } *************** *** 137,143 **** { $pafiledb_template->assign_block_vars( 'cat_row', array( ! 'CATEGORY_NAME' => $pafiledb->cat_rowset[$cat_id]['cat_name'], ! 'IS_HIGHER_CAT' => ( $pafiledb->cat_rowset[$cat_id] ) ? false : true, ! 'U_CAT' => append_sid( "admin_pa_catauth.$phpEx?cat_parent={$pafiledb->cat_rowset[$cat_id]['cat_parent']}" ) )); --- 138,144 ---- { $pafiledb_template->assign_block_vars( 'cat_row', array( ! 'CATEGORY_NAME' => $this->cat_rowset[$cat_id]['cat_name'], ! 'IS_HIGHER_CAT' => ( $this->cat_rowset[$cat_id] ) ? false : true, ! 'U_CAT' => append_sid( "admin_pafiledb.$phpEx?action=catauth_manage&cat_parent={$this->cat_rowset[$cat_id]['cat_parent']}" ) )); *************** *** 148,152 **** for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) { ! $selected = ( $pafiledb->cat_rowset[$cat_id][$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>'; } --- 149,153 ---- for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) { ! $selected = ( $this->cat_rowset[$cat_id][$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>'; } *************** *** 157,161 **** $s_hidden_fields = '<input type="hidden" name="cat_id" value="' . $cat_id . '">'; ! $cat_name = $pafiledb->cat_rowset[$cat_id]['cat_name']; } --- 158,162 ---- $s_hidden_fields = '<input type="hidden" name="cat_id" value="' . $cat_id . '">'; ! $cat_name = $this->cat_rowset[$cat_id]['cat_name']; } *************** *** 171,175 **** 'L_RESET' => $lang['Reset'], ! 'S_CATAUTH_ACTION' => append_sid( "admin_pa_catauth.$phpEx" ), 'S_COLUMN_SPAN' => $s_column_span, 'S_HIDDEN_FIELDS' => $s_hidden_fields --- 172,176 ---- 'L_RESET' => $lang['Reset'], ! 'S_CATAUTH_ACTION' => append_sid( "admin_pafiledb.$phpEx?action=catauth_manage" ), 'S_COLUMN_SPAN' => $s_column_span, 'S_HIDDEN_FIELDS' => $s_hidden_fields *************** *** 178,182 **** // Output $pafiledb_template->display( 'body' ); ! $pafiledb->_pafiledb(); $pafiledb_cache->unload(); } --- 179,183 ---- // Output $pafiledb_template->display( 'body' ); ! $this->_pafiledb(); $pafiledb_cache->unload(); } Index: admin_license_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/admin/admin_license_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_license_manage.php 8 Jul 2006 10:23:35 -0000 1.1 --- admin_license_manage.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 25,31 **** include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! if ( isset( $HTTP_GET_VARS['license'] ) || isset( $HTTP_POST_VARS['license'] ) ) { ! $license = ( isset( $HTTP_POST_VARS['license'] ) ) ? $HTTP_POST_VARS['license'] : $HTTP_GET_VARS['license']; switch ( $license ) --- 25,31 ---- include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! if ( isset( $_GET['license'] ) || isset( $_POST['license'] ) ) { ! $license = ( isset( $_POST['license'] ) ) ? $_POST['license'] : $_GET['license']; switch ( $license ) *************** *** 35,48 **** $template->set_filenames( array( 'admin' => 'admin/pa_admin_license_add.tpl' ) ); ! if ( isset( $HTTP_GET_VARS['add'] ) || isset( $HTTP_POST_VARS['add'] ) ) { ! $add = ( isset( $HTTP_GET_VARS['add'] ) ) ? $HTTP_GET_VARS['add'] : $HTTP_POST_VARS['add']; } if ( $add == 'do' ) { ! if ( isset( $HTTP_GET_VARS['form'] ) || isset( $HTTP_POST_VARS['form'] ) ) { ! $form = ( isset( $HTTP_GET_VARS['form'] ) ) ? $HTTP_GET_VARS['form'] : $HTTP_POST_VARS['form']; } // $form['text'] = str_replace("\n", "<br>", $form['text']); --- 35,48 ---- $template->set_filenames( array( 'admin' => 'admin/pa_admin_license_add.tpl' ) ); ! if ( isset( $_GET['add'] ) || isset( $_POST['add'] ) ) { ! $add = ( isset( $_GET['add'] ) ) ? $_GET['add'] : $_POST['add']; } if ( $add == 'do' ) { ! if ( isset( $_GET['form'] ) || isset( $_POST['form'] ) ) { ! $form = ( isset( $_GET['form'] ) ) ? $_GET['form'] : $_POST['form']; } // $form['text'] = str_replace("\n", "<br>", $form['text']); *************** *** 54,58 **** } ! $message = $lang['Licenseadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_license.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 54,58 ---- } ! $message = $lang['Licenseadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pafiledb.$phpEx?action=li... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2006-07-08 16:28:50
|
Update of /cvsroot/mxbb/mx_pafiledb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15070/modules/mx_pafiledb/admin Modified Files: admin_pafiledb.php Removed 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: moved functions and removed files --- admin_pa_category.php DELETED --- --- admin_pa_file.php DELETED --- --- admin_pa_settings.php DELETED --- --- admin_pa_catauth.php DELETED --- --- admin_pa_license.php DELETED --- --- admin_pa_fchecker.php DELETED --- Index: admin_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pafiledb.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_pafiledb.php 8 Jul 2006 10:23:34 -0000 1.1 --- admin_pafiledb.php 8 Jul 2006 16:28:46 -0000 1.2 *************** *** 59,63 **** $module['pafileDB_Download']['1_Cat_manage'] = $setmodules_admin_path . $filename . "?action=cat_manage"; $module['pafileDB_Download']['2_File_manage'] = $setmodules_admin_path . $filename . "?action=file_manage"; ! $module['pafileDB_Download']['3_Permissions'] = $setmodules_admin_path . $filename . "?action=auth_manage"; $module['pafileDB_Download']['4_License'] = $setmodules_admin_path . $filename . "?action=license_manage"; $module['pafileDB_Download']['5_Custom_manage'] = $setmodules_admin_path . $filename . "?action=custom_manage"; --- 59,63 ---- $module['pafileDB_Download']['1_Cat_manage'] = $setmodules_admin_path . $filename . "?action=cat_manage"; $module['pafileDB_Download']['2_File_manage'] = $setmodules_admin_path . $filename . "?action=file_manage"; ! $module['pafileDB_Download']['3_Permissions'] = $setmodules_admin_path . $filename . "?action=catauth_manage"; $module['pafileDB_Download']['4_License'] = $setmodules_admin_path . $filename . "?action=license_manage"; $module['pafileDB_Download']['5_Custom_manage'] = $setmodules_admin_path . $filename . "?action=custom_manage"; *************** *** 96,100 **** 'cat_manage' => 'cat_manage', 'file_manage' => 'file_manage', ! 'auth_manage' => 'auth_manage', 'license_manage' => 'license_manage', 'custom_manage' => 'custom_manage', --- 96,101 ---- 'cat_manage' => 'cat_manage', 'file_manage' => 'file_manage', ! 'catauth_manage' => 'catauth_manage', ! 'ug_auth_manage' => 'ug_auth_manage', 'license_manage' => 'license_manage', 'custom_manage' => 'custom_manage', --- admin_pa_custom.php DELETED --- --- admin_pa_ug_auth.php DELETED --- |
|
From: Jon O. <jon...@us...> - 2006-07-08 16:26:07
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13965/modules/mx_linkdb/linkdb/includes Modified Files: functions_admin.php functions_linkdb.php Log Message: moved functions Index: functions_admin.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_admin.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions_admin.php 8 Jul 2006 10:22:38 -0000 1.1 --- functions_admin.php 8 Jul 2006 16:26:04 -0000 1.2 *************** *** 43,46 **** --- 43,369 ---- } + /** + * Enter description here... + * + * @param unknown_type $cat_id + * @return unknown + */ + function update_add_cat( $cat_id = false ) + { + global $db, $_POST, $lang; + + $cat_name = ( isset( $_POST['cat_name'] ) ) ? htmlspecialchars( $_POST['cat_name'] ) : ''; + $cat_desc = ( isset( $_POST['cat_desc'] ) ) ? htmlspecialchars( $_POST['cat_desc'] ) : ''; + $cat_parent = ( isset( $_POST['cat_parent'] ) ) ? intval( $_POST['cat_parent'] ) : 0; + $cat_allow_file = ( isset( $_POST['cat_allow_file'] ) ) ? intval( $_POST['cat_allow_file'] ) : 0; + + $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; + $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; + $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; + $comments_forum_id = intval( $_POST['comments_forum_id'] ); + + $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; + + $cat_use_ratings = ( isset( $_POST['cat_allow_ratings'] ) ) ? intval( $_POST['cat_allow_ratings'] ) : 0; + + $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; + $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; + + // + // Permissions + // + $view_level = intval( $_POST['auth_view'] ); + $post_level = intval( $_POST['auth_post'] ); + $rate_level = intval( $_POST['auth_rate'] ); + $comment_level = intval( $_POST['auth_comment'] ); + $edit_level = intval( $_POST['auth_edit'] ); + $delete_level = intval( $_POST['auth_delete'] ); + $approval_level = intval( $_POST['auth_approval'] ); + $approval_edit_level = intval( $_POST['auth_approval_edit'] ); + + if ( empty( $cat_name ) ) + { + $this->error[] = $lang['Cat_name_missing']; + } + + if ( $cat_parent ) + { + if ( !$this->cat_rowset[$cat_parent]['cat_allow_file'] && !$cat_allow_file ) + { + $this->error[] = $lang['Cat_conflict']; + } + } + + if ( sizeof( $this->error ) ) + { + return; + } + + $cat_name = str_replace( "\'", "''", $cat_name ); + $cat_desc = str_replace( "\'", "''", $cat_desc ); + + if ( !$cat_id ) + { + $cat_order = 0; + if ( !empty( $this->subcat_rowset[$cat_parent] ) ) + { + foreach( $this->subcat_rowset[$cat_parent] as $cat_data ) + { + if ( $cat_order < $cat_data['cat_order'] ) + { + $cat_order = $cat_data['cat_order']; + } + } + } + + $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)"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldn\'t add a new category', '', __LINE__, __FILE__, $sql ); + } + } + else + { + $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " + SET cat_name = '$cat_name', cat_desc = '$cat_desc', cat_parent = $cat_parent, cat_allow_file = $cat_allow_file, cat_allow_ratings = $cat_use_ratings, cat_allow_comments = $cat_use_comments, internal_comments = $cat_internal_comments, autogenerate_comments = $cat_autogenerate_comments, comments_forum_id = $comments_forum_id, show_pretext = $cat_show_pretext, notify = $cat_notify, notify_group = $cat_notify_group, auth_view = $view_level, auth_post = $post_level, auth_rate = $rate_level, auth_comment = $comment_level, auth_edit = $edit_level, auth_delete = $delete_level, auth_approval = $approval_level, auth_approval_edit = $approval_edit_level + WHERE cat_id = $cat_id"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldn\'t Edit this category', '', __LINE__, __FILE__, $sql ); + } + + if ( $cat_parent != $this->cat_rowset[$cat_id]['cat_parent'] ) + { + $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); + $this->reorder_cat( $cat_parent ); + } + $this->modified( true ); + } + + if ( $cat_id ) + { + return $cat_id; + } + else + { + return $db->sql_nextid(); + } + } + + /** + * Enter description here... + * + * @param unknown_type $cat_id + */ + function delete_cat( $cat_id = false ) + { + global $db, $_POST, $lang; + + $file_to_cat_id = ( isset( $_POST['file_to_cat_id'] ) ) ? intval( $_POST['file_to_cat_id'] ) : ''; + $subcat_to_cat_id = ( isset( $_POST['subcat_to_cat_id'] ) ) ? intval( $_POST['subcat_to_cat_id'] ) : ''; + $file_mode = ( isset( $_POST['file_mode'] ) ) ? htmlspecialchars( $_POST['file_mode'] ) : 'move'; + $subcat_mode = ( isset( $_POST['subcat_mode'] ) ) ? htmlspecialchars( $_POST['subcat_mode'] ) : 'move'; + + if ( empty( $cat_id ) ) + { + $this->error[] = $lang['Cdelerror']; + } + else + { + if ( ( $file_to_cat_id == -1 || empty( $file_to_cat_id ) ) && $file_mode == 'move' ) + { + $this->error[] = $lang['Cdelerror']; + } + + if ( $subcat_mode == 'move' && empty( $subcat_to_cat_id ) ) + { + $this->error[] = $lang['Cdelerror']; + } + + if ( sizeof( $this->error ) ) + { + return; + } + + $sql = 'DELETE FROM ' . LINK_CATEGORIES_TABLE . " + WHERE cat_id = $cat_id"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); + } + + $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); + + if ( $file_mode == 'delete' ) + { + $this->delete_links( $cat_id, 'category' ); + } + else + { + $this->move_links( $cat_id, $file_to_cat_id ); + } + + if ( $subcat_mode == 'delete' ) + { + $this->delete_subcat( $cat_id, $file_mode, $file_to_cat_id ); + } + else + { + $this->move_subcat( $cat_id, $subcat_to_cat_id ); + } + $this->modified( true ); + } + } + + /** + * Enter description here... + * + * @param unknown_type $from_cat + * @param unknown_type $to_cat + */ + function move_links( $from_cat, $to_cat ) + { + global $db; + + $sql = 'UPDATE ' . LINKS_TABLE . " + SET link_catid = $to_cat + WHERE link_catid = $from_cat"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt move files', '', __LINE__, __FILE__, $sql ); + } + $this->modified( true ); + return; + } + + /** + * Enter description here... + * + * @param unknown_type $cat_id + * @param unknown_type $file_mode + * @param unknown_type $to_cat + */ + function delete_subcat( $cat_id, $file_mode = 'delete', $to_cat = false ) + { + global $db; + + if ( empty( $this->subcat_rowset[$cat_id] ) || count( $this->subcat_rowset[$cat_id] ) <= 0 ) + { + return; + } + + foreach( $this->subcat_rowset[$cat_id] as $sub_cat_id => $subcat_data ) + { + $this->delete_subcat( $sub_cat_id, $file_mode, $to_cat ); + + $sql = 'DELETE FROM ' . LINK_CATEGORIES_TABLE . " + WHERE cat_id = $sub_cat_id"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); + } + + if ( $file_mode == 'delete' ) + { + $this->delete_links( $sub_cat_id, 'category' ); + } + else + { + $this->move_links( $sub_cat_id, $to_cat ); + } + } + $this->modified( true ); + return; + } + + /** + * Enter description here... + * + * @param unknown_type $from_cat + * @param unknown_type $to_cat + */ + function move_subcat( $from_cat, $to_cat ) + { + global $db; + + $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " + SET cat_parent = $to_cat + WHERE cat_parent = $from_cat"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt move Sub Category', '', __LINE__, __FILE__, $sql ); + } + $this->modified( true ); + return; + } + + /** + * Enter description here... + * + * @param unknown_type $cat_parent + */ + function reorder_cat( $cat_parent ) + { + global $db; + + $sql = 'SELECT cat_id, cat_order + FROM ' . LINK_CATEGORIES_TABLE . " + WHERE cat_parent = $cat_parent + ORDER BY cat_order ASC"; + + if ( !$result = $db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not get list of Categories', '', __LINE__, __FILE__, $sql ); + } + + $i = 10; + while ( $row = $db->sql_fetchrow( $result ) ) + { + $cat_id = $row['cat_id']; + + $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " + SET cat_order = $i + WHERE cat_id = $cat_id"; + if ( !$db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not update order fields', '', __LINE__, __FILE__, $sql ); + } + $i += 10; + } + } + + /** + * Enter description here... + * + * @param unknown_type $cat_id + */ + function order_cat( $cat_id ) + { + global $db, $_GET; + + $move = ( isset( $_GET['move'] ) ) ? intval( $_GET['move'] ) : 15; + $cat_parent = $this->cat_rowset[$cat_id]['cat_parent']; + + $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " + SET cat_order = cat_order + $move + WHERE cat_id = $cat_id"; + + if ( !$result = $db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not change category order', '', __LINE__, __FILE__, $sql ); + } + + $this->reorder_cat( $cat_parent ); + $this->init(); + } } ?> \ No newline at end of file Index: functions_linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_linkdb.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** functions_linkdb.php 8 Jul 2006 10:22:38 -0000 1.14 --- functions_linkdb.php 8 Jul 2006 16:26:04 -0000 1.15 *************** *** 1406,1808 **** * Enter description here... * - * @param unknown_type $cat_id - * @return unknown - */ - function update_add_cat( $cat_id = false ) - { - global $db, $_POST, $lang; - - $cat_name = ( isset( $_POST['cat_name'] ) ) ? htmlspecialchars( $_POST['cat_name'] ) : ''; - $cat_desc = ( isset( $_POST['cat_desc'] ) ) ? htmlspecialchars( $_POST['cat_desc'] ) : ''; - $cat_parent = ( isset( $_POST['cat_parent'] ) ) ? intval( $_POST['cat_parent'] ) : 0; - $cat_allow_file = ( isset( $_POST['cat_allow_file'] ) ) ? intval( $_POST['cat_allow_file'] ) : 0; - - $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; - $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; - $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; - $comments_forum_id = intval( $_POST['comments_forum_id'] ); - - $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; - - $cat_use_ratings = ( isset( $_POST['cat_allow_ratings'] ) ) ? intval( $_POST['cat_allow_ratings'] ) : 0; - - $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; - $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; - - // - // Permissions - // - $view_level = intval( $_POST['auth_view'] ); - $post_level = intval( $_POST['auth_post'] ); - $rate_level = intval( $_POST['auth_rate'] ); - $comment_level = intval( $_POST['auth_comment'] ); - $edit_level = intval( $_POST['auth_edit'] ); - $delete_level = intval( $_POST['auth_delete'] ); - $approval_level = intval( $_POST['auth_approval'] ); - $approval_edit_level = intval( $_POST['auth_approval_edit'] ); - - if ( empty( $cat_name ) ) - { - $this->error[] = $lang['Cat_name_missing']; - } - - if ( $cat_parent ) - { - if ( !$this->cat_rowset[$cat_parent]['cat_allow_file'] && !$cat_allow_file ) - { - $this->error[] = $lang['Cat_conflict']; - } - } - - if ( sizeof( $this->error ) ) - { - return; - } - - $cat_name = str_replace( "\'", "''", $cat_name ); - $cat_desc = str_replace( "\'", "''", $cat_desc ); - - if ( !$cat_id ) - { - $cat_order = 0; - if ( !empty( $this->subcat_rowset[$cat_parent] ) ) - { - foreach( $this->subcat_rowset[$cat_parent] as $cat_data ) - { - if ( $cat_order < $cat_data['cat_order'] ) - { - $cat_order = $cat_data['cat_order']; - } - } - } - - $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)"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldn\'t add a new category', '', __LINE__, __FILE__, $sql ); - } - } - else - { - $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " - SET cat_name = '$cat_name', cat_desc = '$cat_desc', cat_parent = $cat_parent, cat_allow_file = $cat_allow_file, cat_allow_ratings = $cat_use_ratings, cat_allow_comments = $cat_use_comments, internal_comments = $cat_internal_comments, autogenerate_comments = $cat_autogenerate_comments, comments_forum_id = $comments_forum_id, show_pretext = $cat_show_pretext, notify = $cat_notify, notify_group = $cat_notify_group, auth_view = $view_level, auth_post = $post_level, auth_rate = $rate_level, auth_comment = $comment_level, auth_edit = $edit_level, auth_delete = $delete_level, auth_approval = $approval_level, auth_approval_edit = $approval_edit_level - WHERE cat_id = $cat_id"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldn\'t Edit this category', '', __LINE__, __FILE__, $sql ); - } - - if ( $cat_parent != $this->cat_rowset[$cat_id]['cat_parent'] ) - { - $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); - $this->reorder_cat( $cat_parent ); - } - $this->modified( true ); - } - - if ( $cat_id ) - { - return $cat_id; - } - else - { - return $db->sql_nextid(); - } - } - - /** - * Enter description here... - * - * @param unknown_type $cat_id - */ - function delete_cat( $cat_id = false ) - { - global $db, $_POST, $lang; - - $file_to_cat_id = ( isset( $_POST['file_to_cat_id'] ) ) ? intval( $_POST['file_to_cat_id'] ) : ''; - $subcat_to_cat_id = ( isset( $_POST['subcat_to_cat_id'] ) ) ? intval( $_POST['subcat_to_cat_id'] ) : ''; - $file_mode = ( isset( $_POST['file_mode'] ) ) ? htmlspecialchars( $_POST['file_mode'] ) : 'move'; - $subcat_mode = ( isset( $_POST['subcat_mode'] ) ) ? htmlspecialchars( $_POST['subcat_mode'] ) : 'move'; - - if ( empty( $cat_id ) ) - { - $this->error[] = $lang['Cdelerror']; - } - else - { - if ( ( $file_to_cat_id == -1 || empty( $file_to_cat_id ) ) && $file_mode == 'move' ) - { - $this->error[] = $lang['Cdelerror']; - } - - if ( $subcat_mode == 'move' && empty( $subcat_to_cat_id ) ) - { - $this->error[] = $lang['Cdelerror']; - } - - if ( sizeof( $this->error ) ) - { - return; - } - - $sql = 'DELETE FROM ' . LINK_CATEGORIES_TABLE . " - WHERE cat_id = $cat_id"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); - } - - $this->reorder_cat( $this->cat_rowset[$cat_id]['cat_parent'] ); - - if ( $file_mode == 'delete' ) - { - $this->delete_links( $cat_id, 'category' ); - } - else - { - $this->move_links( $cat_id, $file_to_cat_id ); - } - - if ( $subcat_mode == 'delete' ) - { - $this->delete_subcat( $cat_id, $file_mode, $file_to_cat_id ); - } - else - { - $this->move_subcat( $cat_id, $subcat_to_cat_id ); - } - $this->modified( true ); - } - } - - /** - * Enter description here... - * - * @param unknown_type $id - * @param unknown_type $mode - */ - function delete_links( $id, $mode = 'file' ) - { - global $db, $phpbb_root_path, $linkdb_functions; - - if ( $mode == 'category' ) - { - $file_ids = array(); - $files_data = array(); - $sql = 'SELECT link_id - FROM ' . LINKS_TABLE . " - WHERE link_catid = $id"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); - } - - while ( $row = $db->sql_fetchrow( $result ) ) - { - $file_ids[] = $row['link_id']; - $files_data[] = $row; - } - - $where_sql = "WHERE link_catid = $id"; - } - else - { - $sql = 'SELECT link_id - FROM ' . LINKS_TABLE . " - WHERE link_id = $id"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); - } - - $file_data = $db->sql_fetchrow( $result ); - - $where_sql = "WHERE link_id = $id"; - } - - $sql = 'DELETE FROM ' . LINKS_TABLE . " - $where_sql"; - - unset( $where_sql ); - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt delete files', '', __LINE__, __FILE__, $sql ); - } - - $where_sql = ( $mode != 'file' && !empty( $file_ids ) ) ? ' IN (' . implode( ', ', $file_ids ) . ') ' : " = $id"; - - $sql = 'DELETE FROM ' . LINK_CUSTOM_DATA_TABLE . " - WHERE customdata_file$where_sql"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt delete custom data', '', __LINE__, __FILE__, $sql ); - } - - if ( $mode == 'file' ) - { - $this->modified( true ); - } - - return; - } - - /** - * Enter description here... - * - * @param unknown_type $from_cat - * @param unknown_type $to_cat - */ - function move_links( $from_cat, $to_cat ) - { - global $db; - - $sql = 'UPDATE ' . LINKS_TABLE . " - SET link_catid = $to_cat - WHERE link_catid = $from_cat"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt move files', '', __LINE__, __FILE__, $sql ); - } - $this->modified( true ); - return; - } - - /** - * Enter description here... - * - * @param unknown_type $cat_id - * @param unknown_type $file_mode - * @param unknown_type $to_cat - */ - function delete_subcat( $cat_id, $file_mode = 'delete', $to_cat = false ) - { - global $db; - - if ( empty( $this->subcat_rowset[$cat_id] ) || count( $this->subcat_rowset[$cat_id] ) <= 0 ) - { - return; - } - - foreach( $this->subcat_rowset[$cat_id] as $sub_cat_id => $subcat_data ) - { - $this->delete_subcat( $sub_cat_id, $file_mode, $to_cat ); - - $sql = 'DELETE FROM ' . LINK_CATEGORIES_TABLE . " - WHERE cat_id = $sub_cat_id"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt Query Info', '', __LINE__, __FILE__, $sql ); - } - - if ( $file_mode == 'delete' ) - { - $this->delete_links( $sub_cat_id, 'category' ); - } - else - { - $this->move_links( $sub_cat_id, $to_cat ); - } - } - $this->modified( true ); - return; - } - - /** - * Enter description here... - * - * @param unknown_type $from_cat - * @param unknown_type $to_cat - */ - function move_subcat( $from_cat, $to_cat ) - { - global $db; - - $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " - SET cat_parent = $to_cat - WHERE cat_parent = $from_cat"; - - if ( !( $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt move Sub Category', '', __LINE__, __FILE__, $sql ); - } - $this->modified( true ); - return; - } - - /** - * Enter description here... - * - * @param unknown_type $cat_parent - */ - function reorder_cat( $cat_parent ) - { - global $db; - - $sql = 'SELECT cat_id, cat_order - FROM ' . LINK_CATEGORIES_TABLE . " - WHERE cat_parent = $cat_parent - ORDER BY cat_order ASC"; - - if ( !$result = $db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not get list of Categories', '', __LINE__, __FILE__, $sql ); - } - - $i = 10; - while ( $row = $db->sql_fetchrow( $result ) ) - { - $cat_id = $row['cat_id']; - - $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " - SET cat_order = $i - WHERE cat_id = $cat_id"; - if ( !$db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not update order fields', '', __LINE__, __FILE__, $sql ); - } - $i += 10; - } - } - - /** - * Enter description here... - * - * @param unknown_type $cat_id - */ - function order_cat( $cat_id ) - { - global $db, $_GET; - - $move = ( isset( $_GET['move'] ) ) ? intval( $_GET['move'] ) : 15; - $cat_parent = $this->cat_rowset[$cat_id]['cat_parent']; - - $sql = 'UPDATE ' . LINK_CATEGORIES_TABLE . " - SET cat_order = cat_order + $move - WHERE cat_id = $cat_id"; - - if ( !$result = $db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not change category order', '', __LINE__, __FILE__, $sql ); - } - - $this->reorder_cat( $cat_parent ); - $this->init(); - } - - /** - * Enter description here... - * * @param unknown_type $file_id * @return unknown --- 1406,1409 ---- *************** *** 2008,2011 **** --- 1609,1687 ---- * Enter description here... * + * @param unknown_type $id + * @param unknown_type $mode + */ + function delete_links( $id, $mode = 'file' ) + { + global $db, $phpbb_root_path, $linkdb_functions; + + if ( $mode == 'category' ) + { + $file_ids = array(); + $files_data = array(); + $sql = 'SELECT link_id + FROM ' . LINKS_TABLE . " + WHERE link_catid = $id"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); + } + + while ( $row = $db->sql_fetchrow( $result ) ) + { + $file_ids[] = $row['link_id']; + $files_data[] = $row; + } + + $where_sql = "WHERE link_catid = $id"; + } + else + { + $sql = 'SELECT link_id + FROM ' . LINKS_TABLE . " + WHERE link_id = $id"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt select files', '', __LINE__, __FILE__, $sql ); + } + + $file_data = $db->sql_fetchrow( $result ); + + $where_sql = "WHERE link_id = $id"; + } + + $sql = 'DELETE FROM ' . LINKS_TABLE . " + $where_sql"; + + unset( $where_sql ); + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt delete files', '', __LINE__, __FILE__, $sql ); + } + + $where_sql = ( $mode != 'file' && !empty( $file_ids ) ) ? ' IN (' . implode( ', ', $file_ids ) . ') ' : " = $id"; + + $sql = 'DELETE FROM ' . LINK_CUSTOM_DATA_TABLE . " + WHERE customdata_file$where_sql"; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt delete custom data', '', __LINE__, __FILE__, $sql ); + } + + if ( $mode == 'file' ) + { + $this->modified( true ); + } + + return; + } + + /** + * Enter description here... + * * @param unknown_type $mode * @param unknown_type $link_id |
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13932/modules/mx_kb/admin Removed Files: admin_kb_art.php admin_kb_auth.php admin_kb_cat.php admin_kb_custom.php admin_kb_settings.php admin_kb_types.php Log Message: removed files --- admin_kb_settings.php DELETED --- --- admin_kb_art.php DELETED --- --- admin_kb_types.php DELETED --- --- admin_kb_auth.php DELETED --- --- admin_kb_cat.php DELETED --- --- admin_kb_custom.php DELETED --- |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:23:38
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27191/modules/mx_pafiledb/pafiledb/admin Added Files: admin_cat_manage.php admin_catauth_manage.php admin_custom_manage.php admin_fchecker_manage.php admin_file_manage.php admin_license_manage.php admin_settings.php admin_ug_auth_manage.php Log Message: making all admincp an object :-) --- NEW FILE: admin_cat_manage.php --- <?php /** * * @package mxBB Portal Module - mx_pafiledb * @version $Id: admin_cat_manage.php,v 1.1 2006/07/08 10:23:34 jonohlsson Exp $ * @copyright (c) 2002-2006 [Mohd Basri, PHP Arena, pafileDB, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class pafiledb_cat_manage extends pafiledb_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); $mode = ( isset( $_REQUEST['mode'] ) ) ? htmlspecialchars( $_REQUEST['mode'] ) : ''; $cat_id = ( isset( $_REQUEST['cat_id'] ) ) ? intval( $_REQUEST['cat_id'] ) : 0; $cat_id_other = ( isset( $_REQUEST['cat_id_other'] ) ) ? intval( $_REQUEST['cat_id_other'] ) : 0; if ( $mode == 'do_add' && !$cat_id ) { $new_cat_id = $pafiledb->update_add_cat(); $mode = 'add'; if ( !sizeof( $pafiledb->error ) ) { $pafiledb->_pafiledb(); $message = $lang['Catadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_category.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_edit_permissions'], '<a href="' . append_sid( "admin_pa_catauth.$phpEx?cat_id=$new_cat_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } $mode = 'add'; } elseif ( $mode == 'do_add' && $cat_id ) { $new_cat_id = $pafiledb->update_add_cat( $cat_id ); if ( !sizeof( $pafiledb->error ) ) { $pafiledb->_pafiledb(); $message = $lang['Catedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_category.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_edit_permissions'], '<a href="' . append_sid( "admin_pa_catauth.$phpEx?cat_id=$new_cat_id" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } $mode = 'edit'; } elseif ( $mode == 'do_delete' ) { $pafiledb->delete_cat( $cat_id ); if ( !sizeof( $pafiledb->error ) ) { $pafiledb->_pafiledb(); $message = $lang['Catsdeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_category.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } } elseif ( $mode == 'cat_order' ) { $pafiledb->order_cat( $cat_id_other ); } elseif ( $mode == 'sync' ) { $pafiledb->sync( $cat_id_other ); } elseif ( $mode == 'sync_all' ) { $pafiledb->sync_all(); } switch ( $mode ) { case '': case 'cat_order': case 'sync': default: $template_file = 'admin/pa_admin_cat.tpl'; $l_title = $lang['Panel_cat_title']; $l_explain = $lang['Panel_cat_explain']; $s_hidden_fields = '<input type="hidden" name="mode" value="add">'; break; case 'add': $template_file = 'admin/pa_admin_cat_edit.tpl'; $l_title = $lang['Acattitle']; $l_explain = $lang['Catexplain']; $s_hidden_fields = '<input type="hidden" name="mode" value="do_add">'; break; case 'edit': $template_file = 'admin/pa_admin_cat_edit.tpl'; $l_title = $lang['Ecattitle']; $l_explain = $lang['Catexplain']; $s_hidden_fields = '<input type="hidden" name="mode" value="do_add">'; $s_hidden_fields .= '<input type="hidden" name="cat_id" value="' . $cat_id . '">'; break; case 'delete': $template_file = 'admin/pa_admin_cat_delete.tpl'; $l_title = $lang['Dcattitle']; $l_explain = $lang['Catexplain']; $s_hidden_fields = '<input type="hidden" name="mode" value="do_delete">'; break; } $pafiledb_template->set_filenames( array( 'admin' => $template_file ) ); if ( sizeof( $pafiledb->error ) ) $pafiledb_template->assign_block_vars( 'pafiledb_error', array() ); $pafiledb_template->assign_vars( array( 'L_CAT_TITLE' => $l_title, 'L_CAT_EXPLAIN' => $l_explain, 'ERROR' => ( sizeof( $pafiledb->error ) ) ? implode( '<br />', $pafiledb->error ) : '', 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_CAT_ACTION' => append_sid( "admin_pa_category.$phpEx" ) )); if ( $mode == '' || $mode == 'cat_order' || $mode == 'sync' || $mode == 'sync_all' ) { $pafiledb_template->assign_vars( array( 'L_CREATE_CATEGORY' => $lang['Create_category'], 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], 'L_MOVE_UP' => $lang['Move_up'], 'L_MOVE_DOWN' => $lang['Move_down'], 'L_SUB_CAT' => $lang['Sub_category'], 'L_RESYNC' => $lang['Resync'] )); admin_cat_main( $cat_id ); } elseif ( $mode == 'add' || $mode == 'edit' ) { if ( $mode == 'add' ) { if ( !$_POST['cat_parent'] ) { $cat_list .= '<option value="0" selected>' . $lang['None'] . '</option>'; } else { $cat_list .= '<option value="0">' . $lang['None'] . '</option>'; } $cat_list .= ( !$_POST['cat_parent'] ) ? $pafiledb->generate_jumpbox() : $pafiledb->generate_jumpbox( 0, 0, array( $_POST['cat_parent'] => 1 ) ); $checked_yes = ( $_POST['cat_allow_file'] ) ? ' checked' : ''; $checked_no = ( !$_POST['cat_allow_file'] ) ? ' checked' : ''; $cat_name = ( !empty( $_POST['cat_name'] ) ) ? $_POST['cat_name'] : ''; $cat_desc = ( !empty( $_POST['cat_desc'] ) ) ? $_POST['cat_desc'] : ''; // // Comments // $use_comments_yes = ""; $use_comments_no = ""; $use_comments_default = "checked=\"checked\""; $internal_comments_internal = ""; $internal_comments_phpbb = ""; $internal_comments_default = "checked=\"checked\""; $autogenerate_comments_yes = ""; $autogenerate_comments_no = ""; $autogenerate_comments_default = "checked=\"checked\""; $comments_forum_id = -1; // // Ratings // $use_ratings_yes = ""; $use_ratings_no = ""; $use_ratings_default = "checked=\"checked\""; // // Instructions // $pretext_show = ""; $pretext_hide = ""; $pretext_default = "checked=\"checked\""; // // Notification // $notify_none = ""; $notify_pm = ""; $notify_email = ""; $notify_default = "checked=\"checked\""; $notify_group_list = mx_get_groups('', 'notify_group'); } else { if ( !$pafiledb->cat_rowset[$cat_id]['cat_parent'] ) { $cat_list .= '<option value="0" selected>' . $lang['None'] . '</option>\n'; } else { $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } $cat_list .= $pafiledb->generate_jumpbox( 0, 0, array( $pafiledb->cat_rowset[$cat_id]['cat_parent'] => 1 ) ); if ( $pafiledb->cat_rowset[$cat_id]['cat_allow_file'] ) { $checked_yes = ' checked'; $checked_no = ''; } else { $checked_yes = ''; $checked_no = ' checked'; } $cat_name = $pafiledb->cat_rowset[$cat_id]['cat_name']; $cat_desc = $pafiledb->cat_rowset[$cat_id]['cat_desc']; // // Comments // $use_comments_yes = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_comments'] == 1 ) ? "checked=\"checked\"" : ""; $use_comments_no = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_comments'] == 0 ) ? "checked=\"checked\"" : ""; $use_comments_default = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_comments'] == -1 ) ? "checked=\"checked\"" : ""; $internal_comments_internal = ( $pafiledb->cat_rowset[$cat_id]['internal_comments'] == 1 ) ? "checked=\"checked\"" : ""; $internal_comments_phpbb = ( $pafiledb->cat_rowset[$cat_id]['internal_comments'] == 0 ) ? "checked=\"checked\"" : ""; $internal_comments_default = ( $pafiledb->cat_rowset[$cat_id]['internal_comments'] == -1 ) ? "checked=\"checked\"" : ""; $comments_forum_id = $pafiledb->cat_rowset[$cat_id]['comments_forum_id']; $autogenerate_comments_yes = ( $pafiledb->cat_rowset[$cat_id]['autogenerate_comments'] == 1 ) ? "checked=\"checked\"" : ""; $autogenerate_comments_no = ( $pafiledb->cat_rowset[$cat_id]['autogenerate_comments'] == 0 ) ? "checked=\"checked\"" : ""; $autogenerate_comments_default = ( $pafiledb->cat_rowset[$cat_id]['autogenerate_comments'] == -1 ) ? "checked=\"checked\"" : ""; // // Ratings // $use_ratings_yes = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_ratings'] == 1 ) ? "checked=\"checked\"" : ""; $use_ratings_no = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_ratings'] == 0 ) ? "checked=\"checked\"" : ""; $use_ratings_default = ( $pafiledb->cat_rowset[$cat_id]['cat_allow_ratings'] == -1 ) ? "checked=\"checked\"" : ""; // // Instructions // $pretext_show = ( $pafiledb->cat_rowset[$cat_id]['show_pretext'] == 1 ) ? "checked=\"checked\"" : ""; $pretext_hide = ( $pafiledb->cat_rowset[$cat_id]['show_pretext'] == 0 ) ? "checked=\"checked\"" : ""; $pretext_default = ( $pafiledb->cat_rowset[$cat_id]['show_pretext'] == -1 ) ? "checked=\"checked\"" : ""; // // Notification // $notify_none = ( $pafiledb->cat_rowset[$cat_id]['notify'] == 0 ) ? "checked=\"checked\"" : ""; $notify_pm = ( $pafiledb->cat_rowset[$cat_id]['notify'] == 1 ) ? "checked=\"checked\"" : ""; $notify_email = ( $pafiledb->cat_rowset[$cat_id]['notify'] == 2 ) ? "checked=\"checked\"" : ""; $notify_default = ( $pafiledb->cat_rowset[$cat_id]['notify'] == -1 ) ? "checked=\"checked\"" : ""; $notify_group_list = mx_get_groups($pafiledb->cat_rowset[$cat_id]['notify_group'], 'notify_group'); } $pafiledb_template->assign_vars( array( 'CAT_NAME' => $cat_name, 'CAT_DESC' => $cat_desc, 'CHECKED_YES' => $checked_yes, 'CHECKED_NO' => $checked_no, // // Comments // 'L_COMMENTS_TITLE' => $lang['Comments_title'], 'L_USE_COMMENTS' => $lang['Use_comments'], 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], 'S_USE_COMMENTS_YES' => $use_comments_yes, 'S_USE_COMMENTS_NO' => $use_comments_no, 'S_USE_COMMENTS_DEFAULT' => $use_comments_default, 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, 'S_INTERNAL_COMMENTS_DEFAULT' => $internal_comments_default, 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], 'FORUM_LIST' => get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, 'S_AUTOGENERATE_COMMENTS_DEFAULT' => $autogenerate_comments_default, // // Ratings // 'L_RATINGS_TITLE' => $lang['Ratings_title'], 'L_USE_RATINGS' => $lang['Use_ratings'], 'L_USE_RATINGS_EXPLAIN' => $lang['Use_ratings_explain'], 'S_USE_RATINGS_YES' => $use_ratings_yes, 'S_USE_RATINGS_NO' => $use_ratings_no, 'S_USE_RATINGS_DEFAULT' => $use_ratings_default, // // Instructions // 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], 'S_SHOW_PRETEXT' => $pretext_show, 'S_HIDE_PRETEXT' => $pretext_hide, 'S_DEFAULT_PRETEXT' => $pretext_default, 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], // // Notifications // 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], 'L_NOTIFY' => $lang['Notify'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['PM'], 'S_NOTIFY_NONE' => $notify_none, 'S_NOTIFY_EMAIL' => $notify_email, 'S_NOTIFY_PM' => $notify_pm, 'S_NOTIFY_DEFAULT' => $notify_default, 'L_NOTIFY_GROUP' => $lang['Notify_group'], 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], 'NOTIFY_GROUP' => $notify_group_list, 'L_CAT_NAME' => $lang['Catname'], 'L_CAT_NAME_INFO' => $lang['Catnameinfo'], 'L_CAT_DESC' => $lang['Catdesc'], 'L_CAT_DESC_INFO' => $lang['Catdescinfo'], 'L_CAT_PARENT' => $lang['Catparent'], 'L_CAT_PARENT_INFO' => $lang['Catparentinfo'], 'L_CAT_ALLOWFILE' => $lang['Allow_file'], 'L_CAT_ALLOWFILE_INFO' => $lang['Allow_file_info'], 'L_CAT_ALLOWCOMMENTS' => $lang['Allow_comments'], 'L_CAT_ALLOWCOMMENTS_INFO' => $lang['Allow_comments_info'], 'L_CAT_ALLOWRATINGS' => $lang['Allow_ratings'], 'L_CAT_ALLOWRATINGS_INFO' => $lang['Allow_ratings_info'], 'L_DEFAULT' => $lang['Use_default'], 'L_NONE' => $lang['None'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_CAT_NAME_FIELD_EMPTY' => $lang['Cat_name_missing'], 'S_CAT_LIST' => $cat_list ) ); } elseif ( $mode == 'delete' ) { $select_cat = $pafiledb->generate_jumpbox( 0, 0, array( $cat_id => 1 ) ); $file_to_select_cat = $pafiledb->generate_jumpbox( 0, 0, '', true ); $pafiledb_template->assign_vars( array( 'S_SELECT_CAT' => $select_cat, 'S_FILE_SELECT_CAT' => $file_to_select_cat, 'L_DELETE' => $lang['Delete'], 'L_DO_FILE' => $lang['Delfiles'], 'L_DO_CAT' => $lang['Do_cat'], 'L_MOVE_TO' => $lang['Move_to'], 'L_SELECT_CAT' => $lang['Select_a_Category'], 'L_DELETE' => $lang['Delete'], 'L_MOVE' => $lang['Move'] )); } $pafiledb_template->display( 'admin' ); $pafiledb->_pafiledb(); $pafiledb_cache->unload(); } } ?> --- NEW FILE: admin_file_manage.php --- <?php /** * * @package mxBB Portal Module - mx_pafiledb * @version $Id: admin_file_manage.php,v 1.1 2006/07/08 10:23:35 jonohlsson Exp $ * @copyright (c) 2002-2006 [Mohd Basri, PHP Arena, pafileDB, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class pafiledb_file_manage extends pafiledb_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // // Init // $custom_field = new custom_field(); $custom_field->init(); $pafiledb->init(); $cat_id = ( isset( $_REQUEST['cat_id'] ) ) ? intval( $_REQUEST['cat_id'] ) : 0; $file_id = ( isset( $_REQUEST['file_id'] ) ) ? intval( $_REQUEST['file_id'] ) : 0; $file_ids = ( isset( $_POST['file_ids'] ) ) ? array_map( 'intval', $_POST['file_ids'] ) : array(); $start = ( isset( $_REQUEST['start'] ) ) ? intval( $_REQUEST['start'] ) : 0; $mode = ( isset( $_REQUEST['mode'] ) ) ? htmlspecialchars( $_REQUEST['mode'] ) : ''; $mode_notification = ( isset( $_REQUEST['mode'] ) ) ? htmlspecialchars( $_REQUEST['mode'] ) : ''; $mode_js = ( isset( $_REQUEST['mode_js'] ) ) ? htmlspecialchars( $_REQUEST['mode_js'] ) : ''; $mode = ( isset( $_POST['addfile'] ) ) ? 'add' : $mode; $mode = ( isset( $_POST['delete'] ) ) ? 'delete' : $mode; $mode = ( isset( $_POST['approve'] ) ) ? 'do_approve' : $mode; $mode = ( isset( $_POST['unapprove'] ) ) ? 'do_unapprove' : $mode; $mode = ( empty( $mode ) ) ? $mode_js : $mode; $mirrors = ( isset( $_POST['mirrors'] ) ) ? true : 0; if ( isset( $_REQUEST['sort_method'] ) ) { switch ( $_REQUEST['sort_method'] ) { case 'file_name': $sort_method = 'file_name'; break; case 'file_time': $sort_method = 'file_time'; break; case 'file_dls': $sort_method = 'file_dls'; break; case 'file_rating': $sort_method = 'rating'; break; case 'file_update_time': $sort_method = 'file_update_time'; break; default: $sort_method = $pafiledb_config['sort_method']; } } else { $sort_method = $pafiledb_config['sort_method']; } if ( isset( $_REQUEST['sort_order'] ) ) { switch ( $_REQUEST['sort_order'] ) { case 'ASC': $sort_order = 'ASC'; break; case 'DESC': $sort_order = 'DESC'; break; default: $sort_order = $pafiledb_config['sort_order']; } } else { $sort_order = $pafiledb_config['sort_order']; } $s_file_actions = array( 'approved' => $lang['Approved_files'], 'broken' => $lang['Broken_files'], 'file_cat' => $lang['File_cat'], 'all_file' => $lang['All_files'], 'maintenance' => $lang['Maintenance'] ); switch ( $mode ) { case '': case 'approved': case 'broken': case 'do_approve': case 'do_unapprove': case 'delete': case 'file_cat': case 'all_file': default: $template_file = 'admin/pa_admin_file.tpl'; $l_title = $lang['File_manage_title']; $l_explain = $lang['Fileexplain']; // $s_hidden_fields = '<input type="hidden" name="mode" value="add">'; break; case 'add': $template_file = 'admin/pa_admin_file_edit.tpl'; $l_title = $lang['Afiletitle']; $l_explain = $lang['Fileexplain']; $s_hidden_fields = '<input type="hidden" name="mode" value="do_add">'; break; case 'edit': case 'do_add': $template_file = 'admin/pa_admin_file_edit.tpl'; $l_title = $lang['Efiletitle']; $l_explain = $lang['Fileexplain']; $s_hidden_fields = '<input type="hidden" name="mode" value="do_add">'; $s_hidden_fields .= '<input type="hidden" name="file_id" value="' . $file_id . '">'; break; case 'maintenance': $template_file = 'admin/pa_admin_file_checker.tpl'; $l_title = $lang['File_checker']; $l_explain = $lang['File_checker_explain']; $s_hidden_fields = '<input type="hidden" name="mode" value="do_maintenace">'; break; case 'mirrors': $template_file = 'admin/pa_admin_file_mirrors.tpl'; $l_title = $lang['Mirrors']; $l_explain = $lang['Mirrors_explain']; $s_hidden_fields = '<input type="hidden" name="mode" value="mirrors">'; $s_hidden_fields .= '<input type="hidden" name="file_id" value="' . $file_id . '">'; break; } if ( $mode == 'do_add' && !$file_id ) { $file_id = $pafiledb->update_add_file(); $custom_field->file_update_data( $file_id ); $pafiledb->_pafiledb(); $mode = 'edit'; if ( !$mirrors ) { // // Notification // $pafiledb->update_add_file_notify($file_id, 'add'); $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_file.php" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } } elseif ( $mode == 'do_add' && $file_id ) { $file_id = $pafiledb->update_add_file( $file_id ); $custom_field->file_update_data( $file_id ); $pafiledb->_pafiledb(); $mode = 'edit'; if ( !$mirrors ) { // // Notification // $pafiledb->update_add_file_notify($file_id, 'edit'); $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_file.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } } elseif ( $mode == 'delete' ) { if ( is_array( $file_ids ) && !empty( $file_ids ) ) { foreach( $file_ids as $temp_file_id ) { $sql = 'SELECT * FROM ' . PA_FILES_TABLE . " WHERE file_id = $temp_file_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } $file_info = $db->sql_fetchrow( $result ); // // Notification // $pafiledb->update_add_file_notify($temp_file_id, 'delete'); // // Comments // if ($pafiledb->comments[$file_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) { if ( $pafiledb->comments[$file_info['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " WHERE file_id = '" . $file_id . "'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt delete comments', '', __LINE__, __FILE__, $sql ); } } else { if ( $file_info['topic_id'] ) { include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); $mx_pa_comments = new pafiledb_comments(); $mx_pa_comments->init( $file_info, 'phpbb'); $mx_pa_comments->post('delete_all', $file_info['topic_id']); } } } $pafiledb->delete_files( $temp_file_id ); } } else { $sql = 'SELECT * FROM ' . PA_FILES_TABLE . " WHERE file_id = $file_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } $file_info = $db->sql_fetchrow( $result ); // // Notification // $pafiledb->update_add_file_notify($file_id, 'delete'); // // Comments // if ($pafiledb->comments[$file_info['file_catid']]['activated'] && $pafiledb_config['del_topic']) { if ( $pafiledb->comments[$file_info['file_catid']]['internal_comments'] ) { $sql = 'DELETE FROM ' . PA_COMMENTS_TABLE . " WHERE file_id = '" . $file_id . "'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt delete comments', '', __LINE__, __FILE__, $sql ); } } else { if ( $file_info['topic_id'] ) { include( $module_root_path . 'pafiledb/includes/functions_comment.' . $phpEx ); $mx_pa_comments = new pafiledb_comments(); $mx_pa_comments->init( $file_info, 'phpbb'); $mx_pa_comments->post('delete_all', $file_info['topic_id']); } } } $pafiledb->delete_files( $file_id ); } $pafiledb->_pafiledb(); } elseif ( $mode == 'do_maintenace' ) { $pafiledb->file_mainenance(); } elseif ( $mode == 'do_approve' || $mode == 'do_unapprove' ) { if ( is_array( $file_ids ) && !empty( $file_ids ) ) { foreach( $file_ids as $temp_file_id ) { $pafiledb->file_approve( $mode, $temp_file_id ); } // // Notification // $pafiledb->update_add_file_notify($file_ids, $mode); } else { $pafiledb->file_approve( $mode, $file_id ); // // Notification // $pafiledb->update_add_file_notify($file_id, $mode); } $pafiledb->_pafiledb(); } $pafiledb_template->set_filenames( array( 'admin' => $template_file ) ); $pafiledb_template->assign_vars( array( 'L_FILE_TITLE' => $l_title, 'L_FILE_EXPLAIN' => $l_explain, 'L_ADD_FILE' => $lang['Afiletitle'], 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_FILE_ACTION' => append_sid( "admin_pa_file.$phpEx" ) )); if ( in_array( $mode, array( '', 'approved', 'broken', 'do_approve', 'do_unapprove', 'delete', 'file_cat', 'all_file' ) ) ) { $mode = ( in_array( $mode, array( 'do_approve', 'do_unapprove', 'delete' ) ) ) ? '' : $mode; if ( $mode != 'approved' && $mode != 'broken' ) { $where_sql = ( $mode == 'file_cat' ) ? "AND file_catid = '$cat_id'" : ''; $sql = "SELECT file_name, file_approved, file_id, file_broken FROM " . PA_FILES_TABLE . " as f1 WHERE file_approved = '1' $where_sql ORDER BY file_time DESC"; if ( $mode == '' || $mode == 'file_cat' || $mode == 'all_file' ) { if ( ( !$result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } $total_files = $db->sql_numrows( $result ); } if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $pafiledb_config['pagination'], $start ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $all_file_rowset[] = $row; } } if ( $mode == '' || $mode == 'approved' || $mode == 'broken' || $mode == 'file_cat' || $mode == 'all_file' ) { if ( $mode == '' ) { $limit = 5; $temp_start = 0; } else { $limit = $pafiledb_config['pagination']; $temp_start = $start; } if ( $mode == '' || $mode == 'approved' ) { $sql = "SELECT file_name, file_approved, file_id, file_broken FROM " . PA_FILES_TABLE . " WHERE file_approved = '0' ORDER BY file_time DESC"; if ( $mode == 'approved' ) { if ( ( !$result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } $total_files = $db->sql_numrows( $result ); } if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $limit, $temp_start ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $approved_file_rowset[] = $row; } } if ( $mode == '' || $mode == 'broken' ) { $sql = "SELECT file_name, file_approved, file_id, file_broken FROM " . PA_FILES_TABLE . " WHERE file_broken = '1' ORDER BY file_time DESC"; if ( $mode == 'broken' ) { if ( ( !$result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } $total_files = $db->sql_numrows( $result ); } if ( !( $result = $pafiledb_functions->sql_query_limit( $sql, $limit, $temp_start ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $broken_file_rowset[] = $row; } } if ( $mode == '' ) { $global_array = array( 0 => array( 'lang_var' => $lang['Approved_files'], 'row_set' => $approved_file_rowset, 'approval' => 'approve' ), 1 => array( 'lang_var' => $lang['Broken_files'], 'row_set' => $broken_file_rowset, 'approval' => 'both' ), 2 => array( 'lang_var' => $lang['All_files'], 'row_set' => $all_file_rowset, 'approval' => 'unapprove' ) ); } elseif ( $mode == 'all_file' || $mode == 'file_cat' ) { $global_array = array( 0 => array( 'lang_var' => $lang['All_files'], 'row_set' => $all_file_rowset, 'approval' => 'unapprove' ) ); } elseif ( $mode == 'approved' ) { $global_array = array( 0 => array( 'lang_var' => $lang['Approved_files'], 'row_set' => $approved_file_rowset, 'approval' => 'approve' ) ); } elseif ( $mode == 'broken' ) { $global_array = array( 0 => array( 'lang_var' => $lang['Broken_files'], 'row_set' => $broken_file_rowset, 'approval' => 'both' ) ); } } $s_file_list = ''; foreach( $s_file_actions as $file_mode => $lang_var ) { $s = ''; if ( $mode == $file_mode ) { $s = ' selected="selected"'; } $s_file_list .= '<option value="' . $file_mode . '"' . $s . '>' . $lang_var . '</option>'; } $cat_list = '<select name="cat_id">'; if ( !$pafiledb->cat_rowset[$cat_id]['cat_parent'] ) { $cat_list .= '<option value="0" selected>' . $lang['None'] . '</option>\n'; } else { $cat_list .= '<option value="0">' . $lang['None'] . '</option>\n'; } $cat_list .= $pafiledb->generate_jumpbox( 0, 0, array( $cat_id => 1 ), true ); $cat_list .= '</select>'; $pafiledb_template->assign_vars( array( 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], 'L_CATEGORY' => $lang['Category'], 'L_MODE' => $lang['View'], 'L_GO' => $lang['Go'], 'L_DELETE_FILE' => $lang['Delete_selected'], 'L_APPROVE' => $lang['Approve'], 'L_UNAPPROVE' => $lang['Unapprove'], 'L_APPROVE_FILE' => $lang['Approve_selected'], 'L_UNAPPROVE_FILE' => $lang['Unapprove_selected'], 'L_NO_FILES' => $lang['No_file'], 'PAGINATION' => generate_pagination( append_sid( "admin_pa_file.$phpEx?mode=$mode&sort_method=$sort_method&sort_order=$sort_order&cat_id=$cat_id" ), $total_files, $pafiledb_config['pagination'], $start ), 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $pafiledb_config['pagination'] ) + 1 ), ceil( $total_files / $pafiledb_config['pagination'] ) ), 'S_CAT_LIST' => $cat_list, 'S_MODE_SELECT' => $s_file_list ) ); if ( $total_files > 0 ) { $template->assign_block_vars( 'pagination', array() ); } foreach( $global_array as $files_data ) { $approve = false; $unapprove = false; if ( $files_data['approval'] == 'both' ) { $approve = $unapprove = true; } elseif ( $files_data['approval'] == 'approve' ) { $approve = true; } elseif ( $files_data['approval'] == 'unapprove' ) { $unapprove = true; } $pafiledb_template->assign_block_vars( 'file_mode', array( 'L_FILE_MODE' => $files_data['lang_var'], 'DATA' => ( isset( $files_data['row_set'] ) ) ? true : false, 'APPROVE' => $approve, 'UNAPPROVE' => $unapprove )); if ( isset( $files_data['row_set'] ) ) { $i = $start + 1; foreach( $files_data['row_set'] as $file_data ) { $approve_mode = ( $file_data['file_approved'] ) ? 'do_unapprove' : 'do_approve'; $pafiledb_template->assign_block_vars( 'file_mode.file_row', array( 'FILE_NAME' => $file_data['file_name'], 'FILE_NUMBER' => $i++, 'FILE_ID' => $file_data['file_id'], 'U_FILE_EDIT' => append_sid( "admin_pa_file.$phpEx?mode=edit&file_id={$file_data['file_id']}" ), 'U_FILE_DELETE' => append_sid( "admin_pa_file.$phpEx?mode=delete&file_id={$file_data['file_id']}" ), 'U_FILE_APPROVE' => append_sid( "admin_pa_file.$phpEx?mode=$approve_mode&file_id={$file_data['file_id']}" ), 'L_APPROVE' => ( $file_data['file_approved'] ) ? $lang['Unapprove'] : $lang['Approve'] )); } } } } elseif ( $mode == 'add' || $mode == 'edit' || $mirrors ) { if ( $mode == 'add' ) { $file_name = ''; $file_desc = ''; $file_long_desc = ''; $file_author = ''; $file_version = ''; $file_website = ''; $file_posticons = $pafiledb_functions->post_icons(); $file_cat_list = $pafiledb->generate_jumpbox( 0, 0, '', true ); $file_license = $pafiledb_functions->license_list(); $pin_checked_yes = ''; $pin_checked_no = ' checked'; $file_download = 0; $approved_checked_yes = ' checked'; $approved_checked_no = ''; $file_ssurl = ''; $ss_checked_yes = ''; $ss_checked_no = ' checked'; $file_url = ''; $custom_exist = $custom_field->display_edit(); } else { $sql = 'SELECT * FROM ' . PA_FILES_TABLE . " WHERE file_id = $file_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); } $file_info = $db->sql_fetchrow( $result ); $file_name = $file_info['file_name']; $file_desc = $file_info['file_desc']; $file_long_desc = $file_info['file_longdesc']; $file_author = $file_info['file_creator']; $file_version = $file_info['file_version']; $file_website = $file_info['file_docsurl']; $file_posticons = $pafiledb_functions->post_icons( $file_info['file_posticon'] ); $file_cat_list = $pafiledb->generate_jumpbox( 0, 0, array( $file_info['file_catid'] => 1 ), true ); $file_license = $pafiledb_functions->license_list( $file_info['file_license'] ); $pin_checked_yes = ( $file_info['file_pin'] ) ? ' checked' : ''; $pin_checked_no = ( !$file_info['file_pin'] ) ? ' checked' : ''; $file_download = intval( $file_info['file_dls'] ); $approved_checked_yes = ( $file_info['file_approved'] ) ? ' checked' : ''; $approved_checked_no = ( !$file_info['file_approved'] ) ? ' checked' : ''; $file_ssurl = $file_info['file_ssurl']; $ss_checked_yes = ( $file_info['file_sshot_link'] ) ? ' checked' : ''; $ss_checked_no = ( !$file_info['file_sshot_link'] ) ? ' checked' : ''; $file_url = $file_info['file_dlurl']; $file_unique_name = $file_info['unique_name']; $file_dir = $file_info['file_dir']; $custom_exist = $custom_field->display_edit( $file_id ); } $pafiledb_template->assign_vars( array( 'U_MIRRORS_PAGE' => append_sid( "admin_pa_file.$phpEx?mode=mirrors&file_id=$file_id" ), 'ADD_MIRRORS' => $mirrors, 'MODE_EDIT' => ( $mode == 'edit' ) ? true : false, 'MODE' => $mode, 'FILESIZE' => intval( $pafiledb_config['max_file_size'] ), 'FILE_NAME' => $file_name, 'FILE_DESC' => $file_desc, 'FILE_LONG_DESC' => $file_long_desc, 'FILE_AUTHOR' => $file_author, 'FILE_VERSION' => $file_version, 'FILE_SSURL' => $file_ssurl, 'FILE_WEBSITE' => $file_website, 'FILE_DLURL' => $file_url, 'FILE_DOWNLOAD' => $file_download, 'CUSTOM_EXIST' => $custom_exist, 'APPROVED_CHECKED_YES' => $approved_checked_yes, 'APPROVED_CHECKED_NO' => $approved_checked_no, 'SS_CHECKED_YES' => $ss_checked_yes, 'SS_CHECKED_NO' => $ss_checked_no, 'PIN_CHECKED_YES' => $pin_checked_yes, 'PIN_CHECKED_NO' => $pin_checked_no, 'MIRROR_FILE' => $file_unique_name, // 'U_UPLOADED_MIRROR' => get_formated_url() . '/' . $file_dir . $file_unique_name, 'U_UPLOADED_MIRROR' => PORTAL_URL . 'modules/mx_pafiledb/' . $file_dir . $file_unique_name, 'L_FILE_APPROVED' => $lang['Approved'], 'L_FILE_APPROVED_INFO' => $lang['Approved_info'], 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'], 'L_SCREENSHOT' => $lang['Scrsht'], 'L_FILES' => $lang['Files'], 'L_FILE_NAME' => $lang['Filename'], 'L_FILE_NAME_INFO' => $lang['Filenameinfo'], 'L_FILE_SHORT_DESC' => $lang['Filesd'], 'L_FILE_SHORT_DESC_INFO' => $lang['Filesdinfo'], 'L_FILE_LONG_DESC' => $lang['Fileld'], 'L_FILE_LONG_DESC_INFO' => $lang['Fileldinfo'], 'L_FILE_AUTHOR' => $lang['Filecreator'], 'L_FILE_AUTHOR_INFO' => $lang['Filecreatorinfo'], 'L_FILE_VERSION' => $lang['Fileversion'], 'L_FILE_VERSION_INFO' => $lang['Fileversioninfo'], 'L_FILESS' => $lang['Filess'], 'L_FILESSINFO' => $lang['Filessinfo'], 'L_FILESS_UPLOAD' => $lang['Filess_upload'], 'L_FILESSINFO_UPLOAD' => $lang['Filessinfo_upload'], 'L_FILE_SSLINK' => $lang['Filess_link'], 'L_FILE_SSLINK_INFO' => $lang['Filess_link_info'], 'L_FILESSUPLOAD' => $lang['Filessupload'], 'L_FILE_WEBSITE' => $lang['Filedocs'], 'L_FILE_WEBSITE_INFO' => $lang['Filedocsinfo'], 'L_FILE_URL' => $lang['Fileurl'], 'L_FILE_UPLOAD' => $lang['File_upload'], 'L_FILEINFO_UPLOAD' => $lang['Fileinfo_upload'], 'L_FILE_URL_INFO' => $lang['Fileurlinfo'], 'L_FILE_POSTICONS' => $lang['Filepi'], 'L_FILE_POSTICONS_INFO' => $lang['Filepiinfo'], 'L_FILE_CAT' => $lang['Filecat'], 'L_FILE_CAT_INFO' => $lang['Filecatinfo'], 'L_FILE_LICENSE' => $lang['Filelicense'], 'L_NONE' => $lang['None'], 'L_FILE_LICENSE_INFO' => $lang['Filelicenseinfo'], 'L_FILE_PINNED' => $lang['Filepin'], 'L_FILE_PINNED_INFO' => $lang['Filepininfo'], 'L_FILE_DOWNLOAD' => $lang['Filedls'], 'L_MIRRORS' => $lang['Mirrors'], 'L_MIRRORS_INFO' => $lang['Mirrors_explain'], 'L_CLICK_HERE_MIRRORS' => $lang['Click_here_mirrors'], 'L_UPLOADED_FILE' => $lang['Uploaded_file'], 'L_NO' => $lang['No'], 'L_YES' => $lang['Yes'], 'S_POSTICONS' => $file_posticons, 'S_LICENSE_LIST' => $file_license, 'S_CAT_LIST' => $file_cat_list ) ); } elseif ( $mode == 'mirrors' ) { if ( isset( $_POST['delete_mirrors'] ) ) { $mirror_ids = ( isset( $_POST['mirror_ids'] ) ) ? array_map( 'intval', $_POST['mirror_ids'] ) : array(); if ( !empty( $mirror_ids ) ) { $pafiledb->delete_mirror( $mirror_ids ); } } if ( isset( $_POST['add_new'] ) ) { $file_upload = ( empty( $_POST['new_download_url'] ) ) ? true : false; $file_remote_url = ( !empty( $_POST['new_download_url'] ) ) ? $_POST['new_download_url'] : ''; $file_local = ( $_FILES['new_userfile']['tmp_name'] !== 'none' ) ? $_FILES['new_userfile']['tmp_name'] : ''; $file_realname = ( $_FILES['new_userfile']['name'] !== 'none' ) ? $_FILES['new_userfile']['name'] : ''; $file_size = ( !empty( $_FILES['new_userfile']['size'] ) ) ? $_FILES['new_userfile']['size'] : ''; $file_type = ( !empty( $_FILES['new_userfile']['type'] ) ) ? $_FILES['new_userfile']['type'] : ''; $mirror_location = ( !empty( $_POST['new_location'] ) ) ? $_POST['new_location'] : ''; $pafiledb->mirror_add_update( $file_id, $file_upload, $file_remote_url, $file_local, $file_realname, $file_size, $file_type, $mirror_location ); } if ( isset( $_POST['modify'] ) ) { $file_urls = ( !empty( $_POST['download_url'] ) ) ? $_POST['download_url'] : array(); $userfiles = ( !empty( $_FILES['userfile'] ) ) ? $_FILES['userfile'] : array(); $locations = ( !empty( $_POST['location'] ) ) ? $_POST['location'] : array(); $data = array(); foreach( $file_urls as $mirror_id => $file_url ) { $data[$mirror_id]['download_url'] = $file_url; } foreach( array_keys( $userfiles ) as $key ) { foreach( $userfiles[$key] as $mirror_id => $userfile ) { $data[$mirror_id][$key] = $userfile; } } foreach( $locations as $mirror_id => $location ) { $data[$mirror_id]['location'] = $location; } unset( $file_urls ); unset( $userfiles ); unset( $locations ); foreach( $data as $mirror_id => $mirror_data ) { $file_upload = ( empty( $mirror_data['download_url'] ) ) ? true : false; $file_remote_url = ( !empty( $mirror_data['download_url'] ) ) ? $mirror_data['download_url'] : ''; $file_local = ( $mirror_data['tmp_name'] !== 'none' ) ? $mirror_data['tmp_name'] : ''; $file_realname = ( $mirror_data['name'] !== 'none' ) ? $mirror_data['name'] : ''; $file_size = ( !empty( $mirror_data['size'] ) ) ? $mirror_data['size'] : ''; $file_type = ( !empty( $mirror_data['type'] ) ) ? $mirror_data['type'] : ''; $mirror_location = ( !empty( $mirror_data['location'] ) ) ? $mirror_data['location'] : ''; $pafiledb->mirror_add_update( $file_id, $file_upload, $file_remote_url, $file_local, $file_realname, $file_size, $file_type, $mirror_location, $mirror_id ); } unset( $data ); } $sql = 'SELECT f.* FROM ' . PA_MIRRORS_TABLE . " AS f WHERE f.file_id = '" . $file_id . "' ORDER BY mirror_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt select download', '', __LINE__, __FILE__, $sql ); } $mirrors_data = array(); while ( $row = $db->sql_fetchrow( $result ) ) { $mirrors_data[$row['mirror_id']] = $row; } $pafiledb_template->assign_vars( array( 'ROW_NOT_EMPTY' => ( empty( $mirrors_data ) ) ? false : true, 'FILESIZE' => intval( $pafiledb_config['max_file_size'] ), 'L_MIRROR_LOCATION' => $lang['Mirror_location'], 'L_FILE_UPLOAD' => $lang['File_upload'], 'L_FILE_DELETE' => $lang['Delete'], 'L_DELETE' => $lang['Delete_selected'], 'L_FILEINFO_UPLOAD' => $lang['Fileinfo_upload'], 'L_UPLOADED_FILE' => $lang['Uploaded_file'], 'L_FILE_URL' => $lang['Fileurl'], 'L_FILE_URL_INFO' => $lang['Fileurl'], 'L_MODIFY' => $lang['Efiletitle'], 'L_ADD_NEW' => $lang['Afiletitle'], 'L_ADD_NEW_MIRROR' => $lang['Add_new_mirror'] )); foreach( $mirrors_data as $mirror_id => $mirror_data ) { $pafiledb_template->assign_block_vars( 'row', array( 'LOCATION' => $mirror_data['mirror_location'], 'MIRROR_ID' => $mirror_id, 'MIRROR_URL' => $mirror_data['file_dlurl'], 'MIRROR_FILE' => $mirror_data['unique_name'], 'U_UPLOADED_MIRROR' => get_formated_url() . '/' . $mirror_data['file_dir'] . $mirror_data['unique_name'] )); } } $pafiledb_template->assign_vars( array( 'ERROR' => ( sizeof( $pafiledb->error ) ) ? implode( '<br />', $pafiledb->error ) : '' ) ); // // Output // include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $pafiledb_template->display( 'admin' ); $pafiledb->_pafiledb(); $pafiledb_cache->unload(); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } } ?> --- NEW FILE: admin_ug_auth_manage.php --- <?php /** * * @package mxBB Portal Module - mx_pafiledb * @version $Id: admin_ug_auth_manage.php,v 1.1 2006/07/08 10:23:35 jonohlsson Exp $ * @copyright (c) 2002-2006 [Mohd Basri, PHP Arena, pafileDB, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined( 'IN_PORTAL' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class pafiledb_ug_auth_manage extends pafiledb_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $pafiledb_functions, $pafiledb_cache, $pafiledb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); $params = array( 'mode' => 'mode', 'user_id' => POST_USERS_URL, 'group_id' => POST_GROUPS_URL ); foreach( $params as $var => $param ) { $$var = ( isset( $_REQUEST[$param] ) ) ? $_REQUEST[$param] : ''; } $user_id = intval( $user_id ); $group_id = intval( $group_id ); $cat_auth_fields = array( 'auth_view', 'auth_read', 'auth_view_file', 'auth_edit_file', 'auth_delete_file', 'auth_upload', 'auth_download', 'auth_rate', 'auth_email', 'auth_view_comment', 'auth_post_comment', 'auth_edit_comment', 'auth_delete_comment' ); $global_auth_fields = array( 'auth_search', 'auth_stats', 'auth_toplist', 'auth_viewall' ); $global_fields_names = array( 'auth_search' => $lang['Auth_search'], 'auth_stats' => $lang['Auth_stats'], 'auth_toplist' => $lang['Auth_toplist'], 'auth_viewall' => $lang['Auth_viewall'] ); $field_names = array( 'auth_view' => $lang['View'], 'auth_read' => $lang['Read'], 'auth_view_file' => $lang['View_file'], 'auth_edit_file' => $lang['Edit_file'], 'auth_delete_file' => $lang['Delete_file'], 'auth_upload' => $lang['Upload'], 'auth_download' => $lang['Download_file'], 'auth_rate' => $lang['Rate'], 'auth_email' => $lang['Email'], 'auth_view_comment' => $lang['View_comment'], 'auth_post_comment' => $lang['Post_comment'], 'auth_edit_comment' => $lang['Edit_comment'], 'auth_delete_comment' => $lang['Delete_comment'] ); $permissions_menu = array( append_sid( "admin_pa_catauth.$phpEx" ) => $lang['Cat_Permissions'], append_sid( "admin_pa_ug_auth.$phpEx?mode=user" ) => $lang['User_Permissions'], append_sid( "admin_pa_ug_auth.$phpEx?mode=group" ) => $lang['Group_Permissions'], append_sid( "admin_pa_ug_auth.$phpEx?mode=global_user" ) => $lang['User_Global_Permissions'], append_sid( "admin_pa_ug_auth.$phpEx?mode=global_group" ) => $lang['Group_Global_Permissions'] ); foreach( $permissions_menu as $url => $l_name ) { $pafiledb_template->assign_block_vars( 'pertype', array( 'U_NAME' => $url, 'L_NAME' => $l_name )); } if ( isset( $_POST['submit'] ) && ( ( $mode == 'user' && $user_id ) || ( $mode == 'group' && $group_id ) ) ) { if ( $mode == 'user' ) { $sql = "SELECT g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND g.group_single_user = '1'"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain user/group information", "", __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); $group_id = $row['group_id']; $db->sql_freeresult( $result ); } $change_mod_list = ( isset( $_POST['moderator'] ) ) ? $_POST['moderator'] : array(); $change_acl_list = array(); for( $j = 0; $j < count( $cat_auth_fields ); $j++ ) { $auth_field = $cat_auth_fields[$j]; while ( list( $cat_id, $value ) = @each( $_POST['private_' . $auth_field] ) ) { $change_acl_list[$cat_id][$auth_field] = $value; } } $sql = ( $mode == 'user' ) ? "SELECT aa.* FROM " . PA_AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND g.group_single_user = " . true : "SELECT * FROM " . PA_AUTH_ACCESS_TABLE . " WHERE group_id = $group_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain user/group permissions", "", __LINE__, __FILE__, $sql ); } $auth_access = array(); while ( $row = $db->sql_fetchrow( $result ) ) { $auth_access[$row['cat_id']] = $row; } $db->sql_freeresult( $result ); $cat_auth_action = array(); $update_acl_status = array(); $update_mod_status = array(); foreach( $pafiledb->cat_rowset as $cat_id => $cat_data ) { if ( ( isset( $auth_access[$cat_id]['auth_mod'] ) && $change_mod_list[$cat_id]['auth_mod'] != $auth_access[$cat_id]['auth_mod'] ) || ( !isset( $auth_access[$cat_id]['auth_mod'] ) && !empty( $change_mod_list[$cat_id]['auth_mod'] ) ) ) { $update_mod_status[$cat_id] = $change_mod_list[$cat_id]['auth_mod']; if ( !$update_mod_status[$cat_id] ) { $cat_auth_action[$cat_id] = 'delete'; } else if ( !isset( $auth_access[$cat_id]['auth_mod'] ) ) { $cat_auth_action[$cat_id] = 'insert'; } else { $cat_auth_action[$cat_id] = 'update'; } } for( $j = 0; $j < count( $cat_auth_fields ); $j++ ) { $auth_field = $cat_auth_fields[$j]; if ( $cat_data[$auth_field] == AUTH_ACL && isset( $change_acl_list[$cat_id][$auth_field] ) ) { if ( ( empty( $auth_access[$cat_id]['auth_mod'] ) && ( isset( $auth_access[$cat_id][$auth_field] ) && $change_acl_list[$cat_id][$auth_field] != $auth_access[$cat_id][$auth_field] ) || ( !isset( $auth_access[$cat_id][$auth_field] ) && !empty( $change_acl_list[$cat_id][$auth_field] ) ) ) || !empty( $update_mod_status[$cat_id] ) ) { $update_acl_status[$cat_id][$auth_field] = ( !empty( $update_mod_status[$cat_id] ) ) ? 0 : $change_acl_list[$cat_id][$auth_field]; if ( isset( $auth_access[$cat_id][$auth_field] ) && empty( $update_acl_status[$cat_id][$auth_field] ) && $cat_auth_action[$cat_id] != 'insert' && $cat_auth_action[$cat_id] != 'update' ) { $cat_auth_action[$cat_id] = 'delete'; } else if ( !isset( $auth_access[$cat_id][$auth_field] ) && !( $cat_auth_action[$cat_id] == 'delete' && empty( $update_acl_status[$cat_id][$auth_field] ) ) ) { $cat_auth_action[$cat_id] = 'insert'; } else if ( isset( $auth_access[$cat_id][$auth_field] ) && !empty( $update_acl_status[$cat_id][$auth_field] ) ) { $cat_auth_action[$cat_id] = 'update'; } } else if ( ( empty( $auth_access[$cat_id]['auth_mod'] ) && ( isset( $auth_access[$cat_id][$auth_field] ) && $change_acl_list[$cat_id][$auth_field] == $auth_access[$cat_id][$auth_field] ) ) && $cat_auth_action[$cat_id] == 'delete' ) { $cat_auth_action[$cat_id] = 'update'; } } } } // Checks complete, make updates to DB $delete_sql = ''; while ( list( $cat_id, $action ) = @each( $cat_auth_action ) ) { if ( $action == 'delete' ) { $delete_sql .= ( ( $delete_sql != '' ) ? ', ' : '' ) . $cat_id; } else { if ( $action == 'insert' ) { $sql_field = ''; $sql_value = ''; while ( list( $auth_type, $value ) = @each( $update_acl_status[$cat_id] ) ) { $sql_field .= ( ( $sql_field != '' ) ? ', ' : '' ) . $auth_type; $sql_value .= ( ( $sql_value != '' ) ? ', ' : '' ) . $value; } $sql_field .= ( ( $sql_field != '' ) ? ', ' : '' ) . 'auth_mod'; $sql_value .= ( ( $sql_value != '' ) ? ', ' : '' ) . ( ( !isset( $update_mod_status[$cat_id] ) ) ? 0 : $update_mod_status[$cat_id] ); $sql = "INSERT INTO " . PA_AUTH_ACCESS_TABLE . " (cat_id, group_id, $sql_field) VALUES ($cat_id, $group_id, $sql_value)"; } else { $sql_values = ''; while ( list( $auth_type, $value ) = @each( $update_acl_status[$cat_id] ) ) { $sql_values .= ( ( $sql_values != '' ) ? ', ' : '' ) . $auth_type . ' = ' . $value; } $sql_values .= ( ( $sql_values != '' ) ? ', ' : '' ) . 'auth_mod = ' . ( ( !isset( $update_mod_status[$cat_id] ) ) ? 0 : $update_mod_status[$cat_id] ); $sql = "UPDATE " . PA_AUTH_ACCESS_TABLE . " SET $sql_values WHERE group_id = $group_id AND cat_id = $cat_id"; } if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't update private forum permissions", "", __LINE__, __FILE__, $sql ); } } } if ( $delete_sql != '' ) { $sql = "DELETE FROM " . PA_AUTH_ACCESS_TABLE . " WHERE group_id = $group_id AND cat_id IN ($delete_sql)"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't delete permission entries", "", __LINE__, __FILE__, $sql ); } } $l_auth_return = ( $mode == 'user' ) ? $lang['Click_return_userauth'] : $lang['Click_return_groupauth']; $message = $lang['Auth_updated'] . '<br /><br />' . sprintf( $l_auth_return, '<a href="' . append_sid( "admin_pa_ug_auth.$phpEx?mode=$mode" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } elseif ( isset( $_POST['submit'] ) && ( ( $mode == 'global_user' && $user_id ) || ( $mode == 'global_group' && $group_id ) ) ) { if ( $mode == 'global_user' ) { $sql = "SELECT g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND g.group_single_user = '1'"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain user/group information", "", __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); $group_id = $row['group_id']; $db->sql_freeresult( $result ); } $change_acl_list = array(); for( $j = 0; $j < count( $global_auth_fields ); $j++ ) { $auth_field = $global_auth_fields[$j]; $change_acl_list[$auth_field] = $_POST['private_' . $auth_field]; } $sql = ( $mode == 'global_user' ) ? "SELECT aa.* FROM " . PA_AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND g.group_single_user = " . true . " AND aa.cat_id = '0'" : "SELECT * FROM " . PA_AUTH_ACCESS_TABLE . " WHERE group_id = $group_id AND cat_id = '0'"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain user/group permissions", "", __LINE__, __FILE__, $sql ); } $auth_access = ''; if ( $row = $db->sql_fetchrow( $result ) ) { $auth_access = $row; } $db->sql_freeresult( $result ); $global_auth_action = array(); $update_acl_status = array(); for( $j = 0; $j < count( $global_auth_fields ); $j++ ) { $auth_field = $global_auth_fields[$j]; if ( $pafiledb_config[$auth_field] == AUTH_ACL && isset( $change_acl_list[$auth_field] ) ) { if ( ( !is_moderator( $group_id ) && ( isset( $auth_access[$auth_field] ) && $change_acl_list[$auth_field] != $auth_access[$auth_field] ) || ( !isset( $auth_access[$cat_id][$auth_field] ) && !empty( $change_acl_list[$auth_field] ) ) ) ) { $update_acl_status[$auth_field] = $change_acl_list[$auth_field]; if ( isset( $auth_access[$auth_field] ) && empty( $update_acl_status[$auth_field] ) && $global_auth_action != 'insert' && $global_auth_action != 'update' ) { $global_auth_action = 'delete'; } else if ( !isset( $auth_access[$auth_field] ) && !( $global_auth_action == 'delete' && empty( $update_acl_status[$auth_field] ) ) ) { $global_auth_action = 'insert'; } else if ( isset( $auth_access[$auth_field] ) && !empty( $update_acl_status[$auth_field] ) ) { $global_auth_action = 'update'; } } else if ( ( !is_moderator( $auth_access['group_id'] ) && ( isset( $auth_access[$auth_field] ) && $change_acl_list[$auth_field] == $auth_access[$auth_field] ) ) && $global_auth_action == 'delete' ) { $global_auth_action = 'update'; } } } // Checks complete, make updates to DB $delete_sql = 0; if ( $global_auth_action == 'delete' ) { $delete_sql = 1; } else { if ( $global_auth_action == 'insert' ) { $sql_field = ''; $sql_value = ''; while ( list( $auth_type, $value ) = @each( $update_acl_status ) ) { $sql_field .= ( ( $sql_field != '' ) ? ', ' : '' ) . $auth_type; $sql_value .= ( ( $sql_value != '' ) ? ', ' : '' ) . $value; } $sql = "INSERT INTO " . PA_AUTH_ACCESS_TABLE . " (cat_id, group_id, $sql_field) VALUES (0, $group_id, $sql_value)"; } else { $sql_values = ''; while ( list( $auth_type, $value ) = @each( $update_acl_status ) ) { $sql_values .= ( ( $sql_values != '' ) ? ', ' : '' ) . $auth_type . ' = ' . $value; } $sql = "UPDATE " . PA_AUTH_ACCESS_TABLE . " SET $sql_values WHERE group_id = $group_id AND cat_id = 0"; } if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't update private forum permissions", "", __LINE__, __FILE__, $sql ); } } if ( $delete_sql ) { $sql = "DELETE FROM " . PA_AUTH_ACCESS_TABLE . " WHERE group_id = $group_id AND cat_id = 0"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't delete permission entries", "", __LINE__, __FILE__, $sql ); } } $l_auth_return = ( $mode == 'global_user' ) ? $lang['Click_return_userauth'] : $lang['Click_return_groupauth']; $message = $lang['Auth_updated'] . '<br /><br />' . sprintf( $l_auth_return, '<a href="' . append_sid( "admin_pa_ug_auth.$phpEx?mode=$mode" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } elseif ( ( $mode == 'user' && ( isset( $_POST['username'] ) || $user_id ) ) || ( $mode == 'group' && $group_id ) ) { if ( isset( $_POST['username'] ) ) { $this_userdata = mx_get_userdata( $_POST['username'], true ); if ( !is_array( $this_userdata ) ) { mx_message_die( GENERAL_MESSAGE, $lang['No_such_user'] ); } $user_id = $this_userdata['user_id']; } // Front end $sql = "SELECT u.user_id, u.username, u.user_level, g.group_id, g.group_name, g.group_single_user FROM " . USERS_TABLE . " u, " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE "; $sql .= ( $mode == 'user' ) ? "u.user_id = $user_id AND ug.user_id = u.user_id AND g.group_id = ug.group_id" : "g.group_id = $group_id AND ug.group_id = g.group_id AND u.user_id = ug.user_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain user/group information", "", __LINE__, __FILE__, $sql ); } $ug_info = array(); while ( $row = $db->sql_fetchrow( $result ) ) { $ug_info[] = $row; } $db->sql_freeresult( $result ); $sql = ( $mode == 'user' ) ? "SELECT aa.*, g.group_single_user FROM " . PA_AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND g.group_single_user = 1" : "SELECT * FROM " . PA_AUTH_ACCESS_TABLE . " WHERE group_id = $group_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain user/group permissions", "", __LINE__, __FILE__, $sql ); } $auth_access = array(); $auth_access_count = array(); while ( $row = $db->sql_fetchrow( $result ) ) { $auth_access[$row['cat_id']][] = $row; $auth_access_count[$row['cat_id']]++; } $db->sql_freeresult( $result ); $is_admin = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == ADMIN && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0; foreach( $pafiledb->cat_rowset as $cat_id => $cat_data ) { for( $j = 0; $j < count( $cat_auth_fields ); $j++ ) { $key = $cat_auth_fields[$j]; $value = $cat_data[$key]; switch ( $value ) { case AUTH_ALL: case AUTH_REG: $auth_ug[$cat_id][$key] = 1; break; case AUTH_ACL: $auth_ug[$cat_id][$key] = ( !empty( $auth_access_count[$cat_id] ) ) ? $pafiledb->auth_check_user( AUTH_ACL, $key, $auth_access[$cat_id], $is_admin ) : 0; $auth_field_acl[$cat_id][$key] = $auth_ug[$cat_id][$key]; break; case AUTH_MOD: $auth_ug[$cat_id][$key] = ( !empty( $auth_access_count[$cat_id] ) ) ? $pafiledb->auth_check_user( AUTH_MOD, $key, $auth_access[$cat_id], $is_admin ) : 0; break; case AUTH_ADMIN: $auth_ug[$cat_id][$key] = $is_admin; break; default: $auth_ug[$cat_id][$key] = 0; break; } } // Is user a moderator? $auth_ug[$cat_id]['auth_mod'] = ( !empty( $auth_access_count[$cat_id] ) ) ? $pafiledb->auth_check_user( AUTH_MOD, 'auth_mod', $auth_access[$cat_id], 0 ) : 0; } $optionlist_acl_adv = array(); $optionlist_mod = array(); foreach( $auth_ug as $cat_id => $user_ary ) { for( $k = 0; $k < count( $cat_auth_fields ); $k++ ) { $field_name = $cat_auth_fields[$k]; if ( $pafiledb->cat_rowset[$cat_id][$field_name] == AUTH_ACL ) { $optionlist_acl_adv[$cat_id][$k] = '<select name="private_' . $field_name . '[' . $cat_id . ']">'; if ( isset( $auth_field_acl[$cat_id][$field_name] ) && !( $is_admin || $user_ary['auth_mod'] ) ) { if ( !$auth_field_acl[$cat_id][$field_name] ) { $optionlist_acl_adv[$cat_id][$k] .= '<option value="1">' . $lang['ON'] . '</option><option value="0" selected="selected">' . $lang['OFF'] . '</option>'; } else { $optionlist_acl_adv[$cat_id][$k] .= '<option value="1" selected="selected">' . $lang['ON'] . '</option><option value="0">' . $lang['OFF'] . '</option>'; } } else { if ( $is_admin || $user_ary['auth_mod'] ) { $optionlist_acl_adv[$cat_id][$k] .= '<option value="1">' . $lang['ON'] . '</option>'; } else { $optionlist_acl_adv[$cat_id][$k] .= '<option value="1">' . $lang['ON'] . '</option><option value="0" selected="selected">' . $lang['OFF'] . '</option>'; } } $optionlist_acl_adv[$cat_id][$k] .= '</select>'; } } $optionlist_mod[$cat_id] = '<select name="moderator[' . $cat_id . ']">'; $optionlist_mod[$cat... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:23:37
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27191/modules/mx_pafiledb/pafiledb/includes Modified Files: functions_admin.php functions_pafiledb.php Log Message: making all admincp an object :-) Index: functions_admin.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_admin.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_admin.php 17 Jun 2006 20:13:22 -0000 1.4 --- functions_admin.php 8 Jul 2006 10:23:34 -0000 1.5 *************** *** 14,232 **** } ! 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; - } ! function admin_display_cat_auth_ug( $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_ug( $sub_cat_id, $depth + 1 ); } return; } - return; - } ! 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; - } - - /** - * Enter description here... - * - * @param unknown_type $sel_id - * @param unknown_type $use_default_option - * @param unknown_type $select_name - * @return unknown - */ - function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) - { - global $db, $lang; ! $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="'.$select_name.'">'; ! if ( $sel_id == 0 ) ! { ! $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; ! } ! if ( $use_default_option ) ! { ! $status = $sel_id == "-1" ? "selected" : ""; ! $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</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; ! } ! 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 ); ! } ! 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 --- 14,262 ---- } ! /** ! * Public pafiledb_admin class. ! * ! */ ! class pafiledb_admin extends pafiledb_public { ! /** ! * load admin module ! * ! * @param unknown_type $module_name send module name to load it ! */ ! function adminmodule( $module_name ) { ! if ( !class_exists( 'pafiledb_' . $module_name ) ) { ! global $module_root_path, $phpEx; ! $this->module_name = $module_name; ! ! require_once( $module_root_path . 'pafiledb/admin/admin_' . $module_name . '.' . $phpEx ); ! eval( '$this->modules[' . $module_name . '] = new pafiledb_' . $module_name . '();' ); ! ! if ( method_exists( $this->modules[$module_name], 'init' ) ) { ! $this->modules[$module_name]->init(); ! } ! } ! } ! 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; } ! function admin_display_cat_auth_ug( $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_ug( $sub_cat_id, $depth + 1 ); } ! return; } return; } ! 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; } ! /** ! * Enter description here... ! * ! * @param unknown_type $sel_id ! * @param unknown_type $use_default_option ! * @param unknown_type $select_name ! * @return unknown ! */ ! function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) { ! global $db, $lang; ! $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="'.$select_name.'">'; ! if ( $sel_id == 0 ) { ! $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; } ! ! if ( $use_default_option ) { ! $status = $sel_id == "-1" ? "selected" : ""; ! $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</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; ! } ! 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 ); ! } ! 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 Index: functions_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** functions_pafiledb.php 5 Jul 2006 22:50:22 -0000 1.34 --- functions_pafiledb.php 8 Jul 2006 10:23:34 -0000 1.35 *************** *** 24,50 **** /** - * load admin module - * - * @param unknown_type $module_name send module name to load it - */ - function adminmodule( $module_name ) - { - if ( !class_exists( 'pafiledb_' . $module_name ) ) - { - global $module_root_path, $phpEx; - - $this->module_name = $module_name; - - require_once( $module_root_path . 'pafiledb/admin/admin_' . $module_name . '.' . $phpEx ); - eval( '$this->modules[' . $module_name . '] = new pafiledb_' . $module_name . '();' ); - - if ( method_exists( $this->modules[$module_name], 'init' ) ) - { - $this->modules[$module_name]->init(); - } - } - } - - /** * load module. * --- 24,27 ---- |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:23:37
|
Update of /cvsroot/mxbb/mx_pafiledb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27191/modules/mx_pafiledb/admin Added Files: admin_pafiledb.php Log Message: making all admincp an object :-) --- NEW FILE: admin_pafiledb.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: admin_pafiledb.php,v 1.1 2006/07/08 10:23:34 jonohlsson Exp $ * @copyright (c) 2002-2006 [CRLin, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( file_exists( './../viewtopic.php' ) ) { define( 'IN_PHPBB', 1 ); define( 'MXBB_MODULE', false ); // // Main paths // $phpbb_root_path = $module_root_path = $mx_root_path = "./../"; // // Left Pane Paths // $setmodules_admin_path = ''; $setmodules_module_path = "./../"; require_once( $phpbb_root_path . 'extension.inc' ); } else { define( 'IN_PORTAL', 1 ); define( 'MXBB_MODULE', true ); // // Main paths // $mx_root_path = './../../../'; $module_root_path = './../../../modules/mx_pafiledb/'; // // Left Pane Paths // $setmodules_module_path = './../modules/mx_pafiledb/'; $setmodules_admin_path = $setmodules_module_path . 'admin/'; define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); $phpEx = substr(strrchr(__FILE__, '.'), 1); } if ( !empty( $setmodules ) ) { include_once( $setmodules_module_path . 'pafiledb/includes/pafiledb_constants.' . $phpEx ); $filename = basename( __FILE__ ); $module['pafileDB_Download']['0_Configuration'] = $setmodules_admin_path . $filename . "?action=settings"; $module['pafileDB_Download']['1_Cat_manage'] = $setmodules_admin_path . $filename . "?action=cat_manage"; $module['pafileDB_Download']['2_File_manage'] = $setmodules_admin_path . $filename . "?action=file_manage"; $module['pafileDB_Download']['3_Permissions'] = $setmodules_admin_path . $filename . "?action=auth_manage"; $module['pafileDB_Download']['4_License'] = $setmodules_admin_path . $filename . "?action=license_manage"; $module['pafileDB_Download']['5_Custom_manage'] = $setmodules_admin_path . $filename . "?action=custom_manage"; $module['pafileDB_Download']['6_Fchecker'] = $setmodules_admin_path . $filename . "?action=fchecker_manage"; return; } // // Includes // require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $module_root_path . 'pafiledb/pafiledb_common.' . $phpEx ); // ********************************************************************** // Read language definition // ********************************************************************** if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); } else { include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); } // // Get action variable other wise set it to the main // $action = ( isset( $_REQUEST['action'] ) ) ? htmlspecialchars( $_REQUEST['action'] ) : 'setting'; // // an array of all expected actions // $actions = array( 'settings' => 'settings', 'cat_manage' => 'cat_manage', 'file_manage' => 'file_manage', 'auth_manage' => 'auth_manage', 'license_manage' => 'license_manage', 'custom_manage' => 'custom_manage', 'fchecker_manage' => 'fchecker_manage' ); // // Lets Build the page // $pafiledb->adminmodule( $actions[$action] ); $pafiledb->modules[$actions[$action]]->main( $action ); $pafiledb->modules[$actions[$action]]->_pafiledb(); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); ?> |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:23:37
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27191/modules/mx_pafiledb/pafiledb Modified Files: pafiledb_common.php Log Message: making all admincp an object :-) Index: pafiledb_common.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/pafiledb_common.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pafiledb_common.php 5 Jul 2006 22:50:22 -0000 1.16 --- pafiledb_common.php 8 Jul 2006 10:23:34 -0000 1.17 *************** *** 89,92 **** $pafiledb_user = new mx_user_info(); ! $pafiledb = new pafiledb_public(); ?> \ No newline at end of file --- 89,101 ---- $pafiledb_user = new mx_user_info(); ! ! if (defined( 'IN_ADMIN' )) ! { ! include_once( $module_root_path . 'pafiledb/includes/functions_admin.' . $phpEx ); ! $pafiledb = new pafiledb_admin(); ! } ! else ! { ! $pafiledb = new pafiledb_public(); ! } ?> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:22:42
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26757/modules/mx_linkdb/linkdb/includes Modified Files: functions_linkdb.php Added Files: functions_admin.php Log Message: working... Index: functions_linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_linkdb.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** functions_linkdb.php 5 Jul 2006 22:49:20 -0000 1.13 --- functions_linkdb.php 8 Jul 2006 10:22:38 -0000 1.14 *************** *** 24,50 **** /** - * load admin module - * - * @param unknown_type $module_name send module name to load it - */ - function adminmodule( $module_name ) - { - if ( !class_exists( 'linkdb_' . $module_name ) ) - { - global $module_root_path, $phpEx; - - $this->module_name = $module_name; - - require_once( $module_root_path . 'linkdb/admin/admin_' . $module_name . '.' . $phpEx ); - eval( '$this->modules[' . $module_name . '] = new linkdb_' . $module_name . '();' ); - - if ( method_exists( $this->modules[$module_name], 'init' ) ) - { - $this->modules[$module_name]->init(); - } - } - } - - /** * load module * --- 24,27 ---- --- NEW FILE: functions_admin.php --- <?php /** * * @package mxBBmodule_mx_kb * @version $Id: functions_admin.php,v 1.1 2006/07/08 10:22:38 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" ); } /** * Public linkdb_admin class. * */ class linkdb_admin extends linkdb_public { /** * load admin module * * @param unknown_type $module_name send module name to load it */ function adminmodule( $module_name ) { if ( !class_exists( 'linkdb_' . $module_name ) ) { global $module_root_path, $phpEx; $this->module_name = $module_name; require_once( $module_root_path . 'linkdb/admin/admin_' . $module_name . '.' . $phpEx ); eval( '$this->modules[' . $module_name . '] = new linkdb_' . $module_name . '();' ); if ( method_exists( $this->modules[$module_name], 'init' ) ) { $this->modules[$module_name]->init(); } } } } ?> |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:22:41
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26757/modules/mx_linkdb/linkdb/admin Modified Files: admin_auth_manage.php admin_cat_manage.php admin_link_manage.php admin_setting.php Log Message: working... Index: admin_cat_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/admin/admin_cat_manage.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** admin_cat_manage.php 3 Jul 2006 12:23:30 -0000 1.7 --- admin_cat_manage.php 8 Jul 2006 10:22:38 -0000 1.8 *************** *** 14,18 **** } ! class linkdb_cat_manage extends linkdb_public { function main( $action ) --- 14,18 ---- } ! class linkdb_cat_manage extends linkdb_admin { function main( $action ) Index: admin_auth_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/admin/admin_auth_manage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_auth_manage.php 4 Jul 2006 18:07:02 -0000 1.1 --- admin_auth_manage.php 8 Jul 2006 10:22:38 -0000 1.2 *************** *** 14,18 **** } ! class linkdb_auth_manage extends linkdb_public { function main( $action ) --- 14,18 ---- } ! class linkdb_auth_manage extends linkdb_admin { function main( $action ) Index: admin_link_manage.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/admin/admin_link_manage.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_link_manage.php 1 Jul 2006 21:32:18 -0000 1.6 --- admin_link_manage.php 8 Jul 2006 10:22:38 -0000 1.7 *************** *** 14,18 **** } ! class linkdb_link_manage extends linkdb_public { function main( $action ) --- 14,18 ---- } ! class linkdb_link_manage extends linkdb_admin { function main( $action ) Index: admin_setting.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/admin/admin_setting.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_setting.php 5 Jul 2006 22:49:20 -0000 1.10 --- admin_setting.php 8 Jul 2006 10:22:38 -0000 1.11 *************** *** 9,18 **** */ ! if ( !defined( 'IN_PHPBB' ) || IN_ADMIN != true ) { die( "Hacking attempt" ); } ! class linkdb_setting extends linkdb_public { function main( $action ) --- 9,18 ---- */ ! if ( !defined( 'IN_PHPBB' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } ! class linkdb_setting extends linkdb_admin { function main( $action ) |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:22:41
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26757/modules/mx_linkdb/linkdb Modified Files: linkdb_common.php Log Message: working... Index: linkdb_common.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/linkdb_common.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** linkdb_common.php 5 Jul 2006 22:49:20 -0000 1.2 --- linkdb_common.php 8 Jul 2006 10:22:38 -0000 1.3 *************** *** 84,88 **** } ! //$linkdb_user = new mx_user_info(); ! $linkdb = new linkdb_public(); ?> \ No newline at end of file --- 84,95 ---- } ! if (defined( 'IN_ADMIN' )) ! { ! include_once( $module_root_path . 'linkdb/includes/functions_admin.' . $phpEx ); ! $linkdb = new linkdb_admin(); ! } ! else ! { ! $linkdb = new linkdb_public(); ! } ?> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:21:44
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26309/modules/mx_kb/admin Added Files: admin_kb.php Log Message: making all admincp an object :-) --- NEW FILE: admin_kb.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: admin_kb.php,v 1.1 2006/07/08 10:21:36 jonohlsson Exp $ * @copyright (c) 2002-2006 [CRLin, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( file_exists( './../viewtopic.php' ) ) { define( 'IN_PHPBB', 1 ); define( 'MXBB_MODULE', false ); // // Main paths // $phpbb_root_path = $module_root_path = $mx_root_path = "./../"; // // Left Pane Paths // $setmodules_admin_path = ''; $setmodules_module_path = "./../"; require_once( $phpbb_root_path . 'extension.inc' ); } else { define( 'IN_PORTAL', 1 ); define( 'MXBB_MODULE', true ); // // Main paths // $mx_root_path = './../../../'; $module_root_path = './../../../modules/mx_kb/'; // // Left Pane Paths // $setmodules_module_path = './../modules/mx_kb/'; $setmodules_admin_path = $setmodules_module_path . 'admin/'; define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); $phpEx = substr(strrchr(__FILE__, '.'), 1); } if ( !empty( $setmodules ) ) { include_once( $setmodules_module_path . 'kb/includes/kb_constants.' . $phpEx ); $filename = basename( __FILE__ ); $module['KB_title']['1_Configuration'] = $setmodules_admin_path . $filename . "?action=settings"; $module['KB_title']['2_Cat_man'] = $setmodules_admin_path . $filename . "?action=cat_manage"; $module['KB_title']['3_Art_man'] = $setmodules_admin_path . $filename . "?action=article_manage"; $module['KB_title']['4_Permissions'] = $setmodules_admin_path . $filename . "?action=auth_manage"; $module['KB_title']['5_Types_man'] = $setmodules_admin_path . $filename . "?action=types_manage"; $module['KB_title']['6_Custom_Field'] = $setmodules_admin_path . $filename . "?action=custom_manage"; return; } // // Includes // require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $module_root_path . 'kb/kb_common.' . $phpEx ); // ********************************************************************** // Read language definition // ********************************************************************** if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); } else { include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); } // // Get action variable other wise set it to the main // $action = ( isset( $_REQUEST['action'] ) ) ? htmlspecialchars( $_REQUEST['action'] ) : 'setting'; // // an array of all expected actions // $actions = array( 'settings' => 'settings', 'cat_manage' => 'cat_manage', 'article_manage' => 'article_manage', 'auth_manage' => 'auth_manage', 'types_manage' => 'types_manage', 'custom_manage' => 'custom_manage' ); // // Lets Build the page // $mx_kb->adminmodule( $actions[$action] ); $mx_kb->modules[$actions[$action]]->main( $action ); $mx_kb->modules[$actions[$action]]->_kb(); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); ?> |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:21:41
|
Update of /cvsroot/mxbb/mx_kb/kb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26309/modules/mx_kb/kb/includes Modified Files: functions_admin.php functions_kb.php Log Message: making all admincp an object :-) Index: functions_admin.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_admin.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** functions_admin.php 17 Jun 2006 20:11:23 -0000 1.6 --- functions_admin.php 8 Jul 2006 10:21:36 -0000 1.7 *************** *** 15,159 **** /** ! * Enter description here... * - * @param unknown_type $cat_parent - * @param unknown_type $depth */ ! function admin_cat_main( $cat_parent = 0, $depth = 0 ) { ! global $mx_kb, $phpbb_root_path, $template, $phpEx, $lang, $images, $module_root_path, $theme; ! $pre = str_repeat( ' ', $depth ); ! if ( isset( $mx_kb->subcat_rowset[$cat_parent] ) ) { ! foreach( $mx_kb->subcat_rowset[$cat_parent] as $category_id => $category ) { ! $category_details = $category['category_details']; ! $category_id = $category['category_id']; ! $category_name = $category['category_name']; ! $temp_url = append_sid( $module_root_path . "kb.$phpEx?mode=cat&cat=$category_id" ); ! $category_link = '<a href="' . $temp_url . '" class="gen">' . $category_name . '</a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=edit&cat=$category_id" ); ! $edit = '<a href="' . $temp_url . '"><img src="' . $images['kb_icon_edit'] . '" border="0" alt="' . $lang['Edit'] . '"></a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=delete&cat=$category_id" ); ! $delete = '<a href="' . $temp_url . '" class="gen"><img src="' . $images['kb_icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=up&cat=$category_id" ); ! $up = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_up'] . '</a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=down&cat=$category_id" ); ! $down = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_down'] . '</a>'; ! $row_class = ( !( $ss % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars( 'catrow', array( ! 'CATEGORY' => $category_link, ! 'CAT_DESCRIPTION' => $category_details, ! 'U_EDIT' => $edit, ! 'U_DELETE' => $delete, ! 'U_UP' => $up, ! 'U_DOWN' => $down, ! 'ROW_CLASS' => $row_class, ! 'PRE' => $pre ! )); ! admin_cat_main( $category_id, $depth + 1 ); } return; } - return; - } ! /** ! * Enter description here... ! * ! * @param unknown_type $sel_id ! * @param unknown_type $use_default_option ! * @param unknown_type $select_name ! * @return unknown ! */ ! function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) ! { ! global $db, $lang; ! ! $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="'.$select_name.'">'; ! if ( $sel_id == 0 ) ! { ! $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; ! } ! if ( $use_default_option ) ! { ! $status = $sel_id == "-1" ? "selected" : ""; ! $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</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; ! } ! /** ! * Enter description here... ! * ! * @param unknown_type $id ! * @param unknown_type $select ! * @return unknown ! */ ! function get_list_kb( $id, $select ) ! { ! global $db; ! $idfield = 'id'; ! $namefield = 'type'; ! $sql = "SELECT * ! FROM " . KB_TYPES_TABLE; ! if ( $select == 0 ) ! { ! $sql .= " WHERE $idfield <> $id"; ! } ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Couldn't get list of types", "", __LINE__, __FILE__, $sql ); ! } ! $typelist = ""; ! while ( $row = $db->sql_fetchrow( $result ) ) ! { ! $typelist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n"; ! } ! return( $typelist ); } ?> \ No newline at end of file --- 15,189 ---- /** ! * Public mx_kb class. * */ ! class mx_kb_admin extends mx_kb_public { ! /** ! * load admin module ! * ! * @param unknown_type $module_name send module name to load it ! */ ! function adminmodule( $module_name ) ! { ! if ( !class_exists( 'kb_' . $module_name ) ) ! { ! global $module_root_path, $phpEx; ! $this->module_name = $module_name; ! ! require_once( $module_root_path . 'kb/admin/admin_' . $module_name . '.' . $phpEx ); ! eval( '$this->modules[' . $module_name . '] = new mx_kb_' . $module_name . '();' ); ! ! if ( method_exists( $this->modules[$module_name], 'init' ) ) ! { ! $this->modules[$module_name]->init(); ! } ! } ! } ! ! /** ! * Enter description here... ! * ! * @param unknown_type $cat_parent ! * @param unknown_type $depth ! */ ! function admin_cat_main( $cat_parent = 0, $depth = 0 ) { ! global $phpbb_root_path, $template, $phpEx, $lang, $images, $module_root_path, $theme; ! ! $pre = str_repeat( ' ', $depth ); ! if ( isset( $this->subcat_rowset[$cat_parent] ) ) { ! foreach( $this->subcat_rowset[$cat_parent] as $category_id => $category ) ! { ! $category_details = '<span class="gensmall">' . $category['category_details'] . '</span>'; ! $category_id = $category['category_id']; ! $category_name = $category['category_name']; ! $temp_url = append_sid( $module_root_path . "kb.$phpEx?mode=cat&cat=$category_id" ); ! $category_link = '<a href="' . $temp_url . '" class="nav" target="_blank">' . $category_name . '</a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=edit&cat=$category_id" ); ! $edit = '<a href="' . $temp_url . '"><img src="' . $images['kb_icon_edit'] . '" border="0" alt="' . $lang['Edit'] . '"></a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=delete&cat=$category_id" ); ! $delete = '<a href="' . $temp_url . '" class="gen"><img src="' . $images['kb_icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=up&cat=$category_id" ); ! $up = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_up'] . '</a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=down&cat=$category_id" ); ! $down = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_down'] . '</a>'; ! $row_class = ( !( $ss % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars( 'catrow', array( ! 'CATEGORY' => $category_link, ! 'CAT_DESCRIPTION' => $category_details, ! 'U_EDIT' => $edit, ! 'U_DELETE' => $delete, ! 'U_UP' => $up, ! 'U_DOWN' => $down, ! 'ROW_CLASS' => $row_class, ! 'PRE' => $pre ! )); ! $this->admin_cat_main( $category_id, $depth + 1 ); ! } ! return; } return; } ! /** ! * Enter description here... ! * ! * @param unknown_type $sel_id ! * @param unknown_type $use_default_option ! * @param unknown_type $select_name ! * @return unknown ! */ ! function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) { ! global $db, $lang; ! $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="'.$select_name.'">'; ! if ( $sel_id == 0 ) { ! $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; } ! ! if ( $use_default_option ) { ! $status = $sel_id == "-1" ? "selected" : ""; ! $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</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; ! } ! /** ! * Enter description here... ! * ! * @param unknown_type $id ! * @param unknown_type $select ! * @return unknown ! */ ! function get_list_kb( $id, $select ) ! { ! global $db; ! $idfield = 'id'; ! $namefield = 'type'; ! $sql = "SELECT * ! FROM " . KB_TYPES_TABLE; ! if ( $select == 0 ) ! { ! $sql .= " WHERE $idfield <> $id"; ! } ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Couldn't get list of types", "", __LINE__, __FILE__, $sql ); ! } ! $typelist = ""; ! while ( $row = $db->sql_fetchrow( $result ) ) ! { ! $typelist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n"; ! } ! ! return( $typelist ); ! } } ?> \ No newline at end of file Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_kb.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** functions_kb.php 5 Jul 2006 22:48:26 -0000 1.13 --- functions_kb.php 8 Jul 2006 10:21:36 -0000 1.14 *************** *** 24,50 **** /** - * load admin module - * - * @param unknown_type $module_name send module name to load it - */ - function adminmodule( $module_name ) - { - if ( !class_exists( 'kb_' . $module_name ) ) - { - global $module_root_path, $phpEx; - - $this->module_name = $module_name; - - require_once( $module_root_path . 'kb/admin/admin_' . $module_name . '.' . $phpEx ); - eval( '$this->modules[' . $module_name . '] = new mx_kb_' . $module_name . '();' ); - - if ( method_exists( $this->modules[$module_name], 'init' ) ) - { - $this->modules[$module_name]->init(); - } - } - } - - /** * load module * --- 24,27 ---- |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:21:40
|
Update of /cvsroot/mxbb/mx_kb/kb In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26309/modules/mx_kb/kb Modified Files: kb_common.php Log Message: making all admincp an object :-) Index: kb_common.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/kb_common.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** kb_common.php 5 Jul 2006 22:48:26 -0000 1.6 --- kb_common.php 8 Jul 2006 10:21:36 -0000 1.7 *************** *** 70,74 **** include_once( $module_root_path . 'kb/includes/functions_kb.' . $phpEx ); ! $mx_kb = new mx_kb_public(); $mx_kb_cache = new mx_kb_cache(); $mx_kb_functions = new mx_kb_functions(); --- 70,83 ---- include_once( $module_root_path . 'kb/includes/functions_kb.' . $phpEx ); ! if (defined( 'IN_ADMIN' )) ! { ! include_once( $module_root_path . 'kb/includes/functions_admin.' . $phpEx ); ! $mx_kb = new mx_kb_admin(); ! } ! else ! { ! $mx_kb = new mx_kb_public(); ! } ! $mx_kb_cache = new mx_kb_cache(); $mx_kb_functions = new mx_kb_functions(); |
Update of /cvsroot/mxbb/mx_kb/kb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26309/modules/mx_kb/kb/admin Added Files: admin_article_manage.php admin_auth_manage.php admin_cat_manage.php admin_custom_manage.php admin_settings.php admin_types_manage.php Log Message: making all admincp an object :-) --- NEW FILE: admin_cat_manage.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: admin_cat_manage.php,v 1.1 2006/07/08 10:21:36 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' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class mx_kb_cat_manage extends mx_kb_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $mx_kb_functions, $mx_kb_cache, $kb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); if ( empty($mode) ) { if ( $create ) { $mode = 'create'; } else if ( $edit ) { $mode = 'edit'; } else if ( $delete ) { $mode = 'delete'; } else { $mode = ''; } } $cat_auth_levels = array( 'ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN' ); $cat_auth_const = array( AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN ); $global_auth = array( 'auth_view', 'auth_post', 'auth_rate', 'auth_comment', 'auth_edit', 'auth_delete', 'auth_approval', 'auth_approval_edit' ); $auth_select = array(); switch ( $mode ) { case ( 'create' ): if ( !$_POST['submit'] ) { $new_cat_name = stripslashes( $_POST['new_cat_name'] ); // // Comments // $use_comments_yes = ""; $use_comments_no = ""; $use_comments_default = "checked=\"checked\""; $internal_comments_internal = ""; $internal_comments_phpbb = ""; $internal_comments_default = "checked=\"checked\""; $comments_forum_id = '-1'; $autogenerate_comments_yes = ""; $autogenerate_comments_no = ""; $autogenerate_comments_default = "checked=\"checked\""; // // Ratings // $use_ratings_yes = ""; $use_ratings_no = ""; $use_ratings_default = "checked=\"checked\""; // // Instructions // $pretext_show = ""; $pretext_hide = ""; $pretext_default = "checked=\"checked\""; // // Notification // $notify_none = ""; $notify_pm = ""; $notify_email = ""; $notify_default = "checked=\"checked\""; $notify_group_list = mx_get_groups('', 'notify_group'); // // Permissions // $cat_rowset['auth_view'] = 0; $cat_rowset['auth_post'] = 1; $cat_rowset['auth_rate'] = 1; $cat_rowset['auth_comment'] = 1; $cat_rowset['auth_edit'] = 1; $cat_rowset['auth_delete'] = 2; $cat_rowset['auth_approval'] = 5; $cat_rowset['auth_approval_edit'] = 5; foreach( $global_auth as $auth ) { $auth_select[$auth] = ' <select name="' . $auth . '">'; for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) { $selected = ( $cat_rowset[$auth] == $cat_auth_const[$k] ) ? ' selected="selected"' : ''; $auth_select[$auth] .= '<option value="' . $cat_auth_const[$k] . '"' . $selected . '>' . $lang['Forum_' . $cat_auth_levels[$k]] . '</option>'; } $auth_select[$auth] .= '</select> '; } // // Generate page // $template->set_filenames( array( 'body' => 'admin/kb_cat_edit_body.tpl' ) ); $template->assign_block_vars( 'switch_cat', array() ); $template->assign_vars( array( 'S_ACTION' => append_sid( "admin_kb.$phpEx?action=cat_manage&mode=create" ), 'L_EDIT_TITLE' => $lang['Create_cat'], 'L_EDIT_DESCRIPTION' => $lang['Create_description'], 'L_CATEGORY' => $lang['Category'], 'L_DESCRIPTION' => $lang['Category_description'], 'L_NUMBER_ARTICLES' => $lang['Articles'], 'L_CAT_SETTINGS' => $lang['Cat_settings'], 'L_CREATE' => $lang['Create'], 'L_PARENT' => $lang['Parent'], 'L_NONE' => $lang['None'], 'PARENT_LIST' => $this->generate_jumpbox( '', 0, 0, 0, true ), 'CAT_NAME' => $new_cat_name, 'DESC' => '', 'NUMBER_ARTICLES' => '0', 'L_DEFAULT' => $lang['Use_default'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_NONE' => $lang['Acc_None'], // // Comments // 'L_COMMENTS_TITLE' => $lang['Comments_title'], 'L_USE_COMMENTS' => $lang['Use_comments'], 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], 'S_USE_COMMENTS_YES' => $use_comments_yes, 'S_USE_COMMENTS_NO' => $use_comments_no, 'S_USE_COMMENTS_DEFAULT' => $use_comments_default, 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, 'S_INTERNAL_COMMENTS_DEFAULT' => $internal_comments_default, 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], 'FORUM_LIST' => $this->get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, 'S_AUTOGENERATE_COMMENTS_DEFAULT' => $autogenerate_comments_default, // // Ratings // 'L_RATINGS_TITLE' => $lang['Ratings_title'], 'L_USE_RATINGS' => $lang['Use_ratings'], 'L_USE_RATINGS_EXPLAIN' => $lang['Use_ratings_explain'], 'S_USE_RATINGS_YES' => $use_ratings_yes, 'S_USE_RATINGS_NO' => $use_ratings_no, 'S_USE_RATINGS_DEFAULT' => $use_ratings_default, // // Instructions // 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], 'S_SHOW_PRETEXT' => $pretext_show, 'S_HIDE_PRETEXT' => $pretext_hide, 'S_DEFAULT_PRETEXT' => $pretext_default, 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], // // Notifications // 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], 'L_NOTIFY' => $lang['Notify'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['PM'], 'S_NOTIFY_NONE' => $notify_none, 'S_NOTIFY_EMAIL' => $notify_email, 'S_NOTIFY_PM' => $notify_pm, 'S_NOTIFY_DEFAULT' => $notify_default, 'L_NOTIFY_GROUP' => $lang['Notify_group'], 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], 'NOTIFY_GROUP' => $notify_group_list, // // Category permissions // 'L_CAT_PERMISSIONS' => $lang['Category_Permissions'], 'L_VIEW_LEVEL' => $lang['View_level'], 'S_VIEW_LEVEL' => $auth_select['auth_view'], 'L_UPLOAD_LEVEL' => $lang['Upload_level'], 'S_UPLOAD_LEVEL' => $auth_select['auth_post'], 'L_RATE_LEVEL' => $lang['Rate_level'], 'S_RATE_LEVEL' => $auth_select['auth_rate'], 'L_COMMENT_LEVEL' => $lang['Comment_level'], 'S_COMMENT_LEVEL' => $auth_select['auth_comment'], 'L_EDIT_LEVEL' => $lang['Edit_level'], 'S_EDIT_LEVEL' => $auth_select['auth_edit'], 'L_DELETE_LEVEL' => $lang['Delete_level'], 'S_DELETE_LEVEL' => $auth_select['auth_delete'], 'L_APPROVAL_LEVEL' => $lang['Approval_level'], 'S_APPROVAL_LEVEL' => $auth_select['auth_approval'], 'L_APPROVAL_EDIT_LEVEL' => $lang['Approval_edit_level'], 'S_APPROVAL_EDIT_LEVEL' => $auth_select['auth_approval_edit'], 'L_DISABLED' => $lang['Disabled'], )); } else if ( $_POST['submit'] ) { $cat_name = trim( $_POST['catname'] ); if ( !$cat_name ) { echo "Please put a category name in!"; } $cat_desc = $_POST['catdesc']; $parent = intval( $_POST['parent'] ); $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; $comments_forum_id = intval( $_POST['comments_forum_id'] ); $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; $cat_use_ratings = ( isset( $_POST['cat_allow_ratings'] ) ) ? intval( $_POST['cat_allow_ratings'] ) : 0; $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; if ( $comments_forum_id == 0 ) { mx_message_die(GENERAL_MESSAGE , 'Select a Forum'); } $view_level = intval( $_POST['auth_view'] ); $post_level = intval( $_POST['auth_post'] ); $rate_level = intval( $_POST['auth_rate'] ); $comment_level = intval( $_POST['auth_comment'] ); $edit_level = intval( $_POST['auth_edit'] ); $delete_level = intval( $_POST['auth_delete'] ); $approval_level = intval( $_POST['auth_approval'] ); $approval_edit_level = intval( $_POST['auth_approval_edit'] ); $sql = "SELECT MAX(cat_order) AS cat_order FROM " . KB_CATEGORIES_TABLE . " WHERE parent = $parent"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } if ( !( $id = $db->sql_fetchrow( $result ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } $cat_order = $id['cat_order'] + 10; $sql = "INSERT INTO " . KB_CATEGORIES_TABLE . " ( category_name, category_details, number_articles, parent, cat_order, auth_view, auth_post, auth_rate, auth_comment, auth_edit, auth_delete, auth_approval, auth_approval_edit, cat_allow_comments, internal_comments, autogenerate_comments, comments_forum_id, cat_allow_ratings, show_pretext, notify, notify_group )" . " VALUES ( '$cat_name', ' $cat_desc', '0', '$parent', '$cat_order', '$view_level', '$post_level', '$rate_level', '$comment_level', '$edit_level', '$delete_level', '$approval_level', '$approval_edit_level', '$cat_use_comments', '$cat_internal_comments', '$cat_autogenerate_comments', '$comments_forum_id', '$cat_use_ratings', '$cat_show_pretext', '$cat_notify', '$cat_notify_group')"; if ( !( $results = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not create category", '', __LINE__, __FILE__, $sql ); } $message = $lang['Cat_created'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } break; case ( 'edit' ): if ( !$_POST['submit'] ) { $cat_id = intval( $_GET['cat'] ); $cat_name = $this->cat_rowset[$cat_id]['category_name']; $cat_desc = $this->cat_rowset[$cat_id]['category_details']; $number_articles = $this->article_in_cat($cat_id); $parent = $this->cat_rowset[$cat_id]['parent']; // // Comments // $use_comments_yes = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 1 ) ? "checked=\"checked\"" : ""; $use_comments_no = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == 0 ) ? "checked=\"checked\"" : ""; $use_comments_default = ( $this->cat_rowset[$cat_id]['cat_allow_comments'] == -1 ) ? "checked=\"checked\"" : ""; $internal_comments_internal = ( $this->cat_rowset[$cat_id]['internal_comments'] == 1 ) ? "checked=\"checked\"" : ""; $internal_comments_phpbb = ( $this->cat_rowset[$cat_id]['internal_comments'] == 0 ) ? "checked=\"checked\"" : ""; $internal_comments_default = ( $this->cat_rowset[$cat_id]['internal_comments'] == -1 ) ? "checked=\"checked\"" : ""; $comments_forum_id = $this->cat_rowset[$cat_id]['comments_forum_id']; $autogenerate_comments_yes = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 1 ) ? "checked=\"checked\"" : ""; $autogenerate_comments_no = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == 0) ? "checked=\"checked\"" : ""; $autogenerate_comments_default = ( $this->cat_rowset[$cat_id]['autogenerate_comments'] == -1 ) ? "checked=\"checked\"" : ""; // // Ratings // $use_ratings_yes = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == 1) ? "checked=\"checked\"" : ""; $use_ratings_no = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == 0) ? "checked=\"checked\"" : ""; $use_ratings_default = ( $this->cat_rowset[$cat_id]['cat_allow_ratings'] == -1 ) ? "checked=\"checked\"" : ""; // // Instructions // $pretext_show = ( $this->cat_rowset[$cat_id]['show_pretext'] == 1) ? "checked=\"checked\"" : ""; $pretext_hide = ( $this->cat_rowset[$cat_id]['show_pretext'] == 0) ? "checked=\"checked\"" : ""; $pretext_default = ( $this->cat_rowset[$cat_id]['show_pretext'] == -1 ) ? "checked=\"checked\"" : ""; // // Notification // $notify_none = ( $this->cat_rowset[$cat_id]['notify'] == 0 ) ? "checked=\"checked\"" : ""; $notify_pm = ( $this->cat_rowset[$cat_id]['notify'] == 1 ) ? "checked=\"checked\"" : ""; $notify_email = ( $this->cat_rowset[$cat_id]['notify'] == 2 ) ? "checked=\"checked\"" : ""; $notify_default = ( $this->cat_rowset[$cat_id]['notify'] == -1 ) ? "checked=\"checked\"" : ""; $notify_group_list = mx_get_groups($this->cat_rowset[$cat_id]['notify_group'], 'notify_group'); // // Permissions // foreach( $global_auth as $auth ) { $auth_select[$auth] = ' <select name="' . $auth . '">'; for( $k = 0; $k < count( $cat_auth_levels ); $k++ ) { $selected = ( $this->cat_rowset[$cat_id][$auth] == $cat_auth_const[$k] ) ? ' selected="selected"' : ''; $auth_select[$auth] .= '<option value="' . $cat_auth_const[$k] . '"' . $selected . '>' . $lang['Forum_' . $cat_auth_levels[$k]] . '</option>'; } $auth_select[$auth] .= '</select> '; } // // Generate page // $template->set_filenames( array( 'body' => 'admin/kb_cat_edit_body.tpl' ) ); $template->assign_block_vars( 'switch_cat', array() ); $template->assign_block_vars( 'switch_cat.switch_edit_category', array() ); $template->assign_vars( array( 'L_EDIT_TITLE' => $lang['Edit_cat'], 'L_EDIT_DESCRIPTION' => $lang['Edit_description'], 'L_CATEGORY' => $lang['Category'], 'L_DESCRIPTION' => $lang['Category_desc'], 'L_NUMBER_ARTICLES' => $lang['Articles'], 'L_CAT_SETTINGS' => $lang['Cat_settings'], 'L_CREATE' => $lang['Edit'], 'L_PARENT' => $lang['Parent'], 'L_NONE' => $lang['None'], 'PARENT_LIST' => $this->generate_jumpbox( '', $cat_id, $parent, true, true ), 'S_ACTION' => append_sid( "admin_kb.$phpEx?action=cat_manage&mode=edit" ), 'CAT_NAME' => $cat_name, 'CAT_DESCRIPTION' => $cat_desc, 'NUMBER_ARTICLES' => $number_articles, 'L_DEFAULT' => $lang['Use_default'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_NONE' => $lang['Acc_None'], // // Comments // 'L_COMMENTS_TITLE' => $lang['Comments_title'], 'L_USE_COMMENTS' => $lang['Use_comments'], 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], 'S_USE_COMMENTS_YES' => $use_comments_yes, 'S_USE_COMMENTS_NO' => $use_comments_no, 'S_USE_COMMENTS_DEFAULT' => $use_comments_default, 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, 'S_INTERNAL_COMMENTS_DEFAULT' => $internal_comments_default, 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], 'FORUM_LIST' => $this->get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, 'S_AUTOGENERATE_COMMENTS_DEFAULT' => $autogenerate_comments_default, // // Ratings // 'L_RATINGS_TITLE' => $lang['Ratings_title'], 'L_USE_RATINGS' => $lang['Use_ratings'], 'L_USE_RATINGS_EXPLAIN' => $lang['Use_ratings_explain'], 'S_USE_RATINGS_YES' => $use_ratings_yes, 'S_USE_RATINGS_NO' => $use_ratings_no, 'S_USE_RATINGS_DEFAULT' => $use_ratings_default, // // Instructions // 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], 'S_SHOW_PRETEXT' => $pretext_show, 'S_HIDE_PRETEXT' => $pretext_hide, 'S_DEFAULT_PRETEXT' => $pretext_default, 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], // // Notifications // 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], 'L_NOTIFY' => $lang['Notify'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['PM'], 'S_NOTIFY_NONE' => $notify_none, 'S_NOTIFY_EMAIL' => $notify_email, 'S_NOTIFY_PM' => $notify_pm, 'S_NOTIFY_DEFAULT' => $notify_default, 'L_NOTIFY_GROUP' => $lang['Notify_group'], 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], 'NOTIFY_GROUP' => $notify_group_list, // // Cat permissions // 'L_CAT_PERMISSIONS' => $lang['Category_Permissions'], 'L_VIEW_LEVEL' => $lang['View_level'], 'S_VIEW_LEVEL' => $auth_select['auth_view'], 'L_UPLOAD_LEVEL' => $lang['Upload_level'], 'S_UPLOAD_LEVEL' => $auth_select['auth_post'], 'L_RATE_LEVEL' => $lang['Rate_level'], 'S_RATE_LEVEL' => $auth_select['auth_rate'], 'L_COMMENT_LEVEL' => $lang['Comment_level'], 'S_COMMENT_LEVEL' => $auth_select['auth_comment'], 'L_EDIT_LEVEL' => $lang['Edit_level'], 'S_EDIT_LEVEL' => $auth_select['auth_edit'], 'L_DELETE_LEVEL' => $lang['Delete_level'], 'S_DELETE_LEVEL' => $auth_select['auth_delete'], 'L_APPROVAL_LEVEL' => $lang['Approval_level'], 'S_APPROVAL_LEVEL' => $auth_select['auth_approval'], 'L_APPROVAL_EDIT_LEVEL' => $lang['Approval_edit_level'], 'S_APPROVAL_EDIT_LEVEL' => $auth_select['auth_approval_edit'], 'L_DISABLED' => $lang['Disabled'], 'S_HIDDEN' => '<input type="hidden" name="catid" value="' . $cat_id . '">' ) ); } else if ( $_POST['submit'] ) { $cat_id = intval( $_POST['catid'] ); $cat_name = trim( $_POST['catname'] ); $cat_desc = $_POST['catdesc']; $number_articles = intval( $_POST['number_articles'] ); $parent = intval( $_POST['parent'] ); $cat_use_comments = ( isset( $_POST['cat_allow_comments'] ) ) ? intval( $_POST['cat_allow_comments'] ) : 0; $cat_internal_comments = ( isset( $_POST['internal_comments'] ) ) ? intval( $_POST['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $_POST['autogenerate_comments'] ) ) ? intval( $_POST['autogenerate_comments'] ) : 0; $comments_forum_id = intval( $_POST['comments_forum_id'] ); $cat_show_pretext = ( isset( $_POST['show_pretext'] ) ) ? intval( $_POST['show_pretext'] ) : 0; $cat_use_ratings = ( isset( $_POST['cat_allow_ratings'] ) ) ? intval( $_POST['cat_allow_ratings'] ) : 0; $cat_notify = ( isset( $_POST['notify'] ) ) ? intval( $_POST['notify'] ) : 0; $cat_notify_group = ( isset( $_POST['notify_group'] ) ) ? intval( $_POST['notify_group'] ) : 0; $view_level = intval( $_POST['auth_view'] ); $post_level = intval( $_POST['auth_post'] ); $rate_level = intval( $_POST['auth_rate'] ); $comment_level = intval( $_POST['auth_comment'] ); $edit_level = intval( $_POST['auth_edit'] ); $delete_level = intval( $_POST['auth_delete'] ); $approval_level = intval( $_POST['auth_approval'] ); $approval_edit_level = intval( $_POST['auth_approval_edit'] ); if ( !$cat_name ) { echo "Please put a category name in!"; } $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET category_name = '" . $cat_name . "', category_details = '" . $cat_desc . "', number_articles = '" . $number_articles . "', parent = '" . $parent . "', auth_view = '" . $view_level . "', auth_post = '" . $post_level . "', auth_rate = '" . $rate_level . "', auth_comment = '" . $comment_level . "', auth_edit = '" . $edit_level . "', auth_delete = '" . $delete_level . "', auth_approval = '" . $approval_level . "', auth_approval_edit = '" . $approval_edit_level . "', cat_allow_comments = '" . $cat_use_comments . "', internal_comments = '" . $cat_internal_comments . "', autogenerate_comments = '" . $cat_autogenerate_comments . "', cat_allow_ratings = '" . $cat_use_ratings . "', notify = '" . $cat_notify . "', notify_group = '" . $cat_notify_group . "', show_pretext = '" . $cat_show_pretext . "', comments_forum_id = '" . $comments_forum_id . "' WHERE category_id = " . $cat_id; if ( !( $results = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update category", '', __LINE__, __FILE__, $sql ); } $message = $lang['Cat_edited'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } break; case ( 'delete' ): if ( !$_POST['submit'] ) { $cat_id = $_GET['cat']; $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $cat_id . "'"; if ( !( $cat_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } if ( $category = $db->sql_fetchrow( $cat_result ) ) { $cat_name = $category['category_name']; } // // Generate page // $template->set_filenames( array( 'body' => 'admin/kb_cat_del_body.tpl' ) ); $template->assign_vars( array( 'L_DELETE_TITLE' => $lang['Cat_delete_title'], 'L_DELETE_DESCRIPTION' => $lang['Cat_delete_desc'], 'L_CAT_DELETE' => $lang['Cat_delete_title'], 'L_DELETE_ARTICLES' => $lang['Delete_all_articles'], 'L_CAT_NAME' => $lang['Article_category'], 'L_MOVE_CONTENTS' => $lang['Move_contents'], 'L_DELETE' => $lang['Move_and_Delete'], 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', 'S_SELECT_TO' => $this->generate_jumpbox( '', $cat_id, 0, true, true ), 'S_ACTION' => append_sid( "admin_kb.$phpEx?action=cat_manage&mode=delete" ), 'CAT_NAME' => $cat_name ) ); } else if ( $_POST['submit'] ) { $new_category = $_POST['move_id']; $old_category = $_POST['catid']; if ( $new_category != '0' ) { $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET article_category_id = '$new_category' WHERE article_category_id = '$old_category'"; if ( !( $move_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not move articles", '', __LINE__, __FILE__, $sql ); } $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '$new_category'"; if ( !( $cat_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $new_cat = $db->sql_fetchrow( $cat_result ) ) { $new_articles = $new_cat['number_articles']; } $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '$old_category'"; if ( !( $oldcat_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $old_cat = $db->sql_fetchrow( $oldcat_result ) ) { $old_articles = $old_cat['number_articles']; } $number_articles = $new_articles + $old_articles; $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET number_articles = '" . $number_articles . "' WHERE category_id = " . $new_category; if ( !( $number_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update articles number", '', __LINE__, __FILE__, $sql ); } } else { $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_category_id = " . $old_category; if ( !( $delete__articles = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not delete articles", '', __LINE__, __FILE__, $sql ); } } $sql = "DELETE FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = $old_category"; if ( !( $delete_result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not delete category", '', __LINE__, __FILE__, $sql ); } $message = $lang['Cat_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=cat_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } break; default: if ( $mode == "up" ) { $cat_id = $_GET['cat']; $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = $cat_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $category = $db->sql_fetchrow( $result ) ) { $parent = $category['parent']; $old_pos = $category['cat_order']; $new_pos = $old_pos-10; } $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET cat_order = '" . $old_pos . "' WHERE parent = " . $parent . " AND cat_order = " . $new_pos; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET cat_order = '" . $new_pos . "' WHERE category_id = " . $cat_id; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } if ( $mode == "down" ) { $cat_id = $_GET['cat']; $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = $cat_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } if ( $category = $db->sql_fetchrow( $result ) ) { $parent = $category['parent']; $old_pos = $category['cat_order']; $new_pos = $old_pos + 10; } $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET cat_order = '" . $old_pos . "' WHERE parent = " . $parent . " AND cat_order = " . $new_pos; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET cat_order = '" . $new_pos . "' WHERE category_id = " . $cat_id; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } // Generate page $template->set_filenames( array( 'body' => 'admin/kb_cat_admin_body.tpl' ) ); $template->assign_vars( array( 'L_CAT_TITLE' => $lang['Panel_cat_title'], 'L_CAT_EXPLAIN' => $lang['Panel_cat_explain'], 'L_CREATE_CAT' => $lang['Create_cat'], 'L_CREATE' => $lang['Create'], 'L_CATEGORY' => $lang['Article_category'], 'L_ACTION' => $lang['Art_action'], 'L_ARTICLES' => $lang['Articles'], 'L_ORDER' => $lang['Update_order'], 'S_ACTION' => append_sid( "admin_kb.$phpEx?action=cat_manage&mode=create" ) ) ); $this->admin_cat_main( 0 ); break; } $template->pparse( 'body' ); } } ?> --- NEW FILE: admin_settings.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: admin_settings.php,v 1.1 2006/07/08 10:21:36 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' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class mx_kb_settings extends mx_kb_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $mx_kb_functions, $mx_kb_cache, $kb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // // Pull all config data // $sql = "SELECT * FROM " . KB_CONFIG_TABLE; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( CRITICAL_ERROR, "Could not query knowledge base configuration information", "", __LINE__, __FILE__, $sql ); } else { while ( $row = $db->sql_fetchrow( $result ) ) { $config_name = $row['config_name']; $config_value = $row['config_value']; $kb_config[$config_name] = $config_value; $new[$config_name] = ( isset( $_POST[$config_name] ) ) ? $_POST[$config_name] : $kb_config[$config_name]; if ( isset( $_POST['submit'] ) ) { $mx_kb_functions->set_config( $config_name, $new[$config_name] ); } } if ( isset( $_POST['submit'] ) ) { $mx_kb_cache->unload(); $message = $lang['KB_config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_kb_config'], "<a href=\"" . append_sid( "admin_kb.$phpEx?action=settings&mode=config" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . "\">", "</a>" ); mx_message_die( GENERAL_MESSAGE, $message ); } } $template->set_filenames( array( "body" => "admin/kb_config_body.tpl" ) ); // // General Settings // $module_name = $new['module_name']; $enable_module_yes = ( $new['enable_module'] ) ? "checked=\"checked\"" : ""; $enable_module_no = ( !$new['enable_module'] ) ? "checked=\"checked\"" : ""; $wysiwyg_path = $new['wysiwyg_path']; // // Article // $allow_wysiwyg_yes = ( $new['allow_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_wysiwyg_no = ( !$new['allow_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : ""; $allow_html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : ""; $allowed_html_tags = $new['allowed_html_tags']; $allow_bbcode_yes = ( $new['allow_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_bbcode_no = ( !$new['allow_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_smilies_yes = ( $new['allow_smilies'] ) ? "checked=\"checked\"" : ""; $allow_smilies_no = ( !$new['allow_smilies'] ) ? "checked=\"checked\"" : ""; $allow_images_yes = ( $new['allow_images'] ) ? "checked=\"checked\"" : ""; $allow_images_no = ( !$new['allow_images'] ) ? "checked=\"checked\"" : ""; $allow_links_yes = ( $new['allow_links'] ) ? "checked=\"checked\"" : ""; $allow_links_no = ( !$new['allow_links'] ) ? "checked=\"checked\"" : ""; $no_image_message = $new['no_image_message']; $no_link_message = $new['no_link_message']; $max_chars = $new['max_chars']; $max_subject_chars = $new['max_subject_chars']; $max_desc_chars = $new['max_desc_chars']; $format_truncate_links_yes = ( $new['formatting_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_truncate_links_no = ( !$new['formatting_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_image_resize = $new['formatting_image_resize']; $format_wordwrap_yes = ( $new['formatting_wordwrap'] ) ? "checked=\"checked\"" : ""; $format_wordwrap_no = ( !$new['formatting_wordwrap'] ) ? "checked=\"checked\"" : ""; // // Appearance // $pagination = $new['pagination']; $sort_method_options = array(); $sort_method_options = array( "Latest", "Creation", "Id", "Userrank", "Alphabetic" ); $sort_method_list = '<select name="sort_method">'; for( $j = 0; $j < count( $sort_method_options ); $j++ ) { if ( $new['sort_method'] == $sort_method_options[$j] ) { $status = "selected"; } else { $status = ''; } $sort_method_list .= '<option value="' . $sort_method_options[$j] . '" ' . $status . '>' . $sort_method_options[$j] . '</option>'; } $sort_method_list .= '</select>'; $sort_order_options = array(); $sort_order_options = array( "DESC", "ASC" ); $sort_order_list = '<select name="sort_order">'; for( $j = 0; $j < count( $sort_order_options ); $j++ ) { if ( $new['sort_order'] == $sort_order_options[$j] ) { $status = "selected"; } else { $status = ''; } $sort_order_list .= '<option value="' . $sort_order_options[$j] . '" ' . $status . '>' . $sort_order_options[$j] . '</option>'; } $sort_order_list .= '</select>'; $header_banner_yes = ( $new['header_banner'] ) ? "checked=\"checked\"" : ""; $header_banner_no = ( !$new['header_banner'] ) ? "checked=\"checked\"" : ""; $stats_list_yes = ( $new['stats_list'] ) ? "checked=\"checked\"" : ""; $stats_list_no = ( !$new['stats_list'] ) ? "checked=\"checked\"" : ""; $settings_newdays = $new['settings_newdays']; $cat_col = $new['cat_col']; // // Instructions // $pretext_show = ( $new['show_pretext'] ) ? "checked=\"checked\"" : ""; $pretext_hide = ( !$new['show_pretext'] ) ? "checked=\"checked\"" : ""; $pt_header = $new['pt_header']; $pt_body = $new['pt_body']; // // Comments (default settings) // $use_comments_yes = ( $new['use_comments'] ) ? "checked=\"checked\"" : ""; $use_comments_no = ( !$new['use_comments'] ) ? "checked=\"checked\"" : ""; $internal_comments_internal = ( $new['internal_comments'] ) ? "checked=\"checked\"" : ""; $internal_comments_phpbb = ( !$new['internal_comments'] ) ? "checked=\"checked\"" : ""; $comments_forum_id = $new['comments_forum_id']; $del_topic_yes = ( $new['del_topic'] ) ? "checked=\"checked\"" : ""; $del_topic_no = ( !$new['del_topic'] ) ? "checked=\"checked\"" : ""; $autogenerate_comments_yes = ( $new['autogenerate_comments'] ) ? "checked=\"checked\"" : ""; $autogenerate_comments_no = ( !$new['autogenerate_comments'] ) ? "checked=\"checked\"" : ""; $allow_comment_wysiwyg_yes = ( $new['allow_comment_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_comment_wysiwyg_no = ( !$new['allow_comment_wysiwyg'] ) ? "checked=\"checked\"" : ""; $allow_comment_html_yes = ( $new['allow_comment_html'] ) ? "checked=\"checked\"" : ""; $allow_comment_html_no = ( !$new['allow_comment_html'] ) ? "checked=\"checked\"" : ""; $allowed_comment_html_tags = $new['allowed_comment_html_tags']; $allow_comment_bbcode_yes = ( $new['allow_comment_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_comment_bbcode_no = ( !$new['allow_comment_bbcode'] ) ? "checked=\"checked\"" : ""; $allow_comment_smilies_yes = ( $new['allow_comment_smilies'] ) ? "checked=\"checked\"" : ""; $allow_comment_smilies_no = ( !$new['allow_comment_smilies'] ) ? "checked=\"checked\"" : ""; $allow_comment_links_yes = ( $new['allow_comment_links'] ) ? "checked=\"checked\"" : ""; $allow_comment_links_no = ( !$new['allow_comment_links'] ) ? "checked=\"checked\"" : ""; $allow_comment_images_yes = ( $new['allow_comment_images'] ) ? "checked=\"checked\"" : ""; $allow_comment_images_no = ( !$new['allow_comment_images'] ) ? "checked=\"checked\"" : ""; $no_comment_link_message = $new['no_comment_link_message']; $no_comment_image_message = $new['no_comment_image_message']; $max_comment_chars = $new['max_comment_chars']; $max_comment_subject_chars = $new['max_comment_subject_chars']; $format_comment_truncate_links_yes = ( $new['formatting_comment_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_comment_truncate_links_no = ( !$new['formatting_comment_truncate_links'] ) ? "checked=\"checked\"" : ""; $format_comment_image_resize = $new['formatting_comment_image_resize']; $format_comment_wordwrap_yes = ( $new['formatting_comment_wordwrap'] ) ? "checked=\"checked\"" : ""; $format_comment_wordwrap_no = ( !$new['formatting_comment_wordwrap'] ) ? "checked=\"checked\"" : ""; $comments_pag = $new['comments_pagination']; // // Ratings (default settings) // $use_ratings_yes = ( $new['use_ratings'] ) ? "checked=\"checked\"" : ""; $use_ratings_no = ( !$new['use_ratings'] ) ? "checked=\"checked\"" : ""; $votes_check_ip_yes = ( $new['votes_check_ip'] ) ? "checked=\"checked\"" : ""; $votes_check_ip_no = ( !$new['votes_check_ip'] ) ? "checked=\"checked\"" : ""; $votes_check_userid_yes = ( $new['votes_check_userid'] ) ? "checked=\"checked\"" : ""; $votes_check_userid_no = ( !$new['votes_check_userid'] ) ? "checked=\"checked\"" : ""; // // Notifications // $notify_none = ( $new['notify'] == 0 ) ? "checked=\"checked\"" : ""; $notify_pm = ( $new['notify'] == 1 ) ? "checked=\"checked\"" : ""; $notify_email = ( $new['notify'] == 2 ) ? "checked=\"checked\"" : ""; $notify_group_list = mx_get_groups($new['notify_group'], 'notify_group'); $template->assign_vars( array( 'S_ACTION' => append_sid( "admin_kb.$phpEx?action=settings&mode=config" ), 'L_CONFIGURATION_TITLE' => $lang['Panel_config_title'], 'L_CONFIGURATION_EXPLAIN' => $lang['Panel_config_explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_NONE' => $lang['Acc_None'], // // General // 'L_GENERAL_TITLE' => $lang['General_title'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_NAME_EXPLAIN' => $lang['Module_name_explain'], 'MODULE_NAME' => $module_name, 'L_ENABLE_MODULE' => $lang['Enable_module'], 'L_ENABLE_MODULE_EXPLAIN' => $lang['Enable_module_explain'], 'S_ENABLE_MODULE_YES' => $enable_module_yes, 'S_ENABLE_MODULE_NO' => $enable_module_no, 'L_WYSIWYG_PATH' => $lang['Wysiwyg_path'], 'L_WYSIWYG_PATH_EXPLAIN' => $lang['Wysiwyg_path_explain'], 'WYSIWYG_PATH' => $wysiwyg_path, // // Article // 'L_ARTICLE_TITLE' => $lang['Article_title'], 'L_ALLOW_WYSIWYG' => $lang['Allow_Wysiwyg'], 'L_ALLOW_WYSIWYG_EXPLAIN' => $lang['Allow_Wysiwyg_explain'], 'S_ALLOW_WYSIWYG_YES' => $allow_wysiwyg_yes, 'S_ALLOW_WYSIWYG_NO' => $allow_wysiwyg_no, 'L_ALLOW_HTML' => $lang['Allow_HTML'], 'L_ALLOW_HTML_EXPLAIN' => $lang['Allow_html_explain'], 'S_ALLOW_HTML_YES' => $allow_html_yes, 'S_ALLOW_HTML_NO' => $allow_html_no, 'L_ALLOW_BBCODE' => $lang['Allow_BBCode'], 'L_ALLOW_BBCODE_EXPLAIN' => $lang['Allow_bbcode_explain'], 'S_ALLOW_BBCODE_YES' => $allow_bbcode_yes, 'S_ALLOW_BBCODE_NO' => $allow_bbcode_no, 'L_ALLOW_SMILIES' => $lang['Allow_smilies'], 'L_ALLOW_SMILIES_EXPLAIN' => $lang['Allow_smilies_explain'], 'S_ALLOW_SMILIES_YES' => $allow_smilies_yes, 'S_ALLOW_SMILIES_NO' => $allow_smilies_no, 'L_ALLOWED_HTML_TAGS' => $lang['Allowed_tags'], 'L_ALLOWED_HTML_TAGS_EXPLAIN' => $lang['Allowed_tags_explain'], 'ALLOWED_HTML_TAGS' => $allowed_html_tags, 'L_ALLOW_IMAGES' => $lang['Allow_images'], 'L_ALLOW_IMAGES_EXPLAIN' => $lang['Allow_images_explain'], 'S_ALLOW_IMAGES_YES' => $allow_images_yes, 'S_ALLOW_IMAGES_NO' => $allow_images_no, 'L_ALLOW_LINKS' => $lang['Allow_links'], 'L_ALLOW_LINKS_EXPLAIN' => $lang['Allow_links_explain'], 'S_ALLOW_LINKS_YES' => $allow_links_yes, 'S_ALLOW_LINKS_NO' => $allow_links_no, 'L_LINKS_MESSAGE' => $lang['Allow_links_message'], 'L_LINKS_MESSAGE_EXPLAIN' => $lang['Allow_links_message_explain'], 'MESSAGE_LINK' => $no_link_message, 'L_IMAGES_MESSAGE' => $lang['Allow_images_message'], 'L_IMAGES_MESSAGE_EXPLAIN' => $lang['Allow_images_message_explain'], 'MESSAGE_IMAGE' => $no_image_message, 'L_MAX_SUBJECT_CHAR' => $lang['Max_subject_char'], 'L_MAX_SUBJECT_CHAR_EXPLAIN' => $lang['Max_subject_char_explain'], 'MAX_SUBJECT_CHAR' => $max_subject_chars, 'L_MAX_DESC_CHAR' => $lang['Max_desc_char'], 'L_MAX_DESC_CHAR_EXPLAIN' => $lang['Max_desc_char_explain'], 'MAX_DESC_CHAR' => $max_desc_chars, 'L_MAX_CHAR' => $lang['Max_char'], 'L_MAX_CHAR_EXPLAIN' => $lang['Max_char_explain'], 'MAX_CHAR' => $max_chars, 'L_FORMAT_WORDWRAP' => $lang['Format_wordwrap'], 'L_FORMAT_WORDWRAP_EXPLAIN' => $lang['Format_wordwrap_explain'], 'S_FORMAT_WORDWRAP_YES' => $format_wordwrap_yes, 'S_FORMAT_WORDWRAP_NO' => $format_wordwrap_no, 'L_FORMAT_IMAGE_RESIZE' => $lang['Format_image_resize'], 'L_FORMAT_IMAGE_RESIZE_EXPLAIN' => $lang['Format_image_resize_explain'], 'FORMAT_IMAGE_RESIZE' => $format_image_resize, 'L_FORMAT_TRUNCATE_LINKS' => $lang['Format_truncate_links'], 'L_FORMAT_TRUNCATE_LINKS_EXPLAIN' => $lang['Format_truncate_links_explain'], 'S_FORMAT_TRUNCATE_LINKS_YES' => $format_truncate_links_yes, 'S_FORMAT_TRUNCATE_LINKS_NO' => $format_truncate_links_no, // // Appearance // 'L_APPEARANCE_TITLE' => $lang['Appearance_title'], 'L_PAGINATION' => $lang['Article_pag'], 'L_PAGINATION_EXPLAIN' => $lang['Article_pag_explain'], 'PAGINATION' => $pagination, 'L_SORT_METHOD' => $lang['Sort_method'], 'L_SORT_METHOD_EXPLAIN' => $lang['Sort_method_explain'], 'SORT_METHOD' => $sort_method_list, 'L_SORT_ORDER' => $lang['Sort_order'], 'L_SORT_ORDER_EXPLAIN' => $lang['Sort_order_explain'], 'SORT_ORDER' => $sort_order_list, 'L_STATS_LIST' => $lang['Stats_list'], 'L_STATS_LIST_EXPLAIN' => $lang['Stats_list_explain'], 'S_STATS_LIST_YES' => $stats_list_yes, 'S_STATS_LIST_NO' => $stats_list_no, 'L_HEADER_BANNER' => $lang['Header_banner'], 'L_HEADER_BANNER_EXPLAIN' => $lang['Header_banner_explain'], 'S_HEADER_BANNER_YES' => $header_banner_yes, 'S_HEADER_BANNER_NO' => $header_banner_no, 'CAT_COL' => $cat_col, 'L_CAT_COL' => $lang['cat_col'], 'L_NFDAYS' => $lang['Nfdays'], 'L_NFDAYSINFO' => $lang['Nfdaysinfo'], 'SETTINGS_NEWDAYS' => $settings_newdays, // // Comments // 'L_COMMENTS_TITLE' => $lang['Comments_title'], 'L_COMMENTS_TITLE_EXPLAIN' => $lang['Comments_title_explain'], 'L_USE_COMMENTS' => $lang['Use_comments'], 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], 'S_USE_COMMENTS_YES' => $use_comments_yes, 'S_USE_COMMENTS_NO' => $use_comments_no, 'L_INTERNAL_COMMENTS' => $lang['Internal_comments'], 'L_INTERNAL_COMMENTS_EXPLAIN' => $lang['Internal_comments_explain'], 'S_INTERNAL_COMMENTS_INTERNAL' => $internal_comments_internal, 'S_INTERNAL_COMMENTS_PHPBB' => $internal_comments_phpbb, 'L_INTERNAL_COMMENTS_INTERNAL' => $lang['Internal_comments_internal'], 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], 'FORUM_LIST' => $this->get_forums( $comments_forum_id, false, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], 'S_AUTOGENERATE_COMMENTS_YES' => $autogenerate_comments_yes, 'S_AUTOGENERATE_COMMENTS_NO' => $autogenerate_comments_no, 'L_ALLOW_COMMENT_WYSIWYG' => $lang['Allow_Wysiwyg'], 'L_ALLOW_COMMENT_WYSIWYG_EXPLAIN' => $lang['Allow_Wysiwyg_explain'], 'S_ALLOW_COMMENT_WYSIWYG_YES' => $allow_comment_wysiwyg_yes, 'S_ALLOW_COMMENT_WYSIWYG_NO' => $allow_comment_wysiwyg_no, 'L_ALLOW_COMMENT_HTML' => $lang['Allow_HTML'], 'L_ALLOW_COMMENT_HTML_EXPLAIN' => $lang['Allow_html_explain'], 'S_ALLOW_COMMENT_HTML_YES' => $allow_comment_html_yes, 'S_ALLOW_COMMENT_HTML_NO' => $allow_comment_html_no, 'L_ALLOW_COMMENT_BBCODE' => $lang['Allow_BBCode'], 'L_ALLOW_COMMENT_BBCODE_EXPLAIN' => $lang['Allow_bbcode_explain'], 'S_ALLOW_COMMENT_BBCODE_YES' => $allow_comment_bbcode_yes, 'S_ALLOW_COMMENT_BBCODE_NO' => $allow_comment_bbcode_no, 'L_ALLOW_COMMENT_SMILIES' => $lang['Allow_smilies'], 'L_ALLOW_COMMENT_SMILIES_EXPLAIN' => $lang['Allow_smilies_explain'], 'S_ALLOW_COMMENT_SMILIES_YES' => $allow_comment_smilies_yes, 'S_ALLOW_COMMENT_SMILIES_NO' => $allow_comment_smilies_no, 'L_ALLOWED_COMMENT_HTML_TAGS' => $lang['Allowed_tags'], 'L_ALLOWED_COMMENT_HTML_TAGS_EXPLAIN' => $lang['Allowed_tags_explain'], 'ALLOWED_COMMENT_HTML_TAGS' => $allowed_comment_html_tags, 'L_ALLOW_COMMENT_IMAGES' => $lang['Allow_images'], 'L_ALLOW_COMMENT_IMAGES_EXPLAIN' => $lang['Allow_images_explain'], 'S_ALLOW_COMMENT_IMAGES_YES' => $allow_comment_images_yes, 'S_ALLOW_COMMENT_IMAGES_NO' => $allow_comment_images_no, 'L_ALLOW_COMMENT_LINKS' => $lang['Allow_links'], 'L_ALLOW_COMMENT_LINKS_EXPLAIN' => $lang['Allow_links_explain'], 'S_ALLOW_COMMENT_LINKS_YES' => $allow_comment_links_yes, 'S_ALLOW_COMMENT_LINKS_NO' => $allow_comment_links_no, 'L_COMMENT_LINKS_MESSAGE' => $lang['Allow_links_message'], 'L_COMMENT_LINKS_MESSAGE_EXPLAIN' => $lang['Allow_links_message_explain'], 'COMMENT_MESSAGE_LINK' => $no_comment_link_message, 'L_COMMENT_IMAGES_MESSAGE' => $lang['Allow_images_message'], 'L_COMMENT_IMAGES_MESSAGE_EXPLAIN' => $lang['Allow_images_message_explain'], 'COMMENT_MESSAGE_IMAGE' => $no_comment_image_message, 'L_COMMENT_MAX_SUBJECT_CHAR' => $lang['Max_subject_char'], 'L_COMMENT_MAX_SUBJECT_CHAR_EXPLAIN' => $lang['Max_subject_char_explain'], 'COMMENT_MAX_SUBJECT_CHAR' => $max_comment_subject_chars, 'L_COMMENT_MAX_CHAR' => $lang['Max_char'], 'L_COMMENT_MAX_CHAR_EXPLAIN' => $lang['Max_char_explain'], 'COMMENT_MAX_CHAR' => $max_comment_chars, 'L_COMMENT_FORMAT_WORDWRAP' => $lang['Format_wordwrap'], 'L_COMMENT_FORMAT_WORDWRAP_EXPLAIN' => $lang['Format_wordwrap_explain'], 'S_COMMENT_FORMAT_WORDWRAP_YES' => $format_comment_wordwrap_yes, 'S_COMMENT_FORMAT_WORDWRAP_NO' => $format_comment_wordwrap_no, 'L_COMMENT_FORMAT_IMAGE_RESIZE' => $lang['Format_image_resize'], 'L_COMMENT_FORMAT_IMAGE_RESIZE_EXPLAIN' => $lang['Format_image_resize_explain'], 'COMMENT_FORMAT_IMAGE_RESIZE' => $format_comment_image_resize, 'L_COMMENT_FORMAT_TRUNCATE_LINKS' => $lang['Format_truncate_links'], 'L_COMMENT_FORMAT_TRUNCATE_LINKS_EXPLAIN' => $lang['Format_truncate_links_explain'], 'S_COMMENT_FORMAT_TRUNCATE_LINKS_YES' => $format_comment_truncate_links_yes, 'S_COMMENT_FORMAT_TRUNCATE_LINKS_NO' => $format_comment_truncate_links_no, 'L_COMMENTS_PAG' => $lang['Comments_pag'], 'L_COMMENTS_PAG_EXPLAIN' => $lang['Comments_pag_explain'], 'COMMENTS_PAG' => $comments_pag, 'L_DEL_TOPIC' => $lang['Del_topic'], 'L_DEL_TOPIC_EXPLAIN' => $lang['Del_topic_explain'], 'S_DEL_TOPIC_YES' => $del_topic_yes, 'S_DEL_TOPIC_NO' => $del_topic_no, // // Ratings // 'L_RATINGS_TITLE' => $lang['Ratings_title'], 'L_RATINGS_TITLE_EXPLAIN' => $lang['Ratings_title_explain'], 'L_USE_RATINGS' => $lang['Use_ratings'], 'L_USE_RATINGS_EXPLAIN' => $lang['Use_ratings_explain'], 'S_USE_RATINGS_YES' => $use_ratings_yes, 'S_USE_RATINGS_NO' => $use_ratings_no, 'L_VOTES_CHECK_IP' => $lang['Votes_check_ip'], 'L_VOTES_CHECK_IP_EXPLAIN' => $lang['Votes_check_ip_explain'], 'S_VOTES_CHECK_IP_YES' => $votes_check_ip_yes, 'S_VOTES_CHECK_IP_NO' => $votes_check_ip_no, 'L_VOTES_CHECK_USERID' => $lang['Votes_check_userid'], 'L_VOTES_CHECK_USERID_EXPLAIN' => $lang['Votes_check_userid_explain'], 'S_VOTES_CHECK_USERID_YES' => $votes_check_userid_yes, 'S_VOTES_CHECK_USERID_NO' => $votes_check_userid_no, // // Instructions // 'L_INSTRUCTIONS_TITLE' => $lang['Instructions_title'], 'L_PRE_TEXT_NAME' => $lang['Pre_text_name'], 'L_PRE_TEXT_EXPLAIN' => $lang['Pre_text_explain'], 'S_SHOW_PRETEXT' => $pretext_show, 'S_HIDE_PRETEXT' => $pretext_hide, 'S_DEFAULT_PRETEXT' => $pretext_default, 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], 'L_PRE_TEXT_HEADER' => $lang['Pre_text_header'], 'L_PT_HEADER' => $pt_header, 'L_PRE_TEXT_BODY' => $lang['Pre_text_body'], 'L_PT_BODY' => $pt_body, // // Notifications // 'L_NOTIFICATIONS_TITLE' => $lang['Notifications_title'], 'L_NOTIFY' => $lang['Notify'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['PM'], 'S_NOTIFY_NONE' => $notify_none, 'S_NOTIFY_EMAIL' => $notify_email, 'S_NOTIFY_PM' => $notify_pm, 'L_NOTIFY_GROUP' => $lang['Notify_group'], 'L_NOTIFY_GROUP_EXPLAIN' => $lang['Notify_group_explain'], 'NOTIFY_GROUP' => $notify_group_list, )); $template->pparse( 'body' ); } } ?> --- NEW FILE: admin_auth_manage.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: admin_auth_manage.php,v 1.1 2006/07/08 10:21:36 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' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class mx_kb_auth_manage extends mx_kb_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $mx_kb_functions, $mx_kb_cache, $kb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // // Start adminCP // if ( !isset( $_POST['submit'] ) ) { $s_kb_cat_list = $this->generate_jumpbox( '', 0, 0, 0, true ); $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ); $template->assign_vars( array( 'L_KB_AUTH_TITLE' => $lang['KB_Auth_Title'], 'L_KB_AUTH_EXPLAIN' => $lang['KB_Auth_Explain'], 'L_SELECT_CAT' => $lang['Select_a_Category'], 'S_KB_ACTION' => append_sid( "admin_kb.$phpEx?action=auth_manage" ), 'L_LOOK_UP_CAT' => $lang['Look_up_Category'], 'CAT_SELECT_TITLE' => $s_kb_cat_list )); $template->pparse( 'body' ); } else { if ( !isset( $_GET['cat_id'] ) ) { $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, ''); $template->set_filenames( array( 'body' => 'admin/kb_cat_auth_body.tpl' ) ); $template->assign_vars( array( 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], 'L_ALBUM_AUTH_EXPLAIN' => $lang['Album_Auth_Explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_GROUPS' => $lang['Usergroups'], 'L_VIEW' => $lang['View'], 'L_UPLOAD' => $lang['Upload'], 'L_RATE' => $lang['Rate'], 'L_COMMENT' => $lang['Comment'], 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], // 'L_APPROVAL' => $lang['Approval'], // 'L_APPROVAL_EDIT' => $lang['Approval_edit'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], 'S_ALBUM_ACTION' => append_sid( "admin_kb.$phpEx?action=auth_manage&cat_id=$cat_id" ), )); // // Get the list of phpBB usergroups // $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> " . true . " ORDER BY group_name ASC"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql ); } while ( $kb_row = $db->sql_fetchrow( $result ) ) { $groupdata[] = $kb_row; } // // Get info of this cat // $sql = "SELECT category_id, category_name, auth_view_groups, auth_post_groups, auth_rate_groups, auth_comment_groups, auth_edit_groups, auth_delete_groups, auth_approval_groups, auth_approval_edit_groups, auth_moderator_groups FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '$cat_id'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not get Category information', '', __LINE__, __FILE__, $sql ); } $thiscat = $db->sql_fetchrow( $result ); $view_groups = @explode( ',', $thiscat['auth_view_groups'] ); $post_groups = @explode( ',', $thiscat['auth_post_groups'] ); $rate_groups = @explode( ',', $thiscat['auth_rate_groups'] ); $comment_groups = @explode( ',', $thiscat['auth_comment_groups'] ); $edit_groups = @explode( ',', $thiscat['auth_edit_groups'] ); $delete_groups = @explode( ',', $thiscat['auth_delete_groups'] ); // $approval_groups = @explode( ',', $thiscat['auth_approval_groups'] ); // $approval_edit_groups = @explode( ',', $thiscat['auth_approval_edit_groups'] ); $moderator_groups = @explode( ',', $thiscat['auth_moderator_groups'] ); for ( $i = 0; $i < count( $groupdata ); $i++ ) { $template->assign_block_vars( 'grouprow', array( 'GROUP_ID' => $groupdata[$i]['group_id'], 'GROUP_NAME' => $groupdata[$i]['group_name'], 'VIEW_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $view_groups ) ) ? 'checked="checked"' : '', 'POST_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $post_groups ) ) ? 'checked="checked"' : '', 'RATE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $rate_groups ) ) ? 'checked="checked"' : '', 'COMMENT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $comment_groups ) ) ? 'checked="checked"' : '', 'EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $edit_groups ) ) ? 'checked="checked"' : '', 'DELETE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : '', // 'APPROVAL_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_groups ) ) ? 'checked="checked"' : '', // 'APPROVAL_EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_edit_groups ) ) ? 'checked="checked"' : '', 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' )); } $template->pparse( 'body' ); } else { $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, ''); $view_groups = @implode( ',', $_POST['view'] ); $post_groups = @implode( ',', $_POST['post'] ); $rate_groups = @implode( ',', $_POST['rate'] ); $comment_groups = @implode( ',', $_POST['comment'] ); $edit_groups = @implode( ',', $_POST['edit'] ); $delete_groups = @implode( ',', $_POST['delete'] ); // $approval_groups = @implode( ',', $_POST['approval'] ); // $approval_edit_groups = @implode( ',', $_POST['approval_edit'] ); $moderator_groups = @implode( ',', $_POST['moderator'] ); $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET auth_view_groups = '$view_groups', auth_post_groups = '$post_groups', auth_rate_groups = '$rate_groups', auth_comment_groups = '$comment_groups', auth_edit_groups = '$edit_groups', auth_delete_groups = '$delete_groups', auth_approval_groups = '$approval_groups', auth_approval_edit_groups = '$approval_edit_groups', auth_moderator_groups = '$moderator_groups' WHERE category_id = '$cat_id'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not update KB config table', '', __LINE__, __FILE__, $sql ); } $message = $lang['KB_Auth_successfully'] . '<br /><br />' . sprintf( $lang['Click_return_KB_auth'], '<a href="' . append_sid( "admin_kb.$phpEx?action=auth_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } } } } ?> --- NEW FILE: admin_types_manage.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: admin_types_manage.php,v 1.1 2006/07/08 10:21:36 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' ) || !defined( 'IN_ADMIN' ) ) { die( "Hacking attempt" ); } class mx_kb_types_manage extends mx_kb_admin { function main( $action ) { global $db, $images, $template, $lang, $phpEx, $mx_kb_functions, $mx_kb_cache, $kb_config, $phpbb_root_path, $module_root_path, $mx_root_path, $mx_request_vars; // // Includes // include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // // Load mode // if ( isset( $_POST['mode'] ) || isset( $_GET['mode'] ) ) { $mode = ( isset( $_POST['mode'] ) ) ? $_POST['mode'] : $_GET['mode']; } else { if ( $create ) { $mode = 'create'; } else if ( $edit ) { $mode = 'edit'; } else if ( $delete ) { $mode = 'delete'; } else { $mode = ''; } } switch ( $mode ) { case ( 'create' ): $type_name = trim( $_POST['new_type_name'] ); if ( !$type_name ) { echo "Please put a type name in!"; exit; } $sql = "INSERT INTO " . KB_TYPES_TABLE . " (type) VALUES ('$type_name')"; if ( !( $results = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not create type", '', __LINE__, __FILE__, $sql ); } $message = $lang['Type_created'] . '<br /><br />' . sprintf( $lang['Click_return_type_manager'], '<a href="' . append_sid( "admin_kb.$phpEx?action=types_manage" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); break; case ( 'edit' ): if ( !$_POST['submit'] ) { $type_id = intval( $_GET['cat'] ); $sql = "SELECT * FROM " . KB_TYPES_TABLE . " WHERE id = " . $type_id; if ( !( $results = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain type", '', __LINE__, __FILE__, $sql ); } if ( $type = $db->sql_fetchrow( $results ) ) { $type = $type['type']; } // Generate page $template->set_filenames( array( 'body' => 'admin/kb_type_edit_body.tpl' ) ); $template->assign_vars( array( 'L_EDIT_TITLE' => $lang['Edit_type'], 'L_CATEGORY' => $lang['Article_type'], 'L_CAT_SETTINGS' => $lang['Cat_settings'], 'L_CREATE' => $lang['Edit'], 'S_ACTION' => append_sid( "admin_kb.$phpEx?action=types_manage&mode=edit" ), 'CAT_NAME' => $type, 'S_HIDDEN' => '<input type="hidden" name="typeid" value="' . $type_id . '">' )); } ... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:19:46
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25417/admin Log Message: Directory /cvsroot/mxbb/mx_pafiledb/pafiledb/admin added to the repository |
|
From: Jon O. <jon...@us...> - 2006-07-08 10:16:33
|
Update of /cvsroot/mxbb/mx_kb/kb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24188/admin Log Message: Directory /cvsroot/mxbb/mx_kb/kb/admin added to the repository |
|
From: Jon O. <jon...@us...> - 2006-07-05 22:51:18
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7915/includes Modified Files: mx_functions_tools.php Log Message: related to kb/pafiledb Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_functions_tools.php 26 Jun 2006 21:32:22 -0000 1.4 --- mx_functions_tools.php 5 Jul 2006 22:51:13 -0000 1.5 *************** *** 1200,1202 **** --- 1200,2113 ---- } } + + /** + * mx_text_formatting + * + * Description + * + * @access public + * @author Jon Ohlsson + * + */ + class mx_text_formatting + { + /** + * Enter description here... + * + * @param unknown_type $mytext + * @param unknown_type $do_url + * @param unknown_type $do_images + * @param unknown_type $do_wordwrap + * @return unknown + */ + function decode( $mytext = '', $do_url = true, $do_images = '300', $do_wordwrap = true ) + { + global $board_config; + + if ( $do_url ) + { + $mytext = $this->_magic_url( $mytext ); + } + + if ( $do_images > 0 ) + { + $mytext = $this->_magic_img( $mytext, $do_images ); + } + + if ( $do_wordwrap ) + { + $mytext = $this->_word_wrap_pass( $mytext ); + } + + return $mytext; + } + + /** + * Enter description here... + * + * Replace magic urls of form http://xxx.xxx., www.xxx. and xx...@xx.... + * Cuts down displayed size of link if over 50 chars, turns absolute links + * into relative versions when the server/script path matches the link + * + * @access private + * @param unknown_type $url + * @return unknown + */ + function _magic_url( $url ) + { + global $board_config; + // $url = stripslashes($url); + if ( $url ) + { + $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; + $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim( $board_config['server_port'] ) . '/' : '/'; + + $match = array(); + $replace = array(); + // relative urls for this board + $match[] = '#(^|[\n ])' . $server_protocol . trim( $board_config['server_name'] ) . $server_port . preg_replace( '/^\/?(.*?)(\/)?$/', '$1', trim( $board_config['script_path'] ) ) . '/([^ \t\n\r <"\']+)#i'; + $replace[] = '<a href="$1" target="_blank">$1</a>'; + // matches a xxxx://aaaaa.bbb.cccc. ... + $match[] = '#(^|[\n ])([\w]+?://.*?[^ \t\n\r<"]*)#ie'; + $replace[] = "'\$1<a href=\"\$2\" target=\"_blank\">' . ((strlen('\$2') > 25) ? substr(str_replace('http://','','\$2'), 0, 17) . '...' : '\$2') . '</a>'"; + // $replace[] = "'\$1<a href=\"\$2\" target=\"_blank\">' . ((strlen('\$2') > 25) ? substr(str_replace('http://','','\$2'), 0, 12) . ' ... ' . substr('\$2', -3) : '\$2') . '</a>'"; + // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing + $match[] = '#(^|[\n ])(www\.[\w\-]+\.[\w\-.\~]+(?:/[^ \t\n\r<"]*)?)#ie'; + $replace[] = "'\$1<a href=\"http://\$2\" target=\"_blank\">' . ((strlen('\$2') > 25) ? substr(str_replace(' ', '%20', str_replace('http://','', '\$2')), 0, 17) . '...' : '\$2') . '</a>'"; + // $replace[] = "'\$1<a href=\"http://\$2\" target=\"_blank\">' . ((strlen('\$2') > 25) ? substr(str_replace(' ', '%20', str_replace('http://','', '\$2')), 0, 12) . ' ... ' . substr('\$2', -3) : '\$2') . '</a>'"; + // matches an email@domain type address at the start of a line, or after a space. + $match[] = '#(^|[\n ])([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)#ie'; + $replace[] = "'\$1<a href=\"mailto:\$2\">' . ((strlen('\$2') > 25) ? substr('\$2', 0, 15) . ' ... ' . substr('\$2', -5) : '\$2') . '</a>'"; + + $url = preg_replace( $match, $replace, $url ); + // Also fix already tagged links + $url = preg_replace( "/<a href=(.*?)>(.*?)<\/a>/ie", "(strlen(\"\\2\") > 25 && !eregi(\"<\", \"\\2\") ) ? '<a href='.stripslashes(\"\\1\").'>'.substr(str_replace(\"http://\",\"\",\"\\2\"), 0, 17) . '...</a>' : '<a href='.stripslashes(\"\\1\").'>'.\"\\2\".'</a>'", $url ); + // $url = preg_replace("/<a href=(.*?)>(.*?)<\/a>/ie", "(strlen(\"\\2\") > 25 && !eregi(\"<\", \"\\2\") ) ? '<a href='.stripslashes(\"\\1\").'>'.substr(str_replace(\"http://\",\"\",\"\\2\"), 0, 12) . ' ... ' . substr(\"\\2\", -3).'</a>' : '<a href='.stripslashes(\"\\1\").'>'.\"\\2\".'</a>'", $url); + return $url; + } + return $url; + } + + /** + * Enter description here... + * + * Validates the img for block_size and resizes when needed + * run within a div tag to ensure the table layout is not broken + * + * @access private + * @param unknown_type $img + * @param unknown_type $do_images + * @return unknown + */ + function _magic_img( $img, $do_images = '300' ) + { + global $board_config, $block_size; + // $img = stripslashes($img); + $image_size = $do_images; + if ( $img ) + { + // Also fix already tagged links + // $img = preg_replace("/<img src=(.*?)(|border(.*?)|alt(.*?))>/ie", "'<br /><br /><center><img src='.stripslashes(\"\\1\").' width=\"'.makeImgWidth(trim(stripslashes(\"\\1\"))).'\" ></center><br />'", $img); + $img = preg_replace( "/<img src=(.*?)>/ie", "(substr_count(\"\\1\", \"smiles\") > 0 ) ? '<img src='.stripslashes(\"\\1\").'>' : + + '<div style=\" overflow: hidden; margin: 0px; padding: 0px; float: left; \"> + <img class=\"noenlarge\" src='.stripslashes(\"\\1\").' border=\"0\" OnLoad=\"if(this.width > $image_size) { this.width = $image_size }\" onclick = \"full_img( this.src )\" alt=\" Click to enlarge \"> + </div>'", $img ); + return $img; + } + return $img; + } + + /** + * Enter description here... + * + * Force Word Wrapping (by TerraFrost) + * + * @access private + * @param unknown_type $message + * @return unknown + */ + function _word_wrap_pass( $message ) + { + $tempText = ""; + $finalText = ""; + $curCount = $tempCount = 0; + $longestAmp = 9; + $inTag = false; + $ampText = ""; + + for ( $num = 0;$num < strlen( $message );$num++ ) + { + $curChar = $message{$num}; + + if ( $curChar == "<" ) + { + for ( $snum = 0;$snum < strlen( $ampText );$snum++ ) + $this->_addWrap( $ampText{$snum}, $ampText{$snum+1}, $finalText, $tempText, $curCount, $tempCount ); + $ampText = ""; + $tempText .= "<"; + $inTag = true; + } + elseif ( $inTag && $curChar == ">" ) + { + $tempText .= ">"; + $inTag = false; + } + elseif ( $inTag ) + { + $tempText .= $curChar; + } + elseif ( $curChar == "&" ) + { + for ( $snum = 0;$snum < strlen( $ampText );$snum++ ) + $this->_addWrap( $ampText{$snum}, $ampText{$snum+1}, $finalText, $tempText, $curCount, $tempCount ); + $ampText = "&"; + } + elseif ( strlen( $ampText ) < $longestAmp && $curChar == ";" && + ( strlen( html_entity_decode( "$ampText;" ) ) == 1 || preg_match( '/^&#[0-9][0-9]*$/', $ampText ) ) ) + { + $this->_addWrap( "$ampText;", $message{$num+1}, $finalText, $tempText, $curCount, $tempCount ); + $ampText = ""; + } + elseif ( strlen( $ampText ) >= $longestAmp || $curChar == ";" ) + { + for ( $snum = 0;$snum < strlen( $ampText );$snum++ ) + $this->_addWrap( $ampText{$snum}, $ampText{$snum+1}, $finalText, $tempText, $curCount, $tempCount ); + $this->_addWrap( $curChar, $message{$num+1}, $finalText, $tempText, $curCount, $tempCount ); + $ampText = ""; + } + elseif ( strlen( $ampText ) != 0 && strlen( $ampText ) < $longestAmp ) + { + $ampText .= $curChar; + } + else + { + $this->_addWrap( $curChar, $message{$num+1}, $finalText, $tempText, $curCount, $tempCount ); + } + } + + return $finalText . $tempText; + } + + /** + * Enter description here... + * + * @param unknown_type $curChar + * @param unknown_type $nextChar + * @param unknown_type $finalText + * @param unknown_type $tempText + * @param unknown_type $curCount + * @param unknown_type $tempCount + */ + function _addWrap( $curChar, $nextChar, &$finalText, &$tempText, &$curCount, &$tempCount ) + { + $softHyph = "­"; + // $softHyph = " "; + $maxChars = 10; + $wrapProhibitedChars = "([{!;,:?}])"; + + if ( $curChar == " " || $curChar == "\n" ) + { + $finalText .= $tempText . $curChar; + $tempText = ""; + $curCount = 0; + $curChar = ""; + }elseif ( $curCount >= $maxChars ) + { + $finalText .= $tempText . $softHyph; + $tempText = ""; + $curCount = 1; + } + else + { + $tempText .= $curChar; + $curCount++; + } + // the following code takes care of (unicode) characters prohibiting non-mandatory breaks directly before them. + // $curChar isn't a " " or "\n" + if ( $tempText != "" && $curChar != "" ) + $tempCount++; + // $curChar is " " or "\n", but $nextChar prohibits wrapping. + elseif ( ( $curCount == 1 && strstr( $wrapProhibitedChars, $curChar ) !== false ) || + ( $curCount == 0 && $nextChar != "" && $nextChar != " " && $nextChar != "\n" && strstr( $wrapProhibitedChars, $nextChar ) !== false ) ) + $tempCount++; + // $curChar and $nextChar aren't both either " " or "\n" + elseif ( !( $curCount == 0 && ( $nextChar == " " || $nextChar == "\n" ) ) ) + $tempCount = 0; + + if ( $tempCount >= $maxChars && $tempText == "" ) + { + $finalText .= " "; + $tempCount = 1; + $curCount = 2; + } + + if ( $tempText == "" && $curCount > 0 ) + $finalText .= $curChar; + } + + /** + * Enter description here... + * + * @param unknown_type $comments_text + * @param unknown_type $allow_images + * @param unknown_type $no_image_message + * @param unknown_type $allow_links + * @param unknown_type $no_link_message + * @return unknown + */ + function remove_images_links( $comments_text, $allow_images = false, $no_image_message = '[No image please]', $allow_links = false, $no_link_message = '[No links please]') + { + if ( $comments_text != '' ) + { + if ( !$allow_images ) + { + if ( preg_match( '/(<img src=)(.+?)(\>)/i', $comments_text ) ) + { + $comments_text = preg_replace( '/(<img src=)(.+?)(\>)/i', $no_image_message, $comments_text ); + } + + if ( preg_match( '/(\[img\])([^\[]*)(\[\/img\])/i', $comments_text ) ) + { + $comments_text = preg_replace( '/(\[img\])([^\[]*)(\[\/img\])/i', $no_image_message, $comments_text ); + } + } + + if ( !$allow_links ) + { + if ( preg_match( '/(\[url=(.*?)\])([^\[]*)(\[\/url\])/i', $comments_text ) ) + { + $comments_text = preg_replace( '/(\[url=(.*?)\])([^\[]*)(\[\/url\])/i', $no_link_message, $comments_text ); + } + + if ( preg_match( '/(\[url\])([^\[]*)(\[\/url\])/i', $comments_text ) ) + { + $comments_text = preg_replace( '/(\[url\])([^\[]*)(\[\/url\])/i', $no_link_message, $comments_text ); + } + + if ( preg_match( "#([\n ])http://www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,\t \n\r]*)?)#i", $comments_text ) ) + { + $comments_text = preg_replace( "#([\n ])http://www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,\t \n\r]*)?)#i", $no_link_message, $comments_text ); + } + + if ( preg_match( "#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,\t \n\r]*)?)#i", $comments_text ) ) + { + $comments_text = preg_replace( "#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,\t \n\r]*)?)#i", $no_link_message, $comments_text ); + } + } + } + return $comments_text; + } + + /** + * Enter description here... + * + * @param unknown_type $mytext + * @param unknown_type $length + * @param unknown_type $add_dots + * @return unknown + */ + function truncate_text( $mytext, $length = 200, $add_dots = true ) + { + $do_trunc = false; + if ( strlen( $mytext ) > $length ) + { + $do_trunc = true; + $mytext = substr( $mytext, 0, $length ); + $mytext = str_replace('<br />', '<br/>', $mytext); + $mytext = substr( $mytext, 0, strrpos( $mytext, ' ' ) ); + $mytext = str_replace('<br/>', '<br />', $mytext); + + if ( $add_dots ) + { + $mytext .= '...'; + } + } + //$return_data = array($mytext, $do_trunc); + return $mytext; + } + } + + define('MX_MAIL_MODE' , 1); + define('MX_PM_MODE' , 2); + define('MX_POST_MODE' , 2); + + define('MX_NEW_NOTIFICATION' , 10); + define('MX_EDITED_NOTIFICATION' , 11); + define('MX_APPROVED_NOTIFICATION' , 12); + define('MX_UNAPPROVED_NOTIFICATION' , 13); + define('MX_DELETED_NOTIFICATION' , 14); + + // + // Includes + // + include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); + + /** + * mx_notification. + * + * This class will handle most PM/MAIL tasks. + * + * // MODE: MX_PM_MODE/MX_MAIL_MODE, $id: get all file/article data for this id + * $mx_notification->init($mode, $id); // MODE: MX_PM_MODE/MX_MAIL_MODE + * + * // MODE: MX_PM_MODE/MX_MAIL_MODE, ACTION: MX_NEW_NOTIFICATION/MX_EDITED_NOTIFICATION/MX_APPROVED_NOTIFICATION/MX_UNAPPROVED_NOTIFICATION + * $mx_notification->notify( $mode = MX_PM_MODE, $action = MX_NEW_NOTIFICATION, $to_id, $from_id, $subject, $message, $html_on, $bbcode_on, $smilies_on ) + * + * @access public + * @author Jon Ohlsson + */ + class mx_notification + { + // + // PM/EMAIL Notification + // + var $subject = ''; + var $message = ''; + + var $to_id = ''; // to one user + var $to_ids = ''; // to many users + var $from_id = ''; + var $html_on = 0; + var $bbcode_on = 1; + var $smilies_on = 1; + + var $first_commnent = ''; // only used for phpBB comments + var $next_commnent = ''; + + // + // Autogenerated comments [Optional] + // + var $data = array(); // all item data in one array (only needed when using automessages) [Optional] + var $langs = array(); // generic lang keys (only needed when using automessages) [Optional] + var $temp_url = ''; // (only needed when using automessages) [Optional] + + var $auto_message = ''; // for auto generated messages + var $auto_message_update = ''; // for auto generated messages + + + + /** + * this will be replaced by the loaded module. + * + * If you are using automessages, this init must populate $lang, $data and $url_rewrite. + * If not, you need no init and may use the notify method as is. + * + * @param unknown_type $module_id + * @return unknown + */ + function init( $item_id = false ) + { + return false; + } + + /** + * Notification - email/PM. + * + * Note: This method may be used by itself (if subject and message is passed) + * to_id: to single user ($to_id > 0), to ALL admins ($to_id == 0) or to all members in group with group_id = -$to_id ($to_id < 0) + * + * @param unknown_type $mode + * @param unknown_type $action + * @param unknown_type $to_id + * @param unknown_type $from_id + * @param unknown_type $subject + * @param unknown_type $message + * @param unknown_type $html_on + * @param unknown_type $bbcode_on + * @param unknown_type $smilies_on + */ + function notify( $mode = MX_PM_MODE, $action = MX_NEW_NOTIFICATION, $to_id = 0, $from_id = '', $subject = '', $message = '', $html_on = '', $bbcode_on = '', $smilies_on = '' ) + { + global $lang, $board_config, $db, $phpbb_root_path, $mx_root_path, $phpEx, $userdata; + + // + // Precheck + // + if (intval($to_id) > 0) + { + $this->to_ids = array('single' => intval($to_id)); // Notify specific user + } + else if(intval($to_id) == 0) + { + $this->to_ids = $this->_get_admins(); // Notify all admins (DEFAULT) + } + else if(intval($to_id) < 0) + { + $group_id = intval( -$to_id); + $this->to_ids = $this->_get_users_in_group( $group_id ); // Notify all in group + } + else + { + mx_message_die(GENERAL_ERROR, 'Bad notify pars - no to_id'); + } + + $this->from_id = empty( $from_id ) ? $userdata['user_id'] : $from_id; + + // + // Toggles + // + $this->html_on = !empty($html_on) ? $html_on : $this->html_on; + $this->bbcode_on = !empty($bbcode_on) ? $bbcode_on : $this->bbcode_on; + $this->smilies_on = !empty($smilies_on) ? $smilies_on : $this->smilies_on; + + $this->subject = $subject; + $this->message = $message; + + // + // Compose Subject + // + if (empty($this->subject) || empty($this->message)) + { + if ( count($this->data) > 0 && count($this->langs) > 0 ) + { + $this->_compose_auto_note($action); + } + else + { + mx_message_die(GENERAL_ERROR, 'Error: no subject or no message'); + } + } + + // + // Now send PM/MAIL + // + foreach ( $this->to_ids as $key => $id ) + { + $this->to_id = $id; + + // + // Why send PM/MAIL to yourself??? + // + if ( $this->to_id == $this->from_id ) + { + //continue; + } + + switch ( $mode ) + { + case MX_MAIL_MODE: + $this->_mailer(); + break; + + case MX_PM_MODE: + $this->_insert_pm(); + break; + + default: + mx_message_die(GENERAL_ERROR, 'Bad notify type'); + } + } + } + + /** + * Notification - PM + * + * based on wgErics good old insert_pm function + * + */ + function _insert_pm() + { + global $db, $lang, $user_ip, $board_config, $userdata, $phpbb_root_path, $phpEx; + + // + // get varibles ready + // + $msg_time = time(); + $attach_sig = $userdata['user_attachsig']; + + // + //get 'to user's info + // + $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active + FROM " . USERS_TABLE . " + WHERE user_id = '" . $this->to_id . "' + AND user_id <> " . ANONYMOUS; + + if ( !($result = $db->sql_query($sql)) ) + { + $error = TRUE; + $error_msg = $lang['No_such_user']; + } + + $to_userdata = $db->sql_fetchrow($result); + $privmsg_subject = trim(strip_tags($this->subject)); + + if ( empty($privmsg_subject) ) + { + $error = TRUE; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_subject']; + } + + if ( !empty($this->message) ) + { + if ( !$error ) + { + if ( $this->bbcode_on ) + { + $bbcode_uid = make_bbcode_uid(); + } + + $privmsg_message = prepare_message(addslashes($this->message), $this->html_on, $this->bbcode_on, $this->smilies_on, $bbcode_uid); + $privmsg_message = str_replace('\\\n', '\n', $privmsg_message); + } + } + else + { + $error = TRUE; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_message']; + } + + // + // See if recipient is at their inbox limit + // + $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time + FROM " . PRIVMSGS_TABLE . " + WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " + OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " + OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) + AND privmsgs_to_userid = " . $to_userdata['user_id']; + + if ( !($result = $db->sql_query($sql)) ) + { + mx_message_die(GENERAL_MESSAGE, $lang['No_such_user']); + } + + $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : ''; + + if ( $inbox_info = $db->sql_fetchrow($result) ) + { + if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] ) + { + $sql = "SELECT privmsgs_id FROM " . PRIVMSGS_TABLE . " + WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " + OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " + OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) + AND privmsgs_date = " . $inbox_info['oldest_post_time'] . " + AND privmsgs_to_userid = " . $to_userdata['user_id']; + + if ( !$result = $db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, 'Could not find oldest privmsgs (inbox)', '', __LINE__, __FILE__, $sql); + } + + $old_privmsgs_id = $db->sql_fetchrow($result); + $old_privmsgs_id = $old_privmsgs_id['privmsgs_id']; + + $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " + WHERE privmsgs_id = $old_privmsgs_id"; + + if ( !$db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (inbox)'.$sql, '', __LINE__, __FILE__, $sql); + } + + $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TEXT_TABLE . " + WHERE privmsgs_text_id = $old_privmsgs_id"; + + if ( !$db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql); + } + } + } + + $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) + VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', " . $this->from_id . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', $this->html_on, $this->bbcode_on, $this->smilies_on, $attach_sig)"; + + if ( !($result = $db->sql_query($sql_info)) ) + { + mx_message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info); + } + + $privmsg_sent_id = $db->sql_nextid(); + + $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) + VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')"; + + if ( !$db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql); + } + + // + // Add to the users new pm counter + // + $sql = "UPDATE " . USERS_TABLE . " + SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " + WHERE user_id = " . $to_userdata['user_id']; + + if ( !$status = $db->sql_query($sql) ) + { + mx_message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql); + } + + /* + if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] ) + { + $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])); + $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx; + $server_name = trim($board_config['server_name']); + $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; + $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; + + // + // Include and initiate emailer + // + include($phpbb_root_path . 'includes/emailer.'.$phpEx); + $emailer = new emailer($board_config['smtp_delivery']); + + $emailer->from($board_config['board_email']); + $emailer->replyto($board_config['board_email']); + + $emailer->use_template('privmsg_notify', $to_userdata['user_lang']); + $emailer->email_address($to_userdata['user_email']); + $emailer->set_subject($lang['Notification_subject']); + + $emailer->assign_vars(array( + 'USERNAME' => $to_username, + 'SITENAME' => $board_config['sitename'], + 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', + + 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox') + ); + + $emailer->send(); + $emailer->reset(); + } + */ + return; + + $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); + + mx_message_die(GENERAL_MESSAGE, $msg); + + } + + /** + * Notification - email + * + */ + function _mailer() + { + global $db, $lang, $user_ip, $board_config, $userdata, $phpbb_root_path, $phpEx; + + // + //get varibles ready + // + $msg_time = time(); + $attach_sig = $userdata['user_attachsig']; + + // + //get to users info + // + $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active + FROM " . USERS_TABLE . " + WHERE user_id = '".$this->to_id."' + AND user_id <> " . ANONYMOUS; + + if ( !($result = $db->sql_query($sql)) ) + { + $error = TRUE; + $error_msg = $lang['No_such_user']; + } + + $to_userdata = $db->sql_fetchrow($result); + + $mail_subject = trim(strip_tags($this->subject)); + + if ( empty($mail_subject) ) + { + $error = TRUE; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_subject']; + } + + if ( !empty($this->message) ) + { + if ( !$error ) + { + if ( $this->bbcode_on ) + { + $bbcode_uid = make_bbcode_uid(); + } + + $mail_message = prepare_message($this->message, $this->html_on, $this->bbcode_on, $this->smilies_on, $bbcode_uid); + $mail_message = str_replace('\\\n', '\n', $mail_message); + + } + } + else + { + $error = TRUE; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_message']; + } + + $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])); + $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx; + $server_name = trim($board_config['server_name']); + $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; + $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; + + // + // Include and initiate mailer + // + include($phpbb_root_path . 'includes/emailer.'.$phpEx); + $emailer = new emailer($board_config['smtp_delivery']); + + // + // Mail + // + $emailer->from( $board_config['board_email'] ); + $emailer->replyto( $board_config['board_email'] ); + + $emailer->email_address($to_userdata['user_email'] ); + $emailer->set_subject( $mail_subject ); + $emailer->msg = $mail_message; + + $emailer->send(); + $emailer->reset(); + } + + /** + * Compose auto note + * + * @access private + * @param unknown_type $action + */ + function _compose_auto_note($action = '') + { + global $lang, $phpEx; + + // + // Compose phpBB post header + // + $this->temp_url = PORTAL_URL . this_kb_mxurl("mode=" . "article&k=" . $this->data['item_id'], false, true); + + $this->auto_message = "[b]" . $this->langs['item_title'] . ":[/b] " . $this->data['item_title'] . "\n"; + $this->auto_message .= "[b]" . $this->langs['author'] . ":[/b] " . $this->data['item_author'] . "\n"; + $this->auto_message .= "[b]" . $this->langs['item_description'] . ":[/b] [i]" . $this->data['item_desc'] . "[/i]\n\n"; + + if ($action != MX_DELETED_NOTIFICATION) + { + $this->auto_message .= "\n\n[b][url=" . $this->temp_url . "]" . $this->langs['read_full_item'] . "[/url][/b]"; + } + + // + // Update message + // + $this->auto_message_update = "[i]" . $this->langs['edited_item_info'] . $this->data['item_editor'] . "[/i]" . "\n\n"; + + // + // Auto generated subject and message + // + switch ( $action ) + { + case MX_NEW_NOTIFICATION: + $this->subject = $this->langs['module_title'] . ' - ' . $this->langs['notify_subject_new']; + $this->message = $this->langs['notify_new_body'] . "\n\n" . $this->auto_message; + break; + + case MX_EDITED_NOTIFICATION: + $this->subject = $this->langs['module_title'] . ' - ' . $this->langs['notify_subject_edited']; + $this->message = $this->langs['notify_edited_body'] . "\n\n" . $this->auto_message_update . $this->auto_message; + break; + + case MX_APPROVED_NOTIFICATION: + $this->subject = $this->langs['module_title'] . ' - ' . $this->langs['notify_subject_approved']; + $this->message = $this->langs['notify_approved_body'] . "\n\n". $this->auto_message; + break; + + case MX_UNAPPROVED_NOTIFICATION: + $this->subject = $this->langs['module_title'] . ' - ' . $this->langs['notify_subject_unapproved']; + $this->message = $this->langs['notify_unapproved_body'] . "\n\n" . $this->auto_message; + break; + + case MX_DELETED_NOTIFICATION: + $this->subject = $this->langs['module_title'] . ' - ' . $this->langs['notify_subject_deleted']; + $this->message = $this->langs['notify_deleted_body'] . "\n\n" . $this->auto_message; + break; + + default: + mx_message_die(GENERAL_ERROR, 'Bad notify action'); + } + } + + /** + * Enter description here... + * + * @param unknown_type $get_all_userdata + * @return unknown + */ + function _get_admins( $get_all_userdata = false ) + { + global $db; + + $admin_type = ADMIN; + + $sql = "SELECT * + FROM " . USERS_TABLE . " + WHERE user_level = '$admin_type'"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not obtain author data", '', __LINE__, __FILE__, $sql ); + } + + $user_ids_array = array(); + while( $row = $db->sql_fetchrow( $result ) ) + { + if ( $get_all_userdata ) + { + $user_ids_array[] = $row; + } + else + { + $user_ids_array[] = $row['user_id']; + } + } + + return $user_ids_array; + } + + /** + * Enter description here... + * + * @param unknown_type $group_id + * @param unknown_type $get_all_userdata + * @return unknown + */ + function _get_users_in_group( $group_id, $get_all_userdata = false ) + { + global $db; + + // + // Get user information for this group + // + $sql = "SELECT u.username, u.user_id, ug.group_id + FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug + WHERE ug.group_id = $group_id + AND u.user_id = ug.user_id + AND ug.user_pending = 0 + ORDER BY u.user_id"; + + if ( !($result = $db->sql_query($sql)) ) + { + mx_message_die(GENERAL_ERROR, 'Error getting user list for group', '', __LINE__, __FILE__, $sql); + } + + $user_ids_array = array(); + while( $row = $db->sql_fetchrow( $result ) ) + { + if ( $get_all_userdata ) + { + $user_ids_array[] = $row; + } + else + { + $user_ids_array[] = $row['user_id']; + } + } + return $user_ids_array; + } + } ?> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2006-07-05 22:50:27
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/modules In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7415/modules/mx_pafiledb/pafiledb/modules Modified Files: pa_category.php pa_download.php pa_email.php pa_file.php pa_license.php pa_main.php pa_mcp.php pa_post_comment.php pa_quickdl.php pa_rate.php pa_search.php pa_stats.php pa_toplist.php pa_user_upload.php pa_viewall.php Log Message: massive update Index: pa_viewall.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_viewall.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pa_viewall.php 17 Jun 2006 20:13:22 -0000 1.15 --- pa_viewall.php 5 Jul 2006 22:50:22 -0000 1.16 *************** *** 98,102 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'] --- 98,102 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'] Index: pa_download.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_download.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pa_download.php 17 Jun 2006 20:13:22 -0000 1.16 --- pa_download.php 5 Jul 2006 22:50:22 -0000 1.17 *************** *** 66,70 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=download&file_id=" . $file_id), true)); } --- 66,70 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=download&file_id=" . $file_id), true)); } *************** *** 143,147 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( pa_this_mxurl() ), 'FILE_NAME' => $file_data['file_name'], --- 143,147 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), 'FILE_NAME' => $file_data['file_name'], *************** *** 150,154 **** $pafiledb_template->assign_block_vars( 'mirror_row', array( ! 'U_DOWNLOAD' => append_sid( $pa_this_mxurl( 'action=download&file_id=' . $file_id . '&mirror_id=-1' ) ), 'MIRROR_LOCATION' => $board_config['sitename'] )); --- 150,154 ---- $pafiledb_template->assign_block_vars( 'mirror_row', array( ! 'U_DOWNLOAD' => append_sid( $$this->this_mxurl( 'action=download&file_id=' . $file_id . '&mirror_id=-1' ) ), 'MIRROR_LOCATION' => $board_config['sitename'] )); *************** *** 157,161 **** { $pafiledb_template->assign_block_vars( 'mirror_row', array( ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl( 'action=download&file_id=' . $file_id . '&mirror_id=' . $mir_id ) ), 'MIRROR_LOCATION' => $mirror_data['mirror_location'] )); --- 157,161 ---- { $pafiledb_template->assign_block_vars( 'mirror_row', array( ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_id . '&mirror_id=' . $mir_id ) ), 'MIRROR_LOCATION' => $mirror_data['mirror_location'] )); *************** *** 205,209 **** // Update downloader Info for the given file // ========================================================================= ! $pafiledb_user->update_downloader_info( $file_id ); if ( !empty( $file_url ) ) --- 205,209 ---- // Update downloader Info for the given file // ========================================================================= ! $pafiledb_user->update_info( $file_id ); if ( !empty( $file_url ) ) Index: pa_post_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_post_comment.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pa_post_comment.php 29 Jun 2006 13:14:48 -0000 1.18 --- pa_post_comment.php 5 Jul 2006 22:50:22 -0000 1.19 *************** *** 70,74 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=post_comment&item_id=" . $item_id), true)); } --- 70,74 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=post_comment&item_id=" . $item_id), true)); } *************** *** 133,137 **** // ! // Instantiate the mx_text class // include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); --- 133,137 ---- // ! // Instantiate the mx_text and mx_text_formatting classes // include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); *************** *** 139,142 **** --- 139,144 ---- $mx_text->init($html_on, $bbcode_on, $smilies_on); + $mx_text_formatting = new mx_text_formatting(); + // // Allow all html tags *************** *** 182,186 **** $this->_pafiledb(); ! $message = $lang['Comment_deleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( "action=file&file_id=$item_id" ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 184,188 ---- $this->_pafiledb(); ! $message = $lang['Comment_deleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=file&file_id=$item_id" ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 199,214 **** $this->update_add_comment($file_data, $item_id, $cid, '', '', $html_on, $bbcode_on, $smilies_on); ! $message = $lang['Comment_posted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( 'action=file&file_id=' . $item_id ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } - // ======================================================= - // Main - // ======================================================= - // - // Instatiate text tools - // - $mx_pa_text_tools = new mx_pa_text_tools(); - // // Generate smilies listing for page output --- 201,208 ---- $this->update_add_comment($file_data, $item_id, $cid, '', '', $html_on, $bbcode_on, $smilies_on); ! $message = $lang['Comment_posted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $item_id ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } // // Generate smilies listing for page output *************** *** 232,236 **** if (!$pa_config['allow_images'] || !$pa_config['allow_links']) { ! $preview_text = $mx_pa_text_tools->remove_images_links( $preview_text, $pa_config['allow_images'], $pa_config['no_image_message'], $pa_config['allow_links'], $pa_config['no_link_message'] ); } --- 226,230 ---- if (!$pa_config['allow_images'] || !$pa_config['allow_links']) { ! $preview_text = $mx_text_formatting->remove_images_links( $preview_text, $pa_config['allow_images'], $pa_config['no_image_message'], $pa_config['allow_links'], $pa_config['no_link_message'] ); } *************** *** 355,362 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( pa_this_mxurl() ), ! 'U_FILE_NAME' => append_sid( pa_this_mxurl( 'action=file&item_id=' . $item_id ) ), ! 'S_POST_ACTION' => append_sid( pa_this_mxurl() ), 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields ) ); --- 349,356 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), ! 'U_FILE_NAME' => append_sid( $this->this_mxurl( 'action=file&item_id=' . $item_id ) ), ! 'S_POST_ACTION' => append_sid( $this->this_mxurl() ), 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields ) ); Index: pa_user_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_user_upload.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pa_user_upload.php 17 Jun 2006 20:13:22 -0000 1.19 --- pa_user_upload.php 5 Jul 2006 22:50:22 -0000 1.20 *************** *** 64,68 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=user_upload&cat_id=" . $cat_id), true)); } --- 64,68 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=user_upload&cat_id=" . $cat_id), true)); } *************** *** 77,81 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=user_upload"), true)); } --- 77,81 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=user_upload"), true)); } *************** *** 134,138 **** $this->delete_files( $file_id ); $this->_pafiledb(); ! $message = $lang['Filedeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( "" ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 134,138 ---- $this->delete_files( $file_id ); $this->_pafiledb(); ! $message = $lang['Filedeleted'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "" ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 156,164 **** if ( $this->auth[$cat_id]['auth_approval'] || ( $this->auth[$cat_id]['auth_mod'] && $userdata['session_logged_in'] )) { ! $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); } else { ! $message = $lang['Fileadded_not_validated'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( "action=category&cat_id=" . $cat_id ) ) . '">', '</a>' ); } --- 156,164 ---- if ( $this->auth[$cat_id]['auth_approval'] || ( $this->auth[$cat_id]['auth_mod'] && $userdata['session_logged_in'] )) { ! $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); } else { ! $message = $lang['Fileadded_not_validated'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=category&cat_id=" . $cat_id ) ) . '">', '</a>' ); } *************** *** 171,175 **** $custom_field->file_update_data( $file_id ); ! $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); $this->_pafiledb(); --- 171,175 ---- $custom_field->file_update_data( $file_id ); ! $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( "action=file&file_id=" . $file_id ) ) . '">', '</a>' ); $this->_pafiledb(); *************** *** 278,282 **** $pafiledb_template->assign_vars( array( ! 'S_ADD_FILE_ACTION' => append_sid( pa_this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'], --- 278,282 ---- $pafiledb_template->assign_vars( array( ! 'S_ADD_FILE_ACTION' => append_sid( $this->this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'], *************** *** 350,354 **** 'MODE' => $mode, 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ) )); --- 350,354 ---- 'MODE' => $mode, 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ) )); Index: pa_file.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_file.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pa_file.php 17 Jun 2006 20:13:22 -0000 1.19 --- pa_file.php 5 Jul 2006 22:50:22 -0000 1.20 *************** *** 95,99 **** if ( !$userdata['session_logged_in'] ) { ! mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=file&file_id=" . $file_id), true)); } */ --- 95,99 ---- if ( !$userdata['session_logged_in'] ) { ! mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=file&file_id=" . $file_id), true)); } */ *************** *** 106,110 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( pa_this_mxurl() ), 'FILE_NAME' => $file_data['file_name'], --- 106,110 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), 'FILE_NAME' => $file_data['file_name'], *************** *** 122,126 **** $file_screenshot_url = trim( $file_data['file_ssurl'] ); $file_website_url = trim( $file_data['file_docsurl'] ); ! $file_download_link = ( $file_data['file_license'] > 0 ) ? append_sid( pa_this_mxurl( 'action=license&license_id=' . $file_data['file_license'] . '&file_id=' . $file_id ) ) : append_sid( pa_this_mxurl( 'action=download&file_id=' . $file_id, 1 ) ); $file_size = $pafiledb_functions->get_file_size( $file_id, $file_data ); --- 122,126 ---- $file_screenshot_url = trim( $file_data['file_ssurl'] ); $file_website_url = trim( $file_data['file_docsurl'] ); ! $file_download_link = ( $file_data['file_license'] > 0 ) ? append_sid( $this->this_mxurl( 'action=license&license_id=' . $file_data['file_license'] . '&file_id=' . $file_id ) ) : append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_id, 1 ) ); $file_size = $pafiledb_functions->get_file_size( $file_id, $file_data ); *************** *** 177,184 **** 'U_DOWNLOAD' => $file_download_link, ! 'U_DELETE' => append_sid( pa_this_mxurl( 'action=user_upload&do=delete&file_id=' . $file_id ) ), ! 'U_EDIT' => append_sid( pa_this_mxurl( 'action=user_upload&file_id=' . $file_id ) ), ! 'U_EMAIL' => append_sid( pa_this_mxurl( 'action=email&file_id=' . $file_id ) ) )); --- 177,184 ---- 'U_DOWNLOAD' => $file_download_link, ! 'U_DELETE' => append_sid( $this->this_mxurl( 'action=user_upload&do=delete&file_id=' . $file_id ) ), ! 'U_EDIT' => append_sid( $this->this_mxurl( 'action=user_upload&file_id=' . $file_id ) ), ! 'U_EMAIL' => append_sid( $this->this_mxurl( 'action=email&file_id=' . $file_id ) ) )); *************** *** 211,215 **** // 'RATE_IMG' => $rate_img, ! 'U_RATE' => append_sid( pa_this_mxurl( 'action=rate&file_id=' . $file_id ) ), )); } --- 211,215 ---- // 'RATE_IMG' => $rate_img, ! 'U_RATE' => append_sid( $this->this_mxurl( 'action=rate&file_id=' . $file_id ) ), )); } Index: pa_license.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_license.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pa_license.php 17 Jun 2006 20:13:22 -0000 1.16 --- pa_license.php 5 Jul 2006 22:50:22 -0000 1.17 *************** *** 69,73 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . 'login.'.$phpEx.'?redirect='.pa_this_mxurl('action=license&license_id=' . $license_id . '&file_id=' . $file_id), true)); } --- 69,73 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . 'login.'.$phpEx.'?redirect='.$this->this_mxurl('action=license&license_id=' . $license_id . '&file_id=' . $file_id), true)); } *************** *** 100,106 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( pa_this_mxurl() ), ! 'U_FILE_NAME' => append_sid( pa_this_mxurl( 'action=file&file_id=' . $file_id ) ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl( 'action=download&file_id=' . $file_id, 1 ) ), 'LE_NAME' => $license['license_name'], --- 100,106 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), ! 'U_FILE_NAME' => append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_id ) ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_id, 1 ) ), 'LE_NAME' => $license['license_name'], Index: pa_mcp.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_mcp.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pa_mcp.php 17 Jun 2006 20:13:22 -0000 1.13 --- pa_mcp.php 5 Jul 2006 22:50:22 -0000 1.14 *************** *** 180,185 **** 'L_INDEX' => "<<", 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( pa_this_mxurl() ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'], 'L_MCP_TITLE' => $l_title, --- 180,185 ---- 'L_INDEX' => "<<", 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'], 'L_MCP_TITLE' => $l_title, *************** *** 188,192 **** 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FILE_ACTION' => append_sid( pa_this_mxurl( "action=mcp" ) ) )); --- 188,192 ---- 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FILE_ACTION' => append_sid( $this->this_mxurl( "action=mcp" ) ) )); *************** *** 378,382 **** 'L_NO_FILES' => $lang['No_file'], ! 'PAGINATION' => generate_pagination( append_sid( pa_this_mxurl( "action=mcp&mode=$mode&sort_method=$sort_method&sort_order=$sort_order&cat_id=$cat_id" ) ), $total_files, $pafiledb_config['pagination'], $start ), 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $pafiledb_config['pagination'] ) + 1 ), ceil( $total_files / $pafiledb_config['pagination'] ) ), --- 378,382 ---- 'L_NO_FILES' => $lang['No_file'], ! 'PAGINATION' => generate_pagination( append_sid( $this->this_mxurl( "action=mcp&mode=$mode&sort_method=$sort_method&sort_order=$sort_order&cat_id=$cat_id" ) ), $total_files, $pafiledb_config['pagination'], $start ), 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $pafiledb_config['pagination'] ) + 1 ), ceil( $total_files / $pafiledb_config['pagination'] ) ), *************** *** 419,425 **** 'FILE_NUMBER' => $i++, 'FILE_ID' => $file_data['file_id'], ! 'U_FILE_EDIT' => append_sid( pa_this_mxurl( "action=user_upload&mode=edit&file_id={$file_data['file_id']}" ) ), ! 'U_FILE_DELETE' => append_sid( pa_this_mxurl( "action=user_upload&do=delete&file_id={$file_data['file_id']}" ) ), ! 'U_FILE_APPROVE' => append_sid( pa_this_mxurl( "action=mcp&mode=$approve_mode&cat_id=$cat_id&file_id={$file_data['file_id']}" ) ), 'L_APPROVE' => ( $file_data['file_approved'] ) ? $lang['Unapprove'] : $lang['Approve'] ) ); --- 419,425 ---- 'FILE_NUMBER' => $i++, 'FILE_ID' => $file_data['file_id'], ! 'U_FILE_EDIT' => append_sid( $this->this_mxurl( "action=user_upload&mode=edit&file_id={$file_data['file_id']}" ) ), ! 'U_FILE_DELETE' => append_sid( $this->this_mxurl( "action=user_upload&do=delete&file_id={$file_data['file_id']}" ) ), ! 'U_FILE_APPROVE' => append_sid( $this->this_mxurl( "action=mcp&mode=$approve_mode&cat_id=$cat_id&file_id={$file_data['file_id']}" ) ), 'L_APPROVE' => ( $file_data['file_approved'] ) ? $lang['Unapprove'] : $lang['Approve'] ) ); Index: pa_category.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_category.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pa_category.php 4 Jul 2006 22:35:12 -0000 1.15 --- pa_category.php 5 Jul 2006 22:50:22 -0000 1.16 *************** *** 109,113 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=". pa_this_mxurl("action=category&cat_id=" . $cat_id, true), true)); } --- 109,113 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=". $this->this_mxurl("action=category&cat_id=" . $cat_id, true), true)); } *************** *** 125,129 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'] ) --- 125,129 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'] ) Index: pa_email.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_email.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pa_email.php 7 Jun 2006 20:29:52 -0000 1.14 --- pa_email.php 5 Jul 2006 22:50:22 -0000 1.15 *************** *** 60,64 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=email&file_id=" . $file_id), true)); } --- 60,64 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=email&file_id=" . $file_id), true)); } *************** *** 171,175 **** $emailer->reset(); ! $message = $lang['Econf'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( 'action=file&id=' . $file_id ) ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_forum'], '<a href="' . append_sid( $mx_root_path . 'index.' . $phpEx ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 171,175 ---- $emailer->reset(); ! $message = $lang['Econf'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( 'action=file&id=' . $file_id ) ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_forum'], '<a href="' . append_sid( $mx_root_path . 'index.' . $phpEx ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 183,187 **** $pafiledb_template->assign_vars( array( 'USER_LOGGED' => ( !$userdata['session_logged_in'] ) ? true : false, ! 'S_EMAIL_ACTION' => append_sid( pa_this_mxurl() ), 'S_HIDDEN_FIELDS' => '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />', --- 183,187 ---- $pafiledb_template->assign_vars( array( 'USER_LOGGED' => ( !$userdata['session_logged_in'] ) ? true : false, ! 'S_EMAIL_ACTION' => append_sid( $this->this_mxurl() ), 'S_HIDDEN_FIELDS' => '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />', *************** *** 202,207 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( pa_this_mxurl() ), ! 'U_FILE_NAME' => append_sid( pa_this_mxurl( 'action=file&file_id=' . $file_id ) ), 'FILE_NAME' => $file_data['file_name'], --- 202,207 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), ! 'U_FILE_NAME' => append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_id ) ), 'FILE_NAME' => $file_data['file_name'], Index: pa_main.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_main.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pa_main.php 4 Jul 2006 18:02:12 -0000 1.15 --- pa_main.php 5 Jul 2006 22:50:22 -0000 1.16 *************** *** 32,36 **** 'L_INDEX' => "<<", 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'], --- 32,36 ---- 'L_INDEX' => "<<", 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), 'DOWNLOAD' => $pafiledb_config['module_name'], Index: pa_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_search.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pa_search.php 17 Jun 2006 20:13:22 -0000 1.17 --- pa_search.php 5 Jul 2006 22:50:22 -0000 1.18 *************** *** 35,39 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=stats"), true)); } --- 35,39 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=stats"), true)); } *************** *** 522,527 **** for( $i = 0; $i < count( $searchset ); $i++ ) { ! $cat_url = append_sid( pa_this_mxurl( 'action=category&cat_id=' . $searchset[$i]['cat_id'] ) ); ! $file_url = append_sid( pa_this_mxurl( 'action=file&file_id=' . $searchset[$i]['file_id'] ) ); // =================================================== // Format the date for the given file --- 522,527 ---- for( $i = 0; $i < count( $searchset ); $i++ ) { ! $cat_url = append_sid( $this->this_mxurl( 'action=category&cat_id=' . $searchset[$i]['cat_id'] ) ); ! $file_url = append_sid( $this->this_mxurl( 'action=file&file_id=' . $searchset[$i]['file_id'] ) ); // =================================================== // Format the date for the given file *************** *** 579,583 **** ); } ! $base_url = append_sid( pa_this_mxurl( "action=search&search_id=$search_id" ) ); $pafiledb_template->assign_vars( array( --- 579,583 ---- ); } ! $base_url = append_sid( $this->this_mxurl( "action=search&search_id=$search_id" ) ); $pafiledb_template->assign_vars( array( *************** *** 587,591 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), 'L_INDEX' => "<<", --- 587,591 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), 'L_INDEX' => "<<", *************** *** 612,616 **** $pafiledb_template->assign_vars( array( ! 'S_SEARCH_ACTION' => append_sid( pa_this_mxurl() ), 'S_CAT_MENU' => $dropmenu, --- 612,616 ---- $pafiledb_template->assign_vars( array( ! 'S_SEARCH_ACTION' => append_sid( $this->this_mxurl() ), 'S_CAT_MENU' => $dropmenu, *************** *** 618,622 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), 'L_YES' => $lang['Yes'], --- 618,622 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), 'L_YES' => $lang['Yes'], Index: pa_quickdl.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_quickdl.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pa_quickdl.php 27 Jun 2006 21:38:43 -0000 1.8 --- pa_quickdl.php 5 Jul 2006 22:50:22 -0000 1.9 *************** *** 141,145 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("actionqdl=category&cat_id=" . $cat_id), true)); } --- 141,145 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("actionqdl=category&cat_id=" . $cat_id), true)); } *************** *** 164,168 **** $pafiledb_template->assign_vars( array( ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl( 'actionqdl=quickdl&cat_id=' . $pafiledb_quickdl['pa_quick_cat'] . $map_xtra ) ), 'DOWNLOAD' => $quickdl['cat_name'], 'BACK' => $quickdl_back --- 164,168 ---- $pafiledb_template->assign_vars( array( ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl( 'actionqdl=quickdl&cat_id=' . $pafiledb_quickdl['pa_quick_cat'] . $map_xtra ) ), 'DOWNLOAD' => $quickdl['cat_name'], 'BACK' => $quickdl_back Index: pa_rate.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_rate.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pa_rate.php 4 Jul 2006 22:35:12 -0000 1.15 --- pa_rate.php 5 Jul 2006 22:50:22 -0000 1.16 *************** *** 63,67 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=rate&file_id=" . $file_id), true)); } --- 63,67 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=rate&file_id=" . $file_id), true)); } *************** *** 75,80 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( pa_this_mxurl() ), ! 'U_FILE_NAME' => append_sid( pa_this_mxurl( 'action=file&file_id=' . $file_id ) ), 'FILE_NAME' => $file_data['file_name'], --- 75,80 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD_HOME' => append_sid( $this->this_mxurl() ), ! 'U_FILE_NAME' => append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_id ) ), 'FILE_NAME' => $file_data['file_name'], *************** *** 93,97 **** } ! $pafiledb_user->update_voter_info( $file_id, $rating ); $rate_info = $pafiledb_functions->get_rating( $file_id ); --- 93,97 ---- } ! $this->update_voter_info( $file_id, $rating ); $rate_info = $pafiledb_functions->get_rating( $file_id ); *************** *** 99,103 **** $result_msg = str_replace( "{newrating}", $rate_info, $result_msg ); ! $message = $result_msg . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( pa_this_mxurl( 'action=file&file_id=' . $file_id ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } --- 99,103 ---- $result_msg = str_replace( "{newrating}", $rate_info, $result_msg ); ! $message = $result_msg . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_id ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } *************** *** 107,111 **** $pafiledb_template->assign_vars( array( ! 'S_RATE_ACTION' => append_sid( pa_this_mxurl( 'action=rate&file_id=' . $file_id ) ), 'L_RATE' => $lang['Rate'], 'L_RERROR' => $lang['Rerror'], --- 107,111 ---- $pafiledb_template->assign_vars( array( ! 'S_RATE_ACTION' => append_sid( $this->this_mxurl( 'action=rate&file_id=' . $file_id ) ), 'L_RATE' => $lang['Rate'], 'L_RERROR' => $lang['Rerror'], Index: pa_toplist.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_toplist.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pa_toplist.php 27 Jun 2006 21:38:43 -0000 1.19 --- pa_toplist.php 5 Jul 2006 22:50:22 -0000 1.20 *************** *** 65,72 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), ! 'U_NEWEST_FILE' => append_sid( pa_this_mxurl( 'action=toplist&mode=newest' ) ), ! 'U_MOST_POPULAR' => append_sid( pa_this_mxurl( 'action=toplist&mode=downloads' ) ), ! 'U_TOP_RATED' => append_sid( pa_this_mxurl( 'action=toplist&mode=rating' ) ), 'L_CURRENT_TOPLIST' => $l_current_toplist, --- 65,72 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), ! 'U_NEWEST_FILE' => append_sid( $this->this_mxurl( 'action=toplist&mode=newest' ) ), ! 'U_MOST_POPULAR' => append_sid( $this->this_mxurl( 'action=toplist&mode=downloads' ) ), ! 'U_TOP_RATED' => append_sid( $this->this_mxurl( 'action=toplist&mode=rating' ) ), 'L_CURRENT_TOPLIST' => $l_current_toplist, *************** *** 142,148 **** 'L_NEW_FILES' => sprintf( $lang['New_Files'], $days ), ! 'U_ONE_WEEK' => append_sid( pa_this_mxurl( 'action=toplist&mode=newest&days=7' ) ), ! 'U_TWO_WEEK' => append_sid( pa_this_mxurl( 'action=toplist&mode=newest&days=14' ) ), ! 'U_30_DAYS' => append_sid( pa_this_mxurl( 'action=toplist&mode=newest&days=30' ) ) ) ); --- 142,148 ---- 'L_NEW_FILES' => sprintf( $lang['New_Files'], $days ), ! 'U_ONE_WEEK' => append_sid( $this->this_mxurl( 'action=toplist&mode=newest&days=7' ) ), ! 'U_TWO_WEEK' => append_sid( $this->this_mxurl( 'action=toplist&mode=newest&days=14' ) ), ! 'U_30_DAYS' => append_sid( $this->this_mxurl( 'action=toplist&mode=newest&days=30' ) ) ) ); *************** *** 164,168 **** $pafiledb_template->assign_block_vars( 'files_date', array( ! 'U_DATES' => append_sid( pa_this_mxurl( 'action=toplist&mode=newest&days=7&selected_date=' . $day_time ) ), 'DATES' => date( 'F d, Y', $day_time ), 'TOTAL_DOWNLOADS' => $file_num ) --- 164,168 ---- $pafiledb_template->assign_block_vars( 'files_date', array( ! 'U_DATES' => append_sid( $this->this_mxurl( 'action=toplist&mode=newest&days=7&selected_date=' . $day_time ) ), 'DATES' => date( 'F d, Y', $day_time ), 'TOTAL_DOWNLOADS' => $file_num ) *************** *** 258,263 **** for ( $i = 0; $i < count( $file_rowset ); $i++ ) { ! $cat_url = append_sid( pa_this_mxurl( 'action=category&cat_id=' . $file_rowset[$i]['file_catid'] ) ); ! $file_url = append_sid( pa_this_mxurl( 'action=file&file_id=' . $file_rowset[$i]['file_id'] ) ); // =================================================== // Format the date for the given file --- 258,263 ---- for ( $i = 0; $i < count( $file_rowset ); $i++ ) { ! $cat_url = append_sid( $this->this_mxurl( 'action=category&cat_id=' . $file_rowset[$i]['file_catid'] ) ); ! $file_url = append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_rowset[$i]['file_id'] ) ); // =================================================== // Format the date for the given file *************** *** 387,397 **** 'L_CATEGORY' => $lang['Category'], ! 'U_TOP_10' => append_sid( pa_this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=num&most_num=10' ) ), ! 'U_TOP_25' => append_sid( pa_this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=num&most_num=25' ) ), ! 'U_TOP_50' => append_sid( pa_this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=num&most_num=50' ) ), ! 'U_TOP_PER_1' => append_sid( pa_this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=per&most_num=1' ) ), ! 'U_TOP_PER_5' => append_sid( pa_this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=per&most_num=5' ) ), ! 'U_TOP_PER_10' => append_sid( pa_this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=per&most_num=10' ) ) ) ); --- 387,397 ---- 'L_CATEGORY' => $lang['Category'], ! 'U_TOP_10' => append_sid( $this->this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=num&most_num=10' ) ), ! 'U_TOP_25' => append_sid( $this->this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=num&most_num=25' ) ), ! 'U_TOP_50' => append_sid( $this->this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=num&most_num=50' ) ), ! 'U_TOP_PER_1' => append_sid( $this->this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=per&most_num=1' ) ), ! 'U_TOP_PER_5' => append_sid( $this->this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=per&most_num=5' ) ), ! 'U_TOP_PER_10' => append_sid( $this->this_mxurl( 'action=toplist&mode=' . $mode . '&most_type=per&most_num=10' ) ) ) ); *************** *** 458,463 **** } ! $cat_url = append_sid( pa_this_mxurl( 'action=category&cat_id=' . $searchset[$i]['cat_id'] ) ); ! $file_url = append_sid( pa_this_mxurl( 'action=file&file_id=' . $searchset[$i]['file_id'] ) ); // =================================================== // Format the date for the given file --- 458,463 ---- } ! $cat_url = append_sid( $this->this_mxurl( 'action=category&cat_id=' . $searchset[$i]['cat_id'] ) ); ! $file_url = append_sid( $this->this_mxurl( 'action=file&file_id=' . $searchset[$i]['file_id'] ) ); // =================================================== // Format the date for the given file Index: pa_stats.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/modules/pa_stats.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pa_stats.php 17 Jun 2006 20:13:22 -0000 1.19 --- pa_stats.php 5 Jul 2006 22:50:22 -0000 1.20 *************** *** 35,39 **** if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".pa_this_mxurl("action=stats"), true)); } --- 35,39 ---- if ( !$userdata['session_logged_in'] ) { ! // mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=".$this->this_mxurl("action=stats"), true)); } *************** *** 167,186 **** $lang['Stats_text'] = str_replace( "{total_categories}", $num['cats'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{total_downloads}", $totaldls, $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_newest_file}", append_sid( pa_this_mxurl( "action=file&file_id=" . $newest['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{newest_file}", $newest['file_name'], $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_oldest_file}", append_sid( pa_this_mxurl( "action=file&file_id=" . $oldest['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{oldest_file}", $oldest['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{average}", $avg, $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_popular}", append_sid( pa_this_mxurl( "action=file&file_id=" . $popular['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{popular}", $popular['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{most}", round( $popular['rating'], 2 ), $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_lpopular}", append_sid( pa_this_mxurl( "action=file&file_id=" . $lpopular['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{lpopular}", $lpopular['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{least}", round( $lpopular['rating'], 2 ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{avg_dls}", $avgdls, $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_most_dl}", append_sid( pa_this_mxurl( "action=file&file_id=" . $mostdl['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{most_dl}", $mostdl['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{most_no}", $mostdl['file_dls'], $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_least_dl}", append_sid( pa_this_mxurl( "action=file&file_id=" . $leastdl['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{least_dl}", $leastdl['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{least_no}", $leastdl['file_dls'], $lang['Stats_text'] ); --- 167,186 ---- $lang['Stats_text'] = str_replace( "{total_categories}", $num['cats'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{total_downloads}", $totaldls, $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_newest_file}", append_sid( $this->this_mxurl( "action=file&file_id=" . $newest['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{newest_file}", $newest['file_name'], $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_oldest_file}", append_sid( $this->this_mxurl( "action=file&file_id=" . $oldest['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{oldest_file}", $oldest['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{average}", $avg, $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_popular}", append_sid( $this->this_mxurl( "action=file&file_id=" . $popular['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{popular}", $popular['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{most}", round( $popular['rating'], 2 ), $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_lpopular}", append_sid( $this->this_mxurl( "action=file&file_id=" . $lpopular['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{lpopular}", $lpopular['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{least}", round( $lpopular['rating'], 2 ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{avg_dls}", $avgdls, $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_most_dl}", append_sid( $this->this_mxurl( "action=file&file_id=" . $mostdl['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{most_dl}", $mostdl['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{most_no}", $mostdl['file_dls'], $lang['Stats_text'] ); ! $lang['Stats_text'] = str_replace( "{u_least_dl}", append_sid( $this->this_mxurl( "action=file&file_id=" . $leastdl['file_id'] ) ), $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{least_dl}", $leastdl['file_name'], $lang['Stats_text'] ); $lang['Stats_text'] = str_replace( "{least_no}", $leastdl['file_dls'], $lang['Stats_text'] ); *************** *** 303,307 **** $pafiledb_template->assign_vars( array( ! 'S_ACTION_CHART' => append_sid( pa_this_mxurl( 'action=stats' ) ), 'L_STATISTICS' => $lang['Statistics'], --- 303,307 ---- $pafiledb_template->assign_vars( array( ! 'S_ACTION_CHART' => append_sid( $this->this_mxurl( 'action=stats' ) ), 'L_STATISTICS' => $lang['Statistics'], *************** *** 314,318 **** 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( pa_this_mxurl() ), 'U_VOTE_LCAP' => $images['mx_vote_lcap'], --- 314,318 ---- 'U_INDEX' => append_sid( $mx_root_path . 'index.' . $phpEx ), ! 'U_DOWNLOAD' => append_sid( $this->this_mxurl() ), 'U_VOTE_LCAP' => $images['mx_vote_lcap'], |
|
From: Jon O. <jon...@us...> - 2006-07-05 22:50:26
|
Update of /cvsroot/mxbb/mx_pafiledb In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7415/modules/mx_pafiledb Modified Files: db_install.php db_upgrade.php dload_lists.php Log Message: massive update Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_upgrade.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** db_upgrade.php 27 Jun 2006 18:14:28 -0000 1.16 --- db_upgrade.php 5 Jul 2006 22:50:21 -0000 1.17 *************** *** 214,217 **** --- 214,221 ---- $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat MODIFY notify_group mediumint(8) NOT NULL default '-1' "; $sql[] = "ALTER TABLE " . $mx_table_prefix . "pa_cat MODIFY auth_delete_file tinyint(2) NOT NULL default '2' "; + + // Appearance + $sql[] = "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('cat_col', '2') "; + } else Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_install.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** db_install.php 3 Jul 2006 09:17:28 -0000 1.24 --- db_install.php 5 Jul 2006 22:50:21 -0000 1.25 *************** *** 289,301 **** // Appearance ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_topnumber', '10')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_newdays', '1')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_stats', '')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_viewall', '1')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_dbdescription', '')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_method', 'file_time')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_order', 'DESC')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pagination', '20')", // art_pagination & settings_file_page // Comments --- 289,303 ---- // Appearance ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_method', 'file_time')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('sort_order', 'DESC')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('pagination', '20')", // art_pagination & settings_file_page ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_stats', '')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_viewall', '1')", "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_dbdescription', '')", + "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_topnumber', '10')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('cat_col', '2')", ! "INSERT INTO " . $mx_table_prefix . "pa_config VALUES ('settings_newdays', '1')", // Comments Index: dload_lists.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/dload_lists.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** dload_lists.php 27 Jun 2006 21:38:43 -0000 1.20 --- dload_lists.php 5 Jul 2006 22:50:21 -0000 1.21 *************** *** 172,179 **** $file_screenshot_url = trim( $recentrow[$j]['file_ssurl'] ); $template->assign_block_vars( 'recent_pics_block.recent_pics.recent_col', array( ! // 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=". $recentrow[$j]['pic_id'])) : append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=". $recentrow[$j]['pic_id'])), ! // 'THUMBNAIL' => append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=". $recentrow[$j]['pic_id'], TRUE)), // 'DESC' => $recentrow[$j]['pic_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $recentrow[$j]['file_name'] . '</a></i></span>' : '' )); --- 172,179 ---- $file_screenshot_url = trim( $recentrow[$j]['file_ssurl'] ); $template->assign_block_vars( 'recent_pics_block.recent_pics.recent_col', array( ! // 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid($pafiledb->this_mxurl("smartor_mode=album_pic&pic_id=". $recentrow[$j]['pic_id'])) : append_sid($pafiledb->this_mxurl("smartor_mode=album_showpage&pic_id=". $recentrow[$j]['pic_id'])), ! // 'THUMBNAIL' => append_sid($pafiledb->this_mxurl("smartor_mode=album_thumbnail&pic_id=". $recentrow[$j]['pic_id'], TRUE)), // 'DESC' => $recentrow[$j]['pic_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $recentrow[$j]['file_name'] . '</a></i></span>' : '' )); *************** *** 190,194 **** $template->assign_block_vars( 'recent_pics_block.recent_pics.recent_detail', array( ! 'TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $recentrow[$j]['file_name'] . '</a></b><br />' : '', 'DESC' => $recentrow[$j]['file_desc'], 'POSTER' => $recent_poster, --- 190,194 ---- $template->assign_block_vars( 'recent_pics_block.recent_pics.recent_detail', array( ! 'TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $recentrow[$j]['file_name'] . '</a></b><br />' : '', 'DESC' => $recentrow[$j]['file_desc'], 'POSTER' => $recent_poster, *************** *** 197,201 **** 'VIEW' => $recentrow[$j]['file_dls'], 'RATING' => ( $pafiledb->ratings[$recentrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'COMMENTS' => ( $pafiledb->comments[$recentrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $recentrow[$j]['comments'] . '<br />' ) : '' // 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($recentrow[$j]['pic_user_ip']) .'</a><br />' : '' )); --- 197,201 ---- 'VIEW' => $recentrow[$j]['file_dls'], 'RATING' => ( $pafiledb->ratings[$recentrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'COMMENTS' => ( $pafiledb->comments[$recentrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $recentrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $recentrow[$j]['comments'] . '<br />' ) : '' // 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($recentrow[$j]['pic_user_ip']) .'</a><br />' : '' )); *************** *** 270,274 **** // 'THUMBNAIL' => append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=". $recentrow[$j]['pic_id'], TRUE)), // 'DESC' => $recentrow[$j]['pic_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $mostrow[$j]['file_name'] . '</a></i></span>' : '' )); --- 270,274 ---- // 'THUMBNAIL' => append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=". $recentrow[$j]['pic_id'], TRUE)), // 'DESC' => $recentrow[$j]['pic_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $mostrow[$j]['file_name'] . '</a></i></span>' : '' )); *************** *** 285,289 **** $template->assign_block_vars( 'most_pics_block.most_pics.most_detail', array( ! 'TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $mostrow[$j]['file_name'] . '</a></b><br />' : '', 'DESC' => $mostrow[$j]['file_desc'], 'POSTER' => $most_poster, --- 285,289 ---- $template->assign_block_vars( 'most_pics_block.most_pics.most_detail', array( ! 'TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $mostrow[$j]['file_name'] . '</a></b><br />' : '', 'DESC' => $mostrow[$j]['file_desc'], 'POSTER' => $most_poster, *************** *** 292,296 **** 'VIEW' => $mostrow[$j]['file_dls'], 'RATING' => ( $pafiledb->ratings[$mostrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'COMMENTS' => ( $pafiledb->comments[$mostrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $mostrow[$j]['comments'] . '<br />' ) : '' // 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($recentrow[$j]['pic_user_ip']) .'</a><br />' : '' )); --- 292,296 ---- 'VIEW' => $mostrow[$j]['file_dls'], 'RATING' => ( $pafiledb->ratings[$mostrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'COMMENTS' => ( $pafiledb->comments[$mostrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $mostrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $mostrow[$j]['comments'] . '<br />' ) : '' // 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($recentrow[$j]['pic_user_ip']) .'</a><br />' : '' )); *************** *** 366,370 **** // 'THUMBNAIL' => append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=". $highestrow[$j]['pic_id'], TRUE)), // 'DESC' => $highestrow[$j]['pic_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $highestrow[$j]['file_name'] . '</a></i></span>' : '' )); --- 366,370 ---- // 'THUMBNAIL' => append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=". $highestrow[$j]['pic_id'], TRUE)), // 'DESC' => $highestrow[$j]['pic_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $highestrow[$j]['file_name'] . '</a></i></span>' : '' )); *************** *** 381,385 **** $template->assign_block_vars( 'highest_pics_block.highest_pics.highest_detail', array( ! 'H_TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $highestrow[$j]['file_name'] . '</a></b><br />' : '', 'H_DESC' => $highestrow[$j]['file_desc'], 'H_POSTER' => $highest_poster, --- 381,385 ---- $template->assign_block_vars( 'highest_pics_block.highest_pics.highest_detail', array( ! 'H_TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $highestrow[$j]['file_name'] . '</a></b><br />' : '', 'H_DESC' => $highestrow[$j]['file_desc'], 'H_POSTER' => $highest_poster, *************** *** 388,392 **** 'H_VIEW' => $highestrow[$j]['file_dls'], 'H_RATING' => ( $pafiledb->ratings[$highestrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'H_COMMENTS' => ( $pafiledb->comments[$highestrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $highestrow[$j]['comments'] . '<br />' ) : '' // 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($highestrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($highestrow[$j]['pic_user_ip']) .'</a><br />' : '' )); --- 388,392 ---- 'H_VIEW' => $highestrow[$j]['file_dls'], 'H_RATING' => ( $pafiledb->ratings[$highestrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'H_COMMENTS' => ( $pafiledb->comments[$highestrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $highestrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $highestrow[$j]['comments'] . '<br />' ) : '' // 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($highestrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($highestrow[$j]['pic_user_ip']) .'</a><br />' : '' )); *************** *** 460,467 **** $file_screenshot_url = trim( $randrow[$j]['file_ssurl'] ); $template->assign_block_vars( 'random_pics_block.rand_pics.rand_col', array( ! // 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(pa_this_mxurl_list("smartor_mode=album_pic&pic_id=". $randrow[$j]['pic_id'])) : append_sid(pa_this_mxurl_list("smartor_mode=album_showpage&pic_id=". $randrow[$j]['pic_id'])), ! // 'THUMBNAIL' => append_sid(pa_this_mxurl_list("smartor_mode=album_thumbnail&pic_id=". $randrow[$j]['pic_id'], TRUE)), // 'DESC' => $randrow[$j]['file_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $randrow[$j]['file_name'] . '</a></i></span>' : '' )); --- 460,467 ---- $file_screenshot_url = trim( $randrow[$j]['file_ssurl'] ); $template->assign_block_vars( 'random_pics_block.rand_pics.rand_col', array( ! // 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid($pafiledb->this_mxurl_list("smartor_mode=album_pic&pic_id=". $randrow[$j]['pic_id'])) : append_sid($pafiledb->this_mxurl_list("smartor_mode=album_showpage&pic_id=". $randrow[$j]['pic_id'])), ! // 'THUMBNAIL' => append_sid($pafiledb->this_mxurl_list("smartor_mode=album_thumbnail&pic_id=". $randrow[$j]['pic_id'], TRUE)), // 'DESC' => $randrow[$j]['file_desc'] ! 'SS' => ( !empty( $file_screenshot_url ) ) ? '<hr><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '"><img src="' . $file_screenshot_url . '" width="100" border="0"></a><br /><span class="genmed"><i><a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $randrow[$j]['file_name'] . '</a></i></span>' : '' )); *************** *** 478,482 **** $template->assign_block_vars( 'random_pics_block.rand_pics.rand_detail', array( ! 'TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $randrow[$j]['file_name'] . '</a></b><br />' : '', 'DESC' => $randrow[$j]['file_desc'], 'POSTER' => $rand_poster, --- 478,482 ---- $template->assign_block_vars( 'random_pics_block.rand_pics.rand_detail', array( ! 'TITLE' => ( empty( $file_screenshot_url ) ) ? '<b>' . $lang['File_Title'] . ': <a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $randrow[$j]['file_name'] . '</a></b><br />' : '', 'DESC' => $randrow[$j]['file_desc'], 'POSTER' => $rand_poster, *************** *** 485,489 **** 'VIEW' => $randrow[$j]['file_dls'], 'RATING' => ( $pafiledb->ratings[$randrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'COMMENTS' => ( $pafiledb->comments[$randrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( pa_this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $randrow[$j]['comments'] . '<br />' ) : '' // 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($randrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($randrow[$j]['pic_user_ip']) .'</a><br />' : '' )); --- 485,489 ---- 'VIEW' => $randrow[$j]['file_dls'], 'RATING' => ( $pafiledb->ratings[$randrow[$j]['file_catid']]['activated'] ) ? ( $lang['Rating'] . ': ' . $rating_image . ', ' ) : '', ! 'COMMENTS' => ( $pafiledb->comments[$randrow[$j]['file_catid']]['activated'] ) ? ( '<a href="' . append_sid( $pafiledb->this_mxurl_list( "action=file&file_id=" . $randrow[$j]['file_id'], false, $pafiledb_page_id ) ) . '">' . $lang['Comments'] . '</a>: ' . $randrow[$j]['comments'] . '<br />' ) : '' // 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($randrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($randrow[$j]['pic_user_ip']) .'</a><br />' : '' )); *************** *** 527,534 **** 'L_LAST_PIC' => $lang['Last_Pic'], ! 'U_YOUR_PERSONAL_GALLERY' => append_sid( pa_this_mxurl_list( "smartor_mode=album_personal&user_id=" . $userdata['user_id'] ) ), 'L_YOUR_PERSONAL_GALLERY' => $lang['Your_Personal_Gallery'], ! 'U_USERS_PERSONAL_GALLERIES' => append_sid( pa_this_mxurl_list( "smartor_mode=album_personal_index" ) ), 'L_USERS_PERSONAL_GALLERIES' => $lang['Users_Personal_Galleries'], --- 527,534 ---- 'L_LAST_PIC' => $lang['Last_Pic'], ! 'U_YOUR_PERSONAL_GALLERY' => append_sid( $pafiledb->this_mxurl_list( "smartor_mode=album_personal&user_id=" . $userdata['user_id'] ) ), 'L_YOUR_PERSONAL_GALLERY' => $lang['Your_Personal_Gallery'], ! 'U_USERS_PERSONAL_GALLERIES' => append_sid( $pafiledb->this_mxurl_list( "smartor_mode=album_personal_index" ) ), 'L_USERS_PERSONAL_GALLERIES' => $lang['Users_Personal_Galleries'], |
|
From: Jon O. <jon...@us...> - 2006-07-05 22:50:26
|
Update of /cvsroot/mxbb/mx_pafiledb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7415/modules/mx_pafiledb/admin Modified Files: admin_pa_file.php admin_pa_settings.php Log Message: massive update Index: admin_pa_settings.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_settings.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** admin_pa_settings.php 17 Jun 2006 20:13:21 -0000 1.18 --- admin_pa_settings.php 5 Jul 2006 22:50:21 -0000 1.19 *************** *** 231,239 **** $settings_topnumber = $new['settings_topnumber']; - $settings_newdays = $new['settings_newdays']; $view_all_yes = ( $new['settings_viewall'] ) ? "checked=\"checked\"" : ""; $view_all_no = ( !$new['settings_viewall'] ) ? "checked=\"checked\"" : ""; // // Instructions --- 231,241 ---- $settings_topnumber = $new['settings_topnumber']; $view_all_yes = ( $new['settings_viewall'] ) ? "checked=\"checked\"" : ""; $view_all_no = ( !$new['settings_viewall'] ) ? "checked=\"checked\"" : ""; + $settings_newdays = $new['settings_newdays']; + $cat_col = $new['cat_col']; + // // Instructions *************** *** 408,411 **** --- 410,416 ---- 'SETTINGS_TOPNUMBER' => $settings_topnumber, + 'CAT_COL' => $cat_col, + 'L_CAT_COL' => $lang['cat_col'], + 'L_NFDAYS' => $lang['Nfdays'], 'L_NFDAYSINFO' => $lang['Nfdaysinfo'], Index: admin_pa_file.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/admin/admin_pa_file.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** admin_pa_file.php 17 Jun 2006 20:13:21 -0000 1.20 --- admin_pa_file.php 5 Jul 2006 22:50:21 -0000 1.21 *************** *** 222,245 **** $pafiledb->update_add_file_notify($file_id, 'add'); - /* - // - // Auto comment - // - if ( $pafiledb->comments[$cat_id]['activated'] && $this->comments[$cat_id]['autogenerate_comments'] ) - { - // - // Autogenerate comment (duplicate the notification message) - // - $mx_pa_notification = new mx_pa_notification(); - $mx_pa_notification->init( $file_id ); - $mx_pa_notification->_compose_auto_note($pa_post_mode == 'add' ? MX_NEW_NOTIFICATION : MX_EDITED_NOTIFICATION); - - // - // Generate comment - // - $this->update_add_comment('', $file_id, 0, addslashes(trim($mx_pa_notification->subject)), addslashes(trim($mx_pa_notification->message))); - } - */ - $message = $lang['Fileadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_file.php" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); --- 222,225 ---- *************** *** 260,283 **** $pafiledb->update_add_file_notify($file_id, 'edit'); - /* - // - // Auto comment - // - if ( $pafiledb->comments[$cat_id]['activated'] && $this->comments[$cat_id]['autogenerate_comments'] ) - { - // - // Autogenerate comment (duplicate the notification message) - // - $mx_pa_notification = new mx_pa_notification(); - $mx_pa_notification->init( $file_id ); - $mx_pa_notification->_compose_auto_note($pa_post_mode == 'add' ? MX_NEW_NOTIFICATION : MX_EDITED_NOTIFICATION); - - // - // Generate comment - // - $this->update_add_comment('', $file_id, 0, addslashes(trim($mx_pa_notification->subject)), addslashes(trim($mx_pa_notification->message))); - } - */ - $message = $lang['Fileedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( "admin_pa_file.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); --- 240,243 ---- |