<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PunBB Forums - How extend search script?]]></title>
	<link rel="self" href="http://punbb.informer.com/forums/feed/atom/topic/21811/"/>
	<updated>2009-06-24T12:35:37Z</updated>
	<generator>PunBB</generator>
	<id>http://punbb.informer.com/forums/topic/21811/how-extend-search-script/</id>
		<entry>
			<title type="html"><![CDATA[Re: How extend search script?]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/128643/#p128643"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Slavok]]></name>
				<uri>http://punbb.informer.com/forums/user/13265/</uri>
			</author>
			<updated>2009-06-24T12:35:37Z</updated>
			<id>http://punbb.informer.com/forums/post/128643/#p128643</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How extend search script?]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/128619/#p128619"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[tomasz]]></name>
				<uri>http://punbb.informer.com/forums/user/14852/</uri>
			</author>
			<updated>2009-06-23T09:29:57Z</updated>
			<id>http://punbb.informer.com/forums/post/128619/#p128619</id>
		</entry>
</feed>
