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


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

1.3
date	2000.01.16.20.34.12;	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.4
log
@starting to modernize babel - nothing autogenerated, standard
directory/library names, etc.
@
text
@function build_search_query ($topic, $subject, $author, $created, $limit, $body, &$query_ref) {
  if (!$topic)
    return error("'topic' undefined");
  
  $query_ref  = "SELECT ";
  $query_ref .= "id, parent, subject, ";
  $query_ref .= "author_id, ";
  $query_ref .= "created, modified, locked ";
  $query_ref .= "FROM posts ";
  $query_ref .= "WHERE ";
  $query_ref .= "topic = '$topic' ";
  if ($subject) $query_ref .= "AND subject LIKE '%$subject%' ";
  // FIXME if ($author) $query_ref .= "AND author LIKE '%$author%' ";
  if ($created) $query_ref .= "AND created > " . (time() + $created) . ' ';
  if ($body) $query_ref .= "AND body LIKE '%$body%' ";
  $query_ref .= "ORDER BY 'created' DESC ";
  if ($limit) $query_ref .= " LIMIT $limit ";
  
  return success();
}
@


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


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
@d7 1
a7 1
  $query_ref .= "author_id, author, ";
d12 4
a15 8
  if ($subject)
    $query_ref .= "AND subject LIKE '%$subject%' ";
  if ($author)
    $query_ref .= "AND author LIKE '%$author%' ";
  if ($created)
    $query_ref .= "AND created > " . (time() + $created) . ' ';
  if ($body)
    $query_ref .= "AND body LIKE '%$body%' ";
d17 1
a17 2
  if ($limit)
    $query_ref .= " LIMIT $limit ";
@


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
@d6 4
a9 4
  $query_ref .= "posts.id, posts.parent, posts.subject, ";
  $query_ref .= "users.username, ";
  $query_ref .= "posts.created, posts.modified, posts.locked ";
  $query_ref .= "FROM posts, users ";
d11 1
a11 1
  $query_ref .= "posts.topic = '$topic' AND ";
d13 1
a13 1
    $query_ref .= "posts.subject LIKE '%$subject%' AND ";
d15 1
a15 1
    $query_ref .= "users.username = '$author' AND ";
d17 1
a17 1
    $query_ref .= "posts.created > " . (time() + $created) . " AND ";
d19 2
a20 3
    $query_ref .= "posts.body LIKE '%$body%' AND ";
  $query_ref .= " users.id = posts.author_id ";
  $query_ref .= " ORDER BY 'created' DESC ";
@

