⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.php

📁 仿榕树下文章系统春节版 1. 将makpass.php文件的root_pass修改成你自己的登陆密码,同时修改$user成只有你自己知道的目录名称。 将data目录里的user目录修改成和上面$use
💻 PHP
📖 第 1 页 / 共 2 页
字号:
//////////////获取分类id////////
$type_list=file("data/xq.php");
$type_list_count=count($type_list);
for ($i=0;$i<$type_list_count;$i++){
    $type_list_code =explode("|", $type_list[$i]);
    if ($type_list_code[0]=="type") {
/////////////////////////////////
    $user=file("data/$type_list_code[1]/list.php");
    $user_count=count($user);
    for ($j=0;$j<$user_count;$j++){
    $SEARCH_IDX[]=$user[$j];
    }
    }
    }
/////////////////////////////////////
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
/////////////////////////////////////////
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $SEARCH_IDX_code = explode("|", $SEARCH_IDX[$sss]);
                if( is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num") and is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt")) {
                        $FILES_ARRAY_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num");
                        $FILES_ARRAY = explode("|", $FILES_ARRAY_DATA[0]);
                                if ( eregi($keyword, $FILES_ARRAY[1])) {
                                        $IDX[] = $FILES_ARRAY[0]."|".$SEARCH_IDX_code[1];
                                }
                              }
                          }
              }
////////////////////////按照指定分类--内容搜索//////////////////////
//////////////获取分类id////////
if ( $text and $keyword and empty($title)) {
//////////////获取分类id////////
$type_list=file("data/xq.php");
$type_list_count=count($type_list)-1;
for ($i=0;$i<=$type_list_count;$i++){
    $type_list_code =explode("|", $type_list[$i]);
    if ($type_list_code[0]=="type") {
    $user=file("data/$type_list_code[1]/list.php");
    $user_count=count($user);
    for ($j=0;$j<$user_count;$j++){
    $SEARCH_IDX[]=$user[$j];}
}}
//////////////////////////////
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
///////////////////
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $SEARCH_IDX_code = explode("|", $SEARCH_IDX[$sss]);
                if( is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num")  and is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt")) {
                        $FILES_ARRAY_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt");
                                if ( eregi($keyword, $FILES_ARRAY_DATA[0])) {
                                        $IDX[] = $SEARCH_IDX_code[0]."|".$SEARCH_IDX_code[1];
                                }
                              }
                          }
              }
/////////////////////////按照指定分类综合搜索//////////////////////
if ( $text and $keyword and $title) {
$type_list=file("data/xq.php");
$type_list_count=count($type_list)-1;
for ($i=0;$i<=$type_list_count;$i++){
    $type_list_code =explode("|", $type_list[$i]);
    if ($type_list_code[0]=="type") {
    $user=file("data/$type_list_code[1]/list.php");
    $user_count=count($user);
    for ($j=0;$j<$user_count;$j++){
    $SEARCH_IDX[]=$user[$j];}
}}
//////////////////////
$Bad_Keyword_Array = array("?", " ", "[", "]", "(", ")", "+", "\\", "|", "$");
for ($q = 0 ; $q < sizeof($Bad_Keyword_Array); $q++)
{
        if (strstr($keyword, $Bad_Keyword_Array[$q])) {
                $keyword = "";
        }
}
        $end =count($SEARCH_IDX);
        for($sss=0; $sss<=$end-1; $sss++) {
                $SEARCH_IDX_code = explode("|", $SEARCH_IDX[$sss]);
                if( is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num") and is_file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt")) {
                        $FILES_txt_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].txt");
                        $FILES_num_DATA = file("data/$SEARCH_IDX_code[1]/$SEARCH_IDX_code[0].num");
                        $FILES_num_code = explode("|", $FILES_num_DATA[0]);
                                if ( eregi($keyword, $FILES_num_code[1]) or eregi($keyword, $FILES_txt_DATA[0])) {
                                        $IDX[] = $SEARCH_IDX_code[0]."|".$SEARCH_IDX_code[1];
                                }
                              }
                          }
              }
