head	1.3;
access;
symbols;
locks; strict;
comment	@# @;


1.3
date	2000.08.28.02.28.21;	author chuck;	state dead;
branches;
next	1.2;

1.2
date	99.08.04.00.56.14;	author chuck;	state Exp;
branches;
next	1.1;

1.1
date	99.07.20.07.36.26;	author jon;	state Exp;
branches;
next	;


desc
@@


1.3
log
@starting to modernize babel - nothing autogenerated, standard
directory/library names, etc.
@
text
@function count_unread_in_topic ($request_ref, $topic, &$unread_ref) {
  if (!$topic) $topic = 'all';
  
  if (!(count_posts_in_topic($request_ref, $topic, $total)))
    return error("could not count posts in topic '$topic'");
  
  if (isset($request_ref->unread_posts)) {
    $unread_ref = $request_ref->unread_posts;
    return success();
  }
  
  $unread_ref = $total - count($request_ref->read_posts);
  
  $request_ref->unread_posts = $unread_ref;
  
  return success();
}
@


1.2
log
@cjh: use session storage for read_posts as well. one more db table gone... :)
@
text
@@


1.1
log
@
jon: alrighty, babel.php3.in is now broken down into seperate
     function files.  they're jusy dying to be combined into
     objects and seperate source files.
@
text
@d7 2
a8 2
  if (isset($request_ref->unread_posts[$topic])) {
    $unread_ref = $request_ref->unread_posts[$topic];
d12 1
a12 1
  $unread_ref = $total - count($request_ref->read_posts[$topic]);
d14 1
a14 1
  $request_ref->unread_posts[$topic] = $unread_ref;
@

