-
Notifications
You must be signed in to change notification settings - Fork 0
/
rss.php
executable file
·64 lines (54 loc) · 1.74 KB
/
rss.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
<?php
/*
[UCenter Home] (C) 2007-2008 Comsenz Inc.
$Id: rss.php 12766 2009-07-20 04:26:21Z liguode $
*/
include_once('./common.php');
@header("Content-type: application/xml");
$pagenum = 10;
$tag = '<?';
$rssdateformat = 'D, d M Y H:i:s T';
$siteurl = getsiteurl();
$uid = empty($_GET['uid'])?0:intval($_GET['uid']);
$list = array();
if(!empty($uid)) {
$space = getspace($uid);
}
if(empty($space)) {
//Õ¾µã¸üÐÂrss
$space['username'] = $_SCONFIG['sitename'];
$space['name'] = $_SCONFIG['sitename'];
$space['email'] = $_SCONFIG['adminemail'];
$space['space_url'] = $siteurl;
$space['lastupdate'] = sgmdate($rssdateformat);
$space['privacy']['blog'] = 1;
} else {
$space['username'] = $space['username'].'@'.$_SCONFIG['sitename'];
$space['space_url'] = $siteurl."space.php?uid=$space[uid]";
$space['lastupdate'] = sgmdate($rssdateformat, $space['lastupdate']);
}
//10ƪ×îÐÂÈÕÖ¾
$uidsql = empty($space['uid'])?'':" AND b.uid='$space[uid]'";
$query = $_SGLOBAL['db']->query("SELECT bf.message, b.*
FROM ".tname('blog')." b
LEFT JOIN ".tname('blogfield')." bf ON bf.blogid=b.blogid
WHERE b.friend='0' $uidsql
ORDER BY dateline DESC
LIMIT 0,$pagenum");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if(!empty($space['privacy']['blog'])) {
$value['message'] = '';
} else {
$value['message'] = getstr($value['message'], 300, 0, 0, 0, 0, -1);
if($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$value['message'] .= "<br /><img src=\"$value[pic]\">";
}
}
realname_set($value['uid'], $value['username']);
$value['dateline'] = sgmdate($rssdateformat, $value['dateline']);
$list[] = $value;
}
realname_get();
include template('space_rss');
?>