Skip to content

Commit

Permalink
1,新增搜索页筛选页验证码。
Browse files Browse the repository at this point in the history
2,其他细节。
  • Loading branch information
magicblack committed Aug 17, 2021
1 parent e72ebf8 commit d68972b
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin/admin_conn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
define('MAC_ADMIN', preg_replace("|[/\\\]{1,}|",'/',dirname(__FILE__) ) );
require(MAC_ADMIN."/../inc/conn.php");
require(MAC_ADMIN.'/../inc/common/phplib.php');
define('MAC_VERSION','2022.3003');
define('MAC_VERSION','2022.3004');
define('MAC_MODULE','admin');

if(strpos($_SERVER["SCRIPT_NAME"],'/admin/')>0){
Expand Down
2 changes: 1 addition & 1 deletion admin/tpl/html/extend_comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
});
$("#btnHide").click(function(){
ajaxshow('btnHide','hide','comment','c_id','c_hide');
ajaxshow('btnHide','hide','comment','c_id','c_hide','');
});
$("#btnSearch").click(function(){
location.href='?m=extend-comment-hide-'+$("#hide").val()+'-type-'+$("#type").val()+'-wd-'+encodeURI($("#wd").val());
Expand Down
16 changes: 16 additions & 0 deletions admin/tpl/html/system_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@
<!-- END list_app_liststatus -->
</td>
</tr>
<tr>
<td>筛选页验证码:</td>
<td>
<!-- BEGIN list_app_listcode -->
<input type="radio" name="app_listcode" value="{v}" {c} />{n}&nbsp;
<!-- END list_app_listcode -->
</td>
</tr>
<tr>
<td>搜索开关:</td>
<td>
Expand All @@ -229,6 +237,14 @@
<!-- END list_app_searchstatus -->
</td>
</tr>
<tr>
<td>搜索验证码:</td>
<td>
<!-- BEGIN list_app_searchcode -->
<input type="radio" name="app_searchcode" value="{v}" {c} />{n}&nbsp;
<!-- END list_app_searchcode -->
</td>
</tr>
<tr>
<td>搜索时间间隔(秒):</td>
<td>
Expand Down
4 changes: 4 additions & 0 deletions admin/tpl/module/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
$config['app']['compress'] = intval(trim(be('post','app_compress')));
$config['app']['filtertags'] = intval(trim(be('post','app_filtertags')));
$config['app']['searchstatus'] = intval(trim(be('post','app_searchstatus')));
$config['app']['searchcode'] = intval(trim(be('post','app_searchcode')));
$config['app']['listcode'] = intval(trim(be('post','app_listcode')));
$config['app']['liststatus'] = intval(trim(be('post','app_liststatus')));
$config['app']['wallfilter'] = intval(trim(be('post','app_wallfilter')));

Expand Down Expand Up @@ -304,6 +306,8 @@
array('p'=>'app','a'=>'searchstatus','c'=>$MAC['app']['searchstatus'],'t'=>0),
array('p'=>'app','a'=>'liststatus','c'=>$MAC['app']['liststatus'],'t'=>0),
array('p'=>'app','a'=>'listcode','c'=>$MAC['app']['listcode'],'t'=>0),
array('p'=>'app','a'=>'searchcode','c'=>$MAC['app']['searchcode'],'t'=>0),
array('p'=>'app','a'=>'wallfilter','c'=>$MAC['app']['wallfilter'],'t'=>0,'n'=>array('关闭','编码方式','空白方式'),'v'=>array(0,1,2)),
array('p'=>'site','a'=>'mobstatus','c'=>$MAC['site']['mobstatus'],'t'=>0),
Expand Down
24 changes: 24 additions & 0 deletions inc/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,30 @@
echo $res;
}

else if($ac=='code_check'){
$v=be("get","code"); $v = chkSql($v);
$t=be("get","type"); $t = chkSql($t);
$res = array();
$res['code'] = 1;
$res['msg'] = 'ok';
if(!in_array($t,['search','list'])){
$res['code'] = 1001;
$res['msg'] = '参数错误';
echo json_encode($res);
exit;
}

if($_SESSION["code_".$t] != $v){
$res['code'] = 1002;
$res['msg'] = '验证码错误';
echo json_encode($res);
exit;
}

$_SESSION["code_".$t] ='1';
echo json_encode($res);
}

else
{
}
Expand Down
8 changes: 8 additions & 0 deletions inc/common/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,14 @@ function replaceArt()
}
unset($matches2);
}

function loadVerify($type)
{
$this->H = loadFile(MAC_ROOT_TEMPLATE."/home_verify.html");
$this->H = str_replace("{type}",$type,$this->H);
$this->base();
echo $this->H;
}
}
$tpl = new AppTpl();
?>
9 changes: 8 additions & 1 deletion inc/module/art.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
if($GLOBALS['MAC']['app']['liststatus']=='0'){
showMsg("筛选页功能已关闭,请稍后重试",MAC_PATH);
exit;
}
if($GLOBALS['MAC']['app']['listcode']=='1' && empty($_SESSION['code_list'])){
$tpl->loadVerify('list');
exit;
}
$tpl->C["siteaid"] = 22;
$tpl->P['cp'] = 'artlist';
Expand Down Expand Up @@ -97,7 +101,10 @@
showMsg("搜索功能已关闭,请稍后重试",MAC_PATH);
exit;
}

if($GLOBALS['MAC']['app']['searchcode']=='1' && empty($_SESSION['code_search'])){
$tpl->loadVerify('search');
exit;
}
$tpl->C["siteaid"] = 25;
$wd = trim(be("all", "wd")); $wd = chkSql($wd);
if(!empty($wd)){ $tpl->P["wd"] = $wd; }
Expand Down
12 changes: 10 additions & 2 deletions inc/module/vod.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@
showMsg("筛选页功能已关闭,请稍后重试",MAC_PATH);
exit;
}
$tpl->C["siteaid"] = 12;
if($GLOBALS['MAC']['app']['listcode']=='1' && empty($_SESSION['code_list'])){
$tpl->loadVerify('list');
exit;
}
$tpl->C["siteaid"] = 12;
$tpl->P['cp'] = 'vodlist';
$tpl->P['cn'] = $tpl->P['id'].'-'.$tpl->P['pg'].'-'.$tpl->P['order'].'-'.$tpl->P['by'].'-'.$tpl->P['year'].'-'.$tpl->P['letter'].'-'.$tpl->P['class'].'-'.urlencode($tpl->P['area']).'-'.urlencode($tpl->P['lang']);
echoPageCache($tpl->P['cp'],$tpl->P['cn']);
$tpl->P['vodtypeid'] = $tpl->P['id'];

$tpl->T = $MAC_CACHE['vodtype'][$tpl->P['vodtypeid']];
if(!is_array($tpl->T)){ showMsg("获取数据失败,请勿非法传递参数","../"); }
getDbConnect();
Expand Down Expand Up @@ -99,6 +103,10 @@
if($GLOBALS['MAC']['app']['searchstatus']=='0'){
showMsg("搜索功能已关闭,请稍后重试",MAC_PATH);
exit;
}
if($GLOBALS['MAC']['app']['searchcode']=='1' && empty($_SESSION['code_search'])){
$tpl->loadVerify('search');
exit;
}
$tpl->C["siteaid"] = 15;
$wd = trim(be("all", "wd")); $wd = chkSql($wd);
Expand Down

0 comments on commit d68972b

Please sign in to comment.