<?php /* Sitemap generator for Bo-Blog 2.0.x Written by Bob Updated on 2006-11-26 */ //How many items are included? $entrynumber = 500; //No need to change anything below error_reporting(0); define("noCounter", 1); include_once "function.php"; $smentries = GetNewPosts($entrynumber, 'blogid,pubtime,edittime,blogalias'); $outputxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n"; $outputxml .= "<url>\n<loc>{$config['blogurl']}/index.php</loc>\n<lastmod>" . gmdate("Y-m-d\\TH:i:s+00:00") . "</lastmod>\n<changefreq>always</changefreq>\n<priority>1.0</priority>\n</url>\n"; if (is_array($smentries)) { foreach ($smentries as $entry) { $entryurl = "{$config['blogurl']}/" . getlink_entry($entry['blogid'], $entry['blogalias']); $entrytime = $entry['edittime'] ? $entry['edittime'] : $entry['pubtime']; $entrytime = gmdate("Y-m-d\\TH:i:s+00:00", $entrytime); $outputxml .= "<url>\n<loc>{$entryurl}</loc>\n<lastmod>{$entrytime}</lastmod>\n<changefreq>always</changefreq>\n<priority>1.0</priority>\n</url>\n"; } } $outputxml .= "</urlset>"; @header("Content-Type: application/xml; charset=utf-8"); die($outputxml);
if (!$_SESSION['permissions']['csearch']) { // No. Let them know the bad news. Unauthorized(); } // Get the information of each forum. list($aCategory, $aForum) = GetForumInfo(); // What are they wanting to do? switch ($_REQUEST['action']) { case 'showresult': ShowResult(); case 'query': Query(); case 'finduser': FindUser(); case 'getnew': GetNewPosts(); case 'getdaily': GetDailyPosts(); } // Search page template require "./skins/{$CFG['skin']}/search/main.tpl.php"; // *************************************************************************** \\ function Query() { // Are they searching by keyword or username? if (trim($_REQUEST['keywordsearch']) != '') { // Keyword KeywordSearch(); } else { if (trim($_REQUEST['usersearch']) != '') { // Username
<?php //Some changes //Time format $timeformat = "<b>n</b> 月 <b>j</b> 日"; require "function.php"; $newvolume = $_GET['n']; $target = $_GET['target']; $category = $_GET['category']; $time = $_GET['time']; $targets = $target == '' ? '' : " target='{$target}'"; $number = $newvolume == '' ? 5 : floor($newvolume); $category = $category == '' ? '' : floor($category); $news = GetNewPosts($number, 'blogid,title,pubtime,blogalias', 0, $category); if (!is_array($news)) { exit; } else { foreach ($news as $entry) { $times = $time == 1 ? "" . gmdate($timeformat, $entry['pubtime'] + $config['timezone'] * 3600) . "" : ''; $show .= "<li><a href='{$config['blogurl']}/" . getlink_entry($entry['blogid'], $entry['blogalias']) . "'{$targets}><span class='blog-post-title'>{$entry['title']}</span> </a><span class='blog-post-date'> {$times}</span></li>"; } } @header("Content-Type: text/javascript; charset=utf-8"); die("document.write(\"<ul>{$show}</ul>\");");