Topic: How extend search script?

Hi
I have some problems with extending search.php to find some more things.
I have add new column to pun_posts table and a <select> button with some <option> inside...
therefore I want to search forum for topics which are marked in that column...
how can I do that?

I've add this lines after 278 line in search.php

/ If it's a search for posts by a specific color
            if ($color)
            {
                switch ($db_type)
                {
                    case 'pgsql':
                        $result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE color = \''.$color.'\'') or error('Unable to fetch color', __FILE__, __LINE__, $db->error());
                        break;

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

                if ($db->num_rows($result))
                {

                    while ($row = $db->fetch_row($result))

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

                }
            }

Re: How extend search script?

I have modified your code a little. Test it out. Add it after line 289 of "<FORUM_ROOT>/search.php":

         if ($color)
         {
            $result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE color = \''.$color.'\'') or error('Unable to fetch color', __FILE__, __LINE__, $db->error());

             if ($db->num_rows($result))
             {
                 $color_results = array();
                 while ($row = $db->fetch_row($result))
                      $color_results[] = $row[0];
                 $db->free_result($result);
             }
             $search_ids = array_intersect($search_ids, $color_results);
             unset($color_results);
          }