$total_search=count($IDX);
$recnum = $page_list_pg;
$listnum = 10;
$totalnum = intval(($total_search)/$recnum)+1;
echo "<title>文章管理</title>\n";
echo "<center>\n";
echo "<br><table border=0 bgcolor=\"$main_color\" cellspacing=1 cellpadding=3 width=735>\n";
echo "<tr bgcolor=$main_color>\n";
echo "<td class=shadow2>\n";
echo "<img src=./images/dot.gif>\n";
echo "<a class=shadow2 href=index.php>文章首页</a>\n";
$file_sort=file("data/"."xq.php");
$file_count=count($file_sort)-1;
$total_file=0;
for ($i=0;$i<=$file_count;$i++) {
        $file_name=explode("|",$file_sort[$i]);
        if ($file_name[0]=="type") {
        $total_file=$total_file+$file_name[4];
        $get_type_name=$get_type_name."<option value=$file_name[1]>$file_name[2]</option>\n";
        }
        else
        echo "<img src=./images/dot.gif heigth=16>"."&nbsp;<a class=shadow2 href=listform.php?form=$file_name[1]>$file_name[2]</a>\n";
        }

echo "</td>\n";
echo "</tr>\n";
echo "<tr bgcolor=$fuse_color walign=middle>\n";
echo "<td class=shadow2>\n";
echo ">> 欢迎光临 <a href='$web_url'>$web_title</a> 文章管理中心&nbsp;&nbsp;搜索所有版块\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<table border=0 cellpadding=10 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=735>\n";
echo "<tr>\n";
echo "<td class=shadow2 valign=bottom>\n";
echo "<img src=images/poll.gif heigth=15> 取得文章总数/搜索文章分类:<b><font color=red>$total_search</font>/$total_file</b>\n";
echo "</td>\n";
/////////////////搜索表单/////////////////////////////////////////
echo "<form method='post' action='search.php'>\n";
echo "<td align=right valign=bottom>\n";
echo "<img src='./images/search.gif' width=16 heigth=16>\n";
echo "标题<input type=checkbox name=title value='1'>\n";
echo "内容<input type=checkbox name=text value='1'>\n";
echo "<input class=border type=text name=keyword size=12 style='color:#000000; background-color:$fuse_color'>\n";
echo "<select size=1 name=searchtype style='color:#000000; border-style:solid; border-width:1; background-color:$fuse_color'>\n";
echo "<option value='all'>-=所有文章=-</option>\n";
echo $get_type_name;
echo "</select> \n";
echo "<input type=submit value=搜索 name=search class=border style='color: #000000; background-color: $main_color'>\n";
echo "</td>\n";
echo"</form>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<table border=0 cellspacing=0 style='border-collapse:collapse' width=735 height=233 cellpadding=3>\n";
echo "<tr>\n";
echo "<td width=64% valign=top>\n";

/////////////将搜索结果分页显示//////////////////////////////
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
page_menu($totalnum);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<center><table border=0 bgcolor=\"white\" cellspacing=1 cellpadding=1 width=100%>\n";
if ( !$p ) { $p = 1; }
for ($i = $total_search-(($p-1)*$recnum)-1; $i > $total_search-($p*$recnum)-1;$i--) {
  $IDX_code=explode("|",$IDX[$i]);
  if ( "$IDX[$i]" && "$IDX[$i]" != '.' && "$IDX[$i]" != '..') {
  $user=file("data/$IDX_code[1]/$IDX_code[0].num");
  $xqfile_info=explode("|",$user[0]);
   $len = strlen($xqfile_info[1]);
  if ($len <= $page_list_code)
    $title_new = $xqfile_info[1];
  else
    $title_new =substr($xqfile_info[1],0,$page_list_code)."...";
    $NO=$i+1;
  echo "<tr><td width=22 height=\"22\"align=center bgcolor=\"$fuse_color\" onmouseover=\"this.bgColor='white';\" onmouseout=\"this.bgColor='$fuse_color';\">";
  echo "$NO</td>";
  echo "<td height=\"22\" bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
  echo "</b><a target=_blank href='show.php?type=$IDX_code[1]&id=$xqfile_info[0]'><span style=font:9pt>$title_new</span></a>";
  if (!empty($xqfile_info[5])) {
        $FILE = split("\.", $xqfile_info[5]);
        $FILE_count=count($FILE);
        $ftype = GET_FILE_TYPE($FILE[$FILE_count-1]);
echo ".<a href=\"artdown.php?type=$IDX_code[1]&id=$xqfile_info[0]\" target=blank><IMG border=0 SRC='images/file/$ftype'></a>/$xqfile_info[19]\n";
}
  if ($xqfile_info[2]!="")
  echo " - <font color=#c0c0c0>$xqfile_info[2]/文 </font>";
  $xqfile_time=explode(" ",$xqfile_info[6]);
  echo "<font color=#c0c0c0>$xqfile_time[0]</font><br>";
}   }
echo "</td>\n";
echo "</tr>\n";
echo "</table></center>\n";
if ($total_search==0)
echo"&nbsp;<img src=./images/dot1.gif>共搜索<font color=red>".$end."</font>篇文章,没有找到符合搜索条件的文章";
elseif ($total_search>0)
echo"&nbsp;<img src=./images/dot1.gif>共搜索<font color=red>".$end."</font>篇文章,搜索到个<font color=red>".$total_search."</font>符合条件";
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:collapse' bordercolor=$biankuang_color width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
page_menu($totalnum);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "<td width=40% valign=top>\n";

