1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
{pc:content action=
"lists"
catid=
"$catid"
num=
"25"
order=
"id DESC"
page=
"$page"
moreinfo=
"1"
}
{loop $data $r}
{php $db = pc_base::load_model(
'hits_model'
); $_r = $db->get_one(array(
'hitsid'
=>
'c-'
.$modelid.
'-'
.$r[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class(
"comment_tag"
,
"comment"
); $comment_total = $comment_tag->count(array(
'commentid'
=>
'content_'
.$catid.
'-'
.$r[id].
'-'
.$modelid));}
if
$comment_total}{$comment_total}{
else
}
0
{/
if
}{/loop}
{$pages}
{/pc}
|
2.频道页获取数据方法:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
{pc:content action=
"lists"
catid=
"$v[catid]"
num=
"5"
order=
"id DESC"
}
{loop $data $v}
{php $db = pc_base::load_model(
'hits_model'
); $_r = $db->get_one(array(
'hitsid'
=>
'c-'
.$modelid.
'-'
.$v[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class(
"comment_tag"
,
"comment"
); $comment_total = $comment_tag->count(array(
'commentid'
=>
'content_'
.$v[catid].
'-'
.$v[id].
'-'
.$modelid));}
if
$comment_total}{$comment_total}{
else
}
0
{/
if
}
{/loop}
{/pc}
|
3.首页获取数据方法:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{pc:content action=
"lists"
catid=
"$r[catid]"
num=
"5"
order=
"id DESC"
return
=
"info"
}
{php $categorys = getcache(
'category_content_'
.$siteid,
'commons'
);}
{loop $info $v}
{php $category = $categorys[$v[catid]];}
{php $modelid = $category[
'modelid'
];}
{php $db = pc_base::load_model(
'hits_model'
); $_r = $db->get_one(array(
'hitsid'
=>
'c-'
.$modelid.
'-'
.$v[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class(
"comment_tag"
,
"comment"
); $comment_total = $comment_tag->count(array(
'commentid'
=>
'content_'
.$v[catid].
'-'
.$v[id].
'-'
.$modelid));}
if
$comment_total}{$comment_total}{
else
}
0
{/
if
}
{/loop}
{/pc}
|
4.推荐位获取数据方法:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
{pc:content action=
"position"
posid=
"2"
order=
"listorder DESC"
num=
"4"
}
{php $categorys = getcache(
'category_content_'
.$siteid,
'commons'
);}
{loop $data $r}
{php $category = $categorys[$r[catid]];}
{php $modelid = $category[
'modelid'
];}
{php $db = pc_base::load_model(
'hits_model'
); $_r = $db->get_one(array(
'hitsid'
=>
'c-'
.$modelid.
'-'
.$r[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class(
"comment_tag"
,
"comment"
); $comment_total = $comment_tag->count(array(
'commentid'
=>
'content_'
.$r[catid].
'-'
.$r[id].
'-'
.$modelid));}
if
$n==
1
}
{/loop}
{/pc}
|