function index() { modTitle('Planit | Recheche'); if (!isCO()) { setAlert('Veuillez vous connecter pour faire une recherche', 'warning'); } loadModel('villes'); $k['villes'] = getAllVille(); set($k); if (!empty($_POST)) { $ok = 0; foreach ($_POST as $post) { if (!empty($post)) { $ok = 1; break; } } if ($ok) { loadModel('recherche'); $v['result'] = search_result($_POST); if (empty($v['result'])) { setAlert('Aucun resultat trouve', 'warning'); } set($v); } else { setAlert('Remplir au moins un champs', 'danger'); } } render(); }
/** * Wrapper to call required function(s) to generate current active form. * @since 2.0.0 * @version 2.1.0 * @return void */ function get_form() { global $hc_cfg, $eID, $lID; if (HCCOM == '') { return 0; } switch (HCCOM) { case 'send': send_to_friend(); break; case 'signup': news_signup(); break; case 'edit': news_edit(); break; case 'filter': filter(); break; case 'search': search(); break; case 'searchresult': search_result(); break; case 'submit': if ($eID > 0 || isset($_GET['sID'])) { submit_update(); } else { submit(); } break; case 'rsvp': rsvp(); break; } }
edit_form($result); break; case "update": $lastop = $data->set_scscf($_POST); $result = $data->get_scscf($_POST); edit_form($result); break; case "new": $lastop = $data->new_scscf($_POST); $result = $data->get_scscf($_POST); edit_form($result); break; case "del": $lastop = $data->del_scscf($_POST); $result = $data->get_scscf_list($_POST); search_result($result); break; case "addcap": $lastopcap = $data->set_scscf_capability($_POST); $result = $data->get_scscf($_POST); edit_form($result); break; case "delcap": $lastopcap = $data->del_scscf_capability($_POST, 1); $result = $data->get_scscf($_POST); edit_form($result); break; default: search_form(); } page_close();
if ($haystack == "pipe") { $title = $row[$i]["title"]; $link = "/pipe/" . $row[$i]["pid"]; $body = $row[$i]["story"]; $zid = $row[$i]["zid"]; } else { if ($haystack == "polls") { $title = $row[$i]["question"]; $link = "/poll/" . $row[$i]["qid"]; $body = ""; $zid = $row[$i]["zid"]; } } } } search_result($title, $link, $zid, $row[$i]["time"], $body); } writeln('</main>'); writeln('</td>'); writeln('</tr>'); writeln('</table>'); print_footer(); die; } print_header("Search"); writeln('<table class="fill">'); writeln('<tr>'); writeln('<td class="left_col">'); print_left_bar("main", "search"); writeln('</td>'); writeln('<td class="fill">');
$override_weblog = weblog_from_para($Pivot_Vars['w']); if (!$override_weblog) { piv_error("Weblog doesn't exist", "Selected weblog \"" . htmlspecialchars($Pivot_Vars['w']) . "\" doesn't exist."); } else { $Current_weblog = $override_weblog; } } } else { reset($Weblogs); $Current_weblog = key($Weblogs); } // Display the search results. LoadWeblogLanguage($Weblogs[$Current_weblog]['language']); $db = new db(); $result = "\n<div class='pivot-search-result'>\n"; $result .= search_result(); $result .= "<!-- Search took " . timetaken() . " seconds -->\n"; $result .= "</div>\n"; unset($db->entry); // Set the template for the tags page if (!isset($Pivot_Vars['t']) || empty($Pivot_Vars['t'])) { if (isset($Weblogs[$Current_weblog]['extra_template']) && $Weblogs[$Current_weblog]['extra_template'] != "") { $template = $Weblogs[$Current_weblog]['extra_template']; } else { $template = $Weblogs[$Current_weblog]['archive_template']; } } else { $template = $Pivot_Vars['t']; } $template_html = load_template($template); $template_html = replace_subweblogs_templates($template_html, $result);
$db2->query('SELECT account_id as album_id FROM album JOIN account USING(account_id) WHERE hof_name = ' . $db->escapeString($query) . ' AND approved = \'YES\' ORDER BY hof_name'); if ($db2->nextRecord()) { album_entry($db2->getField('album_id')); } else { // get all id's and build array $album_ids = array(); while ($db->nextRecord()) { $album_ids[] = $db->getField('album_id'); } // double check if we have id's if (count($album_ids) > 0) { search_result($album_ids); } else { main_page(); } } } elseif ($db->getNumRows() == 1) { if ($db->nextRecord()) { album_entry($db->getField('album_id')); } else { main_page(); } } else { main_page(); } } else { main_page();
<li class="sc posts" id="searchfile"> <?php if ($file == "") { ?> <h2><a href="http://zhiqiang.org/blog/category/resource">类最新文章</a></h2> <ul> <?php get_same_category_post("681"); ?> </ul> <?php } else { ?> <h2>"<?php echo $file; ?> "的相关文章</h2> <ul> <?php search_result($text); ?> </ul> <?php } ?> </li> </ul> </div> <?php get_footer();
//テキストボックスに入力されているかどうかを判断 if (empty($query_value)) { //入力されていなければ,速攻で検索結果を表示 //どのカテゴリが選択されているかを判断 if ($query_category == "all") { result($paper); } elseif ($paper['category'] == $query_category) { result($paper); } else { $not = notPaper($not, $datalength); } } else { if ($query_category == "all") { $not = search_result($paper, $query_key, $query_value, $not, $datalength); } elseif ($paper['category'] == $query_category) { $not = search_result($paper, $query_key, $query_value, $not, $datalength); } else { $not = notPaper($not, $datalength); } } } //入力された文字列でデータベース内を検索 function search_result($paper, $query_key, $query_value, $not, $datalength) { if (strpos($paper[$query_key], $query_value) === FALSE) { $not = notPaper($not, $datalength); } else { //検索結果を表示する result($paper); } return $not;