예제 #1
0
파일: sitemap.php 프로젝트: MikeCoder/mblog
function sitemap_update()
{
    require_once EMLOG_ROOT . '/content/plugins/sitemap/class.sitemap.php';
    extract(sitemap_config());
    $sitemap = new sitemap($sitemap_name);
    return $sitemap->build();
}
예제 #2
0
function callback_init()
{
    require_once EMLOG_ROOT . '/content/plugins/sitemap/class.sitemap.php';
    require_once EMLOG_ROOT . '/content/plugins/sitemap/sitemap.php';
    extract(sitemap_config());
    $sitemap = new sitemap($sitemap_name);
    $sitemap->build();
}
예제 #3
0
 /**
  * Обновляет (дописывает новыми данными) карту нужного типа.
  *
  * @param string $type   тип. карты.
  * @param boolean $send   отправлять ли в гугул индекс.
  */
 static function update($type, $send = true)
 {
     $smap = new sitemap($type);
     $smap->_update($send);
 }
예제 #4
0
 /**
  * Process datatables re-order ajax request.
  * Used by 'Datatables'
  * @return \Illuminate\Http\JsonResponse
  */
 public function sort(Request $request)
 {
     $sortArray = $request->get('sortable_');
     if (is_null($sortArray)) {
         $data = ['status' => 'warning', 'statusText' => 'Geen update', 'responseText' => 'Er was geen wijziging!? (sortArray is null)'];
         return response()->json($data, 400);
     }
     try {
         $cnt = 0;
         foreach ($sortArray as $key => $sitemapId) {
             $sitemap = sitemap::find($sitemapId);
             $sitemap->timestamps = false;
             $sitemap->order_by_number = ++$cnt;
             $sitemap->save();
             //- See more at: http://findnerd.com/list/view/Update-without-touching-timestamps-Laravel/10269/#sthash.8m6PWJpT.dpuf
             //Sitemap::where('id',$sitemapId)->update(['order_by_number'=>++$cnt]);
         }
         $data = ['status' => 'success', 'statusText' => 'Update is gelukt', 'responseText' => 'De volgorde is aangepast'];
         return response()->json($data, 200);
     } catch (\Exception $e) {
         $data = ['status' => 'danger', 'statusText' => 'Update is mislukt!', 'responseText' => '' . $e->getMessage() . '<br>line: (' . $e->getLine() . ')<bR>file: (' . $e->getFile() . ')'];
         return response()->json($data, 400);
     }
     return "sort";
 }
