OSDN Git Service

e23011b9b69e5cc383d92dde39ae10fb830ad609
[idb/iDB.git.git] / inc / rssfeed.php
1 <?php
2 /*
3     This program is free software; you can redistribute it and/or modify
4     it under the terms of the Revised BSD License.
5
6     This program is distributed in the hope that it will be useful,
7     but WITHOUT ANY WARRANTY; without even the implied warranty of
8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9     Revised BSD License for more details.
10
11     Copyright 2004-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12     Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13
14     $FileInfo: rssfeed.php - Last Update: 08/02/2019 SVN 905 - Author: cooldude2k $
15 */
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="rssfeed.php"||$File3Name=="/rssfeed.php") {
18         require('index.php');
19         exit(); }
20 if(!isset($_GET['debug'])) { $_GET['debug'] = null; }
21 if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
22 $boardsname = htmlentities($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
23 $boardsname = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $boardsname);
24 $_GET['feedtype'] = strtolower($_GET['feedtype']);
25 if($_GET['feedtype']!="rss"&&$_GET['feedtype']!="atom"&&$_GET['feedtype']!="oldrss"&&
26         $_GET['feedtype']!="opml"&&$_GET['feedtype']!="opensearch") { 
27         $_GET['feedtype'] = "rss"; }
28 //$basepath = pathinfo($_SERVER['REQUEST_URI']);
29 /*if(dirname($_SERVER['REQUEST_URI'])!="."||
30         dirname($_SERVER['REQUEST_URI'])!=null) {
31 $basedir = dirname($_SERVER['REQUEST_URI'])."/"; }*/
32 if(dirname($_SERVER['SCRIPT_NAME'])!="."||
33         dirname($_SERVER['SCRIPT_NAME'])!=null) {
34 $basedir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
35 if($basedir==null||$basedir==".") {
36 if(dirname($_SERVER['SCRIPT_NAME'])=="."||
37         dirname($_SERVER['SCRIPT_NAME'])==null) {
38 $basedir = dirname($_SERVER['PHP_SELF'])."/"; } }
39 if($basedir=="\/") { $basedir="/"; }
40 $basedir = str_replace("//", "/", $basedir);
41 if($Settings['fixpathinfo']!="on"&&
42         $Settings['fixpathinfo']!="off"&&
43         $Settings['fixpathinfo']!==null) {
44                 $basedir = "/"; } $BaseURL = $basedir;
45 if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS'] = 'off'; }
46 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
47 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
48 if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
49         $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$BaseURL; }
50 if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
51         $BoardURL = $Settings['idburl']; 
52         if($Settings['qstr']!="/") {
53         $AltBoardURL = $BoardURL; } 
54         if($Settings['qstr']=="/") { 
55         $AltBoardURL = preg_replace("/\/$/","",$BoardURL); } }
56 if ($_GET['id']==null) { $_GET['id']="1"; }
57 if($rssurlon=="on") { $BoardURL =  $rssurl; }
58 $feedsname = basename($_SERVER['SCRIPT_NAME']);
59 if($_SERVER['PATH_INFO']!=null) {
60 $feedsname .= htmlentities($_SERVER['PATH_INFO'], ENT_QUOTES, $Settings['charset']); }
61 if($_SERVER['QUERY_STRING']!=null) {
62 $feedsname .= "?".htmlentities($_SERVER['QUERY_STRING'], ENT_QUOTES, $Settings['charset']); }
63 $checkfeedtype = "application/rss+xml";
64 if($_GET['feedtype']=="oldrss") { $checkfeedtype = "application/xml"; }
65 if($_GET['feedtype']=="rss") { $checkfeedtype = "application/rss+xml"; }
66 if($_GET['feedtype']=="atom") { $checkfeedtype = "application/atom+xml"; }
67 if($_GET['feedtype']=="opml") { $checkfeedtype = "text/x-opml"; }
68 if($_GET['feedtype']=="opensearch") { $checkfeedtype = "application/opensearchdescription+xml"; }
69 if(stristr($_SERVER["HTTP_ACCEPT"],$checkfeedtype) ) {
70 header("Content-Type: ".$checkfeedtype."; charset=".$Settings['charset']); }
71 else { if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
72 header("Content-Type: application/xml; charset=".$Settings['charset']); }
73 else { if (stristr($_SERVER["HTTP_USER_AGENT"],"FeedValidator")) {
74    header("Content-Type: application/xml; charset=".$Settings['charset']);
75 } else { header("Content-Type: text/xml; charset=".$Settings['charset']); } } }
76 header("Content-Language: en");
77 header("Vary: Accept");
78 if($_GET['feedtype']=="oldrss"||$_GET['feedtype']=="rss"||$_GET['feedtype']=="atom"||$_GET['feedtype']=="opml") { 
79 $prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2."", array($_GET['id']));
80 $preresult=sql_query($prequery,$SQLStat);
81 $prenum=sql_num_rows($preresult);
82 $prei=0;
83 if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
84 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
85 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
86 $ForumID=sql_result($preresult,0,"id");
87 $ForumName=sql_result($preresult,0,"Name");
88 $ForumName = htmlentities($ForumName, ENT_QUOTES, $Settings['charset']);
89 $ForumName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ForumName);
90 $ForumCatID=sql_result($preresult,0,"CategoryID");
91 $ForumType=sql_result($preresult,0,"ForumType");
92 $ForumType = strtolower($ForumType);
93 sql_free_result($preresult);
94 if($PermissionInfo['CanViewForum'][$ForumID]=="no"||
95         $PermissionInfo['CanViewForum'][$ForumID]!="yes") {
96 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
97 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
98 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
99 if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="no"||
100         $CatPermissionInfo['CanViewCategory'][$ForumCatID]!="yes") {
101 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
102 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
103 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
104 $gltf = array(null); $gltf[0] = $ForumID;
105 if ($ForumType=="subforum") { 
106 $apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"id\"", array($ForumID));
107 $apcresult=sql_query($apcquery,$SQLStat);
108 $apcnum=sql_num_rows($apcresult);
109 $apci=0; $apcl=1; if($apcnum>=1) {
110 while ($apci < $apcnum) {
111 $SubsForumID=sql_result($apcresult,$apci,"id");
112 if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
113         $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
114 $gltf[$apcl] = $SubsForumID; ++$apcl; }
115 ++$apci; }
116 sql_free_result($apcresult); } }
117 $Atom = null; $RSS = null; $PreRSS = null;
118 $gltnum = count($gltf); $glti = 0; 
119 while ($glti < $gltnum) {
120 $ExtraIgnores = null;
121 if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
122         $ExtraIgnores = " AND \"Closed\"<>3"; }
123 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC LIMIT %i", array($gltf[$glti],$Settings['max_topics']));
124 $result=sql_query($query,$SQLStat);
125 $num=sql_num_rows($result); $i=0;
126 while ($i < $num) {
127 $TopicID=sql_result($result,$i,"id");
128 $ForumID=sql_result($result,$i,"ForumID");
129 $CategoryID=sql_result($result,$i,"CategoryID");
130 $pquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC LIMIT %i", array($TopicID,1));
131 $presult=sql_query($pquery,$SQLStat);
132 $pnum=sql_num_rows($presult);
133 $MyDescription=sql_result($presult,0,"Post");
134 $UsersID=sql_result($result,$i,"UserID");
135 $GuestsName=sql_result($result,$i,"GuestName");
136 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
137 $reresult=sql_query($requery,$SQLStat);
138 $renum=sql_num_rows($reresult);
139 if($renum<1) { $UsersID = -1;
140 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
141 $reresult=sql_query($requery,$SQLStat);
142 $renum=sql_num_rows($reresult); }
143 $memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
144 $memreresult=sql_query($memrequery,$SQLStat);
145 $memrenum=sql_num_rows($memreresult);
146 $UsersName=sql_result($reresult,0,"Name");
147 $UsersGroupID=sql_result($reresult,0,"GroupID");
148 $PreUserCanExecPHP=sql_result($memreresult,0,"CanExecPHP");
149 if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
150         $PreUserCanExecPHP = "no"; }
151 $PreUserCanDoHTML=sql_result($memreresult,0,"CanDoHTML");
152 if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
153         $PreUserCanDoHTML = "no"; }
154 $PreUserCanUseBBTags=sql_result($memreresult,0,"CanUseBBTags");
155 if($PreUserCanUseBBTags!="yes"&&$PreUserCanUseBBTags!="no"&&$PreUserCanUseBBTags!="group") {
156         $PreUserCanUseBBTags = "no"; }
157 sql_free_result($memreresult);
158 if($UsersName=="Guest") { $UsersName=$GuestsName;
159 if($UsersName==null) { $UsersName="Guest"; } }
160 sql_free_result($reresult);
161 $gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($UsersGroupID));
162 $gresult=sql_query($gquery,$SQLStat);
163 $UsersGroup=sql_result($gresult,0,"Name");
164 $User1CanExecPHP = $PreUserCanExecPHP;
165 if($PreUserCanExecPHP=="group") {
166 $User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
167 if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
168         $User1CanExecPHP = "no"; }
169 $User1CanDoHTML = $PreUserCanDoHTML;
170 if($PreUserCanDoHTML=="group") {
171 $User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
172 if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
173         $User1CanDoHTML = "no"; }
174 $User1CanUseBBTags = $PreUserCanUseBBTags;
175 if($User1CanUseBBTags=="group") {
176 $User1CanUseBBTags=sql_result($gresult,0,"CanUseBBTags"); }
177 if($User1CanUseBBTags!="yes"&&$User1CanUseBBTags!="no") {
178         $User1CanUseBBTags = "no"; }
179 $GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
180 $GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
181 sql_free_result($gresult);
182 if($User1CanUseBBTags=="yes") { $MyDescription = bbcode_parser($MyDescription); }
183 if($User1CanExecPHP=="no") {
184 $MyDescription = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$MyDescription); }
185 if($User1CanExecPHP=="yes") { $MyDescription = php_execute($MyDescription); }
186 if($User1CanDoHTML=="no") {
187 $MyDescription = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$MyDescription); }
188 if($User1CanDoHTML=="yes") { $MyDescription = do_html_bbcode($MyDescription); }
189 $MyDescription = text2icons($MyDescription,$Settings['sqltable'],$SQLStat);
190 $MyDescription = preg_replace("/\<br\>/", "<br />", nl2br($MyDescription));
191 $MyDescription = url2link($MyDescription);
192 if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
193         $UsersName = $GroupNamePrefix.$UsersName; }
194 if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
195         $UsersName = $UsersName.$GroupNameSuffix; }
196 $TheTime=sql_result($result,$i,"TimeStamp");
197 $atomcurtime = new DateTime();
198 $atomcurtime->setTimestamp($TheTime);
199 $atomcurtime->setTimezone($utctz);
200 $AtomTime=$atomcurtime->format("Y-m-d\TH:i:s\Z");
201 //$OldRSSTime=$atomcurtime->format("Y-m-d\TH:i:s+0:00");
202 $OldRSSTime=$AtomTime;
203 $TheTime=$atomcurtime->format("D, j M Y G:i:s \G\M\T");
204 $TopicName=sql_result($result,$i,"TopicName");
205 $ForumDescription=sql_result($result,$i,"Description");
206 if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
207         $PermissionInfo['CanViewForum'][$ForumID]=="yes"&&
208         isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
209         $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
210 if($_GET['feedtype']=="atom") {
211 $CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
212 $Atom .= '<entry>'."\n".'<title>'.$TopicName.'</title>'."\n".'<summary>'.$CDataDescription.'</summary>'."\n".'<link rel="alternate" href="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'" />'."\n".'<id>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</id>'."\n".'<author>'."\n".'<name>'.$UsersName.'</name>'."\n".'</author>'."\n".'<updated>'.$AtomTime.'</updated>'."\n".'</entry>'."\n"; }
213 if($_GET['feedtype']=="oldrss") {
214 $CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
215 $PreRSS .= '      <rdf:li rdf:resource="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'" />'."\n";
216 $RSS .= '<item rdf:about="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'">'."\n".'<title>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</description>'."\n".'<dc:publisher>'.$UsersName.'</dc:publisher>'."\n".'<dc:creator>'.$UsersName.'</dc:creator>'."\n".'<dc:date>'.$OldRSSTime.'</dc:date>'."\n".'</item>'."\n"; }
217 if($_GET['feedtype']=="rss") {
218 $CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
219 $RSS .= '<item>'."\n".'<pubDate>'.$TheTime.'</pubDate>'."\n".'<author>'.$UsersName.'</author>'."\n".'<title>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</description>'."\n".'<link>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</link>'."\n".'<guid>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</guid>'."\n".'</item>'."\n"; } }
220 ++$i; sql_free_result($presult); }
221 sql_free_result($result);
222 ++$glti; } }
223 $endtag = " \n";
224 xml_doc_start("1.0",$Settings['charset']);
225 if($Settings['showverinfo']=="on") { ?>
226 <!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
227 <?php } if($Settings['showverinfo']!="on") { ?>
228 <!-- generator="<?php echo $iDB; ?>" -->
229 <?php } echo "\n"; if($_GET['feedtype']=="oldrss") { ?>
230 <rdf:RDF 
231  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
232  xmlns="http://purl.org/rss/1.0/"
233  xmlns:dc="http://purl.org/dc/elements/1.1/"
234 >
235 <channel rdf:about="<?php echo $BoardURL.$feedsname; ?>">
236  <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
237   <link><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></link>
238   <description>RSS Feed of the Topics in Forum <?php echo $ForumName; ?></description>
239   <image rdf:resource="<?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif" />
240  
241   <items>
242     <rdf:Seq>
243 <?php echo $PreRSS; ?>
244     </rdf:Seq>
245   </items>
246 </channel>
247
248 <image rdf:about="<?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif">
249   <title><?php echo $boardsname; ?></title>
250   <link><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></link>
251   <url><?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif</url>
252 </image>
253 <?php echo "\n".$RSS."\n"; ?></rdf:RDF>
254 <?php } if($_GET['feedtype']=="rss") { ?>
255 <rss version="2.0">
256 <channel>
257    <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
258    <description>RSS Feed of the Topics in Forum <?php echo $ForumName; ?></description>
259    <link><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></link>
260    <language>en</language>
261    <?php if($Settings['showverinfo']=="on") { ?>
262    <generator><?php echo $VerInfo['iDB_Ver_Show']; ?></generator>
263    <?php } if($Settings['showverinfo']!="on") { ?>
264    <generator><?php echo $iDB; ?></generator>
265    <?php } echo "\n"; ?>
266    <copyright><?php echo $SettInfo['Author']; ?></copyright>
267    <ttl>120</ttl>
268    <image>
269         <url><?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif</url>
270         <title><?php echo $boardsname; ?></title>
271         <link><?php echo $AltBoardURL; ?></link>
272    </image>
273  <?php echo $endtag; ?>
274  <?php echo "\n".$RSS."\n"; ?></channel>
275 </rss>
276 <?php } if($_GET['feedtype']=="atom") { ?>
277 <feed xmlns="http://www.w3.org/2005/Atom">
278   <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
279    <subtitle>Atom Feed of the Topics in Forum <?php echo $ForumName; ?></subtitle>
280    <link rel="self" href="<?php echo $BoardURL.$feedsname; ?>" />
281    <id><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></id>
282    <updated><?php echo gmdate("Y-m-d\TH:i:s\Z"); ?></updated>
283    <?php if($Settings['showverinfo']=="on") { ?>
284    <generator><?php echo $VerInfo['iDB_Ver_Show']; ?></generator>
285    <?php } if($Settings['showverinfo']!="on") { ?>
286    <generator><?php echo $iDB; ?></generator>
287    <?php } ?>
288   <icon><?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif</icon>
289 <?php echo $endtag; ?>
290  <?php echo "\n".$Atom."\n"; ?>
291 </feed>
292 <?php } if($_GET['feedtype']=="opml") { ?>
293 <opml version="1.0">
294   <head>
295     <dateCreated><?php echo gmdate("d-M-Y"); ?></dateCreated>
296   </head>
297   <body>
298     <?php /*<!--
299         <outline text="<?php echo $ForumName; ?> Topics RSS 1.0 Feed" type="link" url="<?php echo $BoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" htmlUrl="<?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>" xmlUrl="<?php echo $BoardURL.url_maker($exfile['rss'],$Settings['rss_ext'],"act=oldrss&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
300         -->*/ ?>
301 <outline text="<?php echo $ForumName; ?> Topics RSS 2.0 Feed" type="rss" url="<?php echo $BoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" htmlUrl="<?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>" xmlUrl="<?php echo $BoardURL.url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
302     <outline text="<?php echo $ForumName; ?> Topics Atom Feed" type="atom" url="<?php echo $BoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" htmlUrl="<?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>" xmlUrl="<?php echo $BoardURL.url_maker($exfile['rss'],$Settings['rss_ext'],"act=atom&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
303   </body>
304 </opml>
305 <?php echo $endtag; ?>
306 <?php } if($_GET['feedtype']=="opensearch") { ?>
307 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
308                        xmlns:moz="http://www.mozilla.org/2006/browser/search/">
309 <ShortName><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Search</ShortName>
310 <Description><?php echo $SettInfo['Description']; ?></Description>
311 <InputEncoding><?php echo $Settings['charset']; ?></InputEncoding>
312 <Image width="16" height="16" type="image/x-icon"><?php echo $AltBoardURL.$ThemeSet['FavIcon']; ?></Image>
313 <Url type="text/html" method="POST" template="<?php echo $BoardURL.url_maker("search",$Settings['file_ext'],null,"search","search"); ?>">
314   <Param name="act" value="topics"/>
315   <Param name="search" value="{searchTerms}"/>
316   <Param name="type" value="wildcard"/>
317   <Param name="page" value="1"/>
318 </Url>
319 <?php echo $endtag; ?>
320 <moz:SearchForm><?php echo $BoardURL.url_maker("search",$Settings['file_ext'],null,"search","search"); ?></moz:SearchForm>
321 </OpenSearchDescription>
322 <?php } if($_GET['debug']=="true"||$_GET['debug']=="on") {
323 function execution_time($starttime) {
324 list($uetime, $etime) = explode(" ", microtime());
325 $endtime = $uetime + $etime;
326 return bcsub($endtime, $starttime, 4); }
327 echo "<!-- execution_time=\"".execution_time($starttime)."\" -->"; }
328 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); ?>