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


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

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

1.3
date	2000.01.16.20.34.14;	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.28;	author jon;	state Exp;
branches;
next	;


desc
@@


1.5
log
@starting to modernize babel - nothing autogenerated, standard
directory/library names, etc.
@
text
@function perform_search (&$request_ref) {
  global $subject, $author, $created, $limit, $body, $hide_read, $auth, $conf;
  if (!isset($subject))   $subject = '';
  if (!isset($author))    $author = '';
  if (!isset($created))   $created = '';
  if (!isset($limit))     $limit = 0;
  if (!isset($body))      $body = 0;
  if (!isset($hide_read)) $hide_read = false;
  
  if (!($dbh = $request_ref->dbh))
    return error("database undefined");
  
  if (!($topic = $request_ref->topic))
    return error("topic undefined");
  
  if (!($url = $conf['url']))
    return error("url not set in conf");
  
  if (!(build_search_query($topic, $subject, $author, $created, $limit, $body, $query)))
    return error("could not build search query");
  
  if (!(restore_multiple_posts($request_ref, $query, $topic, $results)))
    return error("could not restore posts with query: $query");
  
  $var_hash['results'] = '';
  reset($results);
  while (list(,$val) = each($results)) {
    if (!($hide_read && is_read($request_ref, $val['id']))) {
      $var_hash['results'] .= "<a href=\"$url/show/$topic/" . $val['id'] . '">';
      $var_hash['results'] .= $val['subject'] . '</a> '; 
      $var_hash['results'] .= 'by ' . $auth->auth_getusername($val['author_id']) . ' ';
      $var_hash['results'] .= ' on ' . date('D M dS h:ia Y', $val['created']);
      $var_hash['results'] .= ' (';
      $var_hash['results'] .= format_child_count(count($val['children']));
      $var_hash['results'] .= ")<br>\n";
    }
  }
  
  if (!$results)
    $var_hash['results'] = "No matching posts";
  
  $var_hash['url'] = $conf['url'];
  $var_hash['topic'] = $request_ref->topic;
  $var_hash['id'] = $request_ref->id;
  
  if (!(restore_state($request_ref)))
    return error("could not restore state");
  
  if (!(build_navigation_bar($request_ref, $var_hash['nav_bar'])))
    return error("could not build navigation bar");
  
  if (!(build_status_bar($request_ref, $var_hash['status'])))
    return error("could not build status bar");
  
  if (!(build_search_button($request_ref, $var_hash['search'])))
    return error("could not build search button");
  
  $var_hash['body_tags'] = make_body_tags();
  
  if (!(print_template('results', $var_hash)))
    return error("could not print results template");
  
  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 should now completely use the PHPLIB database abstraction code. The
SQL schema still needs to be revised for portability - it's tied to mysql
now through auto_increment - but I want to redo the schema anyway in order
to get rid of most recursive queries. And this should make it easier for
people to set up - I'm going to try and put together an installable tarball
later today.

A friend of mine has promised to do some design work to improve the UI and
generally change things to match IMP/other horde stuff by the end of
January, so I'm hoping to get feedback on what's good and what's bad in the
current UI.

Hoping that this and the Turba commit might jumpstart some work on modules
other than IMP...
@
text
@d2 1
a2 1
  global $subject, $author, $created, $limit, $body, $hide_read, $auth;
d16 1
a16 1
  if (!($url = $request_ref->conf['url']))
d42 1
a42 1
  $var_hash['url'] = $request_ref->conf['url'];
d58 1
a58 1
  $var_hash['body_tags'] = make_body_tags($request_ref);
d60 2
a61 2
  if (!(print_template($request_ref->conf['results_template'], $var_hash)))
    return error("could not print 'results_template'");
@


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 $subject, $author, $created, $limit, $body, $hide_read;
d26 7
a32 7
  if (!is_array($results)) $results = array();
  while (list($key, $val) = each($results)) {
    if (!($hide_read && is_read($request_ref, $val->id))) {
      $var_hash['results'] .= "<a href=\"$url/show/$topic/$val->id\">";
      $var_hash['results'] .= "$val->subject</a> "; 
      $var_hash['results'] .= "by $val->author ";
      $var_hash['results'] .= ' on ' . date('D M dS h:ia Y', "$val->created");
d34 1
a34 2
      $var_hash['results'] .= format_child_count(count("$val->children"));
      
@


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