예제 #5
0
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/payed.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/pay_place.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/rating.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/account.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/banners.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/maintenance.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/search_parser.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/project_exrates.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/static_compress.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/blogs.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/commune.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/spam.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/commune.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/articles.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users_suspicious_contacts.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/firstpage.php';
sitemap::create('blogs', false);
sitemap::create('projects', false);
sitemap::create('commune', false);
sitemap::create('articles', false);
sitemap::create('interview', false);
sitemap::create('portfolio', false);
sitemap::create('users', false);
sitemap::create('catalog', false);
sitemap::create('userpages', false);
sitemap::generateMainSitemap();
예제 #6
0
        foreach ($this->urls as $link => $status) {
            set_time_limit(10);
            if ($status == self::COMPLETE) {
                $parts = explode("/", trim(parse_url($link, PHP_URL_PATH), "/"));
                if (trim($parts[0]) == '') {
                    $level = 1;
                } else {
                    $level = count($parts) + 1;
                }
                $priority = round(1 / $level, 4);
                $urls[] = array('loc' => $link, 'lastmod' => date('Y-m-d H:i:s'), 'changefreq' => 'daily', 'priority' => $priority);
            }
        }
        print_r($urls);
    }
    private function log($msg)
    {
        echo "<pre>" . $msg . "</pre>";
        flush();
        ob_flush();
        flush();
        ob_flush();
    }
}
$sitemap = new sitemap('http://example.com/');
$sitemap->ignoreLiteral(".pdf");
$sitemap->ignoreLiteral("mailto");
$sitemap->ignoreLiteral("javascript");
$sitemap->ignoreLiteral("()");
$sitemap->Execute();
$sitemap->build();
예제 #7
0
파일: sitemaps.php 프로젝트: netroby/ecshop
    {
        $all = $this->head;
        $all .= $this->item;
        $all .= $this->footer;
        return $all;
    }
}
define('IN_ECS', true);
define('INIT_NO_USERS', true);
define('INIT_NO_SMARTY', true);
require dirname(__FILE__) . '/includes/init.php';
if (file_exists(ROOT_PATH . DATA_DIR . '/sitemap.dat') && time() - filemtime(ROOT_PATH . DATA_DIR . '/sitemap.dat') < 86400) {
    $out = file_get_contents(ROOT_PATH . DATA_DIR . '/sitemap.dat');
} else {
    $site_url = rtrim($ecs->url(), '/');
    $sitemap = new sitemap();
    $config = unserialize($_CFG['sitemap']);
    $item = array('loc' => "{$site_url}/", 'lastmod' => local_date('Y-m-d'), 'changefreq' => $config['homepage_changefreq'], 'priority' => $config['homepage_priority']);
    $sitemap->item($item);
    /* 商品分类 */
    $sql = 'SELECT cat_id,cat_name FROM ' . $ecs->table('category') . ' ORDER BY parent_id';
    $res = $db->query($sql);
    while ($row = $db->fetchRow($res)) {
        $item = array('loc' => "{$site_url}/" . build_uri('category', array('cid' => $row['cat_id']), $row['cat_name']), 'lastmod' => local_date('Y-m-d'), 'changefreq' => $config['category_changefreq'], 'priority' => $config['category_priority']);
        $sitemap->item($item);
    }
    /* 文章分类 */
    $sql = 'SELECT cat_id,cat_name FROM ' . $ecs->table('article_cat') . ' WHERE cat_type=1';
    $res = $db->query($sql);
    while ($row = $db->fetchRow($res)) {
        $item = array('loc' => "{$site_url}/" . build_uri('article_cat', array('acid' => $row['cat_id']), $row['cat_name']), 'lastmod' => local_date('Y-m-d'), 'changefreq' => $config['category_changefreq'], 'priority' => $config['category_priority']);
예제 #8
0
파일: index.php 프로젝트: chegestar/catroxs
        }
        // Дата последнего посещения
        $last = isset($_GET['last']) ? intval($_GET['last']) : $datauser['lastdate'];
        echo '</ul></p></div><div class="phdr">' . $lng['last_visit'] . ': ' . date("d.m.Y (H:i)", $last) . '</div>';
        break;
    default:
        /*
        -----------------------------------------------------------------
        Главное меню сайта
        -----------------------------------------------------------------
        */
        if (isset($_SESSION['ref'])) {
            unset($_SESSION['ref']);
        }
        $headmod = 'mainpage';
        require 'incfiles/head_shout.php';
        include 'pages/mainmenu.php';
        /*
        -----------------------------------------------------------------
        Карта сайта
        -----------------------------------------------------------------
        */
        if (isset($set['sitemap'])) {
            $set_map = unserialize($set['sitemap']);
            if (($set_map['forum'] || $set_map['lib']) && ($set_map['users'] || !$user_id) && ($set_map['browsers'] || !$is_mobile)) {
                $map = new sitemap();
                echo '<div class="sitemap">' . $map->site() . '</div>';
            }
        }
}
require 'incfiles/end.php';
예제 #9
0
 public function generate()
 {
     require "libs/sitemap.php";
     $sitemap = new sitemap(URL);
     //$sitemap->setPath(URL.'xmls/');
     $sitemap->setPath('/home/u177922748/public_html/');
     $sitemap->setFilename('sitemap');
     $sitemap->addItem('', '0.9', 'weekly', 'Jun 25');
     $sitemap->addItem('postjob', '0.4', 'monthly', 'Jun 25');
     $sitemap->addItem('login', '0.4', 'monthly', 'Jun 25');
     $sitemap->addItem('contactus', '0.4', 'monthly', 'Jun 25');
     $sitemap->addItem('terms', '0.4', 'monthly', 'Jun 25');
     $sitemap->addItem('privacy', '0.4', 'monthly', 'Jun 25');
     $sitemap->addItem('signup', '0.4', 'monthly', 'Jun 25');
     $posts = $this->model->sitemapList();
     foreach ($posts as $post) {
         $sitemap->addItem('jobs/view/' . $post['postid'], '0.7', 'weekly', $post['date_create']);
     }
     $sitemap->createSitemapIndex(URL, 'Today');
     header('location:' . URL . 'feedback');
 }
