mirror of
https://github.com/torrentpier/torrentpier.git
synced 2024-12-15 00:21:17 -08:00
3626143879
* Replaced some file_exists to is_file * Update functions_thumbs.php * Updated * Update CronHelper.php * Updated * Update IPHelper.php * Updated * Update update_forums_atom.php * Update functions.php * Update Validate.php
51 lines
1.7 KiB
PHP
51 lines
1.7 KiB
PHP
<?php
|
||
/**
|
||
* TorrentPier – Bull-powered BitTorrent tracker engine
|
||
*
|
||
* @copyright Copyright (c) 2005-2024 TorrentPier (https://torrentpier.com)
|
||
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
|
||
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
|
||
*/
|
||
|
||
if (!empty($setmodules)) {
|
||
$module['MODS']['SITEMAP'] = basename(__FILE__);
|
||
return;
|
||
}
|
||
|
||
require __DIR__ . '/pagestart.php';
|
||
|
||
$sql = 'SELECT * FROM ' . BB_CONFIG;
|
||
|
||
if (!$result = DB()->sql_query($sql)) {
|
||
bb_die('Could not query config information in admin_sitemap');
|
||
} else {
|
||
$new_params = [];
|
||
|
||
while ($row = DB()->sql_fetchrow($result)) {
|
||
$config_name = $row['config_name'];
|
||
$config_value = $row['config_value'];
|
||
$default_config[$config_name] = $config_value;
|
||
$new[$config_name] = $_POST[$config_name] ?? $default_config[$config_name];
|
||
|
||
if (isset($_POST['submit']) && $row['config_value'] != $new[$config_name]) {
|
||
$new_params[$config_name] = $new[$config_name];
|
||
}
|
||
}
|
||
|
||
if (isset($_POST['submit'])) {
|
||
if (!empty($new_params)) {
|
||
bb_update_config($new_params);
|
||
}
|
||
}
|
||
}
|
||
|
||
$s_mess = $lang['SITEMAP_CREATED'] . ': <b>' . bb_date($new['sitemap_time'], $bb_cfg['post_date_format']) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
|
||
$message = is_file(SITEMAP_DIR . '/sitemap.xml') ? $s_mess : $lang['SITEMAP_NOT_CREATED'];
|
||
|
||
$template->assign_vars([
|
||
'STATIC_SITEMAP' => $new['static_sitemap'],
|
||
'MESSAGE' => $message
|
||
]);
|
||
|
||
print_page('admin_sitemap.tpl', 'admin');
|