gbooktemp.txt
1.96 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
<?php
require("../../class/connect.php");
if(!defined('InEmpireCMS'))
{
exit();
}
require("../../class/db_sql.php");
require("../../class/q_functions.php");
require "../".LoadLang("pub/fun.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//分類id
$bid=(int)$_GET['bid'];
$gbr=$empire->fetch1("select bid,bname,groupid from {$dbtbpre}enewsgbookclass where bid='$bid'");
if(empty($gbr['bid']))
{
printerror("EmptyGbook","",1);
}
//權限
if($gbr['groupid'])
{
include("../../member/class/user.php");
$user=islogin();
include("../../data/dbcache/MemberLevel.php");
if($level_r[$gbr[groupid]][level]>$level_r[$user[groupid]][level])
{
echo"<script>alert('您的會員級別不足(".$level_r[$gbr[groupid]][groupname]."),沒有權限提交信息!');history.go(-1);</script>";
exit();
}
}
esetcookie("gbookbid",$bid,0);
$bname=$gbr['bname'];
$search="&bid=$bid";
$page=(int)$_GET['page'];
$page=RepPIntvar($page);
$start=0;
$line=$public_r['gb_num'];//每頁顯示條數
$page_line=10;//每頁顯示鏈接數
$offset=$start+$page*$line;//總偏移量
$totalnum=(int)$_GET['totalnum'];
if($totalnum>0)
{
$num=$totalnum;
}
else
{
$totalquery="select count(*) as total from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
$num=$empire->gettotal($totalquery);//取得總條數
}
$search.="&totalnum=$num";
$query="select lyid,name,email,`mycall`,lytime,lytext,retext from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
$query=$query." order by lyid desc limit $offset,$line";
$sql=$empire->query($query);
$listpage=page1($num,$line,$page_line,$start,$page,$search);
$url="<a href='".ReturnSiteIndexUrl()."'>".$fun_r['index']."</a> > ".$fun_r['saygbook'];
?>
<!--empire.listtemp.top-->
<?
while($r=$empire->fetch($sql))
{
$r['retext']=nl2br($r[retext]);
$r['lytext']=nl2br($r[lytext]);
?>
<!--empire.listtemp.center-->
<?
}
?>
<!--empire.listtemp.footer-->
<?php
db_close();
$empire=null;
?>