require("$_SERVER[DOCUMENT_ROOT]/lib/header.inc.php");
$currHeader->setPageTitle("Riptide Gaming - Search");
$currBanner->addContent("Search for posts");
?>
if ($_REQUEST["action"] == "doSearch")
{
// build query
$query = "SELECT postindex, date, subject, posttype, username";
// if sumamries are on, grab some of the body
if ($_REQUEST["summaries"] == 1) $query .= " , LEFT(body, 250) AS summary";
$query .= " FROM riptide_posts, riptide_users WHERE riptide_users.userindex = riptide_posts.posterid";
// add word search queries
if ($_REQUEST["subject"] != "") $query .= " AND subject LIKE '%$_REQUEST[subject]%'";
if ($_REQUEST["body"] != "") $query .= " AND body LIKE '%$_REQUEST[body]%'";
// add post type filter
if ($_REQUEST["type"] == -2) $query .= " AND (posttype = 2 OR posttype = 5)";
elseif ($_REQUEST["type"] >= 1) $query .= " AND posttype = $_REQUEST[type]";
$query .= " ORDER BY postindex ASC";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{
print("
$row[subject] - $row[username] - $row[date]\n");
if ($_REQUEST["summaries"] == 1) print("
$row[summary]\n"); } } else { ?>
This form will allow you to search for posts from Riptide's database. It can also act as a post type filter if you leave out a search term. Permitted wildcards are _ (single character match) and % (multiple character match).
This form is somewhat more simplistic then the old Riptide search was, I'm too lazy to restore its full functionality.
Note: There isn't any paging here, like on the threadlist. That means you might get a lot of results, like on the threadlist. So it might take a while, like the threadlist.
Another note: Some of the storyverse stories might be incorrectly labelled as regular stories. So I've included a meta type that gets both story types. If you happen to find one thats labelled wrong, let me know and I'll fix it.
} ?> require("$_SERVER[DOCUMENT_ROOT]/lib/footer.inc.php"); ?>