Ejemplo n.º 1
0
<?php

// search module for faq.
if (!defined('e107_INIT')) {
    exit;
}
$search_info[$key]['qtype'] = "FAQs";
if ($results = $sql->db_Select("faqs", "*", "faq_question REGEXP('" . $query . "') OR faq_answer REGEXP('" . $query . "') ORDER BY faq_id DESC ")) {
    while ($row = $sql->db_Fetch()) {
        extract($row);
        if (preg_match('/' . str_replace('/', '\\/', $query) . '/i', $faq_question)) {
            $que = parsesearch($faq_question, $query);
            $ans = substr($faq_answer, 0, 70);
            $text .= "<img src=\"" . THEME . "images/bullet2.gif\" alt=\"bullet\" /> <b><a href=\"" . e_PLUGIN . "faqs/faqs.php?cat." . $faq_parent . "." . $faq_id . "\">" . $que . "</a></b><br /><span class=\"smalltext\">Match found in faq question</span><br />" . $ans . "<br /><br />";
        }
        if (preg_match('/' . str_replace('/', '\\/', $query) . '/i', $faq_answer)) {
            $resmain = parsesearch($faq_answer, $query);
            $text .= "<img src=\"" . THEME . "images/bullet2.gif\" alt=\"bullet\" /> <b><a href=\"" . e_PLUGIN . "faqs/faqs.php?cat." . $faq_parent . "." . $faq_id . "\">" . $faq_question . "</a></b><br /><span class=\"smalltext\">Match found in faq answer</span><br />" . $resmain . "<br /><br />";
        }
    }
} else {
    $text .= "No matches.";
}
Ejemplo n.º 2
0
        $event_ward_ = $event_ward;
    }
    $event_organisation_ = parsesearch($event_organisation, $query);
    if (!$event_organisation_) {
        $event_organisation_ = $event_organisation;
    }
    $event_title_ = parsesearch($event_title, $query);
    if (!$event_title_) {
        $event_title_ = $event_title;
    }
    $event_details_ = parsesearch($event_details, $query);
    if (!$event_details_) {
        $event_details_ = $event_details;
    }
    $event_cat_name_ = parsesearch($event_cat_name, $query);
    if (!$event_cat_name_) {
        $event_cat_name_ = $event_cat_name;
    }
    $event_threat_ = parsesearch($event_threat, $query);
    if (!$event_url_) {
        $event_threat_ = $event_threat;
    }
    $bullet = '';
    if (defined('BULLET')) {
        $bullet = '<img src="' . THEME . 'images/' . BULLET . '" alt="" class="icon" />';
    } elseif (file_exists(THEME . 'images/bullet2.gif')) {
        $bullet = '<img src="' . THEME . 'images/bullet2.gif" alt="" class="icon" />';
    }
    $text .= $bullet . " <a href=\"event.php?" . $event_start . "\">{$event_title}</a>{$event_details}<br />";
}
$qtype = LAN_911;
Ejemplo n.º 3
0
function show_content_search_result($searchkeyword)
{
    global $row, $qs, $ns, $rs, $tp, $plugindir, $plugintable, $gen, $aa, $content_pref, $datequery, $gen, $mainparent, $content_icon_path;
    $newcontent_shortcodes = e107::getScBatch('content', TRUE);
    $mainparent = $aa->getMainParent(is_numeric($qs[1]) ? $qs[1] : intval($qs[2]));
    $content_pref = $aa->getContentPref($mainparent);
    $array = $aa->getCategoryTree("", intval($qs[1]), TRUE);
    $validparent = implode(",", array_keys($array));
    $qry = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
    $searchkeyword = $tp->toDB($searchkeyword);
    $qry .= " AND (content_heading REGEXP '" . $searchkeyword . "' OR content_subheading REGEXP '" . $searchkeyword . "' OR content_summary REGEXP '" . $searchkeyword . "' OR content_text REGEXP '" . $searchkeyword . "' ) ";
    $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
    $sqlsr = "";
    if (!is_object($sqlsr)) {
        $sqlsr = new db();
    }
    if (!$sqlsr->db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_icon, content_datestamp", " " . $qry . " " . $datequery . " ORDER BY content_heading")) {
        $textsr = "<div style='text-align:center;'>" . CONTENT_SEARCH_LAN_0 . "</div>";
    } else {
        if (!isset($CONTENT_SEARCHRESULT_TABLE)) {
            if (!$content_pref["content_theme"]) {
                require_once $plugindir . "templates/default/content_searchresult_template.php";
            } else {
                if (is_readable($tp->replaceConstants($content_pref["content_theme"]) . "content_searchresult_template.php")) {
                    require_once $tp->replaceConstants($content_pref["content_theme"]) . "content_searchresult_template.php";
                } else {
                    require_once $plugindir . "templates/default/content_searchresult_template.php";
                }
            }
        }
        $content_searchresult_table_string = "";
        if (!is_object($gen)) {
            $gen = new convert();
        }
        while ($row = $sqlsr->db_Fetch()) {
            $row['content_heading'] = parsesearch($row['content_heading'], $searchkeyword, "full");
            $row['content_subheading'] = parsesearch($row['content_subheading'], $searchkeyword, "full");
            $row['content_text'] = parsesearch($row['content_text'], $searchkeyword, "");
            $content_searchresult_table_string .= $tp->parseTemplate($CONTENT_SEARCHRESULT_TABLE, FALSE, $newcontent_shortcodes);
        }
        $textsr = $CONTENT_SEARCHRESULT_TABLE_START . $content_searchresult_table_string . $CONTENT_SEARCHRESULT_TABLE_END;
    }
    $caption = CONTENT_LAN_20;
    $ns->tablerender($caption, $textsr);
    require_once FOOTERF;
    exit;
}