本文整理汇总了PHP中Sitemap::setFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP Sitemap::setFilename方法的具体用法?PHP Sitemap::setFilename怎么用?PHP Sitemap::setFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sitemap
的用法示例。
在下文中一共展示了Sitemap::setFilename方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$arrTmp = $this->product->findall();
$products = $arrTmp['rpta'] == true ? $arrTmp['array'] : array();
unlink(APPPATH . "../tmp/sitemap.xml");
unlink(APPPATH . "../tmp/sitemap-index.xml");
$sitemap = new Sitemap("https://www.lifeleg.com");
$sitemap->setPath('tmp/');
$sitemap->setFilename('sitemap');
///AGREGAR ITEMS AL XML CON LAS RUTAS DE LAS PAGINAS WEB
$sitemap->addItem('/', '1.0', 'daily', 'Today');
$hoy = getdate();
$sitemap->addItem('/index.php/Petshop', '0.8', 'weekly', $hoy['month'] . " " . $hoy['mday']);
foreach ($products as $key => $value) {
$sitemap->addItem('/index.php/Petshop/detail/' . $value['url'], '0.8', 'weekly', $hoy['month'] . " " . $hoy['mday']);
}
/// SE CREA EL ARCHIVO
$sitemap->createSitemapIndex('https://www.lifeleg.com/tmp/', 'Today');
}
示例2: generatePagesSitemap
function generatePagesSitemap()
{
$sitemap = new Sitemap(SITE_DOMAIN);
$sitemap->setPath(DOC_ROOT . '/');
$sitemap->setFilename('page');
$posts = new Posts();
$sitemap->addItem('', '1.0', 'daily', 'Today');
while ($row = $posts->getPostsLoop(null, 'page')) {
$sitemap->addItem($posts->getPostPermLink($row['ID'], $row['post_type'], $row['link_title']), '0.8', 'weekly', $row['post_date']);
}
$sitemap->createSitemapIndex(SITE_DOMAIN, 'Today');
}
示例3: Sitemap
<?
include 'Sitemap.php';
include '../config/settings.inc.php';
$sitemap = new Sitemap('http://www.roseindigo.com');
$sitemap->setPath('maps/');
// $sitemap->addItem('/filles/naissance', '1.0', 'daily', 'Today');
$sitemap->setFilename('categories');
// VENDEZ
$sitemap->addItem("/vendez", '0.5', 'daily', 'Today');
$sitemap->addItem("/concept", '0.5', 'daily', 'Today');
$sitemap->addItem("/livre-d-or", '0.5', 'daily', 'Today');
// MARQUES
$servername = _DB_SERVER_;
$username = _DB_USER_;
$password = _DB_PASSWD_;
// Create connection
$conn = new mysqli($servername, $username, $password);
$conn->select_db("presta");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// print_r( "Connected successfully !!!!<br/>");
// print_r($conn);
示例4: Sitemap
<?
include 'Sitemap.php';
include '../config/settings.inc.php';
$sitemap = new Sitemap('http://www.roseindigo.com');
$sitemap->setPath('maps/');
// $sitemap->addItem('/filles/naissance', '1.0', 'daily', 'Today');
$sitemap->setFilename('products');
$servername = _DB_SERVER_;
$username = _DB_USER_;
$password = _DB_PASSWD_;
// Create connection
$conn = new mysqli($servername, $username, $password);
$conn->select_db("presta");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// print_r( "Connected successfully !!!!<br/>");
// print_r($conn);
if ($result = $conn->query("SELECT DATABASE()")) {
$row = $result->fetch_row();