本文整理汇总了PHP中generate_sitemap函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_sitemap函数的具体用法?PHP generate_sitemap怎么用?PHP generate_sitemap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_sitemap函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restore_bak
/**
* Restore Pages Backup File
*
* @since 1.0
* @uses GSBACKUPSPATH
* @uses GSDATAPAGESPATH
*
* @param string $id File ID to restore
*/
function restore_bak($id)
{
$file = GSBACKUPSPATH . "pages/" . $id . ".bak.xml";
$newfile = GSDATAPAGESPATH . $id . ".xml";
$tmpfile = GSBACKUPSPATH . "pages/" . $id . ".tmp.xml";
if (!file_exists($newfile)) {
copy($file, $newfile);
unlink($file);
} else {
copy($file, $tmpfile);
copy($newfile, $file);
copy($tmpfile, $newfile);
unlink($tmpfile);
}
generate_sitemap();
}
示例2: exec_action
$note->addCData($parent);
$note = $xml->addChild('content');
$note->addCData($content);
$note = $xml->addChild('private');
$note->addCData($private);
$note = $xml->addChild('author');
$note->addCData($author);
exec_action('changedata-save');
if (isset($_POST['autosave']) && $_POST['autosave'] == 'true') {
XMLsave($xml, GSAUTOSAVEPATH . $url);
} else {
XMLsave($xml, $file);
}
//ending actions
exec_action('changedata-aftersave');
generate_sitemap();
// redirect user back to edit page
if (isset($_POST['autosave']) && $_POST['autosave'] == 'true') {
echo 'OK';
} else {
if ($_POST['redirectto'] != '') {
$redirect_url = $_POST['redirectto'];
} else {
$redirect_url = 'edit.php';
}
if ($url == $_POST['existing-url']) {
redirect($redirect_url . "?id=" . $url . "&upd=edit-success&type=edit");
} else {
redirect($redirect_url . "?id=" . $url . "&old=" . $_POST['existing-url'] . "&upd=edit-success&type=edit");
}
}
示例3: login_cookie_check
/**
* View Sitemap
*
* Displays your site's sitemap
*
* @package GetSimple
* @subpackage Theme
*/
// Setup inclusions
$load['plugin'] = true;
include 'inc/common.php';
login_cookie_check();
exec_action('load-sitemap');
$sitemapfile = '../' . GSSITEMAPFILE;
if (!file_exists($sitemapfile) || isset($_GET['refresh'])) {
if (generate_sitemap() === true) {
$success = i18n_r('SITEMAP_REFRESHED');
} else {
$error = i18n_r('SITEMAP_ERROR');
}
}
$pagetitle = strip_tags(i18n_r('SIDE_VIEW_SITEMAP'));
get_template('header');
?>
<?php
include 'template/include-nav.php';
?>
<div class="bodycontent clearfix">
<div id="maincontent">
示例4: generate_sitemap
if ($static === 'sitemap.xml') {
generate_sitemap('index');
} elseif ($static === 'sitemap.base.xml') {
generate_sitemap('base');
} elseif ($static === 'sitemap.post.xml') {
generate_sitemap('post');
} elseif ($static === 'sitemap.static.xml') {
generate_sitemap('static');
} elseif ($static === 'sitemap.tag.xml') {
generate_sitemap('tag');
} elseif ($static === 'sitemap.archive.xml') {
generate_sitemap('archive');
} elseif ($static === 'sitemap.author.xml') {
generate_sitemap('author');
} elseif ($static === 'sitemap.category.xml') {
generate_sitemap('category');
}
die;
} elseif ($static === 'admin') {
if (login()) {
config('views.root', 'system/admin/views');
render('main', array('title' => 'Admin - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'bodyclass' => 'adminfront', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Admin'));
} else {
$login = site_url() . 'login';
header("location: {$login}");
}
die;
} elseif ($static === 'login') {
config('views.root', 'system/admin/views');
render('login', array('title' => 'Login - ' . blog_title(), 'description' => 'Login page from ' . blog_title() . '.', 'canonical' => site_url() . '/login', 'bodyclass' => 'inlogin', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Login'));
die;
示例5: nm_generate_sitemap
function nm_generate_sitemap()
{
if (GSVERSION >= '3.3' && (!defined('NMNOSITEMAP') || !NMNOSITEMAP)) {
generate_sitemap();
}
}
示例6: header
case URL_COMPANIES:
require_once 'page_companies.php';
break;
case 'get-companies':
require_once 'page_getcompanies.php';
break;
case 'job-unavailable':
header("HTTP/1.1 404 Not Found");
$html_title = 'Unavailable job / ' . SITE_NAME;
$template = 'no-job.tpl';
break;
case 'sitemap.xml':
generate_sitemap('xml');
break;
case 'sitemap.txt':
generate_sitemap('txt');
break;
// custom pages, with fallback to the 404 error page
// custom pages, with fallback to the 404 error page
default:
$result = $db->query('
SELECT
*
FROM
' . DB_PREFIX . 'pages
WHERE
url = "' . $db->real_escape_string($page) . '"
');
$pageData = $result->fetch_assoc();
if (is_array($pageData)) {
require_once 'page_page.php';
示例7: header
if ($static === 'sitemap.xml' || $static === 'sitemap.base.xml' || $static === 'sitemap.post.xml' || $static === 'sitemap.static.xml' || $static === 'sitemap.tag.xml' || $static === 'sitemap.archive.xml' || $static === 'sitemap.author.xml') {
header('Content-Type: text/xml');
if ($static === 'sitemap.xml') {
generate_sitemap('index');
} elseif ($static === 'sitemap.base.xml') {
generate_sitemap('base');
} elseif ($static === 'sitemap.post.xml') {
generate_sitemap('post');
} elseif ($static === 'sitemap.static.xml') {
generate_sitemap('static');
} elseif ($static === 'sitemap.tag.xml') {
generate_sitemap('tag');
} elseif ($static === 'sitemap.archive.xml') {
generate_sitemap('archive');
} elseif ($static === 'sitemap.author.xml') {
generate_sitemap('author');
}
die;
} elseif ($static === 'admin') {
if (login()) {
config('views.root', 'system/admin/views');
render('main', array('head_contents' => head_contents('Admin - ' . blog_title(), blog_description(), site_url()), 'bodyclass' => 'adminfront', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Admin'));
} else {
$login = site_url() . 'login';
header("location: {$login}");
}
die;
} elseif ($static === 'login') {
config('views.root', 'system/admin/views');
render('login', array('head_contents' => head_contents('Login - ' . blog_title(), 'Login page from ' . blog_title() . '.', site_url() . '/login'), 'bodyclass' => 'inlogin', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Login'));
die;
示例8: elseif
} elseif ($static === 'sitemap.base.xml') {
generate_sitemap('base');
} elseif ($static === 'sitemap.post.xml') {
generate_sitemap('post');
} elseif ($static === 'sitemap.static.xml') {
generate_sitemap('static');
} elseif ($static === 'sitemap.tag.xml') {
generate_sitemap('tag');
} elseif ($static === 'sitemap.archive.xml') {
generate_sitemap('archive');
} elseif ($static === 'sitemap.author.xml') {
generate_sitemap('author');
} elseif ($static === 'sitemap.category.xml') {
generate_sitemap('category');
} elseif ($static === 'sitemap.type.xml') {
generate_sitemap('type');
}
die;
} elseif ($static === 'admin') {
if (login()) {
config('views.root', 'system/admin/views');
render('main', array('title' => 'Admin - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'bodyclass' => 'admin-front', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Admin'));
} else {
$login = site_url() . 'login';
header("location: {$login}");
}
die;
} elseif ($static === 'login') {
config('views.root', 'system/admin/views');
render('login', array('title' => 'Login - ' . blog_title(), 'description' => 'Login page from ' . blog_title() . '.', 'canonical' => site_url() . '/login', 'bodyclass' => 'in-login', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Login'));
die;
示例9: login_cookie_check
<?php
/**
* View Sitemap
*
* Displays your site's sitemap
*
* @package GetSimple
* @subpackage Theme
*/
// Setup inclusions
$load['plugin'] = true;
include 'inc/common.php';
login_cookie_check();
if (!generate_sitemap()) {
$error = generate_sitemap();
} else {
if (isset($_GET['refresh'])) {
$success = i18n_r('SITEMAP_REFRESHED');
}
}
get_template('header', cl($SITENAME) . ' » ' . strip_tags(i18n_r('SIDE_VIEW_SITEMAP')));
?>
<?php
include 'template/include-nav.php';
?>
<div class="bodycontent clearfix">
<div id="maincontent">
<div class="main" >
示例10: edit_comic
function edit_comic($ID, $comic)
{
global $scdb;
$PID = (int) $ID;
if ($PID != $ID || $ID < 1) {
$this->comic->message = 'You must call $scadmin->edit_comic() with a valid permalink ID at the first agrument!';
return false;
}
if (!is_array($comic) || !isset($comic['title']) || !isset($comic['image'])) {
$this->comic->message = 'You must call $scadmin->edit_comic() with an associative array of values as the argument setting at least the "title" and "image" values.';
return false;
}
$title = safe_text($comic['title']);
$info = isset($comic['info']) ? safe_text($comic['info'], 200) : '';
$image = safe_text($comic['image'], 100, 'image');
if ($image === false) {
$this->comic->message = 'Invalid Image File/Name';
return false;
}
// consider leaving the `time` field alone if these aren't set instead of using NOW()
$datetime = isset($comic['date']) && isset($comic['time']) ? $comic['date'] . ' ' . $comic['time'] : '';
if (!preg_match("/^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\$/", $datetime)) {
$datetime = NOW;
}
if (!$scdb->query("UPDATE `{$scdb->comics}` SET title='{$title}', info='{$info}', image='{$image}', time='{$datetime}' WHERE `PID` = '{$PID}' LIMIT 1")) {
$this->comic->message = 'Failed to edit comic!';
$scdb->debug();
return false;
}
$this->comic->message = 'Succesfully Edited!';
refresh_facebook();
clear_cache();
generate_sitemap();
return true;
}
示例11: cherry_save_options
function cherry_save_options()
{
$post_data = $_POST;
unset($post_data['action']);
foreach ($post_data as $key => $val) {
update_option($key, $val);
}
//echo $post_data['do_generate_sitemap'];
robot_txt_generate();
generate_sitemap();
exit;
}