/////////////////////////////本类最新文章//////////////////////////////////////////////////
echo "<table border=0 bgcolor=\"$main_color\" cellspacing=1 cellpadding=1 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% bgcolor=$main_color>\n";
echo "<img src='./images/quote.gif' width=16 heigth=16> 最新文章\n";
echo "</td>\n";
echo "</tr>\n";
$file_new_sort=file("data/xq".".new");
$file_new_count=count($file_new_sort)-1;
for ($i=$file_new_count;$i>=$file_new_count-$page_list_new+1;$i--) {
        $file_new_name=explode("|",$file_new_sort[$i]);
    if ( "$file_new_name[0]" && "$file_new_name[0]" != '.' && "$file_new_name[0]" != '..') {
  $file_new_array=file("data/$file_new_name[1]/$file_new_name[0].num");
  $file_new_info=explode("|",$file_new_array[0]);
     $len = strlen($file_new_info[1]);
  if ($len <= $new_hot_code)
     $title = $file_new_info[1];
  else
    $title =substr($file_new_info[1],0,$new_hot_code)."...";
echo "<tr><td align=left bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
echo "<img src=./images/dot1.gif width=6 heigth=9>&nbsp;<a target=_blank href=show.php?type=$file_new_name[1]&id=$file_new_info[0]>$title</a>\n";
$file_time=explode(" ",$file_new_info[6]);
echo "<font color=#c0c0c0>-$file_time[0]</font>";
echo "<br>";
echo "</td>\n";
echo "</tr>\n";
 }
}
echo "</table>\n";
echo "<br>\n";
/////////////////////////热门文章///////////////////////////////////////////
echo "<table border=0 bgcolor=\"$main_color\" cellspacing=1 cellpadding=1 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% bgcolor=$main_color>\n";
echo "<img src='./images/quote.gif' width=16 heigth=16> 热门文章\n";
echo "</td>\n";
echo "</tr>\n";
$file_new_sort=file("data/xq".".hot");
$file_new_count=count($file_new_sort)-1;
for ($i=0;$i<$page_list_new;$i++) {
        $file_new_name=explode("|",$file_new_sort[$i]);
    if ( "$file_new_name[0]" && "$file_new_name[0]" != '.' && "$file_new_name[0]" != '..') {
  $file_new_array=file("data/$file_new_name[1]/$file_new_name[0].num");
  $file_new_info=explode("|",$file_new_array[0]);

     $len = strlen($file_new_info[1]);
  if ($len <= $new_hot_code)
     $title = $file_new_info[1];
  else
    $title =substr($file_new_info[1],0,$new_hot_code)."...";
echo "<tr><td align=left bgcolor=\"white\" onmouseover=\"this.bgColor='$fuse_color';\" onmouseout=\"this.bgColor='white';\">";
echo "<img src=./images/dot1.gif width=6 heigth=9>&nbsp;<a target=_blank href=show.php?type=$file_new_name[1]&id=$file_new_info[0]>$title</a>\n";
echo "<font color=#c0c0c0>阅:</font><font color=red>$file_new_info[16]/$file_new_info[17]</font>";
echo " <font color=#c0c0c0>评:$file_new_info[18]</font>";
echo "<br>";
echo "</td>\n";
echo "</tr>\n";
 }
}
echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<TR > <TD  colspan='2' vAlign=top width='100%'><P align=right class=small><A href='http://qiji.wo.to/'></A></P></TD></TR></TBODY></TABLE></DIV></TD></TR>";
echo "</table>\n";
echo "<hr width=735 color=$biankuang_color>\n";
require("foot.php");
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -