/[gnuheter]/gnuheter/diary.php
ViewVC logotype

Diff of /gnuheter/diary.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by pawal, Mon Feb 3 20:35:06 2003 UTC revision 1.18 by pawal, Wed Feb 26 21:16:35 2003 UTC
# Line 32  $did = (int) $HTTP_GET_VARS['did']; Line 32  $did = (int) $HTTP_GET_VARS['did'];
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      }      }
# Line 106  function diary_recent () { Line 107  function diary_recent () {
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');
# Line 233  switch ($op) { Line 255  switch ($op) {
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  }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26