예제 #10
0
<?php

chdir(dirname(__FILE__));
require_once '../classes/config.php';
require_once '../classes/stdf.php';
require_once '../classes/sitemap.php';
sitemap::create('articles', false);
sitemap::create('interview', false);
sitemap::create('portfolio', false);
sitemap::create('users', false);
예제 #11
0
<?php

require_once 'kernel/lib/sitemap/sitemap.php';
$sitemap = new sitemap();
echo $sitemap->generate('http://digiseo.ir');
예제 #12
0
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/banners.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/maintenance.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/search_parser.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/project_exrates.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/static_compress.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/blogs.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/commune.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/spam.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/commune.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/articles.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users_suspicious_contacts.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/firstpage.php';
/*
sitemap::create('blogs', false);
sitemap::create('projects', false);
sitemap::create('commune', false);
sitemap::create('articles', false);
sitemap::create('interview', false);
sitemap::create('portfolio', false);
sitemap::create('users', false);
sitemap::create('catalog', false);
sitemap::create('userpages', false);
*/
sitemap::create('catalog', false);
//sitemap::update('catalog', false);
//sitemap::create('projects', false);
//sitemap::update('projects', false);
//sitemap::generateMainSitemap();
예제 #13
0
<?php

chdir(dirname(__FILE__));
require_once "../stdf.php";
require_once "../sitemap.php";
$help = "\n--blogs\t\tCreate blogs sitemap\n\n--commune\tCreate commune sitemap\n  \n--projects\tCreate project sitemap\n  \n--users\tCreate users sitemap\n\n--portfolio\tCreate portfolio sitemap\n\n--articles\tCreate articles sitemap\n\n--interview\tCreate interview sitemap\n\n--regions\tCreate region sitemap\n\n--catalog\tCreate freelancers catalog sitemap\n\n--userpages\tCreate user pages sitemap\n\n--tservices\tCreate tservices sitemap\n\n";
$type = preg_replace('/^--/', '', $argv[1]);
$send = SERVER === 'release';
if ($type == 'all') {
    foreach (sitemap::$types as $t => $p) {
        sitemap::create($t, $send);
    }
    sitemap::generateMainSitemap();
    if ($send) {
        sitemap::send();
    }
} else {
    if (sitemap::$types[$type]) {
        sitemap::create($type, $send);
        sitemap::generateMainSitemap();
        if ($send) {
            sitemap::send();
        }
    } else {
        echo $help;
    }
}
예제 #14
0
<?php

