-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
116 lines (110 loc) · 4.21 KB
/
index.php
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/**
* TestGuest Version1.0
* ==============================================
* Copy 2010-2012 yc60
* Web:http://www.yc60.com
* ==============================================
* Author:Lee
* Data:2015-1-4
*/
session_start();
define('IN_TG', true);
define('SCRIPT','index' );
//引入公共文件
require dirname(__FILE__).'/includes/common.inc.php';
//
//读取数据
$_html=_html(_get_xml('new.xml'));
//调用分页函数
global $_pagenum,$_pagesize,$_system;
_page("SELECT tg_id FROM tg_article WHERE tg_reid = 0",$_system['article']);
//读取数据
$_result = _query("SELECT tg_id,tg_title,tg_type,tg_readcount,tg_commendcount
FROM tg_article
WHERE tg_reid = 0
ORDER BY tg_date DESC
LIMIT $_pagenum,$_pagesize
");
//读取最新图片
if(isset($_SESSION['admin'])){
$_photo = _fetch_array("SELECT tg_id AS id,
tg_name AS name,
tg_url AS url
FROM
tg_photo
ORDER BY
tg_date DESC
LIMIT
1
");
}else{
$_photo = _fetch_array("SELECT tg_id AS id,
tg_name AS name,
tg_url AS url
FROM
tg_photo
WHERE
tg_sid in (SELECT tg_id FROM tg_dir WHERE tg_type=0)
ORDER BY
tg_date DESC
LIMIT
1
");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
require 'includes/title.inc.php';
?>
<script type="text/javascript" src="js/blog.js"></script>
</head>
<body>
<?php
require ROOT_PATH.'includes/header.inc.php';
?>
<div id='list'>
<h2>贴子列表</h2>
<a href="post.php" class="post">发表帖子</a>
<ul class="aricle">
<?php
$_htmllist = array();
while (!!$_rows = _fetch_array_list($_result)) {
$_htmllist['id'] = $_rows['tg_id'];
$_htmllist['type'] = $_rows['tg_type'];
$_htmllist['readcount'] = $_rows['tg_readcount'];
$_htmllist['commendcount'] = $_rows['tg_commendcount'];
$_htmllist['title'] = $_rows['tg_title'];
$_htmllist = _html($_htmllist);
echo '<li class="icon'.$_htmllist['type'].'"><em>阅读数(<strong>'.$_htmllist['readcount'].'</strong>) 评论数(<strong>'.$_htmllist['commendcount'].'</strong>)</em> <a href="article.php?id='.$_htmllist['id'].'">'._title($_htmllist['title'],20).'</a></li>';
}
_free_result($_result);
?>
</ul>
<?php _paging(2);?>
</div>
<div id='user'>
<h2>新进用户</h2>
<dl>
<dd class='user'><?php echo $_html['username']?></dd>
<dt><img src="<?php echo $_html['face']?>" /></dt>
<dd class='message'><a href="javascript:;" name="message" title="<?php echo $_html['id']?>">发消息</a></dd>
<dd class='frenid'><a href="javascript:;" name="friend" title="<?php echo $_html['id']?>">加为好友</a></dd>
<dd class='guest'>写留言</dd>
<dd class='flower'><a href="javascript:;" name="flower" title="<?php echo $_html['id']?>">给他送花</a></dd>
<dd class='email'>邮箱:<a href="mailto:<?php echo $_html['email']?>"><?php echo $_html['email']?></a></dd>
<dd class='url'>网址:<a href="<?php echo $_html['url']?>" target="_blank"><?php echo $_html['url']?></a></dd>
</dl>
</div>
<div id='pics'>
<h2>最新图片--<?php echo $_photo['name']?></h2>
<a href="photo_detail.php?id=<?php echo $_photo['id']?>"><img src="thumb.php?filename=<?php echo $_photo['url']?>&percent=0.4" alt="<?php echo $_photo['name']?>" /></a>
</div>
<?php
require ROOT_PATH.'includes/footer.inc.php';
?>
</body>
</html>