header(); dbconnect(); $terms = stripslashes($terms); $output .= ""; $output .= " "; $output .= " "; $output .= " "; $output .= " "; $output .= " "; $output .= " "; $output .= "
"; $output .= "
"; $output .= "
"; ### category: $output .= " "; ### author: $output .= " "; ### order: $output .= ""; $output .= " "; $output .= "
"; ### Compose query: $query = "SELECT DISTINCT s.sid, s.aid, s.informant, s.subject, s.time FROM stories s, authors a WHERE s.sid != 0 "; // Note: s.sid is a dummy clause used to enforce the WHERE-tag. if ($terms != "") $query .= "AND (s.subject LIKE '%$terms%' OR s.abstract LIKE '%$terms%' OR s.comments LIKE '%$terms%') "; if ($author != "") $query .= "AND s.aid = '$author' "; if ($category != "") $query .= "AND s.category = '$category' "; if ($order == "Oldest first") $query .= " ORDER BY s.time ASC"; else $query .= " ORDER BY s.time DESC"; ### Perform query: $result = mysql_query("$query"); ### Display search results: $output .= "
"; while (list($sid, $aid, $informant, $subject, $time) = mysql_fetch_row($result)) { $num++; if ($user) { $link = "umode)) { $link .= "&mode=$user->umode"; } else { $link .= "&mode=threaded"; } if (isset($user->uorder)) { $link .= "&order=$user->uorder"; } else { $link .= "&order=0"; } if (isset($user->thold)) { $link .= "&thold=$user->thold"; } else { $link .= "&thold=0"; } $link .= "\">$subject"; } else { $link = "$subject"; } $output .= "

$num) $link
by $informant, posted on ". date("l, F d, Y - H:i A", $time) .".

\n"; } if ($num == 0) $output .= "

Your search did not match any articles in our database:

  • Try using fewer words.
  • Try using more general keywords.
  • Try using different keywords.

"; else $output .= "

$num results matched your search query.

"; $output .= "
"; $theme->box("Search", $output); $theme->footer(); ?>