32 |
$cookie = cookiedecode($HTTP_COOKIE_VARS['user']); |
$cookie = cookiedecode($HTTP_COOKIE_VARS['user']); |
33 |
if (!$did) $did = 0; |
if (!$did) $did = 0; |
34 |
if (!@$cookie[1] and !$did) { |
if (!@$cookie[1] and !$did) { |
35 |
if (!$HTTP_GET_VARS['user'] and !$cookie[1] and $HTTP_GET_VARS['op']!='recent') { |
if (!$HTTP_GET_VARS['user'] and !$cookie[1] and |
36 |
|
($HTTP_GET_VARS['op']!='recent' and $HTTP_GET_VARS['op']!='rss')) { |
37 |
header("Location: index.php"); |
header("Location: index.php"); |
38 |
exit; |
exit; |
39 |
} |
} |
107 |
include('footer.php'); |
include('footer.php'); |
108 |
} |
} |
109 |
|
|
110 |
|
function diary_rss ($user = "") { |
111 |
|
global $nuke_url, $gconf; |
112 |
|
dbconnect(); |
113 |
|
$i = 0; $items = array(); |
114 |
|
// $sql = "SELECT did,aid,title,time FROM diary ORDER BY did DESC LIMIT 20"; |
115 |
|
$sql = "SELECT did,aid,title,time FROM diary "; |
116 |
|
if ($user) $sql.= "WHERE aid='$user' " ; |
117 |
|
$sql.= "ORDER BY did DESC LIMIT 20"; |
118 |
|
$result = mysql_query($sql); |
119 |
|
$numrows = mysql_num_rows($result); |
120 |
|
if ($numrows) { |
121 |
|
while ($numrows--) { |
122 |
|
list($did,$aid,$title,$time,$bodytext) = mysql_fetch_row($result); |
123 |
|
if (!$user) { $title = "{$aid}: {$title}"; } |
124 |
|
$items[$i]['title'] = ereg_replace("&","",$title); |
125 |
|
$items[$i]['link'] = "{$nuke_url}diary.php.php?did={$did}"; |
126 |
|
$i++; |
127 |
|
} |
128 |
|
echo produce_rss(&$items,&$gconf['rss']); |
129 |
|
} |
130 |
|
} |
131 |
|
|
132 |
function diary_edit ($did=0) { |
function diary_edit ($did=0) { |
133 |
include('config.php'); |
include('config.php'); |
255 |
case "recent": |
case "recent": |
256 |
diary_recent(); |
diary_recent(); |
257 |
break; |
break; |
258 |
|
case "rss": |
259 |
|
diary_rss(@$user); |
260 |
|
break; |
261 |
default: |
default: |
262 |
diary_display($did,@$user); |
diary_display($did,@$user); |
263 |
} |
} |