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


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

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


desc
@@


1.2
log
@starting to modernize babel - nothing autogenerated, standard
directory/library names, etc.
@
text
@function get_next_unread (&$request_ref, $id, &$next_ref) {
  if (!($topic = $request_ref->topic))
    return error("topic undefined");
  
  if (!(count_unread_in_topic($request_ref, $topic, $unread)))
    return error("could not could unread in '$topic'");
  
  if (!$unread)
    return FAILURE;
  
  if (!$id)
    return error("couldn't get next unread");
  
  if (!(restore_post($request_ref, $id, $request_ref->topic, $post)))
    return error("could not restore post '$id'");
  
  $children = $post['children'];
  
  $siblings = $post['siblings'];
  
  $parent = $post['parent'];
  
  if ($children) {
    $next_ref = $children[0];
  } else if (get_next_in_list($next, $id, $siblings)) {
    $next_ref = $next;
  } else if (get_next_upwards($request_ref, $parent, $next)) {
    $next_ref = $next;
  } else {
    return FAILURE;
  }
  
  if (is_read($request_ref, $next_ref)) {
    if (!isset($$next_ref))
      $$next_ref = '';
    return get_next_unread($request_ref, $$next_ref, $next_ref);
  }
  
  return success();
}
@


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
@@

