-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtag.php
More file actions
executable file
·87 lines (78 loc) · 2.54 KB
/
tag.php
File metadata and controls
executable file
·87 lines (78 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
require_once("duomiphp/common.php");
require_once(duomi_INC."/core.class.php");
$page = (isset($page) && is_numeric($page)) ? $page : 1;
if(!isset($tag)) $tag = '';
$tag = Filtersearch(stripslashes($tag));
$tag = addslashes(cn_substr($tag,20));
if($tag=='')
{
ShowMsg('标签不能为空!','-1','0',$cfg_search_time);
exit();
}
echoTagPage();
function echoTagPage()
{
global $dsql,$cfg_iscache,$mainClassObj,$page,$t1,$cfg_search_time,$searchtype,$tag;
if($cfg_search_time) checksearchTimes($cfg_search_time);
$searchTemplatePath = "/duomiui/".$GLOBALS['cfg_df_style']."/".$GLOBALS['cfg_df_html']."/tag.html";
$pSize = getPageSizeOnCache($searchTemplatePath,"search","");
if (empty($pSize)) $pSize=12;
$whereStr=" where v_tag like '%$tag%'";
$sql="select vids from duomi_tags where tag='$tag'";
$row = $dsql->GetOne($sql);
if(is_array($row))
{
$vids=$row['vids'];
$TotalResult = count(explode(',', $row['vids']));
}
else
{
$TotalResult = 0;
}
$pCount = ceil($TotalResult/$pSize);
$cacheName="parse_tag_";
if($cfg_iscache){
if(chkFileCache($cacheName)){
$content = getFileCache($cacheName);
}else{
$content = parsesearchPart($searchTemplatePath);
setFileCache($cacheName,$content);
}
}else{
$content = parsesearchPart($searchTemplatePath);
}
$tempStr = $content;
$tempStr = str_replace("{duomicms:tag}",$tag,$tempStr);
$tempStr = str_replace("{duomicms:tagnum}",$TotalResult,$tempStr);
$content=$tempStr;
$content=$mainClassObj->parsePageList($content,$vids,$page,$pCount,$TotalResult,"tag");
$content=replaceCurrentTypeId($content,-444);
$content=$mainClassObj->parseIf($content);
$content=str_replace("{duomicms:member}",front_member(),$content);
$searchPageStr = $content;
echo str_replace("{duomicms:runinfo}",getRunTime($t1),$searchPageStr) ;
}
function parsesearchPart($templatePath)
{
global $mainClassObj;
$content=loadFile(duomi_ROOT.$templatePath);
$content=$mainClassObj->parseTopAndFoot($content);
$content=$mainClassObj->parseSelf($content);
$content=$mainClassObj->parseGlobal($content);
$content=$mainClassObj->parseMenuList($content,"",$currentTypeId);
$content=$mainClassObj->parseVideoList($content,$currentTypeId);
$content=$mainClassObj->parseTopicList($content);
return $content;
}
function checksearchTimes($searchtime)
{
if(GetCookie("sduomi2_tag")=="ok")
{
ShowMsg('搜索限制为'.$searchtime.'秒一次','-1','0',$cfg_search_time);
exit;
}else{
PutCookie("sduomi2_tag","ok",$searchtime);
}
}
?>