PHPBB3的百度sitemap生成器代码
02 error_reporting(0);
03 define('IN_PHPBB', true);
04 $phpbb_root_path = './';
05 $phpEx = substr(strrchr(__FILE__, '.'), 1);
06
07 include($phpbb_root_path . 'config.' . $phpEx);
08 include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
09
10 $db = new $sql_db();
11
12 $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
13
14 if(PHP_VERSION
15 $_GET = &$HTTP_GET_VARS;
16 $_SERVER = &$HTTP_SERVER_VARS;
17 }
18
19
20 $maxitemnum = 500;
21 $timestamp = time();
22 $PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
23 $boardurl = 'http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1);
24
25 $sitemapfile = $phpbb_root_path.'./cache/baidu_sitemap.xml';
26 echo $xmlfiletime = @filemtime($sitemapfile);
27
28 header("Content-type: application/xml");
29
30 $xmlcontent = "n".
31 "
32
33 if($timestamp - $xmlfiletime >= 8 * 3600) {
34 $xmlfiletime = $timestamp - 8 * 3600;
35
36 $sql = 'SELECT * FROM '.$table_prefix.'topics WHERE topic_time > '.$xmlfiletime.' LIMIT '.$maxitemnum;
37 $result = $db->sql_query($sql);
38
39 $xmlcontent .= "
40 "
41 "
42 "
43 "
44
45 while ($data=$db->sql_fetchrow($result)) {
46 print_r($data);
47 $xmlcontent .= "
48 " {$boardurl}viewforum.php?f={$data['forum_id']}&t={$data['topic_id']}n".
49 "
50 "
51 "
52 "
53 "
54 "
55 "
56 " n";
57 }
58
59 $xmlcontent .= "";
60 if($fp = @fopen($sitemapfile, 'w')) {
61 fwrite($fp, $xmlcontent);
62 flock($fp, 2);
63 fclose($fp);
64 }
65
66 echo $xmlcontent;
67
68 } else {
69
70 @readfile($sitemapfile);
71
72 }

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

WebStorm Mac版
好用的JavaScript開發工具

記事本++7.3.1
好用且免費的程式碼編輯器

Atom編輯器mac版下載
最受歡迎的的開源編輯器

SecLists
SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。