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


1.5
date	2000.08.28.02.28.19;	author chuck;	state dead;
branches;
next	1.4;

1.4
date	2000.01.17.22.10.59;	author chuck;	state Exp;
branches;
next	1.3;

1.3
date	2000.01.16.18.49.38;	author chuck;	state Exp;
branches;
next	1.2;

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

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


desc
@@


1.5
log
@starting to modernize babel - nothing autogenerated, standard
directory/library names, etc.
@
text
@function build_tree (&$request_ref, $id, &$tree_ref) {
  global $unread_only, $auth;
  
  if (!($topic = $request_ref->topic))
    return error("topic undefined");
  
  if (!($url = $GLOBALS['conf']['url']))
    return error("could not find 'url' in conf");
  
  if (!(restore_post($request_ref, $id, $topic, $post)))
    return error("could not restore post '$id'");
  
  $children = array();
  if (isset($post['children'])) $children = $post['children'];
  
  $id = $post['id'];
  $subject = $post['subject'];
  $author_id = $post['author_id'];
  $author = $auth->auth_getusername($post['author_id']);
  $created = $post['created'];
  $has_children = $children;
  $is_open = folder_is_open($request_ref, $id);
  
  if (!isset($unread_only))
    $unread_only = false;
  if (!($unread_only and is_read($request_ref, $id))) {
    $tree_ref .= '<dd>';
    
    if (!$unread_only && $has_children && $is_open)
      $tree_ref .= make_close_button($request_ref, $id) . ' ';
    
    if (!$unread_only && $has_children && !$is_open)
      $tree_ref .= make_open_button($request_ref, $id) . ' ';
    
    if ($unread_only || !$has_children)
      $tree_ref .= make_bullet_button() . ' ';
    
    if ($id == $request_ref->id)
      $tree_ref .= make_current_button() . ' ';
    
    $tree_ref .= "<a href=\"$url/show/$topic/$id\">";
    
    $tree_ref .= "$subject</a> by ";
    
    $tree_ref .= "<a href=\"$url/profile/$topic/$id?userid=$author_id\">";
    
    $tree_ref .= "<i>$author</i></a> ";
    
    if (is_new($request_ref, $created))
      $tree_ref .= make_new_button();
    
    $tree_ref .= '(' . format_child_count(count($children)) . ')';
    
    if (!(is_read($request_ref, $id)))
      $tree_ref .= make_unread_button();
    
    $tree_ref .= "</dd>\n";
  }
  
  if ($is_open or $unread_only) {
    
    $tree_ref .= "<dl>\n";
    
    if (is_array($children)) {
      while (list($key, $id) = each($children)) {
	if (!(build_tree($request_ref, $id, $tree_ref)))
	  return error("could not build tree for id '$id'");
      }
    }
    
    $tree_ref .= "</dl>\n";
  }
  
  return success();
}
@


1.4
log
@Another whomping commit that really doesn't do much tangible. The conf
system is now moved over to the $conf[section][value|subsection] mode that
the other cvs horde stuff is using.

Also, I'm compacting and tightening up the code wherever possible when I go.
Lots of major changes - moving the configuration of forums into the
database, changes in the database code for faster sql access, options to put
different forums in different tables/databases, and some nifty setup ideas -
to come.

Comments on what people would like to see in a forum system - I've already
thought of being able to attach files (where should they be stored?) - would
be welcome.
@
text
@@


1.3
log
@Babel no longer keeps it's own user table; it grabs Horde (phplib)
usernames/ids and uses those. We'll need to figure out a way of storing
email and fullname prefs with Horde accounts.
@
text
@d7 1
a7 1
  if (!($url = $request_ref->conf['url']))
d36 1
a36 1
      $tree_ref .= make_bullet_button($request_ref) . ' ';
d39 1
a39 1
      $tree_ref .= make_current_button($request_ref, $id) . ' ';
d50 1
a50 1
      $tree_ref .= make_new_button($request_ref);
d55 1
a55 1
      $tree_ref .= make_unread_button($request_ref);
@


1.2
log
@cjh: pruning out all the code that either isn't used or is only used for
maintaining/creating users - all of which is moving to Horde proper. Also a
few more fixes for the new session/user stuff, though I haven't quite gotten
rid of the "users" table yet - that's coming, though.

babel.php3 is a nice bit shorter, now... ;)

Anyway, a bit more work, and a better Horde user framework, and babel should
be more or less ready for primetime. oh, there's that whole customization
thing, too.

Speaking of which, what do people prefer: imp-style defaults.php3, or
babel-style babel.conf. I figure we should standardize on one; they're both
easy to auto-generate; babel's is maybe a little bit more overhead to parse,
but it's a bit more user friendly as well. Thoughts?
@
text
@d2 1
a2 1
  global $unread_only;
a17 1
  $author = $post['author'];
d19 1
@


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
@d19 1
d45 1
a45 1
    $tree_ref .= "<a href=\"$url/profile/$topic/$id?user=$author\">";
@

