function mc_show_search_results($content) { // if this is the result of a search, show search output. $ret = false; if (isset($_GET['mcs'])) { // simple search $ret = true; $query = $_GET['mcs']; } else { if (isset($_POST['mcs'])) { // advanced search $ret = true; $query = $_POST; } } if ($ret) { return mc_search_results($query); } else { return $content; } }
function mc_show_search_results($content) { global $post; if (is_object($post) && in_the_loop()) { // if this is the result of a search, show search output. $ret = false; $query = false; if (isset($_GET['mcs'])) { // simple search $ret = true; $query = $_GET['mcs']; } else { if (isset($_POST['mcs'])) { // advanced search $ret = true; $query = $_POST; } } if ($ret && $query) { return mc_search_results($query); } else { return $content; } } else { return $content; } }