Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
Re-add site map
Browse files Browse the repository at this point in the history
  • Loading branch information
hoaquynhtim99 committed May 19, 2016
1 parent 9354537 commit e906992
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions modules/video-clip/funcs/sitemap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* @Project VIDEO CLIPS AJAX 4.x
* @Author PHAN TAN DUNG ([email protected])
* @Copyright (C) 2014 PHAN TAN DUNG. All rights reserved
* @License GNU/GPL version 2 or any later version
* @Createdate Dec 01, 2014, 04:33:14 AM
*/

if (!defined('NV_IS_MOD_VIDEOCLIPS'))
die('Stop!!!');

$url = array();
$cacheFile = NV_LANG_DATA . '_sitemap_' . NV_CACHE_PREFIX . '.cache';
$pa = NV_CURRENTTIME - 7200;

if (($cache = $nv_Cache->getItem($module_name, $cacheFile)) != false and filemtime(NV_ROOTDIR . '/' . NV_CACHEDIR . '/' . $module_name . '/' . $cacheFile) >= $pa) {
$url = unserialize($cache);
} else {
$sql = "SELECT alias,addtime FROM " . NV_PREFIXLANG . "_" . $module_data . "_clip WHERE status=1";
$result = $db->query($sql);
while (list($alias, $publtime) = $result->fetch(3)) {
$url[] = array('link' => NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=" . $alias . $global_config['rewrite_exturl'], 'publtime' => $publtime);
}

$cache = serialize($url);
$nv_Cache->setItem($module_name, $cacheFile, $cache);
}

nv_xmlSitemap_generate($url);
die();

0 comments on commit e906992

Please sign in to comment.