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

📄 search.php

📁 1.增加了近40项后台核心设置
💻 PHP
字号:
<?php
require "./global.php";
include_once R_P.'header.php';
unset($keyq);
$page ? "" : $page = "1";
if($search && $key){
   $key2 = $key;
   $keyt ? "" : $key = "%$key%";
   $keyw == "all" ? "" : $keylid = "AND lid='$keyw'";
   $spage ? "" : $spage = "1";
   if($keym == "all")
      $keywh = "WHERE name LIKE '$key' $keylid OR content LIKE '$key' $keylid";
   if($keym == "name")
      $keywh = "WHERE name LIKE '$key' $keylid";
   if($keym == "author")
      $keywh = "WHERE author LIKE '$key' $keylid";
   if($keym == "cont" && $rootindex['alls'])
      $keywh = "WHERE content LIKE '$key' $keylid";
   $limit = ($spage-1)*$rootindex[lists];
   $keyq = "SELECT wid,name,author,date,lid FROM xydw_art $keywh ORDER BY date DESC LIMIT $limit,$rootindex[lists]";
   $viewa1 = $db->query($keyq);
   $spage ++;
   if($viewa1 && !$pamount){
      $pamount = $db->getone("SELECT COUNT(*) AS amount FROM xydw_art $keywh");
      $pamount = (int)($pamount['amount']/$rootindex['lists']);
      $pamount['amount']%$rootindex['lists'] && $pamount++;
   }
   if($spage>2){$spagef = $spage-2;
      $xydwpage .= " <a href='search.php?search=1&keyw=$keyw&keym=$keym&keyt=$keyt&key=$key2&spage=$spagef&pamount=$pamount'>上一页</a>";
   }
   if(!$viewa1 || $pamount<$spage){
       $xydwpage .= " <font color=red>已搜索到最后一页</font>";
   } else {
       $xydwpage .= " <a href='search.php?search=1&keyw=$keyw&keym=$keym&keyt=$keyt&key=$key2&spage=$spage&pamount=$pamount'>下一页</a>";
   }
   $keyss = str_replace("%","",$key);
}
if($keyq){
   while($viewa = $db->fetch_array($viewa1)){
      $date = date("Y-m-d",$viewa[date]);
      if($viewa[author]){
	    $viewa[author] = str_replace($keyss,"<font color=red>$keyss</font>",$viewa[author]);
        $viewa[author]= "作者:".$viewa['author'];
      }
	  $keyred = preg_replace("/$keyss/i","<font color=red>$keyss</font>",$viewa[name]);
	  if($ishtml == "0"){
	     $viewall .= "<tr bgcolor='$bcolor'><td>· <a href='./read.php?wid=$viewa[wid]' target=_blank>$keyred</a>&nbsp;{$viewa[author]}</td><td width='100' align=right>$date</td></tr>\n";
	  } else {
	     $date2 = date("ym",$viewa[date]);
	     $viewall .= "<tr bgcolor='$bcolor'><td>·<a href='./html_data/$viewa[lid]/$date2/$viewa[wid].htm' target=_blank>$keyred</a>&nbsp;{$viewa[author]}</td><td width='100' align=right>$date</td></tr>\n";
	  }
   }
}
include_once R_P."include/left.php";
include_once temp('search');
include_once R_P.'footer.php';
?>

⌨️ 快捷键说明

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