if (!defined('IN_AJAX')) {
    die(basename(__FILE__));
}
global $bb_cfg, $lang;
$mode = (string) $this->request['mode'];
$map = new sitemap();
$html = '';
switch ($mode) {
    case 'create':
        $map->create();
        if (@file_exists(SITEMAP_DIR . 'sitemap.xml')) {
            $html .= $lang['SITEMAP_CREATED'] . ': <b>' . bb_date(TIMENOW, $bb_cfg['post_date_format']) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap.xml') . '" target="_blank">' . make_url('sitemap.xml') . '</a>';
        } else {
            $html .= $lang['SITEMAP_NOT_CREATED'];
        }
        break;
    case 'search_update':
        if (!@file_exists(SITEMAP_DIR . 'sitemap.xml')) {
            $map->create();
        }
        $map_link = make_url(SITEMAP_DIR . 'sitemap.xml');
        if (strpos($map->send_url("http://google.com/webmasters/sitemaps/ping?sitemap=", $map_link), "successfully added") !== false) {
            $html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Google: <font style="color: green;">' . $lang['SITEMAP_SENT'] . '</font>';
        } else {
            $html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Google: <font style="color: red;">' . $lang['SITEMAP_ERROR'] . '</font> URL: <a href="http://google.com/webmasters/sitemaps/ping?sitemap=' . urlencode($map_link) . '" target="_blank">http://google.com/webmasters/sitemaps/ping?sitemap=' . $map_link . '</a>';
        }
        if (strpos($map->send_url("http://ping.blogs.yandex.ru/ping?sitemap=", $map_link), "OK") !== false) {
            $html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Yandex: <font style="color: green;">' . $lang['SITEMAP_SENT'] . '</font>';
        } else {
예제 #15
0
		$smarty_q->assign("author_profession_de", $quotes_temp[0]["author_profession_de"]);
		$smarty_q->assign("author_name_freeform_et", $quotes_temp[0]["author_name_freeform_et"]);
		$smarty_q->assign("author_name_freeform_en", $quotes_temp[0]["author_name_freeform_en"]);
		$smarty_q->assign("author_name_freeform_de", $quotes_temp[0]["author_name_freeform_de"]);
		$smarty_q->assign("url_friendly_author_name_et", $quotes_temp[0]["url_friendly_author_name_et"]);
		$smarty_q->assign("url_friendly_author_name_en", $quotes_temp[0]["url_friendly_author_name_en"]);
		$smarty_q->assign("url_friendly_author_name_de", $quotes_temp[0]["url_friendly_author_name_de"]);
		$smarty_q->assign("author_wiki_url_et", $quotes_temp[0]["author_wiki_url_et"]);
		$smarty_q->assign("author_wiki_url_en", $quotes_temp[0]["author_wiki_url_en"]);
		$smarty_q->assign("author_wiki_url_de", $quotes_temp[0]["author_wiki_url_de"]);
		break;
	case "generate_indexes":
		acl();
		tag::generate_index();
		robots::generate("robots_".$config_q["locale"].".txt");
		sitemap::generate("sitemap_".$config_q["locale"].".xml");
		die("done");
		break;
	case "find_similar_quotes":
		acl();
		quote::find_similar_quotes();
		break;
	case "get_new_quotes_from_zitate_de":
		acl();
		quote::get_new_quotes_from_zitate_de();
		break;
	case "admin":
		acl();
		echo "admin";
		break;
	case "userprofile":
예제 #16
0
<?php

if (!defined('BB_ROOT')) {
    die(basename(__FILE__));
}
require CLASS_DIR . 'sitemap.php';
$map = new sitemap();
$map->create();
if (@file_exists(BB_ROOT . "/sitemap/sitemap.xml")) {
    $map_link = make_url('/sitemap/sitemap.xml');
    $map->send_url("http://google.com/webmasters/sitemaps/ping?sitemap=", $map_link);
    $map->send_url("http://ping.blogs.yandex.ru/ping?sitemap=", $map_link);
    $map->send_url("http://www.bing.com/ping?sitemap=", $map_link);
    $map->send_url("http://rpc.weblogs.com/pingSiteForm?name=InfraBlog&url=", $map_link);
}
예제 #17
0
<?php

/**
* @package     JohnCMS
* @link        http://johncms.com
* @copyright   Copyright (C) 2008-2011 JohnCMS Community
* @license     LICENSE.txt (see attached file)
* @version     VERSION.txt (see attached file)
* @author      http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
require '../incfiles/core.php';
$textl = $lng['library'];
require '../incfiles/head.php';
$map = new sitemap();
echo $map->library_contents();
require '../incfiles/end.php';
<?php

/*
 * @CODOLICENSE
 */
$smarty = \CODOF\Smarty\Single::get_instance();
require_once 'sitemap_gen.php';
class sitemap
{
    static function run()
    {
        if (isset($_GET['site_url']) && isset($_GET['sitemap_url']) && CODOF\Access\CSRF::valid($_GET['CSRF_token'])) {
            $sitemapObject = new Crawler($_GET['site_url']);
            $sitemapPath = ABSPATH . 'sitemap.xml';
            $sitemapFile = $sitemapObject->createSitemap($sitemapPath);
            // session_write_close();
            // ob_end_flush();
            exit;
        }
    }
}
sitemap::run();
$content = $smarty->fetch('system/sitemap.tpl');
예제 #19
0
<?php

include_once 'extension/googlesitemapgenerator/classes/sitemap.php';
$sitemap = new sitemap();
$sitemap->genereate();
예제 #20
0
<?php

/**
* @package     JohnCMS
* @link        http://johncms.com
* @copyright   Copyright (C) 2008-2011 JohnCMS Community
* @license     LICENSE.txt (see attached file)
* @version     VERSION.txt (see attached file)
* @author      http://johncms.com/about
*/
define('_IN_JOHNCMS', 1);
require '../incfiles/core.php';
$textl = $lng['forum'];
require '../incfiles/head.php';
$map = new sitemap();
echo $map->forum_contents();
require '../incfiles/end.php';
예제 #21
0
 public function build()
 {
     $return_struct = array('status' => 0, 'code' => 501, 'msg' => 'Not Implemented', 'content' => array());
     try {
         //$profiler = new Profiler;
         //* 初始化返回数据 */
         $return_data = array();
         //* 收集请求数据 ==根据业务逻辑定制== */
         $request_data = $this->input->post();
         //* 实现功能后屏蔽此异常抛出 */
         //throw new MyRuntimeException('Not Implemented',501);
         //权限验证
         if ($this->site_id == 0) {
             throw new MyRuntimeException(Kohana::lang('o_global.select_site'), 400);
         }
         role::check('default', $this->site_id, 0);
         // 调用底层服务
         $sitemap_service = SitemapService::get_instance();
         //业务逻辑
         $xmlContent = '';
         $xmlContent .= '<?xml version="1.0" encoding="UTF-8"?>';
         $xmlContent .= '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
         //添加首页
         if (!empty($request_data['index']) && is_numeric($request_data['index'])) {
             $priority = number_format($request_data['index'], 1);
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.bad_request'), 404);
         }
         $site_domain = Mysite::instance($this->site_id)->get('domain');
         $xmlContent .= sitemap::Render('http://' . $site_domain, 0, 'always', $priority);
         //添加分类页面
         $categories = $sitemap_service->get_category_page_by_site_id($this->site_id);
         if (!empty($request_data['category']) && is_numeric($request_data['category'])) {
             $priority = number_format($request_data['category'], 1);
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.bad_request'), 404);
         }
         if (!empty($categories)) {
             foreach ($categories as $category) {
                 if (empty($request_data['exclude_category']) || !empty($request_data['exclude_category']) && !in_array($category['id'], $request_data['exclude_category'])) {
                     $xmlContent .= sitemap::Render(category::permalink($category['id']), 0, 'weekly', $priority);
                 }
             }
         }
         //添加商品页面
         if (!empty($request_data['product']) && is_numeric($request_data['product'])) {
             $priority = number_format($request_data['product'], 1);
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.bad_request'), 404);
         }
         if (isset($request_data['on_sale'])) {
             $on_sale = intval($request_data['on_sale']);
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.bad_request'), 404);
         }
         $products = $sitemap_service->get_product_page_by_site_id($this->site_id, $on_sale);
         if (!empty($request_data['exclude_product'])) {
             if (preg_match('/^([a-zA-Z0-9_]+,)*[a-zA-Z0-9_]+$/i', $request_data['exclude_product'])) {
                 $request_data['exclude_product'] = explode(',', $request_data['exclude_product']);
             } else {
                 throw new MyRuntimeException(Kohana::lang('o_site.product_id_format_check'), 404);
             }
         }
         if (!empty($products)) {
             foreach ($products as $product) {
                 if (empty($request_data['exclude_product'])) {
                     $xmlContent .= sitemap::Render(product::permalink($product['id']), $product['update_timestamp'], 'weekly', $priority);
                 } elseif (!empty($request_data['exclude_product']) && !in_array($product['sku'], $request_data['exclude_product'])) {
                     $xmlContent .= sitemap::Render(product::permalink($product['id']), $product['update_timestamp'], 'weekly', $priority);
                 }
             }
         }
         //添加促销页
         if (!empty($request_data['promotion']) && is_numeric($request_data['promotion'])) {
             $priority = number_format($request_data['promotion'], 1);
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.bad_request'), 404);
         }
         $promotions = $sitemap_service->get_promotion_page_by_site_id($this->site_id);
         if (!empty($promotions)) {
             $route = Myroute::instance()->get();
             $action = $route['promotion'];
             foreach ($promotions as $promotion) {
                 $xmlContent .= sitemap::Render('http://' . $site_domain . '/' . $action . '/' . $promotion['id'], time(), 'weekly', $priority);
             }
         }
         //添加文案页
         if (!empty($request_data['doc']) && is_numeric($request_data['doc'])) {
             $priority = number_format($request_data['doc'], 1);
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.bad_request'), 404);
         }
         $docs = $sitemap_service->get_doc_page_by_site_id($this->site_id);
         if (!empty($docs)) {
             foreach ($docs as $doc) {
                 $lastmod = strtotime($doc['updated']);
                 $xmlContent .= sitemap::Render('http://' . $site_domain . '/' . $doc['permalink'], $lastmod, 'weekly', $priority);
             }
         }
         $xmlContent .= '</urlset>';
         $data['sitemap'] = $xmlContent;
         if (!Mysite_detail::instance()->update_by_site_id($this->site_id, $data)) {
             throw new MyRuntimeException(Kohana::lang('o_site.sitemap_error_handle'), 500);
         }
         //* 补充&修改返回结构体 */
         $return_struct['status'] = 1;
         $return_struct['code'] = 200;
         $return_struct['msg'] = '操作成功';
         $return_struct['content'] = $return_data;
         $return_struct['action'] = array('type' => 'location', 'url' => url::base() . 'site/sitemap');
         //* 请求类型 */
         if ($this->is_ajax_request()) {
             // ajax 请求
             // json 输出
             $this->template->content = $return_struct;
         } else {
             // html 输出
             $this->template->return_struct = $return_struct;
             $content = new View('info');
             $this->template->content = $content;
             //* 请求结构数据绑定 */
             $this->template->content->request_data = $request_data;
             //* 返回结构体绑定 */
             $this->template->content->return_struct = $return_struct;
         }
         // end of request type determine
     } catch (MyRuntimeException $ex) {
         $return_struct['status'] = 0;
         $return_struct['code'] = $ex->getCode();
         $return_struct['msg'] = $ex->getMessage();
         //TODO 异常处理
         //throw $ex;
         if ($this->is_ajax_request()) {
             $this->template->content = $return_struct;
         } else {
             $this->template->return_struct = $return_struct;
             $content = new View('info');
             $this->template->content = $content;
             //* 请求结构数据绑定 */
             $this->template->content->request_data = $request_data;
             //* 返回结构体绑定 */
             $this->template->content->return_struct = $return_struct;
         }
     }
 }
예제 #22
0
} catch (Exception $e) {
    $log->TRACE($e->getMessage());
}
try {
    $log->TRACE(sitemap::update('userpages'));
} catch (Exception $e) {
    $log->TRACE($e->getMessage());
}
try {
    $log->TRACE(sitemap::update('tservices'));
} catch (Exception $e) {
    $log->TRACE($e->getMessage());
}
try {
    $log->TRACE(sitemap::generateMainSitemap());
    $log->TRACE(sitemap::send());
} catch (Exception $e) {
    $log->TRACE($e->getMessage());
}
// Чистим сессии загруженны, но не использованных файлов
$log->TRACE(attachedfiles::clearOldSessions());
//------------------------------------------------------------------------------
// Рассылка ПРО о том что ПРО закончится через день
// Вызываем для тех у кого включена опция и для тех у кого нет
// но сообщение в итоге шлем всем одинаковое см getPROEnding
// так как пока автопродление неиспользуется
$log->TRACE(payed::getPROEnding(true, 3));
// За 3 дня для тех у кого включено автопродление
$log->TRACE(payed::getPROEnding(true, 1));
// За 1 день для тех у кого включено автопродление
$log->TRACE(payed::getPROEnding(false, 3));
예제 #23
0
파일: index.php 프로젝트: saintho/phpdisk
$C[last_file] = get_last_file(15);
$C[hot_file] = get_hot_file(15);
if ($auth[is_fms]) {
    $C[links_arr] = get_friend_link();
    $C[last_users] = get_last_user_list(5);
    $C[last_one] = index_last();
    $C[ann_list] = get_announces();
    $C[index_tags] = get_last_tag();
    $C[commend_file] = get_commend_file(15);
}
require_once template_echo('phpdisk', $user_tpl_dir);
$f = PHPDISK_ROOT . "./system/global/stats.inc.php";
if (!file_exists($f) || $timestamp - @filemtime($f) > 3600) {
    stats_cache();
}
sitemap::build();
include PHPDISK_ROOT . "./includes/footer.inc.php";
function get_last_user_list($num = 10)
{
    global $db, $tpf;
    $q = $db->query("select username,reg_time from {$tpf}users order by userid desc limit {$num}");
    $last_users = array();
    while ($rs = $db->fetch_array($q)) {
        $rs[a_space] = urr("space", "username=" . rawurlencode($rs[username]));
        $rs[reg_time] = date('Y-m-d', $rs[reg_time]);
        $last_users[] = $rs;
    }
    $db->free($q);
    unset($rs);
    return $last_users;
}