Search forum
*/ function stripBBCode($text_to_search) { $pattern = '|[[\/\!]*?[^\[\]]*?]|si'; $replace = ''; return preg_replace($pattern, $replace, $text_to_search); } //data_dump($_GET, false, "Post data:"); // Fetch and sanitize values: $type = getValue($_GET['type']); if ($type !== false) $type = (int)$type; $text = getvalue($_GET['text']); $textTitleSql = ""; $textPostSql = ""; $textAuthorSql = ""; if ($text !== false) { $text = explode(' ', $text); for ($i = 0; $i < count($text); $i++) { if ($i != count($text) -1) { $textTitleSql .= "`title` LIKE '%". $text[$i] ."%' AND "; $textPostSql .= "`text` LIKE '%". $text[$i] ."%' AND "; $textAuthorSql .= "`player_name` LIKE '%". $text[$i] ."%' AND "; } else { $textTitleSql .= "`title` LIKE '%". $text[$i] ."%'"; $textPostSql .= "`text` LIKE '%". $text[$i] ."%'"; $textAuthorSql .= "`player_name` LIKE '%". $text[$i] ."%'"; } } //data_dump($text, array($textTitleSql, $textPostSql, $textAuthorSql), "search"); } ?>Char | Thread | Post |
---|---|---|
140) ? substr($result['text'],0,137).'...' : $result['text']; ?> |