<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[PunBB Forums - How extend search script?]]></title>
		<link>http://punbb.informer.com/forums/topic/21811/how-extend-search-script/</link>
		<description><![CDATA[The most recent posts in How extend search script?.]]></description>
		<lastBuildDate>Wed, 24 Jun 2009 12:35:37 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How extend search script?]]></title>
			<link>http://punbb.informer.com/forums/post/128643/#p128643</link>
			<description><![CDATA[<p>I have modified your code a little. Test it out. Add it after line 289 of &quot;&lt;FORUM_ROOT&gt;/search.php&quot;:<br /></p><div class="codebox"><pre><code>         if ($color)
         {
            $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE color = \&#039;&#039;.$color.&#039;\&#039;&#039;) or error(&#039;Unable to fetch color&#039;, __FILE__, __LINE__, $db-&gt;error());

             if ($db-&gt;num_rows($result))
             {
                 $color_results = array();
                 while ($row = $db-&gt;fetch_row($result))
                      $color_results[] = $row[0];
                 $db-&gt;free_result($result);
             }
             $search_ids = array_intersect($search_ids, $color_results);
             unset($color_results);
          }</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Slavok)]]></author>
			<pubDate>Wed, 24 Jun 2009 12:35:37 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128643/#p128643</guid>
		</item>
		<item>
			<title><![CDATA[How extend search script?]]></title>
			<link>http://punbb.informer.com/forums/post/128619/#p128619</link>
			<description><![CDATA[<p>Hi<br />I have some problems with extending search.php to find some more things.<br />I have add new column to pun_posts table and a &lt;select&gt; button with some &lt;option&gt; inside... <br />therefore I want to search forum for topics which are marked in that column...<br />how can I do that?</p><p>I&#039;ve add this lines after 278 line in search.php<br /></p><div class="codebox"><pre><code>/ If it&#039;s a search for posts by a specific color
            if ($color)
            {
                switch ($db_type)
                {
                    case &#039;pgsql&#039;:
                        $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE color = \&#039;&#039;.$color.&#039;\&#039;&#039;) or error(&#039;Unable to fetch color&#039;, __FILE__, __LINE__, $db-&gt;error());
                        break;

                    default:
                        $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE color = \&#039;&#039;.$color.&#039;\&#039;&#039;) or error(&#039;Unable to fetch color&#039;, __FILE__, __LINE__, $db-&gt;error());
                        break;
                }

                if ($db-&gt;num_rows($result))
                {

                    while ($row = $db-&gt;fetch_row($result))

                    $search_ids = array();
                    while ($row = $db-&gt;fetch_row($result))
                        $search_ids[] = $row[0];
                        //echo $search_ids;
                        //echo $row;
                    $db-&gt;free_result($result);

                }
            }</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (tomasz)]]></author>
			<pubDate>Tue, 23 Jun 2009 09:29:57 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128619/#p128619</guid>
		</item>
	</channel>
</rss>
