示例#1
0
文件: search.php 项目: kaz6120/P_BLOG
     $keyword = trim($_GET['k']);
 }
 $page = $_GET['p'];
 $date = $_GET['d'];
 $case = $_GET['c'];
 // Case sensitive flag
 // If case-sensitive, search target field as BINARY.
 if ($case == 1) {
     // case-sensitive
     $binary_flag = 'BINARY ';
 } else {
     $binary_flag = '';
 }
 if ($page != '' & $case != '') {
     if ($keyword == '' && $date == '') {
         $contents = no_keywords_error();
         xhtml_output('forum');
         exit;
     } else {
         $sql = 'SELECT' . ' `id`, `tid`, `parent_key`, `title`, `comment`, `user_name`, `user_pass`, `user_uri`, `user_mail`,' . " `color`, `date`, DATE_FORMAT(`mod`, '%Y/%m/%d %T') as `mod`, `trash`" . " FROM `{$forum_table}`";
         if ($date != "all") {
             $sql .= ' WHERE (`trash` = 0) AND (';
         } else {
             $sql .= ' WHERE (`trash` = 0) ';
         }
     }
     if ($keyword != '') {
         // keyword search
         if (!strrchr($keyword, " ")) {
             $keys = explode(",", $keyword);
             $and_or = 'OR';
示例#2
0
                $section_content = '';
                while ($row = mysql_fetch_array($res)) {
                    $row = highlight_keywords($row, 'log');
                    $row = convert_to_utf8($row);
                    $section_content .= display_article_box($row);
                }
            }
        } else {
            $flip_link = '';
            $section_content = '<h3>' . $lang['no_matches'] . "</h3>\n";
            $section_content .= display_search_plus();
        }
    } else {
        $hit_result = '';
        $flip_link = '';
        $section_content = no_keywords_error($mode = 'log');
    }
} else {
    // Show the default interface
    $hit_result = '';
    $flip_link = '';
    $section_content = '<h2 id="archive-title">SEARCH PLUS+</h2>' . "\n";
    $section_content .= display_search_plus();
}
$contents = <<<EOD
{$hit_result}
<div class="section">
{$flip_link}{$section_content}{$flip_link}
</div>
EOD;
xhtml_output('log');
示例#3
0
                $section_content = '';
                while ($row = mysql_fetch_array($res)) {
                    $row = highlight_keywords('file');
                    $row = convert_to_utf8($row);
                    $section_content .= display_binary_box($row, $data_table);
                }
            }
        } else {
            $flip_link = '';
            $section_content = '<h3>' . $lang['no_matches'] . "</h3>\n";
            $section_content .= display_search_plus();
        }
    } else {
        $hit_result = '';
        $flip_link = '';
        $section_content = no_keywords_error($mode = 'file');
    }
} else {
    // Show the default interface
    $hit_result = '';
    $flip_link = '';
    $section_content = '<h2 id="archive-title">FILE SEARCH PLUS+</h2>' . "\n";
    $section_content .= display_search_plus();
}
$contents = <<<EOD
{$hit_result}
<div class="section">
{$flip_link}{$section_content}{$flip_link}
</div>
EOD;
xhtml_output('file');