<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — PunRewrite 1.0, a better positioning in search engines]]></title>
		<link>https://punbb.informer.com/forums/topic/9581/punrewrite-10-a-better-positioning-in-search-engines/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/9581/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in PunRewrite 1.0, a better positioning in search engines.]]></description>
		<lastBuildDate>Sat, 20 Oct 2007 12:21:43 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/102247/#p102247</link>
			<description><![CDATA[<p>Can i change so Punrewrite shows three letter words to? </p><p>For example <span class="bbu">Fly to kina now</span> gets .com/t162-kina.html now isnt so good.</p>]]></description>
			<author><![CDATA[null@example.com (adjust)]]></author>
			<pubDate>Sat, 20 Oct 2007 12:21:43 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/102247/#p102247</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/100580/#p100580</link>
			<description><![CDATA[<p>Hi all,<br />I can&#039;t find some lines to replace them like in the readme install , in index.php, viewtopic.php and search.php because I&#039;m using the sub_forum_mod-1.0.9.2 and PunBB1.2.15<br />Can you tell me please how can I do to use this rewriting ?<br />Here are my actually files:</p><p>index.php<br />[code]&lt;?php<br />/***********************************************************************</p><p>&nbsp; Copyright (C) 2002-2005&nbsp; Rickard Andersson (rickard@punbb.org)</p><p>&nbsp; This file is part of PunBB.</p><p>&nbsp; PunBB is free software; you can redistribute it and/or modify it<br />&nbsp; under the terms of the GNU General Public License as published<br />&nbsp; by the Free Software Foundation; either version 2 of the License,<br />&nbsp; or (at your option) any later version.</p><p>&nbsp; PunBB is distributed in the hope that it will be useful, but<br />&nbsp; WITHOUT ANY WARRANTY; without even the implied warranty of<br />&nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; See the<br />&nbsp; GNU General Public License for more details.</p><p>&nbsp; You should have received a copy of the GNU General Public License<br />&nbsp; along with this program; if not, write to the Free Software<br />&nbsp; Foundation, Inc., 59 Temple Place, Suite 330, Boston,<br />&nbsp; MA&nbsp; 02111-1307&nbsp; USA</p><p>************************************************************************/</p><br /><p>define(&#039;PUN_ROOT&#039;, &#039;./&#039;);<br />require PUN_ROOT.&#039;include/common.php&#039;;</p><br /><p>if ($pun_user[&#039;g_read_board&#039;] == &#039;0&#039;)<br />&nbsp; &nbsp; message($lang_common[&#039;No view&#039;]);</p><br /><p>// Load the index.php language file<br />require PUN_ROOT.&#039;lang/&#039;.$pun_user[&#039;language&#039;].&#039;/index.php&#039;;</p><p>$page_title = pun_htmlspecialchars($pun_config[&#039;o_board_title&#039;]);<br />define(&#039;PUN_ALLOW_INDEX&#039;, 1);<br />require PUN_ROOT.&#039;header.php&#039;;</p><p>################################################################################<br />########################### Sub Forum MOD (start) ##############################<br />################################################################################<br />$sfcount=0;<br />$sfdb = array($_parent_id_, $_topics_, $_posts_, $_last_post_id_, $_last_poster_, $_last_post_);<br />$forums_info = $db-&gt;query(&#039;SELECT num_topics, num_posts, parent_forum_id, last_post_id, last_poster, last_post, id, forum_name FROM &#039;.$db-&gt;prefix.&#039;forums ORDER BY disp_position&#039;) or error(implode($db-&gt;error(),&#039;&#039;),__FILE__,__LINE__,$db-&gt;error());<br />while($current = $db-&gt;fetch_assoc($forums_info)) {<br /> if ($current[&#039;parent_forum_id&#039;] != 0)<br />&nbsp; {<br />&nbsp; &nbsp;$sfdb[$sfcount][0] = $current[&#039;parent_forum_id&#039;];<br />&nbsp; &nbsp;$sfdb[$sfcount][1] = $current[&#039;num_topics&#039;];<br />&nbsp; &nbsp;$sfdb[$sfcount][2] = $current[&#039;num_posts&#039;];<br />&nbsp; &nbsp;$sfdb[$sfcount][3] = $current[&#039;last_post_id&#039;];<br />&nbsp; &nbsp;$sfdb[$sfcount][4] = $current[&#039;last_poster&#039;];<br />&nbsp; &nbsp;$sfdb[$sfcount][5] = $current[&#039;last_post&#039;];<br />&nbsp; &nbsp;$sfdb[$sfcount][6] = $current[&#039;id&#039;];<br />&nbsp; &nbsp;$sfdb[$sfcount][7] = $current[&#039;forum_name&#039;];<br />&nbsp; &nbsp;$sfcount++;<br />&nbsp; }<br />}<br />################################################################################<br />########################### Sub Forum MOD ( end ) ##############################<br />################################################################################</p><p>// Print the categories and forums<br />$result = $db-&gt;query(&#039;SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.parent_forum_id FROM &#039;.$db-&gt;prefix.&#039;categories AS c INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON c.id=f.cat_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND (f.parent_forum_id IS NULL OR f.parent_forum_id=0) ORDER BY c.disp_position, c.id, f.disp_position&#039;, true) or error(&#039;Unable to fetch category/forum list&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>$cur_category = 0;<br />$cat_count = 0;<br />while ($cur_forum = $db-&gt;fetch_assoc($result))<br />{<br />&nbsp; &nbsp; $moderators = &#039;&#039;;</p><p>&nbsp; &nbsp; if ($cur_forum[&#039;cid&#039;] != $cur_category)&nbsp; &nbsp; // A new category since last iteration?<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($cur_category != 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;\t\t\t&quot;.&#039;&lt;/tbody&gt;&#039;.&quot;\n\t\t\t&quot;.&#039;&lt;/table&gt;&#039;.&quot;\n\t\t&quot;.&#039;&lt;/div&gt;&#039;.&quot;\n\t&quot;.&#039;&lt;/div&gt;&#039;.&quot;\n&quot;.&#039;&lt;/div&gt;&#039;.&quot;\n\n&quot;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; ++$cat_count;</p><p>?&gt;<br />&lt;div id=&quot;idx&lt;?php echo $cat_count ?&gt;&quot; class=&quot;blocktable&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;&lt;span&gt;&lt;?php echo pun_htmlspecialchars($cur_forum[&#039;cat_name&#039;]) ?&gt;&lt;/span&gt;&lt;/h2&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;box&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table cellspacing=&quot;0&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;thead&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tcl&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Forum&#039;] ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tc2&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_index[&#039;Topics&#039;] ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tc3&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Posts&#039;] ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tcr&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Last post&#039;] ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/thead&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tbody&gt;<br />&lt;?php</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $cur_category = $cur_forum[&#039;cid&#039;];<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; $item_status = &#039;&#039;;<br />&nbsp; &nbsp; $icon_text = $lang_common[&#039;Normal icon&#039;];<br />&nbsp; &nbsp; $icon_type = &#039;icon&#039;;</p><p>&nbsp; &nbsp; // Are there new posts?<br />&nbsp; &nbsp; if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $cur_forum[&#039;last_post&#039;] &gt; $pun_user[&#039;last_visit&#039;])<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $item_status = &#039;inew&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $icon_text = $lang_common[&#039;New icon&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $icon_type = &#039;icon inew&#039;;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; // Is this a redirect forum?<br />&nbsp; &nbsp; if ($cur_forum[&#039;redirect_url&#039;] != &#039;&#039;)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $forum_field = &#039;&lt;h3&gt;&lt;a href=&quot;&#039;.pun_htmlspecialchars($cur_forum[&#039;redirect_url&#039;]).&#039;&quot; title=&quot;&#039;.$lang_index[&#039;Link to&#039;].&#039; &#039;.pun_htmlspecialchars($cur_forum[&#039;redirect_url&#039;]).&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_forum[&#039;forum_name&#039;]).&#039;&lt;/a&gt;&lt;/h3&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $num_topics = $num_posts = &#039; &#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $item_status = &#039;iredirect&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $icon_text = $lang_common[&#039;Redirect icon&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $icon_type = &#039;icon&#039;;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $forum_field = &#039;&lt;h3&gt;&lt;a href=&quot;viewforum.php?id=&#039;.$cur_forum[&#039;fid&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_forum[&#039;forum_name&#039;]).&#039;&lt;/a&gt;&lt;/h3&gt;&#039;;<br />################################################################################<br />########################### Sub Forum MOD (start) ##############################<br />################################################################################<br />&nbsp; $n_t = 0;<br />&nbsp; $n_p = 0;<br />&nbsp; $l_pid = $cur_forum[&#039;last_post_id&#039;];<br />&nbsp; $l_pr = $cur_forum[&#039;last_poster&#039;];<br />&nbsp; $l_post = $cur_forum[&#039;last_post&#039;];<br />&nbsp; for ($i = 0; $i &lt; $sfcount; $i++)<br />&nbsp; {<br />&nbsp; &nbsp;if ($sfdb[$i][0] == $cur_forum[&#039;fid&#039;])<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp;$n_t = $n_t + $sfdb[$i][1];<br />&nbsp; &nbsp; &nbsp;$n_p = $n_p + $sfdb[$i][2];<br />&nbsp; &nbsp; &nbsp;if ($l_pid &lt; $sfdb[$i][3])<br />&nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp;$l_pid = $sfdb[$i][3];<br />&nbsp; &nbsp; &nbsp; &nbsp;$l_pr = $sfdb[$i][4];<br />&nbsp; &nbsp; &nbsp; &nbsp;$l_post = $sfdb[$i][5];<br />&nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />&nbsp; }<br />&nbsp; $num_topics = $n_t + $cur_forum[&#039;num_topics&#039;];<br />&nbsp; $num_posts = $n_p + $cur_forum[&#039;num_posts&#039;];<br />################################################################################<br />########################### Sub Forum MOD ( end ) ##############################<br />################################################################################<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; if ($cur_forum[&#039;forum_desc&#039;] != &#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; $forum_field .= &quot;\n\t\t\t\t\t\t\t\t&quot;.$cur_forum[&#039;forum_desc&#039;];</p><br /><p>&nbsp; &nbsp; // If there is a last_post/last_poster.<br />&nbsp; &nbsp; if ($l_post != &#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $last_post = &#039;&lt;a href=&quot;viewtopic.php?pid=&#039;.$l_pid.&#039;#p&#039;.$l_pid.&#039;&quot;&gt;&#039;.format_time($l_post).&#039;&lt;/a&gt; &lt;span class=&quot;byuser&quot;&gt;&#039;.$lang_common[&#039;by&#039;].&#039; &#039;.pun_htmlspecialchars($l_pr).&#039;&lt;/span&gt;&#039;;<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; $last_post = &#039; &#039;;</p><p>&nbsp; &nbsp; if ($cur_forum[&#039;moderators&#039;] != &#039;&#039;)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $mods_array = unserialize($cur_forum[&#039;moderators&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; $moderators = array();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; while (list($mod_username, $mod_id) = @each($mods_array))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $moderators[] = &#039;&lt;a href=&quot;profile.php?id=&#039;.$mod_id.&#039;&quot;&gt;&#039;.pun_htmlspecialchars($mod_username).&#039;&lt;/a&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $moderators = &quot;\t\t\t\t\t\t\t\t&quot;.&#039;&lt;p&gt;&lt;em&gt;(&#039;.$lang_common[&#039;Moderated by&#039;].&#039;&lt;/em&gt; &#039;.implode(&#039;, &#039;, $moderators).&#039;)&lt;/p&gt;&#039;.&quot;\n&quot;;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!empty($sfdb))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach ($sfdb as $sub_forums)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($cur_forum[&#039;fid&#039;] == $sub_forums[0] &amp;&amp; !$pun_user[&#039;is_guest&#039;] &amp;&amp; $sub_forums[5] &gt; $pun_user[&#039;last_visit&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $item_status = &#039;inew&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_text = $lang_common[&#039;New icon&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_type = &#039;icon inew&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&lt;?php if ($item_status != &#039;&#039;) echo &#039; class=&quot;&#039;.$item_status.&#039;&quot;&#039;; ?&gt;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;tcl&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;intd&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;&lt;?php echo $icon_type ?&gt;&quot;&gt;&lt;div class=&quot;nosize&quot;&gt;&lt;?php echo $icon_text ?&gt;&lt;/div&gt;&lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;tclcon&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo $forum_field.&quot;\n&quot;.$moderators ?&gt;<br />&lt;?php<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sub_forums_list = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($sfdb)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach ($sfdb as $sub_forums) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if($cur_forum[&#039;fid&#039;] == $sub_forums[0]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sub_forums_list[] = &#039;&lt;a href=&quot;viewforum.php?id=&#039;.$sub_forums[6].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($sub_forums[7]).&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// EDIT THIS FOR THE DISPLAY STYLE OF THE SUBFORUMS ON MAIN PAGE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(!empty($sub_forums_list)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Leave one $sub_forums_list commented out to use the other (between the ###..)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;################################<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// This is Single Line Wrap Style<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sub_forums_list = &quot;\t\t\t\t\t\t\t\t&quot;.&#039;&lt;em&gt;Sous Forums:&lt;/em&gt; &#039;.implode(&#039;, &#039;, $sub_forums_list).&quot;\n&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// This is List Style<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//$sub_forums_list = &quot;\n&quot;.&#039;&lt;b&gt;&lt;em&gt;Sub Forums:&lt;/em&gt;&lt;/b&gt;&lt;br /&gt;  --  &#039;.implode(&#039;&lt;br /&gt;  --  &#039;, $sub_forums_list).&quot;\n&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;################################<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($cur_forum[&#039;forum_desc&#039;] != NULL) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&lt;br /&gt;&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// TO TURN OFF DISPLAY OF SUBFORUMS ON INDEX PAGE, COMMENT OUT THE FOLLOWING LINE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />?&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;tc2&quot;&gt;&lt;?php echo $num_topics ?&gt;&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;tc3&quot;&gt;&lt;?php echo $num_posts ?&gt;&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;tcr&quot;&gt;&lt;?php echo $last_post ?&gt;&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&lt;?php</p><p>}</p><p>// Did we output any categories and forums?<br />if ($cur_category &gt; 0)<br />&nbsp; &nbsp; echo &quot;\t\t\t&quot;.&#039;&lt;/tbody&gt;&#039;.&quot;\n\t\t\t&quot;.&#039;&lt;/table&gt;&#039;.&quot;\n\t\t&quot;.&#039;&lt;/div&gt;&#039;.&quot;\n\t&quot;.&#039;&lt;/div&gt;&#039;.&quot;\n&quot;.&#039;&lt;/div&gt;&#039;.&quot;\n\n&quot;;<br />else<br />&nbsp; &nbsp; echo &#039;&lt;div id=&quot;idx0&quot; class=&quot;block&quot;&gt;&lt;div class=&quot;box&quot;&gt;&lt;div class=&quot;inbox&quot;&gt;&lt;p&gt;&#039;.$lang_index[&#039;Empty board&#039;].&#039;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#039;;</p><br /><p>// Collect some statistics from the database<br />$result = $db-&gt;query(&#039;SELECT COUNT(id)-1 FROM &#039;.$db-&gt;prefix.&#039;users&#039;) or error(&#039;Unable to fetch total user count&#039;, __FILE__, __LINE__, $db-&gt;error());<br />$stats[&#039;total_users&#039;] = $db-&gt;result($result);</p><p>$result = $db-&gt;query(&#039;SELECT id, username FROM &#039;.$db-&gt;prefix.&#039;users ORDER BY registered DESC LIMIT 1&#039;) or error(&#039;Unable to fetch newest registered user&#039;, __FILE__, __LINE__, $db-&gt;error());<br />$stats[&#039;last_user&#039;] = $db-&gt;fetch_assoc($result);</p><p>$result = $db-&gt;query(&#039;SELECT SUM(num_topics), SUM(num_posts) FROM &#039;.$db-&gt;prefix.&#039;forums&#039;) or error(&#039;Unable to fetch topic/post count&#039;, __FILE__, __LINE__, $db-&gt;error());<br />list($stats[&#039;total_topics&#039;], $stats[&#039;total_posts&#039;]) = $db-&gt;fetch_row($result);</p><p>?&gt;<br />&lt;div id=&quot;brdstats&quot; class=&quot;block&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;&lt;span&gt;&lt;?php echo $lang_index[&#039;Board info&#039;] ?&gt;&lt;/span&gt;&lt;/h2&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;box&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dl class=&quot;conr&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dt&gt;&lt;strong&gt;&lt;?php echo $lang_index[&#039;Board stats&#039;] ?&gt;&lt;/strong&gt;&lt;/dt&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd&gt;&lt;?php echo $lang_index[&#039;No of users&#039;].&#039;: &lt;strong&gt;&#039;. $stats[&#039;total_users&#039;] ?&gt;&lt;/strong&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd&gt;&lt;?php echo $lang_index[&#039;No of topics&#039;].&#039;: &lt;strong&gt;&#039;.$stats[&#039;total_topics&#039;] ?&gt;&lt;/strong&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd&gt;&lt;?php echo $lang_index[&#039;No of posts&#039;].&#039;: &lt;strong&gt;&#039;.$stats[&#039;total_posts&#039;] ?&gt;&lt;/strong&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/dl&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dl class=&quot;conl&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dt&gt;&lt;strong&gt;&lt;?php echo $lang_index[&#039;User info&#039;] ?&gt;&lt;/strong&gt;&lt;/dt&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd&gt;&lt;?php echo $lang_index[&#039;Newest user&#039;] ?&gt;: &lt;a href=&quot;profile.php?id=&lt;?php echo $stats[&#039;last_user&#039;][&#039;id&#039;] ?&gt;&quot;&gt;&lt;?php echo pun_htmlspecialchars($stats[&#039;last_user&#039;][&#039;username&#039;]) ?&gt;&lt;/a&gt;&lt;/dd&gt;</p><p>&lt;?php</p><p>if ($pun_config[&#039;o_users_online&#039;] == &#039;1&#039;)<br />{<br />&nbsp; &nbsp; // Fetch users online info and generate strings for output<br />&nbsp; &nbsp; $num_guests = 0;<br />&nbsp; &nbsp; $users = array();<br />&nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT user_id, ident FROM &#039;.$db-&gt;prefix.&#039;online WHERE idle=0 ORDER BY ident&#039;, true) or error(&#039;Unable to fetch online list&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; while ($pun_user_online = $db-&gt;fetch_assoc($result))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($pun_user_online[&#039;user_id&#039;] &gt; 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $users[] = &quot;\n\t\t\t\t&quot;.&#039;&lt;dd&gt;&lt;a href=&quot;profile.php?id=&#039;.$pun_user_online[&#039;user_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($pun_user_online[&#039;ident&#039;]).&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ++$num_guests;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; $num_users = count($users);<br />&nbsp; &nbsp; echo &quot;\t\t\t\t&quot;.&#039;&lt;dd&gt;&#039;. $lang_index[&#039;Users online&#039;].&#039;: &lt;strong&gt;&#039;.$num_users.&#039;&lt;/strong&gt;&lt;/dd&gt;&#039;.&quot;\n\t\t\t\t&quot;.&#039;&lt;dd&gt;&#039;.$lang_index[&#039;Guests online&#039;].&#039;: &lt;strong&gt;&#039;.$num_guests.&#039;&lt;/strong&gt;&lt;/dd&gt;&#039;.&quot;\n\t\t\t&quot;.&#039;&lt;/dl&gt;&#039;.&quot;\n&quot;;</p><br /><p>&nbsp; &nbsp; if ($num_users &gt; 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;\t\t\t&quot;.&#039;&lt;dl id=&quot;onlinelist&quot; class= &quot;clearb&quot;&gt;&#039;.&quot;\n\t\t\t\t&quot;.&#039;&lt;dt&gt;&lt;strong&gt;&#039;.$lang_index[&#039;Online&#039;].&#039;: &lt;/strong&gt;&lt;/dt&gt;&#039;.&quot;\t\t\t\t&quot;.implode(&#039;,&lt;/dd&gt; &#039;, $users).&#039;&lt;/dd&gt;&#039;.&quot;\n\t\t\t&quot;.&#039;&lt;/dl&gt;&#039;.&quot;\n&quot;;<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;\t\t\t&quot;.&#039;&lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;&#039;.&quot;\n&quot;;</p><p>}<br />else<br />&nbsp; &nbsp; echo &quot;\t\t&quot;.&#039;&lt;/dl&gt;&#039;.&quot;\n\t\t\t&quot;.&#039;&lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;&#039;.&quot;\n&quot;;</p><br /><p>?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;<br />&lt;?php</p><p>$footer_style = &#039;index&#039;;<br />require PUN_ROOT.&#039;footer.php&#039;;[/code]<br />viewtopic.php<br />[code]&lt;?php<br />/***********************************************************************</p><p>&nbsp; Copyright (C) 2002-2005&nbsp; Rickard Andersson (rickard@punbb.org)</p><p>&nbsp; This file is part of PunBB.</p><p>&nbsp; PunBB is free software; you can redistribute it and/or modify it<br />&nbsp; under the terms of the GNU General Public License as published<br />&nbsp; by the Free Software Foundation; either version 2 of the License,<br />&nbsp; or (at your option) any later version.</p><p>&nbsp; PunBB is distributed in the hope that it will be useful, but<br />&nbsp; WITHOUT ANY WARRANTY; without even the implied warranty of<br />&nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; See the<br />&nbsp; GNU General Public License for more details.</p><p>&nbsp; You should have received a copy of the GNU General Public License<br />&nbsp; along with this program; if not, write to the Free Software<br />&nbsp; Foundation, Inc., 59 Temple Place, Suite 330, Boston,<br />&nbsp; MA&nbsp; 02111-1307&nbsp; USA</p><p>************************************************************************/</p><br /><p>define(&#039;PUN_ROOT&#039;, &#039;./&#039;);<br />require PUN_ROOT.&#039;include/common.php&#039;;</p><br /><p>if ($pun_user[&#039;g_read_board&#039;] == &#039;0&#039;)<br />&nbsp; &nbsp; message($lang_common[&#039;No view&#039;]);</p><br /><p>$action = isset($_GET[&#039;action&#039;]) ? $_GET[&#039;action&#039;] : null;<br />$id = isset($_GET[&#039;id&#039;]) ? intval($_GET[&#039;id&#039;]) : 0;<br />$pid = isset($_GET[&#039;pid&#039;]) ? intval($_GET[&#039;pid&#039;]) : 0;<br />if ($id &lt; 1 &amp;&amp; $pid &lt; 1)<br />&nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);</p><p>// Load the viewtopic.php language file<br />require PUN_ROOT.&#039;lang/&#039;.$pun_user[&#039;language&#039;].&#039;/topic.php&#039;;</p><br /><p>// If a post ID is specified we determine topic ID and page number so we can redirect to the correct message<br />if ($pid)<br />{<br />&nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT topic_id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE id=&#039;.$pid) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; if (!$db-&gt;num_rows($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);</p><p>&nbsp; &nbsp; $id = $db-&gt;result($result);</p><p>&nbsp; &nbsp; // Determine on what page the post is located (depending on $pun_user[&#039;disp_posts&#039;])<br />&nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id.&#039; ORDER BY posted&#039;) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; $num_posts = $db-&gt;num_rows($result);</p><p>&nbsp; &nbsp; for ($i = 0; $i &lt; $num_posts; ++$i)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $cur_id = $db-&gt;result($result, $i);<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($cur_id == $pid)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; ++$i;&nbsp; &nbsp; // we started at 0</p><p>&nbsp; &nbsp; $_GET[&#039;p&#039;] = ceil($i / $pun_user[&#039;disp_posts&#039;]);<br />}</p><p>// If action=new, we redirect to the first new post (if any)<br />else if ($action == &#039;new&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;])<br />{<br />&nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT MIN(id) FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id.&#039; AND posted&gt;&#039;.$pun_user[&#039;last_visit&#039;]) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; $first_new_post_id = $db-&gt;result($result);</p><p>&nbsp; &nbsp; if ($first_new_post_id)<br />&nbsp; &nbsp; &nbsp; &nbsp; header(&#039;Location: viewtopic.php?pid=&#039;.$first_new_post_id.&#039;#p&#039;.$first_new_post_id);<br />&nbsp; &nbsp; else&nbsp; &nbsp; // If there is no new post, we go to the last post<br />&nbsp; &nbsp; &nbsp; &nbsp; header(&#039;Location: viewtopic.php?id=&#039;.$id.&#039;&amp;action=last&#039;);</p><p>&nbsp; &nbsp; exit;<br />}</p><p>// If action=last, we redirect to the last post<br />else if ($action == &#039;last&#039;)<br />{<br />&nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT MAX(id) FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; $last_post_id = $db-&gt;result($result);</p><p>&nbsp; &nbsp; if ($last_post_id)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; header(&#039;Location: viewtopic.php?pid=&#039;.$last_post_id.&#039;#p&#039;.$last_post_id);<br />&nbsp; &nbsp; &nbsp; &nbsp; exit;<br />&nbsp; &nbsp; }<br />}</p><br /><p>// Fetch some info about the topic<br />if (!$pun_user[&#039;is_guest&#039;])<br />&nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT pf.forum_name AS parent_forum, f.parent_forum_id, t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;subscriptions AS s ON (t.id=s.topic_id AND s.user_id=&#039;.$pun_user[&#039;id&#039;].&#039;) LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) LEFT JOIN &#039;.$db-&gt;prefix.&#039;forums AS pf ON f.parent_forum_id=pf.id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=&#039;.$id.&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());<br />else<br />&nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT pf.forum_name AS parent_forum, f.parent_forum_id, t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) LEFT JOIN &#039;.$db-&gt;prefix.&#039;forums AS pf ON f.parent_forum_id=pf.id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=&#039;.$id.&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>if (!$db-&gt;num_rows($result))<br />&nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);</p><p>$cur_topic = $db-&gt;fetch_assoc($result);</p><p>// Sort out who the moderators are and if we are currently a moderator (or an admin)<br />$mods_array = ($cur_topic[&#039;moderators&#039;] != &#039;&#039;) ? unserialize($cur_topic[&#039;moderators&#039;]) : array();<br />$is_admmod = ($pun_user[&#039;g_id&#039;] == PUN_ADMIN || ($pun_user[&#039;g_id&#039;] == PUN_MOD &amp;&amp; array_key_exists($pun_user[&#039;username&#039;], $mods_array))) ? true : false;</p><p>// Can we or can we not post replies?<br />if ($cur_topic[&#039;closed&#039;] == &#039;0&#039;)<br />{<br />&nbsp; &nbsp; if (($cur_topic[&#039;post_replies&#039;] == &#039;&#039; &amp;&amp; $pun_user[&#039;g_post_replies&#039;] == &#039;1&#039;) || $cur_topic[&#039;post_replies&#039;] == &#039;1&#039; || $is_admmod)<br />&nbsp; &nbsp; &nbsp; &nbsp; $post_link = &#039;&lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Post reply&#039;].&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; $post_link = &#039; &#039;;<br />}<br />else<br />{<br />&nbsp; &nbsp; $post_link = $lang_topic[&#039;Topic closed&#039;];</p><p>&nbsp; &nbsp; if ($is_admmod)<br />&nbsp; &nbsp; &nbsp; &nbsp; $post_link .= &#039; / &lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Post reply&#039;].&#039;&lt;/a&gt;&#039;;<br />}</p><br /><p>// Determine the post offset (based on $_GET[&#039;p&#039;])<br />$num_pages = ceil(($cur_topic[&#039;num_replies&#039;] + 1) / $pun_user[&#039;disp_posts&#039;]);</p><p>$p = (!isset($_GET[&#039;p&#039;]) || $_GET[&#039;p&#039;] &lt;= 1 || $_GET[&#039;p&#039;] &gt; $num_pages) ? 1 : $_GET[&#039;p&#039;];<br />$start_from = $pun_user[&#039;disp_posts&#039;] * ($p - 1);</p><p>// Generate paging links<br />$paging_links = $lang_common[&#039;Pages&#039;].&#039;: &#039;.paginate($num_pages, $p, &#039;viewtopic.php?id=&#039;.$id);</p><br /><p>if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; $cur_topic[&#039;subject&#039;] = censor_words($cur_topic[&#039;subject&#039;]);</p><br /><p>$quickpost = false;<br />if ($pun_config[&#039;o_quickpost&#039;] == &#039;1&#039; &amp;&amp;<br />&nbsp; &nbsp; !$pun_user[&#039;is_guest&#039;] &amp;&amp;<br />&nbsp; &nbsp; ($cur_topic[&#039;post_replies&#039;] == &#039;1&#039; || ($cur_topic[&#039;post_replies&#039;] == &#039;&#039; &amp;&amp; $pun_user[&#039;g_post_replies&#039;] == &#039;1&#039;)) &amp;&amp;<br />&nbsp; &nbsp; ($cur_topic[&#039;closed&#039;] == &#039;0&#039; || $is_admmod))<br />{<br />&nbsp; &nbsp; $required_fields = array(&#039;req_message&#039; =&gt; $lang_common[&#039;Message&#039;]);<br />&nbsp; &nbsp; $quickpost = true;<br />}</p><p>if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $pun_config[&#039;o_subscriptions&#039;] == &#039;1&#039;)<br />{<br />&nbsp; &nbsp; if ($cur_topic[&#039;is_subscribed&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; // I apologize for the variable naming here. It&#039;s a mix of subscription and action I guess :-)<br />&nbsp; &nbsp; &nbsp; &nbsp; $subscraction = &#039;&lt;p class=&quot;subscribelink clearb&quot;&gt;&#039;.$lang_topic[&#039;Is subscribed&#039;].&#039; - &lt;a href=&quot;misc.php?unsubscribe=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Unsubscribe&#039;].&#039;&lt;/a&gt;&lt;/p&gt;&#039;.&quot;\n&quot;;<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; $subscraction = &#039;&lt;p class=&quot;subscribelink clearb&quot;&gt;&lt;a href=&quot;misc.php?subscribe=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Subscribe&#039;].&#039;&lt;/a&gt;&lt;/p&gt;&#039;.&quot;\n&quot;;<br />}<br />else<br />&nbsp; &nbsp; $subscraction = &#039;&lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;&#039;.&quot;\n&quot;;</p><p>$page_title = pun_htmlspecialchars($pun_config[&#039;o_board_title&#039;].&#039; / &#039;.$cur_topic[&#039;subject&#039;]);<br />define(&#039;PUN_ALLOW_INDEX&#039;, 1);<br />require PUN_ROOT.&#039;header.php&#039;;</p><p>?&gt;<br />&lt;div class=&quot;linkst&quot;&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&quot;pagelink conl&quot;&gt;&lt;?php echo $paging_links ?&gt;&lt;/p&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&quot;postlink conr&quot;&gt;&lt;?php echo $post_link ?&gt;&lt;/p&gt;<br />&lt;?php</p><p>if($cur_topic[&#039;parent_forum&#039;])<br />&nbsp; &nbsp; echo &quot;\t\t&quot;.&#039;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;index.php&quot;&gt;&#039;.$lang_common[&#039;Index&#039;].&#039;&lt;/a&gt; &lt;/li&gt;&lt;li&gt;» &lt;a href=&quot;viewforum.php?id=&#039;.$cur_topic[&#039;parent_forum_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;parent_forum&#039;]).&#039;&lt;/a&gt; &lt;/li&gt;&lt;li&gt;» &lt;a href=&quot;viewforum.php?id=&#039;.$cur_topic[&#039;forum_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]).&#039;&lt;/a&gt; &lt;/li&gt;&lt;li&gt;» &#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/li&gt;&lt;/ul&gt;&#039;;<br />else<br />&nbsp; &nbsp; echo &quot;\t\t&quot;.&#039;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;index.php&quot;&gt;&#039;.$lang_common[&#039;Index&#039;].&#039;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &lt;a href=&quot;viewforum.php?id=&#039;.$cur_topic[&#039;forum_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]).&#039;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/li&gt;&lt;/ul&gt;&#039;;</p><p>?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;</p><p>&lt;?php</p><br /><p>require PUN_ROOT.&#039;include/parser.php&#039;;</p><p>$bg_switch = true;&nbsp; &nbsp; // Used for switching background color in posts<br />$post_count = 0;&nbsp; &nbsp; // Keep track of post numbers</p><p>// Retrieve the posts (and their respective poster/online status)<br />$result = $db-&gt;query(&#039;SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;users AS u ON u.id=p.poster_id INNER JOIN &#039;.$db-&gt;prefix.&#039;groups AS g ON g.g_id=u.group_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=&#039;.$id.&#039; ORDER BY p.id LIMIT &#039;.$start_from.&#039;,&#039;.$pun_user[&#039;disp_posts&#039;], true) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());<br />while ($cur_post = $db-&gt;fetch_assoc($result))<br />{<br />&nbsp; &nbsp; $post_count++;<br />&nbsp; &nbsp; $user_avatar = &#039;&#039;;<br />&nbsp; &nbsp; $user_info = array();<br />&nbsp; &nbsp; $user_contacts = array();<br />&nbsp; &nbsp; $post_actions = array();<br />&nbsp; &nbsp; $is_online = &#039;&#039;;<br />&nbsp; &nbsp; $signature = &#039;&#039;;</p><p>&nbsp; &nbsp; // If the poster is a registered user.<br />&nbsp; &nbsp; if ($cur_post[&#039;poster_id&#039;] &gt; 1)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $username = &#039;&lt;a href=&quot;profile.php?id=&#039;.$cur_post[&#039;poster_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_post[&#039;username&#039;]).&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $user_title = get_title($cur_post);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_title = censor_words($user_title);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Format the online indicator<br />&nbsp; &nbsp; &nbsp; &nbsp; $is_online = ($cur_post[&#039;is_online&#039;] == $cur_post[&#039;poster_id&#039;]) ? &#039;&lt;strong&gt;&#039;.$lang_topic[&#039;Online&#039;].&#039;&lt;/strong&gt;&#039; : $lang_topic[&#039;Offline&#039;];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_avatars&#039;] == &#039;1&#039; &amp;&amp; $cur_post[&#039;use_avatar&#039;] == &#039;1&#039; &amp;&amp; $pun_user[&#039;show_avatars&#039;] != &#039;0&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($img_size = @getimagesize($pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.gif&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_avatar = &#039;&lt;img src=&quot;&#039;.$pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.gif&quot; &#039;.$img_size[3].&#039; alt=&quot;&quot; /&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($img_size = @getimagesize($pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.jpg&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_avatar = &#039;&lt;img src=&quot;&#039;.$pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.jpg&quot; &#039;.$img_size[3].&#039; alt=&quot;&quot; /&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($img_size = @getimagesize($pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.png&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_avatar = &#039;&lt;img src=&quot;&#039;.$pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.png&quot; &#039;.$img_size[3].&#039; alt=&quot;&quot; /&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_avatar = &#039;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // We only show location, register date, post count and the contact links if &quot;Show user info&quot; is enabled<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_show_user_info&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($cur_post[&#039;location&#039;] != &#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $cur_post[&#039;location&#039;] = censor_words($cur_post[&#039;location&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_topic[&#039;From&#039;].&#039;: &#039;.pun_htmlspecialchars($cur_post[&#039;location&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_common[&#039;Registered&#039;].&#039;: &#039;.date($pun_config[&#039;o_date_format&#039;], $cur_post[&#039;registered&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_show_post_count&#039;] == &#039;1&#039; || $pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_common[&#039;Posts&#039;].&#039;: &#039;.$cur_post[&#039;num_posts&#039;];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Now let&#039;s deal with the contact links (E-mail and URL)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (($cur_post[&#039;email_setting&#039;] == &#039;0&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;]) || $pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_contacts[] = &#039;&lt;a href=&quot;mailto:&#039;.$cur_post[&#039;email&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;E-mail&#039;].&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($cur_post[&#039;email_setting&#039;] == &#039;1&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_contacts[] = &#039;&lt;a href=&quot;misc.php?email=&#039;.$cur_post[&#039;poster_id&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;E-mail&#039;].&#039;&lt;/a&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($cur_post[&#039;url&#039;] != &#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_contacts[] = &#039;&lt;a href=&quot;&#039;.pun_htmlspecialchars($cur_post[&#039;url&#039;]).&#039;&quot;&gt;&#039;.$lang_topic[&#039;Website&#039;].&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_info[] = &#039;&lt;dd&gt;IP: &lt;a href=&quot;moderate.php?get_host=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$cur_post[&#039;poster_ip&#039;].&#039;&lt;/a&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($cur_post[&#039;admin_note&#039;] != &#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_topic[&#039;Note&#039;].&#039;: &lt;strong&gt;&#039;.pun_htmlspecialchars($cur_post[&#039;admin_note&#039;]).&#039;&lt;/strong&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; // If the poster is a guest (or a user that has been deleted)<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $username = pun_htmlspecialchars($cur_post[&#039;username&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; $user_title = get_title($cur_post);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_info[] = &#039;&lt;dd&gt;IP: &lt;a href=&quot;moderate.php?get_host=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$cur_post[&#039;poster_ip&#039;].&#039;&lt;/a&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_show_user_info&#039;] == &#039;1&#039; &amp;&amp; $cur_post[&#039;poster_email&#039;] != &#039;&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_contacts[] = &#039;&lt;a href=&quot;mailto:&#039;.$cur_post[&#039;poster_email&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;E-mail&#039;].&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; // Generation post action array (quote, edit, delete etc.)<br />&nbsp; &nbsp; if (!$is_admmod)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (!$pun_user[&#039;is_guest&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $post_actions[] = &#039;&lt;li class=&quot;postreport&quot;&gt;&lt;a href=&quot;misc.php?report=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Report&#039;].&#039;&lt;/a&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($cur_topic[&#039;closed&#039;] == &#039;0&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($cur_post[&#039;poster_id&#039;] == $pun_user[&#039;id&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((($start_from + $post_count) == 1 &amp;&amp; $pun_user[&#039;g_delete_topics&#039;] == &#039;1&#039;) || (($start_from + $post_count) &gt; 1 &amp;&amp; $pun_user[&#039;g_delete_posts&#039;] == &#039;1&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $post_actions[] = &#039;&lt;li class=&quot;postdelete&quot;&gt;&lt;a href=&quot;delete.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Delete&#039;].&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pun_user[&#039;g_edit_posts&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $post_actions[] = &#039;&lt;li class=&quot;postedit&quot;&gt;&lt;a href=&quot;edit.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Edit&#039;].&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (($cur_topic[&#039;post_replies&#039;] == &#039;&#039; &amp;&amp; $pun_user[&#039;g_post_replies&#039;] == &#039;1&#039;) || $cur_topic[&#039;post_replies&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $post_actions[] = &#039;&lt;li class=&quot;postquote&quot;&gt;&lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&amp;qid=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Quote&#039;].&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; $post_actions[] = &#039;&lt;li class=&quot;postreport&quot;&gt;&lt;a href=&quot;misc.php?report=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Report&#039;].&#039;&lt;/a&gt;&#039;.$lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&lt;li class=&quot;postdelete&quot;&gt;&lt;a href=&quot;delete.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Delete&#039;].&#039;&lt;/a&gt;&#039;.$lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&lt;li class=&quot;postedit&quot;&gt;&lt;a href=&quot;edit.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Edit&#039;].&#039;&lt;/a&gt;&#039;.$lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&lt;li class=&quot;postquote&quot;&gt;&lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&amp;qid=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Quote&#039;].&#039;&lt;/a&gt;&#039;;</p><br /><p>&nbsp; &nbsp; // Switch the background color for every message.<br />&nbsp; &nbsp; $bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;<br />&nbsp; &nbsp; $vtbg = ($bg_switch) ? &#039; roweven&#039; : &#039; rowodd&#039;;</p><br /><p>&nbsp; &nbsp; // Perform the main parsing of the message (BBCode, smilies, censor words etc)<br />&nbsp; &nbsp; $cur_post[&#039;message&#039;] = parse_message($cur_post[&#039;message&#039;], $cur_post[&#039;hide_smilies&#039;]);</p><p>&nbsp; &nbsp; // Do signature parsing/caching<br />&nbsp; &nbsp; if ($cur_post[&#039;signature&#039;] != &#039;&#039; &amp;&amp; $pun_user[&#039;show_sig&#039;] != &#039;0&#039;)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (isset($signature_cache[$cur_post[&#039;poster_id&#039;]]))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $signature = $signature_cache[$cur_post[&#039;poster_id&#039;]];<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $signature = parse_signature($cur_post[&#039;signature&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $signature_cache[$cur_post[&#039;poster_id&#039;]] = $signature;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }</p><p>?&gt;<br />&lt;div id=&quot;p&lt;?php echo $cur_post[&#039;id&#039;] ?&gt;&quot; class=&quot;blockpost&lt;?php echo $vtbg ?&gt;&lt;?php if (($post_count + $start_from) == 1) echo &#039; firstpost&#039;; ?&gt;&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;&lt;span&gt;&lt;span class=&quot;conr&quot;&gt;#&lt;?php echo ($start_from + $post_count) ?&gt; &lt;/span&gt;&lt;a href=&quot;viewtopic.php?pid=&lt;?php echo $cur_post[&#039;id&#039;].&#039;#p&#039;.$cur_post[&#039;id&#039;] ?&gt;&quot;&gt;&lt;?php echo format_time($cur_post[&#039;posted&#039;]) ?&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;box&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postleft&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dl&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dt&gt;&lt;strong&gt;&lt;?php echo $username ?&gt;&lt;/strong&gt;&lt;/dt&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd class=&quot;usertitle&quot;&gt;&lt;strong&gt;&lt;?php echo $user_title ?&gt;&lt;/strong&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd class=&quot;postavatar&quot;&gt;&lt;?php echo $user_avatar ?&gt;&lt;/dd&gt;<br />&lt;?php if (count($user_info)) echo &quot;\t\t\t\t\t&quot;.implode(&#039;&lt;/dd&gt;&#039;.&quot;\n\t\t\t\t\t&quot;, $user_info).&#039;&lt;/dd&gt;&#039;.&quot;\n&quot;; ?&gt;<br />&lt;?php if (count($user_contacts)) echo &quot;\t\t\t\t\t&quot;.&#039;&lt;dd class=&quot;usercontacts&quot;&gt;&#039;.implode(&#039;  &#039;, $user_contacts).&#039;&lt;/dd&gt;&#039;.&quot;\n&quot;; ?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/dl&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postright&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h3&gt;&lt;?php if (($post_count + $start_from) &gt; 1) echo &#039; Re: &#039;; ?&gt;&lt;?php echo pun_htmlspecialchars($cur_topic[&#039;subject&#039;]) ?&gt;&lt;/h3&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postmsg&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo $cur_post[&#039;message&#039;].&quot;\n&quot; ?&gt;<br />&lt;?php if ($cur_post[&#039;edited&#039;] != &#039;&#039;) echo &quot;\t\t\t\t\t&quot;.&#039;&lt;p class=&quot;postedit&quot;&gt;&lt;em&gt;&#039;.$lang_topic[&#039;Last edit&#039;].&#039; &#039;.pun_htmlspecialchars($cur_post[&#039;edited_by&#039;]).&#039; (&#039;.format_time($cur_post[&#039;edited&#039;]).&#039;)&lt;/em&gt;&lt;/p&gt;&#039;.&quot;\n&quot;; ?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&lt;?php if ($signature != &#039;&#039;) echo &quot;\t\t\t\t&quot;.&#039;&lt;div class=&quot;postsignature&quot;&gt;&lt;hr /&gt;&#039;.$signature.&#039;&lt;/div&gt;&#039;.&quot;\n&quot;; ?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postfootleft&quot;&gt;&lt;?php if ($cur_post[&#039;poster_id&#039;] &gt; 1) echo &#039;&lt;p&gt;&#039;.$is_online.&#039;&lt;/p&gt;&#039;; ?&gt;&lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postfootright&quot;&gt;&lt;?php echo (count($post_actions)) ? &#039;&lt;ul&gt;&#039;.implode($lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&#039;, $post_actions).&#039;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&#039;.&quot;\n&quot; : &#039;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&#039;.&quot;\n&quot; ?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;</p><p>&lt;?php if ($post_count == &#039;1&#039; &amp;&amp; $adsense_config[&#039;google_adsense_enabled&#039;] == &#039;1&#039; &amp;&amp; strpos($adsense_config[&#039;google_exclude_forums&#039;], &#039;,&#039;.$cur_topic[&#039;forum_id&#039;].&#039;,&#039;) === FALSE &amp;&amp; strpos($adsense_config[&#039;google_exclude_groups&#039;], &#039;,&#039;.$pun_user[&#039;g_id&#039;].&#039;,&#039;) === FALSE)<br />&nbsp; &nbsp; {<br />?&gt;<br />&lt;div class=&quot;blockpost&lt;?php echo $vtbg ?&gt;&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;&lt;span&gt;&lt;?php echo format_time($cur_post[&#039;posted&#039;]) ?&gt;&lt;/span&gt;&lt;/h2&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;box&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postleft&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dl&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dt&gt;&lt;strong&gt;&lt;?php echo $adsense_config[&#039;google_bot_name&#039;] ?&gt;&lt;/strong&gt;&lt;/dt&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd class=&quot;usertitle&quot;&gt;&lt;?php echo $adsense_config[&#039;google_bot_tag&#039;] ?&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/dl&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postright&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postmsg&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo &quot;&lt;br /&gt;&lt;div style=\&quot;TEXT-ALIGN: center\&quot;&gt;<br />&nbsp; &nbsp; &lt;script type=\&quot;text/javascript\&quot;&gt;<br />&nbsp; &nbsp; &lt;!--<br />&nbsp; &nbsp; &nbsp; &nbsp; google_ad_client = \&quot;&quot;.$adsense_config[&#039;google_ad_client&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_ad_width = &quot;.$adsense_config[&#039;google_ad_width&#039;].&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_ad_height = &quot;.$adsense_config[&#039;google_ad_height&#039;].&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_ad_format = \&quot;&quot;.$adsense_config[&#039;google_ad_format&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_ad_channel = \&quot;&quot;.$adsense_config[&#039;google_ad_channel&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_ad_type = \&quot;&quot;.$adsense_config[&#039;google_ad_type&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_color_border = \&quot;&quot;.$adsense_config[&#039;google_color_border&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_color_bg = \&quot;&quot;.$adsense_config[&#039;google_color_bg&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_color_link = \&quot;&quot;.$adsense_config[&#039;google_color_link&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_color_url = \&quot;&quot;.$adsense_config[&#039;google_color_url&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; google_color_text = \&quot;&quot;.$adsense_config[&#039;google_color_text&#039;].&quot;\&quot;;<br />&nbsp; &nbsp; //--&gt;<br />&nbsp; &nbsp; &lt;/script&gt;<br />&nbsp; &nbsp; &lt;script type=\&quot;text/javascript\&quot; src=\&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js\&quot;&gt;&lt;/script&gt;<br />&lt;/div&gt;&lt;br /&gt;\n&quot; ?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;<br />&lt;?php<br />&nbsp; &nbsp; }</p><p>}</p><p>?&gt;<br />&lt;div class=&quot;postlinksb&quot;&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&quot;postlink conr&quot;&gt;&lt;?php echo $post_link ?&gt;&lt;/p&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&quot;pagelink conl&quot;&gt;&lt;?php echo $paging_links ?&gt;&lt;/p&gt;<br />&lt;?php</p><p>if($cur_topic[&#039;parent_forum&#039;])<br />&nbsp; &nbsp; echo &quot;\t\t&quot;.&#039;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;index.php&quot;&gt;&#039;.$lang_common[&#039;Index&#039;].&#039;&lt;/a&gt; &lt;/li&gt;&lt;li&gt;» &lt;a href=&quot;viewforum.php?id=&#039;.$cur_topic[&#039;parent_forum_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;parent_forum&#039;]).&#039;&lt;/a&gt; &lt;/li&gt;&lt;li&gt;» &lt;a href=&quot;viewforum.php?id=&#039;.$cur_topic[&#039;forum_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]).&#039;&lt;/a&gt; &lt;/li&gt;&lt;li&gt;» &#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/li&gt;&lt;/ul&gt;&#039;;<br />else<br />&nbsp; &nbsp; echo &quot;\t\t&quot;.&#039;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;index.php&quot;&gt;&#039;.$lang_common[&#039;Index&#039;].&#039;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &lt;a href=&quot;viewforum.php?id=&#039;.$cur_topic[&#039;forum_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]).&#039;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/li&gt;&lt;/ul&gt;&#039;;</p><p>?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo $subscraction ?&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;</p><p>&lt;?php</p><p>// Display quick post if enabled<br />if ($quickpost)<br />{</p><p>?&gt;<br />&lt;div class=&quot;blockform&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;&lt;span&gt;&lt;?php echo $lang_topic[&#039;Quick post&#039;] ?&gt;&lt;/span&gt;&lt;/h2&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;box&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;form method=&quot;post&quot; action=&quot;post.php?tid=&lt;?php echo $id ?&gt;&quot; onsubmit=&quot;this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;inform&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fieldset&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;legend&gt;&lt;?php echo $lang_common[&#039;Write message legend&#039;] ?&gt;&lt;/legend&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;infldset txtarea&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;hidden&quot; name=&quot;form_sent&quot; value=&quot;1&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;hidden&quot; name=&quot;form_user&quot; value=&quot;&lt;?php echo (!$pun_user[&#039;is_guest&#039;]) ? pun_htmlspecialchars($pun_user[&#039;username&#039;]) : &#039;Guest&#039;; ?&gt;&quot; /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label&gt;&lt;textarea name=&quot;req_message&quot; rows=&quot;7&quot; cols=&quot;75&quot; tabindex=&quot;1&quot;&gt;&lt;/textarea&gt;&lt;/label&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ul class=&quot;bblinks&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;help.php#bbcode&quot; onclick=&quot;window.open(this.href); return false;&quot;&gt;&lt;?php echo $lang_common[&#039;BBCode&#039;] ?&gt;&lt;/a&gt;: &lt;?php echo ($pun_config[&#039;p_message_bbcode&#039;] == &#039;1&#039;) ? $lang_common[&#039;on&#039;] : $lang_common[&#039;off&#039;]; ?&gt;&lt;/li&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;help.php#img&quot; onclick=&quot;window.open(this.href); return false;&quot;&gt;&lt;?php echo $lang_common[&#039;img tag&#039;] ?&gt;&lt;/a&gt;: &lt;?php echo ($pun_config[&#039;p_message_img_tag&#039;] == &#039;1&#039;) ? $lang_common[&#039;on&#039;] : $lang_common[&#039;off&#039;]; ?&gt;&lt;/li&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;help.php#smilies&quot; onclick=&quot;window.open(this.href); return false;&quot;&gt;&lt;?php echo $lang_common[&#039;Smilies&#039;] ?&gt;&lt;/a&gt;: &lt;?php echo ($pun_config[&#039;o_smilies&#039;] == &#039;1&#039;) ? $lang_common[&#039;on&#039;] : $lang_common[&#039;off&#039;]; ?&gt;&lt;/li&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ul&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fieldset&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; tabindex=&quot;2&quot; value=&quot;&lt;?php echo $lang_common[&#039;Submit&#039;] ?&gt;&quot; accesskey=&quot;s&quot; /&gt;&lt;/p&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/form&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;<br />&lt;?php</p><p>}</p><p>// Increment &quot;num_views&quot; for topic<br />$low_prio = ($db_type == &#039;mysql&#039;) ? &#039;LOW_PRIORITY &#039; : &#039;&#039;;<br />$db-&gt;query(&#039;UPDATE &#039;.$low_prio.$db-&gt;prefix.&#039;topics SET num_views=num_views+1 WHERE id=&#039;.$id) or error(&#039;Unable to update topic&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>$forum_id = $cur_topic[&#039;forum_id&#039;];<br />$footer_style = &#039;viewtopic&#039;;<br />require PUN_ROOT.&#039;footer.php&#039;;[/code]<br />search.php<br />[code]&lt;?php<br />/***********************************************************************</p><p>&nbsp; Copyright (C) 2002-2005&nbsp; Rickard Andersson (rickard@punbb.org)</p><p>&nbsp; This file is part of PunBB.</p><p>&nbsp; PunBB is free software; you can redistribute it and/or modify it<br />&nbsp; under the terms of the GNU General Public License as published<br />&nbsp; by the Free Software Foundation; either version 2 of the License,<br />&nbsp; or (at your option) any later version.</p><p>&nbsp; PunBB is distributed in the hope that it will be useful, but<br />&nbsp; WITHOUT ANY WARRANTY; without even the implied warranty of<br />&nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; See the<br />&nbsp; GNU General Public License for more details.</p><p>&nbsp; You should have received a copy of the GNU General Public License<br />&nbsp; along with this program; if not, write to the Free Software<br />&nbsp; Foundation, Inc., 59 Temple Place, Suite 330, Boston,<br />&nbsp; MA&nbsp; 02111-1307&nbsp; USA</p><p>************************************************************************/</p><br /><p>// The contents of this file are very much inspired by the file search.php<br />// from the phpBB Group forum software phpBB2 (<a href="http://www.phpbb.com">http://www.phpbb.com</a>).</p><br /><p>define(&#039;PUN_ROOT&#039;, &#039;./&#039;);<br />require PUN_ROOT.&#039;include/common.php&#039;;</p><br /><p>// Load the search.php language file<br />require PUN_ROOT.&#039;lang/&#039;.$pun_user[&#039;language&#039;].&#039;/search.php&#039;;</p><br /><p>if ($pun_user[&#039;g_read_board&#039;] == &#039;0&#039;)<br />&nbsp; &nbsp; message($lang_common[&#039;No view&#039;]);<br />else if ($pun_user[&#039;g_search&#039;] == &#039;0&#039;)<br />&nbsp; &nbsp; message($lang_search[&#039;No search permission&#039;]);</p><br /><p>// Detect two byte character sets<br />$multibyte = (isset($lang_common[&#039;lang_multibyte&#039;]) &amp;&amp; $lang_common[&#039;lang_multibyte&#039;]) ? true : false;</p><br /><p>// Figure out what to do :-)<br />if (isset($_GET[&#039;action&#039;]) || isset($_GET[&#039;search_id&#039;]))<br />{<br />&nbsp; &nbsp; $action = (isset($_GET[&#039;action&#039;])) ? $_GET[&#039;action&#039;] : null;<br />&nbsp; &nbsp; $forum = (isset($_GET[&#039;forum&#039;])) ? intval($_GET[&#039;forum&#039;]) : -1;<br />&nbsp; &nbsp; $sort_dir = (isset($_GET[&#039;sort_dir&#039;])) ? (($_GET[&#039;sort_dir&#039;] == &#039;DESC&#039;) ? &#039;DESC&#039; : &#039;ASC&#039;) : &#039;DESC&#039;;<br />&nbsp; &nbsp; if (isset($search_id)) unset($search_id);</p><p>&nbsp; &nbsp; // If a search_id was supplied<br />&nbsp; &nbsp; if (isset($_GET[&#039;search_id&#039;]))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $search_id = intval($_GET[&#039;search_id&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($search_id &lt; 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; // If it&#039;s a regular search (keywords and/or author)<br />&nbsp; &nbsp; else if ($action == &#039;search&#039;)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $keywords = (isset($_GET[&#039;keywords&#039;])) ? strtolower(trim($_GET[&#039;keywords&#039;])) : null;<br />&nbsp; &nbsp; &nbsp; &nbsp; $author = (isset($_GET[&#039;author&#039;])) ? strtolower(trim($_GET[&#039;author&#039;])) : null;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (preg_match(&#039;#^[\*%]+$#&#039;, $keywords) || strlen(str_replace(array(&#039;*&#039;, &#039;%&#039;), &#039;&#039;, $keywords)) &lt; 3)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keywords = &#039;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (preg_match(&#039;#^[\*%]+$#&#039;, $author) || strlen(str_replace(array(&#039;*&#039;, &#039;%&#039;), &#039;&#039;, $author)) &lt; 3)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $author = &#039;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (!$keywords &amp;&amp; !$author)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No terms&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($author)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $author = str_replace(&#039;*&#039;, &#039;%&#039;, $author);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $show_as = (isset($_GET[&#039;show_as&#039;])) ? $_GET[&#039;show_as&#039;] : &#039;posts&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $sort_by = (isset($_GET[&#039;sort_by&#039;])) ? intval($_GET[&#039;sort_by&#039;]) : null;<br />&nbsp; &nbsp; &nbsp; &nbsp; $search_in = (!isset($_GET[&#039;search_in&#039;]) || $_GET[&#039;search_in&#039;] == &#039;all&#039;) ? 0 : (($_GET[&#039;search_in&#039;] == &#039;message&#039;) ? 1 : -1);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; // If it&#039;s a user search (by id)<br />&nbsp; &nbsp; else if ($action == &#039;show_user&#039;)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $user_id = intval($_GET[&#039;user_id&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($user_id &lt; 2)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($action != &#039;show_new&#039; &amp;&amp; $action != &#039;show_24h&#039; &amp;&amp; $action != &#039;show_unanswered&#039; &amp;&amp; $action != &#039;show_subscriptions&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);<br />&nbsp; &nbsp; }</p><br /><p>&nbsp; &nbsp; // If a valid search_id was supplied we attempt to fetch the search results from the db<br />&nbsp; &nbsp; if (isset($search_id))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $ident = ($pun_user[&#039;is_guest&#039;]) ? get_remote_address() : $pun_user[&#039;username&#039;];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT search_data FROM &#039;.$db-&gt;prefix.&#039;search_cache WHERE id=&#039;.$search_id.&#039; AND ident=\&#039;&#039;.$db-&gt;escape($ident).&#039;\&#039;&#039;) or error(&#039;Unable to fetch search results&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($row = $db-&gt;fetch_assoc($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $temp = unserialize($row[&#039;search_data&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_results = $temp[&#039;search_results&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = $temp[&#039;num_hits&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_by = $temp[&#039;sort_by&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_dir = $temp[&#039;sort_dir&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $show_as = $temp[&#039;show_as&#039;];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($temp);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No hits&#039;]);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $keyword_results = $author_results = array();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Search a specific forum?<br />&nbsp; &nbsp; &nbsp; &nbsp; $forum_sql = ($forum != -1 || ($forum == -1 &amp;&amp; $pun_config[&#039;o_search_all_forums&#039;] == &#039;0&#039;)) ? &#039; AND t.forum_id = &#039;.$forum : &#039;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (!empty($author) || !empty($keywords))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If it&#039;s a search for keywords<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($keywords)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $stopwords = (array)@file(PUN_ROOT.&#039;lang/&#039;.$pun_user[&#039;language&#039;].&#039;/stopwords.txt&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $stopwords = array_map(&#039;trim&#039;, $stopwords);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Are we searching for multibyte charset text?<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($multibyte)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Strip out excessive whitespace<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keywords = trim(preg_replace(&#039;#\s+#&#039;, &#039; &#039;, $keywords));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keywords_array = explode(&#039; &#039;, $keywords);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Filter out non-alphabetical chars<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $noise_match = array(&#039;^&#039;, &#039;$&#039;, &#039;&amp;&#039;, &#039;(&#039;, &#039;)&#039;, &#039;&lt;&#039;, &#039;&gt;&#039;, &#039;`&#039;, &#039;\&#039;&#039;, &#039;&quot;&#039;, &#039;|&#039;, &#039;,&#039;, &#039;@&#039;, &#039;_&#039;, &#039;?&#039;, &#039;%&#039;, &#039;~&#039;, &#039;[&#039;, &#039;]&#039;, &#039;{&#039;, &#039;}&#039;, &#039;:&#039;, &#039;\\&#039;, &#039;/&#039;, &#039;=&#039;, &#039;#&#039;, &#039;\&#039;&#039;, &#039;;&#039;, &#039;!&#039;, &#039;¤&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $noise_replace = array(&#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039;&#039;,&nbsp; &#039;&#039;,&nbsp; &nbsp;&#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039;&#039;,&nbsp; &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039;&#039; ,&nbsp; &#039; &#039;, &#039; &#039;, &#039; &#039;, &#039; &#039;,&nbsp; &#039; &#039;, &#039; &#039;, &#039; &#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keywords = str_replace($noise_match, $noise_replace, $keywords);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Strip out excessive whitespace<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keywords = trim(preg_replace(&#039;#\s+#&#039;, &#039; &#039;, $keywords));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Fill an array with all the words<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keywords_array = explode(&#039; &#039;, $keywords);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (empty($keywords_array))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No hits&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (list($i, $word) = @each($keywords_array))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_chars = pun_strlen($word);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($num_chars &lt; 3 || $num_chars &gt; 20 || in_array($word, $stopwords))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($keywords_array[$i]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Should we search in message body or topic subject specifically?<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_in_cond = ($search_in) ? (($search_in &gt; 0) ? &#039; AND m.subject_match = 0&#039; : &#039; AND m.subject_match = 1&#039;) : &#039;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $word_count = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $match_type = &#039;and&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result_list = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @reset($keywords_array);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (list(, $cur_word) = @each($keywords_array))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch ($cur_word)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#039;and&#039;:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#039;or&#039;:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#039;not&#039;:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $match_type = $cur_word;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Are we searching for multibyte charset text?<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($multibyte)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $cur_word = $db-&gt;escape(&#039;%&#039;.str_replace(&#039;*&#039;, &#039;&#039;, $cur_word).&#039;%&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $cur_word_like = ($db_type == &#039;pgsql&#039;) ? &#039;ILIKE \&#039;&#039;.$cur_word.&#039;\&#039;&#039; : &#039;LIKE \&#039;&#039;.$cur_word.&#039;\&#039;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($search_in &gt; 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE message &#039;.$cur_word_like;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($search_in &lt; 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#039;SELECT p.id FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;topics AS t ON t.id=p.topic_id WHERE t.subject &#039;.$cur_word_like.&#039; GROUP BY p.id, t.id&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#039;SELECT p.id FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;topics AS t ON t.id=p.topic_id WHERE p.message &#039;.$cur_word_like.&#039; OR t.subject &#039;.$cur_word_like.&#039; GROUP BY p.id, t.id&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $cur_word = str_replace(&#039;*&#039;, &#039;%&#039;, $cur_word);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#039;SELECT m.post_id FROM &#039;.$db-&gt;prefix.&#039;search_words AS w INNER JOIN &#039;.$db-&gt;prefix.&#039;search_matches AS m ON m.word_id = w.id WHERE w.word LIKE \&#039;&#039;.$cur_word.&#039;\&#039;&#039;.$search_in_cond;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query($sql, true) or error(&#039;Unable to search for posts&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $row = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($temp = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $row[$temp[0]] = 1;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$word_count)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result_list[$temp[0]] = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($match_type == &#039;or&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result_list[$temp[0]] = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($match_type == &#039;not&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result_list[$temp[0]] = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($match_type == &#039;and&#039; &amp;&amp; $word_count)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @reset($result_list);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (list($post_id,) = @each($result_list))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!isset($row[$post_id]))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result_list[$post_id] = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ++$word_count;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;free_result($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @reset($result_list);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (list($post_id, $matches) = @each($result_list))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($matches)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keyword_results[] = $post_id;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($result_list);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If it&#039;s a search for author name (and that author name isn&#039;t Guest)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($author &amp;&amp; strcasecmp($author, &#039;Guest&#039;) &amp;&amp; strcasecmp($author, $lang_common[&#039;Guest&#039;]))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch ($db_type)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#039;pgsql&#039;:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;users WHERE username ILIKE \&#039;&#039;.$db-&gt;escape($author).&#039;\&#039;&#039;) or error(&#039;Unable to fetch users&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;users WHERE username LIKE \&#039;&#039;.$db-&gt;escape($author).&#039;\&#039;&#039;) or error(&#039;Unable to fetch users&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($db-&gt;num_rows($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_ids = &#039;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($row = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $user_ids .= (($user_ids != &#039;&#039;) ? &#039;,&#039; : &#039;&#039;).$row[0];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE poster_id IN(&#039;.$user_ids.&#039;)&#039;) or error(&#039;Unable to fetch matched posts list&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($row = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $author_results[] = $row[0];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;free_result($result);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($author &amp;&amp; $keywords)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If we searched for both keywords and author name we want the intersection between the results<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids = array_intersect($keyword_results, $author_results);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($keyword_results, $author_results);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($keywords)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids = $keyword_results;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids = $author_results;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = count($search_ids);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$num_hits)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No hits&#039;]);</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($show_as == &#039;topics&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT t.id FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;topics AS t ON t.id=p.topic_id INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id IN(&#039;.implode(&#039;,&#039;, $search_ids).&#039;)&#039;.$forum_sql.&#039; GROUP BY t.id&#039;, true) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($row = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids[] = $row[0];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;free_result($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = count($search_ids);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT p.id FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;topics AS t ON t.id=p.topic_id INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id IN(&#039;.implode(&#039;,&#039;, $search_ids).&#039;)&#039;.$forum_sql, true) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($row = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids[] = $row[0];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;free_result($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = count($search_ids);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else if ($action == &#039;show_new&#039; || $action == &#039;show_24h&#039; || $action == &#039;show_user&#039; || $action == &#039;show_subscriptions&#039; || $action == &#039;show_unanswered&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If it&#039;s a search for new posts<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($action == &#039;show_new&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pun_user[&#039;is_guest&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_common[&#039;No permission&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT t.id FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post&gt;&#039;.$pun_user[&#039;last_visit&#039;].&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = $db-&gt;num_rows($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$num_hits)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No new posts&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If it&#039;s a search for todays posts<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($action == &#039;show_24h&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT t.id FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post&gt;&#039;.(time() - 86400).&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = $db-&gt;num_rows($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$num_hits)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No recent posts&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If it&#039;s a search for posts by a specific user ID<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($action == &#039;show_user&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT t.id FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;posts AS p ON t.id=p.topic_id INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id=&#039;.$user_id.&#039; GROUP BY t.id&#039;) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = $db-&gt;num_rows($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$num_hits)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No user posts&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If it&#039;s a search for subscribed topics<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if ($action == &#039;show_subscriptions&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pun_user[&#039;is_guest&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT t.id FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;subscriptions AS s ON (t.id=s.topic_id AND s.user_id=&#039;.$pun_user[&#039;id&#039;].&#039;) INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1)&#039;) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = $db-&gt;num_rows($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$num_hits)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No subscriptions&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If it&#039;s a search for unanswered posts<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT t.id FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_hits = $db-&gt;num_rows($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$num_hits)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_search[&#039;No unanswered&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // We want to sort things after last post<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_by = 4;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($row = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_ids[] = $row[0];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;free_result($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $show_as = &#039;topics&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message($lang_common[&#039;Bad request&#039;]);</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; // Prune &quot;old&quot; search results<br />&nbsp; &nbsp; &nbsp; &nbsp; $old_searches = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT ident FROM &#039;.$db-&gt;prefix.&#039;online&#039;) or error(&#039;Unable to fetch online list&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($db-&gt;num_rows($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($row = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $old_searches[] = &#039;\&#039;&#039;.$db-&gt;escape($row[0]).&#039;\&#039;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;query(&#039;DELETE FROM &#039;.$db-&gt;prefix.&#039;search_cache WHERE ident NOT IN(&#039;.implode(&#039;,&#039;, $old_searches).&#039;)&#039;) or error(&#039;Unable to delete search results&#039;, __FILE__, __LINE__, $db-&gt;error());<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Final search results<br />&nbsp; &nbsp; &nbsp; &nbsp; $search_results = implode(&#039;,&#039;, $search_ids);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Fill an array with our results and search properties<br />&nbsp; &nbsp; &nbsp; &nbsp; $temp[&#039;search_results&#039;] = $search_results;<br />&nbsp; &nbsp; &nbsp; &nbsp; $temp[&#039;num_hits&#039;] = $num_hits;<br />&nbsp; &nbsp; &nbsp; &nbsp; $temp[&#039;sort_by&#039;] = $sort_by;<br />&nbsp; &nbsp; &nbsp; &nbsp; $temp[&#039;sort_dir&#039;] = $sort_dir;<br />&nbsp; &nbsp; &nbsp; &nbsp; $temp[&#039;show_as&#039;] = $show_as;<br />&nbsp; &nbsp; &nbsp; &nbsp; $temp = serialize($temp);<br />&nbsp; &nbsp; &nbsp; &nbsp; $search_id = mt_rand(1, 2147483647);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $ident = ($pun_user[&#039;is_guest&#039;]) ? get_remote_address() : $pun_user[&#039;username&#039;];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;query(&#039;INSERT INTO &#039;.$db-&gt;prefix.&#039;search_cache (id, ident, search_data) VALUES(&#039;.$search_id.&#039;, \&#039;&#039;.$db-&gt;escape($ident).&#039;\&#039;, \&#039;&#039;.$db-&gt;escape($temp).&#039;\&#039;)&#039;) or error(&#039;Unable to insert search results&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($action != &#039;show_new&#039; &amp;&amp; $action != &#039;show_24h&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;end_transaction();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;close();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Redirect the user to the cached result page<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; header(&#039;Location: search.php?search_id=&#039;.$search_id);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }</p><br /><p>&nbsp; &nbsp; // Fetch results to display<br />&nbsp; &nbsp; if ($search_results != &#039;&#039;)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; switch ($sort_by)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_by_sql = ($show_as == &#039;topics&#039;) ? &#039;t.poster&#039; : &#039;p.poster&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 2:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_by_sql = &#039;t.subject&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 3:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_by_sql = &#039;t.forum_id&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 4:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_by_sql = &#039;t.last_post&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sort_by_sql = ($show_as == &#039;topics&#039;) ? &#039;t.posted&#039; : &#039;p.posted&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($show_as == &#039;posts&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $substr_sql = ($db_type != &#039;sqlite&#039;) ? &#039;SUBSTRING&#039; : &#039;SUBSTR&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#039;SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, &#039;.$substr_sql.&#039;(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;topics AS t ON t.id=p.topic_id WHERE p.id IN(&#039;.$search_results.&#039;) ORDER BY &#039;.$sort_by_sql;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#039;SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM &#039;.$db-&gt;prefix.&#039;topics AS t WHERE t.id IN(&#039;.$search_results.&#039;) ORDER BY &#039;.$sort_by_sql;</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; // Determine the topic or post offset (based on $_GET[&#039;p&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; $per_page = ($show_as == &#039;posts&#039;) ? $pun_user[&#039;disp_posts&#039;] : $pun_user[&#039;disp_topics&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $num_pages = ceil($num_hits / $per_page);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $p = (!isset($_GET[&#039;p&#039;]) || $_GET[&#039;p&#039;] &lt;= 1 || $_GET[&#039;p&#039;] &gt; $num_pages) ? 1 : $_GET[&#039;p&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $start_from = $per_page * ($p - 1);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Generate paging links<br />&nbsp; &nbsp; &nbsp; &nbsp; $paging_links = $lang_common[&#039;Pages&#039;].&#039;: &#039;.paginate($num_pages, $p, &#039;search.php?search_id=&#039;.$search_id);</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &#039; &#039;.$sort_dir.&#039; LIMIT &#039;.$start_from.&#039;, &#039;.$per_page;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query($sql) or error(&#039;Unable to fetch search results&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $search_set = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; while ($row = $db-&gt;fetch_assoc($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_set[] = $row;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;free_result($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $page_title = pun_htmlspecialchars($pun_config[&#039;o_board_title&#039;]).&#039; / &#039;.$lang_search[&#039;Search results&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; require PUN_ROOT.&#039;header.php&#039;;</p><br /><p>?&gt;<br />&lt;div class=&quot;linkst&quot;&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&quot;pagelink&quot;&gt;&lt;?php echo $paging_links ?&gt;&lt;/p&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;</p><p>&lt;?php</p><p>&nbsp; &nbsp; &nbsp; &nbsp; //Set background switching on for show as posts<br />&nbsp; &nbsp; &nbsp; &nbsp; $bg_switch = true;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($show_as == &#039;topics&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; {</p><p>?&gt;<br />&lt;div id=&quot;vf&quot; class=&quot;blocktable&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;&lt;span&gt;&lt;?php echo $lang_search[&#039;Search results&#039;]; ?&gt;&lt;/span&gt;&lt;/h2&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;box&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table cellspacing=&quot;0&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;thead&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tcl&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Topic&#039;]; ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tc2&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Forum&#039;] ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tc3&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Replies&#039;] ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th class=&quot;tcr&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Last post&#039;] ?&gt;&lt;/th&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/thead&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tbody&gt;<br />&lt;?php</p><p>&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Fetch the list of forums<br />&nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;query(&#039;SELECT id, forum_name FROM &#039;.$db-&gt;prefix.&#039;forums&#039;) or error(&#039;Unable to fetch forum list&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $forum_list = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; while ($forum_list[] = $db-&gt;fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Finally, lets loop through the results and output them<br />&nbsp; &nbsp; &nbsp; &nbsp; for ($i = 0; $i &lt; count($search_set); ++$i)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @reset($forum_list);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (list(, $temp) = @each($forum_list))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($temp[0] == $search_set[$i][&#039;forum_id&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $forum = &#039;&lt;a href=&quot;viewforum.php?id=&#039;.$temp[0].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($temp[1]).&#039;&lt;/a&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_set[$i][&#039;subject&#039;] = censor_words($search_set[$i][&#039;subject&#039;]);</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($show_as == &#039;posts&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon = &#039;&lt;div class=&quot;icon&quot;&gt;&lt;div class=&quot;nosize&quot;&gt;&#039;.$lang_common[&#039;Normal icon&#039;].&#039;&lt;/div&gt;&lt;/div&gt;&#039;.&quot;\n&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $subject = &#039;&lt;a href=&quot;viewtopic.php?id=&#039;.$search_set[$i][&#039;tid&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($search_set[$i][&#039;subject&#039;]).&#039;&lt;/a&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $search_set[$i][&#039;last_post&#039;] &gt; $pun_user[&#039;last_visit&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon = &#039;&lt;div class=&quot;icon inew&quot;&gt;&lt;div class=&quot;nosize&quot;&gt;&#039;.$lang_common[&#039;New icon&#039;].&#039;&lt;/div&gt;&lt;/div&gt;&#039;.&quot;\n&quot;;</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search_set[$i][&#039;message&#039;] = censor_words($search_set[$i][&#039;message&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $message = str_replace(&quot;\n&quot;, &#039;&lt;br /&gt;&#039;, pun_htmlspecialchars($search_set[$i][&#039;message&#039;]));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $pposter = pun_htmlspecialchars($search_set[$i][&#039;pposter&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($search_set[$i][&#039;poster_id&#039;] &gt; 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $pposter = &#039;&lt;strong&gt;&lt;a href=&quot;profile.php?id=&#039;.$search_set[$i][&#039;poster_id&#039;].&#039;&quot;&gt;&#039;.$pposter.&#039;&lt;/a&gt;&lt;/strong&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pun_strlen($message) &gt;= 1000)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $message .= &#039; …&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $vtpost1 = ($i == 0) ? &#039; vtp1&#039; : &#039;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Switch the background color for every message.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $vtbg = ($bg_switch) ? &#039; rowodd&#039; : &#039; roweven&#039;;</p><br /><p>?&gt;<br />&lt;div class=&quot;blockpost searchposts&lt;?php echo $vtbg ?&gt;&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;&lt;?php echo $forum ?&gt; » &lt;?php echo $subject ?&gt; » &lt;a href=&quot;viewtopic.php?pid=&lt;?php echo $search_set[$i][&#039;pid&#039;].&#039;#p&#039;.$search_set[$i][&#039;pid&#039;] ?&gt;&quot;&gt;&lt;?php echo format_time($search_set[$i][&#039;pposted&#039;]) ?&gt;&lt;/a&gt;&lt;/h2&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;box&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;inbox&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postleft&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dl&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dt&gt;&lt;?php echo $pposter ?&gt;&lt;/dt&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd&gt;Replies: &lt;?php echo $search_set[$i][&#039;num_replies&#039;] ?&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd&gt;&lt;?php echo $icon; ?&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd&gt;&lt;p class=&quot;clearb&quot;&gt;&lt;a href=&quot;viewtopic.php?pid=&lt;?php echo $search_set[$i][&#039;pid&#039;].&#039;#p&#039;.$search_set[$i][&#039;pid&#039;] ?&gt;&quot;&gt;&lt;?php echo $lang_search[&#039;Go to post&#039;] ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/dd&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/dl&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postright&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;postmsg&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;&lt;?php echo $message ?&gt;&lt;/p&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&lt;/div&gt;<br />&lt;?php</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon = &#039;&lt;div class=&quot;icon&quot;&gt;&lt;div class=&quot;nosize&quot;&gt;&#039;.$lang_common[&#039;Normal icon&#039;].&#039;&lt;/div&gt;&lt;/div&gt;&#039;.&quot;\n&quot;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_text = $lang_common[&#039;Normal icon&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $item_status = &#039;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_type = &#039;icon&#039;;</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $subject = &#039;&lt;a href=&quot;viewtopic.php?id=&#039;.$search_set[$i][&#039;tid&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($search_set[$i][&#039;subject&#039;]).&#039;&lt;/a&gt; &lt;span class=&quot;byuser&quot;&gt;&#039;.$lang_common[&#039;by&#039;].&#039; &#039;.pun_htmlspecialchars($search_set[$i][&#039;poster&#039;]).&#039;&lt;/span&gt;&#039;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($search_set[$i][&#039;closed&#039;] != &#039;0&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_text = $lang_common[&#039;Closed icon&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $item_status = &#039;iclosed&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $search_set[$i][&#039;last_post&#039;] &gt; $pun_user[&#039;last_visit&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_text .= &#039; &#039;.$lang_common[&#039;New icon&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $item_status .= &#039; inew&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $icon_type = &#039;icon inew&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $subject = &#039;&lt;strong&gt;&#039;.$subject.&#039;&lt;/strong&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $subject_new_posts = &#039;&lt;span class=&quot;newtext&quot;&gt;[ &lt;a href=&quot;viewtopic.php?id=&#039;.$search_set[$i][&#039;tid&#039;].&#039;&amp;action=new&quot; title=&quot;&#039;.$lang_common[&#039;New posts info&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;New posts&#039;].&#039;&lt;/a&gt; ]&lt;/span&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $subject_new_posts = null;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $num_pages_topic = ceil(($search_set[$i][&#039;num_replies&#039;] + 1) / $pun_user[&#039;disp_posts&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($num_pages_topic &gt; 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $subject_multipage = &#039;[ &#039;.paginate($num_pages_topic, -1, &#039;viewtopic.php?id=&#039;.$search_set[$i][&#039;tid&#039;]).&#039; ]&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $subject_multipage = null;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // S</p>]]></description>
			<author><![CDATA[null@example.com (Dax701)]]></author>
			<pubDate>Sat, 15 Sep 2007 08:48:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/100580/#p100580</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/76683/#p76683</link>
			<description><![CDATA[<p>Is there a way to drop the .html with this mod?</p>]]></description>
			<author><![CDATA[null@example.com (BigA)]]></author>
			<pubDate>Wed, 06 Sep 2006 09:38:50 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/76683/#p76683</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/75850/#p75850</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>cannot enter to post to have a &quot;?&quot; to final.</p></blockquote></div><p>The same happens to me...¿any help with this? Here you have an example of what happens, try to click on thread in this forum:</p><p><a href="http://www.compradoresonline.com.ar/f19-Ropa-accesorios-deportivos.html">http://www.compradoresonline.com.ar/f19 … tivos.html</a></p><p>Also search doesn&#039;t work, so i have to go back to the original one.</p><p>Thanks for the help.</p>]]></description>
			<author><![CDATA[null@example.com (Protheo)]]></author>
			<pubDate>Sun, 27 Aug 2006 15:38:47 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/75850/#p75850</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/68282/#p68282</link>
			<description><![CDATA[<p>Hi guys,</p><p>I can read english and I see that the developer doesn&#039;t support this mod anymore.</p><p>There is any chance to make it working? </p><p>I woul like to have this mode on my Site.</p><br /><p>Regards.</p>]]></description>
			<author><![CDATA[null@example.com (Routehunter)]]></author>
			<pubDate>Mon, 15 May 2006 10:04:28 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/68282/#p68282</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/68092/#p68092</link>
			<description><![CDATA[<p>I am running PunBB 1.2.11 and this mod seems not working. Any help? Or it&#039;s my fault?</p><p>I had tried to follow the instruction but the files are different.</p><p>Thanks.</p>]]></description>
			<author><![CDATA[null@example.com (Routehunter)]]></author>
			<pubDate>Thu, 11 May 2006 19:40:21 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/68092/#p68092</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/60057/#p60057</link>
			<description><![CDATA[<p>I&#039;ll don&#039;t support PunRewrite anymore.<br />I&#039;m now using Sim07&#039;s PunOOgle : <a href="http://punres.org/desc.php?pid=162">http://punres.org/desc.php?pid=162</a></p>]]></description>
			<author><![CDATA[null@example.com (keyes)]]></author>
			<pubDate>Wed, 11 Jan 2006 21:12:13 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60057/#p60057</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57854/#p57854</link>
			<description><![CDATA[<p>Works great!&nbsp; I have it up and running on my forums. <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>I&#039;ve also modified the Google Sitemap Generator extension for use with PunRewrite so that the new rewritten URLs are displayed in the xml file.&nbsp; You can download it from <a href="http://www.punres.org/desc.php?pid=149">http://www.punres.org/desc.php?pid=149</a>.</p>]]></description>
			<author><![CDATA[null@example.com (trf)]]></author>
			<pubDate>Sun, 27 Nov 2005 07:57:56 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57854/#p57854</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57649/#p57649</link>
			<description><![CDATA[<p>i have a proble, if i go to a topic to have &quot;?&quot; to final i cant open this tipic: give this error:</p><p>Forbidden<br />You don&#039;t have permission to access /rewrite/forums/t171-hola-todos?.html on this server.</p><p>Apache/1.3.31 Server at localhost Port 80</p><p>how i fix this problem?</p><p>in a Keyes Forum not have this problem, but her forums url is other and my forum url is:<br />Exaple</p><p>Gadem&#039;s forum URL<br />forums/t171-hola-todos%3F.html</p><p>Keyes Froum Url:</p><p>forums/t171-hola-todos.html</p>]]></description>
			<author><![CDATA[null@example.com (Gadem)]]></author>
			<pubDate>Wed, 23 Nov 2005 21:54:53 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57649/#p57649</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57648/#p57648</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Bad HTTP_REFERER. You were referred to this page from an unauthorized source. If the problem persists please make sure that &#039;Base URL&#039; is correctly set in Admin/Options and that you are visiting the forum by navigating to that URL. More information regarding the referrer check can be found in the PunBB documentation.</p></blockquote></div><p>I also got these errors sometimes.&nbsp; I had to change back to normal links <img src="https://punbb.informer.com/forums/img/smilies/sad.png" width="15" height="15" alt="sad" /></p>]]></description>
			<author><![CDATA[null@example.com (freakalis)]]></author>
			<pubDate>Wed, 23 Nov 2005 21:49:31 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57648/#p57648</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57647/#p57647</link>
			<description><![CDATA[<p>True indeed.</p>]]></description>
			<author><![CDATA[null@example.com (Jérémie)]]></author>
			<pubDate>Wed, 23 Nov 2005 21:34:20 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57647/#p57647</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57614/#p57614</link>
			<description><![CDATA[<p>Jeremie: What happens when two topics have the same subject? Then you have to start appending numbers at the end and then you&#039;re in a world of trouble.</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Wed, 23 Nov 2005 15:52:21 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57614/#p57614</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57567/#p57567</link>
			<description><![CDATA[<div class="quotebox"><cite>keyes wrote:</cite><blockquote><p>Just the id and &quot;.html&quot; is needed.</p></blockquote></div><p>About the id, is it necessary ? If you go down the &quot;subject in url&quot; road, why include it ? To reduce the SQL query ?</p><p>About the .html, it&#039;s absolutely not needed. In fact, it&#039;s best not to have it. With your example, it gives: <a href="http://placelibre.ath.cx/2459-maintenant-milices/">http://placelibre.ath.cx/2459-maintenant-milices/</a> (with optionnal ending /).</p><p>Nicer, and more effective.</p>]]></description>
			<author><![CDATA[null@example.com (Jérémie)]]></author>
			<pubDate>Wed, 23 Nov 2005 04:38:59 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57567/#p57567</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57538/#p57538</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Bad HTTP_REFERER. You were referred to this page from an unauthorized source. If the problem persists please make sure that &#039;Base URL&#039; is correctly set in Admin/Options and that you are visiting the forum by navigating to that URL. More information regarding the referrer check can be found in the PunBB documentation.</p></blockquote></div><p>I get this so much as soon as I implemented this in...</p>]]></description>
			<author><![CDATA[null@example.com (briank)]]></author>
			<pubDate>Tue, 22 Nov 2005 21:48:15 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57538/#p57538</guid>
		</item>
		<item>
			<title><![CDATA[Re: PunRewrite 1.0, a better positioning in search engines]]></title>
			<link>https://punbb.informer.com/forums/post/57522/#p57522</link>
			<description><![CDATA[<p>Strange T-STRING errors...</p><p>searching for this:</p><div class="codebox"><pre><code>&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;index.php&quot;&gt;&lt;?php echo $lang_common[&#039;Index&#039;] ?&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &lt;a href=&quot;viewforum.php?id=&lt;?php echo $cur_topic[&#039;forum_id&#039;] ?&gt;&quot;&gt;&lt;?php echo pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]) ?&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &lt;?php echo pun_htmlspecialchars($cur_topic[&#039;subject&#039;]) ?&gt;&lt;/li&gt;&lt;/ul&gt;</code></pre></div><p>I found that in viewtopic.php (manually updated to version 1.2.10 with each update released) what&#039;s there is expressed differently:</p><div class="codebox"><pre><code>&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;index.php&quot;&gt;&#039;.$lang_common[&#039;Index&#039;].&#039;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &lt;a href=&quot;viewforum.php?id=&#039;.$cur_topic[&#039;forum_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]).&#039;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/li&gt;&lt;/ul&gt;</code></pre></div><p>i see two instances of similar code used twice in this page, simply replacing the code present with the code for this mod results in T-STRING errors related to unexpected &#039;;&#039; and &#039;,&#039; markup.</p><p>I&#039;m wondering why my viewtopic.php has such different code from this mod.</p>]]></description>
			<author><![CDATA[null@example.com (dss)]]></author>
			<pubDate>Tue, 22 Nov 2005 10:30:12 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/57522/#p57522</guid>
		</item>
	</channel>
</rss>
