|
From: Jon O. <jon...@us...> - 2006-07-01 21:31:09
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10058/modules/mx_pafiledb/pafiledb/includes Modified Files: functions.php functions_pafiledb.php Log Message: minor fixes Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** functions.php 17 Jun 2006 20:13:22 -0000 1.23 --- functions.php 1 Jul 2006 21:31:06 -0000 1.24 *************** *** 1240,1244 **** function init( $item_id = 0) { ! global $db, $lang, $mx_pa_custom_field, $module_root_path, $phpbb_root_path, $phpEx, $mx_pafiledb, $userdata; // ======================================================= --- 1240,1244 ---- function init( $item_id = 0) { ! global $db, $lang, $mx_pa_custom_field, $module_root_path, $phpbb_root_path, $phpEx, $pafiledb, $userdata; // ======================================================= *************** *** 1958,1961 **** --- 1958,1962 ---- 'L_QUICK_JUMP' => $lang['Quick_jump'], 'JUMPMENU' => $pafiledb->modules[$pafiledb->module_name]->generate_jumpbox( 0, 0, array( $_GET['cat_id'] => 1 ) ), + 'S_JUMPBOX_ACTION' => append_sid( pa_this_mxurl( ) ), 'S_AUTH_LIST' => $pafiledb->modules[$pafiledb->module_name]->auth_can_list, *************** *** 1965,1969 **** 'L_MODULE_ORIG_AUTHOR' => $pa_module_orig_author, 'L_MODULE_AUTHOR' => $pa_module_author, - 'S_JUMPBOX_ACTION' => append_sid( pa_this_mxurl( ) ), 'S_TIMEZONE' => sprintf( $lang['All_times'], $lang[number_format( $board_config['board_timezone'] )] ) ) ); --- 1966,1969 ---- Index: functions_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** functions_pafiledb.php 27 Jun 2006 21:38:43 -0000 1.30 --- functions_pafiledb.php 1 Jul 2006 21:31:06 -0000 1.31 *************** *** 24,27 **** --- 24,50 ---- /** + * Enter description here... + * + * @param unknown_type $module_name + */ + 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. * *************** *** 169,173 **** $this->notification[$cat_rowset[$i]['cat_id']]['activated'] = $cat_rowset[$i]['notify'] == -1 ? (intval($pafiledb_config['notify'])) : ( intval($cat_rowset[$i]['notify']) ); // -1, 0, 1, 2 $this->notification[$cat_rowset[$i]['cat_id']]['notify_group'] = $cat_rowset[$i]['notify_group'] == -1 || $cat_rowset[$i]['notify_group'] == 0 ? (intval($pafiledb_config['notify_group'])) : ( intval($cat_rowset[$i]['notify_group']) ); // Group_id - } } --- 192,195 ---- *************** *** 522,562 **** * @return unknown */ - function new_file_in_cat_old( $cat_id ) - { - global $pafiledb_config, $board_config, $db, $_COOKIE; - - $files_new = 0; - - $time = time() - ( $pafiledb_config['settings_newdays'] * 24 * 60 * 60 ); - - $sql = 'SELECT file_time, file_catid - FROM ' . PA_FILES_TABLE . " - WHERE file_approved = '1' - AND file_catid IN (" . $this->gen_cat_ids( $cat_id ) . ') - AND file_time > ' . $time . ' - ORDER BY file_time DESC'; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt Query Files info', '', __LINE__, __FILE__, $sql ); - } - - while ( $row = $db->sql_fetchrow( $result ) ) - { - if ( $this->auth[$row['file_catid']]['auth_read'] ) - { - $files_new++; - } - } - - return $files_new; - } - - /** - * Enter description here... - * - * @param unknown_type $cat_id - * @return unknown - */ function new_file_in_cat( $cat_id ) { --- 544,547 ---- *************** *** 952,956 **** global $db, $pafiledb_config, $pafiledb_template, $board_config; global $images, $lang, $phpEx, $pafiledb_functions; - // MX global $phpbb_root_path, $mx_root_path, $module_root_path, $is_block, $phpEx; --- 937,940 ---- *************** *** 2348,2479 **** * Enter description here... * - */ - /* - function pm_notify() - { - global $lang, $emailer, $board_config, $kb_config, $db, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $is_block, $page_id, $images; - - if ( $action == 2 ) - { - $email_body = $lang['Email_body']; - - include( $phpbb_root_path . 'includes/emailer.' . $phpEx ); - $emailer = new emailer( $board_config['smtp_delivery'] ); - $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n"; - $emailer->email_address( $board_config['board_email'] ); - $emailer->set_subject( $lang['New_article'] ); - $emailer->extra_headers( $email_headers ); - $emailer->msg = $email_body; - - $emailer->send(); - $emailer->reset(); - } - else if ( $action == 1 ) - { - $sql = "UPDATE " . USERS_TABLE . " - SET user_new_privmsg = '1', user_last_privmsg = '9999999999' - WHERE user_id = " . $kb_config['admin_id']; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql ); - } - // added by snake for extended PM - $approve_pm_view = "<table width=" . "100%" . " border=" . "1" . " cellspacing=" . "0" . " cellpadding=" . "0" . "><tr><td>" . $lang['Category'] . "</td><td>" . $lang['Art_action'] . "</td></tr>"; - - $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE approved = '2' ORDER BY article_id DESC LIMIT 1"; - if ( !( $article_result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); - } - - while ( $article = $db->sql_fetchrow( $article_result ) ) - { - $approved_yesno = $article['approved']; - $article_description = $article['article_description']; - $article_cat = $article['article_category_id']; - $bbcode_uid = $article['bbcode_uid']; // to enadbe bbcode from article html seems to wolr by default even whwn off - $articlebody = "[quote:$bbcode_uid]" . $article['article_body'] . "<br>[/quote:$bbcode_uid]"; // include the post for approve.. - // type - $type_id = $article['article_type']; - $article_type = get_kb_type( $type_id ); - $article_date = create_date( $board_config['default_dateformat'], $article['article_date'], $board_config['board_timezone'] ); - // author information - $author_id = $article['article_author_id']; - - if ( $author_id == 0 ) - { - $author = ( $username != '' ) ? $lang['Guest'] : $article['username']; - } - else - { - $author_name = get_kb_author( $author_id ); - $temp_url = append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$author_id" ); - $author = '<a href="' . $temp_url . '" class="gen">' . $author_name . '</a>'; - } - - $article_id = $article['article_id']; - $views = $article['views']; - $article_title = $article['article_title']; - $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id" ) ); - $article = '<a href="' . $temp_url . '" class="gen">' . $article_title . '</a>'; - - $approve = ''; - $delete = ''; - $category_name = ''; - - $category = get_kb_cat( $article_cat ); - $category_name = $category['category_name']; - - if ( $approved_yesno == 2 ) - { - // approve - $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=approve&a=$article_id" ); - $approve = '<a href="' . $temp_url . '"><img src="' . $images['pa_icon_approve'] . '" border="0" alt="' . $lang['Approve'] . '"></a>'; - } - else - { - // unapprove - $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=unapprove&a=$article_id" ); - $unapprove = '<a href="' . $temp_url . '"><img src="' . $images['pa_icon_unapprove'] . '" border="0" alt="' . $lang['Un_approve'] . '"></a>'; - } - $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=delete&a=$article_id" ); - $delete = '<a href="' . $temp_url . '"><img src="' . $images['pa_icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; - $approve_pm_view .= "<tr><td>$category_name</td><td>$approve ' ' $delete ' ' $unapprove</td></tr>"; // the action table - } - - $approve_pm_view .= "</table>"; // end action table - - $user_id = $kb_config['admin_id']; - $new_article_subject = $lang['New_article']; - $new_article = $lang['Email_body']; // original code - $new_article .= $articlebody; // the extended Pm body - $new_article .= '<p>' . $approve_pm_view; // the extended Pm body - $new_article .= '<br><a href=' . PORTAL_URL . $module_root_path . 'admin/admin_kb_art.' . $phpEx . '>KB Admin page</a><br>'; // the extended Pm body - $new_article = addslashes( $new_article ); - - $privmsgs_date = date( "U" ); - // End Snake Extend PM Mod - $sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('5', '" . $new_article_subject . "', '" . $user_id . "', '" . $user_id . "', '" . $privmsgs_date . "', '0', '1', '1', '0')"; - if ( !$db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql ); - } - $privmsg_sent_id = $db->sql_nextid(); - $privmsgs_text = $lang['register_pm_subject']; - - $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . $new_article . "')"; // need to aply the bbcode_uid for bbcode to work - if ( !$db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql ); - } - } - return; - } - */ - - /** - * Enter description here... - * * @param unknown_type $article_data * @param unknown_type $item_id --- 2332,2335 ---- |