| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?php
- define('IN_SMT', true);
- define('CURSCRIPT', 'sitemap');
- define('IN_MYMPS', true);
- require_once dirname(__FILE__) . '/include/global.php';
- require_once dirname(__FILE__) . '/data/config.php';
- require_once MYMPS_DATA . '/config.db.php';
- require_once MYMPS_INC . '/db.class.php';
- @header('Content-type: text/xml');
- @header('Content-Type: text/html; charset=utf-8');
- !in_array($part, array('info', 'category', 'news', 'store', 'docu')) && $part == 'info';
- $mayi = '<?xml version="1.0" encoding="UTF-8"?>
- <urlset>
- ';
- switch ($part) {
- case 'info':
- $info = mymps_get_infos(5000);
- if (is_array($info)) {
- foreach ($info as $k => $v) {
- $mayi .= '<url>
- <loc>';
- $mayi .= $mymps_global['SiteUrl'] . $v['uri'] . '</loc>
- ';
- $mayi .= '<lastmod>';
- $mayi .= GetTime($v['begintime'], 'Y-m-d H:i:s');
- $mayi .= '</lastmod>
- ';
- $mayi .= '<changefreq>weekly</changefreq>
- ';
- $mayi .= '<priority>0.9</priority>
- ';
- $mayi .= '</url>
- ';
- }
- }
- break;
- case 'category':
- $categories = get_categories_tree(0, 'category');
- if (is_array($categories)) {
- foreach ($categories as $k => $v) {
- $mayi .= '<url>
- <loc>';
- $mayi .= $v[uri] . '</loc>
- ';
- $mayi .= '<lastmod>';
- $mayi .= GetTime($timestamp, 'Y-m-d');
- $mayi .= '</lastmod>
- ';
- $mayi .= '<changefreq>daily</changefreq>
- ';
- $mayi .= '<priority>0.9</priority>
- ';
- $mayi .= '</url>
- ';
- if (is_array($v[children])) {
- foreach ($v[children] as $u => $w) {
- $mayi .= '<url>
- <loc>';
- $mayi .= $w[uri] . '</loc>
- ';
- $mayi .= '<lastmod>';
- $mayi .= GetTime($timestamp, 'Y-m-d');
- $mayi .= '</lastmod>
- ';
- $mayi .= '<changefreq>daily</changefreq>
- ';
- $mayi .= '<priority>0.8</priority>
- ';
- $mayi .= '</url>
- ';
- }
- }
- }
- }
- break;
- case 'store':
- $store = mymps_get_members(5000);
- if (is_array($store)) {
- foreach ($store as $k => $v) {
- $mayi .= '<url>
- <loc>';
- $mayi .= $mymps_global['SiteUrl'] . $v['uri'] . '</loc>
- ';
- $mayi .= '<lastmod>';
- $mayi .= GetTime($v['jointime'], 'Y-m-d H:i:s');
- $mayi .= '</lastmod>
- ';
- $mayi .= '<changefreq>daily</changefreq>
- ';
- $mayi .= '<priority>0.9</priority>
- ';
- $mayi .= '</url>
- ';
- }
- }
- break;
- case 'news':
- $news = mymps_get_news(5000);
- if (is_array($news)) {
- foreach ($news as $k => $v) {
- $mayi .= '<url>
- <loc>';
- $mayi .= $mymps_global['SiteUrl'] . $v['uri'] . '</loc>
- ';
- $mayi .= '<lastmod>';
- $mayi .= GetTime($v['begintime'], 'Y-m-d H:i:s');
- $mayi .= '</lastmod>
- ';
- $mayi .= '<changefreq>daily</changefreq>
- ';
- $mayi .= '<priority>0.9</priority>
- ';
- $mayi .= '</url>
- ';
- }
- }
- break;
- case 'docu':
- $docu = get_member_docu(1000);
- if (is_array($docu)) {
- foreach ($docu as $k => $v) {
- $mayi .= '<url>
- <loc>';
- $mayi .= $mymps_global['SiteUrl'] . $v['uri'] . '</loc>
- ';
- $mayi .= '<lastmod>';
- $mayi .= GetTime($v['pubtime'], 'Y-m-d H:i:s');
- $mayi .= '</lastmod>
- ';
- $mayi .= '<changefreq>weekly</changefreq>
- ';
- $mayi .= '<priority>0.9</priority>
- ';
- $mayi .= '</url>
- ';
- }
- }
- break;
- }
- $mayi .= '</urlset>';
- echo $mayi;
- is_object($db) && $db->Close();
- $db = $db_mymps = NULL;
- ?>
|