|
From: Jon O. <jon...@us...> - 2007-07-22 21:17:32
|
Update of /cvsroot/mxbb/mx_ggsitemaps/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10068/admin Added Files: admin_mx_ggsitemap.php index.htm Log Message: Added this module, for now, so i do not loose it --- NEW FILE: admin_mx_ggsitemap.php --- <?php /** * * @package mxBB Portal Module - mx_ggsitemaps * @version $Id: admin_mx_ggsitemap.php,v 1.1 2007/07/22 21:17:25 jonohlsson Exp $ * @copyright (c) 2002-2006 [www.phpbb-seo.com] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( file_exists( 'admin_board.php' ) ) { define('IN_PHPBB', 1); $admin_root_path1 = $admin_root_path2 = './'; $module_root_path2 = $phpbb_root_path = $mx_root_path = '../'; $module_root_path = $mx_root_path . 'mx_ggsitemaps/'; $pathkb = ''; } else { define('IN_PORTAL', 1); $mx_root_path = '../../../'; $admin_root_path1 = $mx_root_path . 'admin/'; $admin_root_path2 = $mx_root_path . 'modules/mx_ggsitemaps/admin/'; $module_root_path2 = $module_root_path = '../'; $pathkb = 'modules/mx_kb/'; } if( !empty($setmodules) ) { $filename = basename(__FILE__); $module['Mx_SiteMaps']['Google_SiteMaps'] = $admin_root_path2 . $filename; return; } $phpEx = substr(strrchr(__FILE__, '.'), 1); require($mx_root_path . 'admin/pagestart.' . $phpEx); // // Include common module stuff... // require($module_root_path . 'includes/common_GGsitemaps.' . $phpEx); // // Begin program proper // $mode = ""; if( isset($HTTP_POST_VARS['submit']) ) { $mode = "submit"; } // Pull all config data $sql = "SELECT * FROM " . GGSITEMAP_TABLE; if ( !$result = $db->sql_query( $sql ) ) { message_die( CRITICAL_ERROR, "Could not query Google sitemap configuration information ", "", __LINE__, __FILE__, $sql ); } else { while( $row = $db->sql_fetchrow($result) ) { $config_name = $row['config_name']; $config_value = $row['config_value']; $default_config[$config_name] = isset($HTTP_POST_VARS['submit']) ? str_replace("'", "\'", $config_value) : $config_value; $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name]; // Ok let's update config if necessary if( $mode == "submit" ) { // The dumb guy checks ;-) if ( ( $config_name == 'sitemap_announce_priority' ) && ( ( $config_value < 0 ) || ( $config_value > 1 ) ) ) { $new[$config_name] = '1.0'; } if ( ($config_name == 'sitemap_default_priority' ) && ( ( $config_value < 0 ) || ( $config_value > 1 ) ) ) { $new[$config_name] = '1.0'; } if ( ($config_name == 'sitemap_sticky_priority' ) && ( ( $config_value < 0 ) || ( $config_value > 1 ) ) ) { $new[$config_name] = '1.0'; } if ( ($config_name == 'sitemap_url_limit' ) && ( ( $config_value < 0 ) || ( $config_value > 50000 ) ) ) { $new[$config_name] = 40000; } if ( ($config_name == 'sitemap_sql_limit' ) && ( ( $config_value < 0 ) || ( $config_value > 1000 ) ) ) { $new[$config_name] = 200; } if ( ($config_name == 'sitemap_limitup' ) && ( ( $config_value < 0 ) || ( $config_value > 1000 ) ) ) { $new[$config_name] = 50; } if ( ($config_name == 'sitemap_limitdown' ) && ( ( $config_value < 0 ) || ( $config_value > 1000 ) ) ) { $new[$config_name] = 50; } if ( ($config_name == 'sitemap_rewrited' ) && ( ( $config_value != "TRUE" ) && ( $config_value != "FALSE" ) ) ) { $new[$config_name] = "FALSE"; } if ( ($config_name == 'sitemap_ver' ) && ( $config_value != "v1.0.0RC2" ) ) { $new[$config_name] = "v1.0.0RC2"; } if ( ($config_name == 'sitemap_c_info' ) && ( $config_value != "(C) 2006 dcz - http://www.phpbb-seo.com/" ) ) { $new[$config_name] = "(C) 2006 dcz - http://www.phpbb-seo.com/"; } if ( ($config_name == 'sitemap_kb_mx_page' ) && ( $config_value < 0 ) ) { $new[$config_name] = "FALSE"; } $sql = "UPDATE " . GGSITEMAP_TABLE . " SET config_value = '" . str_replace("\'", "''", $new[$config_name]) . "' WHERE config_name = '$config_name'"; if( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Failed to update Google sitemap configuration ", "", __LINE__, __FILE__, $sql); } } } // Send a nice message if config updated if( $mode == "submit" ) { $message = $lang['Google_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_ggsitemap_config'], "<a href=\"" . append_sid($admin_root_path2 . "admin_mx_ggsitemap.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid($admin_root_path1 . "index.$phpEx?pane=right") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); } } // We shall build the page then $template->set_filenames(array( "admin_ggsitemap" => "admin/admin_mx_ggsitemap.tpl") ); $sitemap_sort_desc = ( $new['sitemap_sort'] == "DESC" ) ? "checked=\"checked\"" : ""; $sitemap_sort_asc = ( $new['sitemap_sort'] == "ASC" ) ? "checked=\"checked\"" : ""; $rewrite_sitemaps_no = ( $new['sitemap_rewrited'] == "FALSE" ) ? "checked=\"checked\"" : ""; $rewrite_sitemaps_yes = ( $new['sitemap_rewrited'] == "TRUE" ) ? "checked=\"checked\"" : ""; $template->assign_vars(array( "L_CONFIGURATION_TITLE" => $lang['Sitemap_conf_title'], "L_CONFIGURATION_EXPLAIN" => sprintf($lang['Sitemap_conf_explain'], "<a href=\"http://www.google.com/webmasters/sitemaps/login\" target=\"_Google\">", "</a>") . '<br />' . sprintf($lang['Sitemap_conf_explain2'], "<a href=\"http://www.google.fr/search?hl=all&q=google+sitemap+submitter&btnG=Rechercher&meta=\" target=\"_Google\">", "</a>"), "S_CONFIG_ACTION" => append_sid($admin_root_path2 . "admin_mx_ggsitemap.$phpEx"), "L_SITEMAP_SETTINGS" => $lang['Sitemap_settings'], "L_SQL_LIMIT" => $lang['Sql_limit'], "L_SQL_LIMIT_EXPLAIN" => $lang['Sql_limit_explain'], "L_DEFAULT_LIMIT" => $lang['Default_limit'], "L_DEFAULT_LIMIT_EXPLAIN" => $lang['Default_limit_explain'], "L_SORT_ORDER" => $lang['Sort_order'], "L_SORT_ORDER_EXPLAIN" => $lang['Sort_order_explain'], "L_NEW_FIRST" => $lang['New_first'], "L_OLD_FIRST" => $lang['Old_first'], "L_S_MOD_REWRITE" => $lang['Mod_rewrite_S'], "L_S_MOD_REWRITE_EXPLAIN" => $lang['Mod_rewrite_S_explain'], "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], "L_SITEMAP_FORUM_SET" => $lang['Sitemap_Forum_set'], "L_ANNOUNCE_PRIORITY" => $lang['Announce_priority'], "L_ANNOUNCE_PRIORITY_EXPLAIN" => $lang['Announce_priority_explain'], "L_STICKY_PRIORITY" => $lang['Sticky_priority'], "L_STICKY_PRIORITY_EXPLAIN" => $lang['Sticky_priority_explain'], "L_DEFAULT_PRIORITY" => $lang['Default_priority'], "L_DEFAULT_PRIORITY_EXPLAIN" => $lang['Default_priority_explain'], "L_PAGINATION_LIMIT1" => $lang['Pagination_limit1'], "L_PAGINATION_LIMIT_EXPLAIN1" => $lang['Pagination_limit_explain1'], "L_PAGINATION_LIMIT2" => $lang['Pagination_limit2'], "L_PAGINATION_LIMIT_EXPLAIN2" => $lang['Pagination_limit_explain2'], "SQL_LIMIT" => $new['sitemap_sql_limit'], "SITEMAP_SORT_DESC" => $sitemap_sort_desc, "SITEMAP_SORT_ASC" => $sitemap_sort_asc, "REWRTIE_S_NO" => $rewrite_sitemaps_no, "REWRTIE_S_YES" => $rewrite_sitemaps_yes, "ANNOUNCE_PRIORITY" => $new['sitemap_announce_priority'], "STICKY_PRIORITY" => $new['sitemap_sticky_priority'], "DEFAULT_PRIORITY" => $new['sitemap_default_priority'], "DEFAULT_LIMIT" => $new['sitemap_url_limit'], "PAGINATION_LIMITDOWN" => $new['sitemap_limitdown'], "PAGINATION_LIMITUP" => $new['sitemap_limitup'], "VER_INFO" => 'mx_ggsitemaps ' . $new['sitemap_ver'] . '<br/>' . make_link($new['sitemap_c_info']), "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'] )); // If kb is installed with mx, let's show some more options if ( file_exists( $mx_root_path . $pathkb . 'includes/functions_kb.' . $phpEx ) && defined('IN_PORTAL') ) { $template -> assign_block_vars('kb_config', array( "L_SITEMAP_KB_SET" => $lang['Sitemap_kb_set'], "L_KB_MX_PAGE" => $lang['KB_mx_page'], "L_KB_MX_PAGE_EXPLAIN" => sprintf($lang['KB_mx_page_explain'], "<a href=\"http://www.mx-system.com/\" target=\"_mxBB\">", "</a>"), "KB_MX_PAGE" => $new['sitemap_kb_mx_page'], ) ); } $template->pparse('admin_ggsitemap'); include_once($admin_root_path1 . 'page_footer_admin.'.$phpEx); ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |