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


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

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

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

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


desc
@@


1.4
log
@starting to modernize babel - nothing autogenerated, standard
directory/library names, etc.
@
text
@function init_read_posts (&$request_ref) {
  global $babel;
  
  if (!($topic = $request_ref->topic))
    return success();
  
  if (!isset($babel['read_posts'][$topic])) {
    $babel['read_posts'][$topic] = array();
  }
  $request_ref->read_posts = $babel['read_posts'][$topic];
  return success();
}
@


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


1.2
log
@cjh: Babel is probably half-broken now, as I begin moving it to use phplib
session storage. Already got rid of the open_posts db table in favor of a
session var; read_posts will follow, and then I'll fix the rest of it.
@
text
@d2 1
a2 2
  if (!($dbh = $request_ref->dbh))
    return error("database undefined");
d7 2
a8 14
  if (!($user_id = $request_ref->user_id))
    return error("'user_id' not specified");
  
  $query  = "SELECT post_id FROM read_posts WHERE topic='$topic' ";
  $query .= "AND user_id='$user_id'";
  
  if (!($sth = $dbh->prepare($query)))
    return error("could not prepare: " . $dbh->errstr);
  
  if (!($sth->execute()))
    return error("could not execute: " . $sth->errstr); 
  
  while($record = $sth->fetchrow()) {
    $request_ref->read_posts[$topic][$record[0]] = $request_ref->read_posts[$topic][$record[0]] + 1;
d10 1
a10 3
  
  $sth->finish();
  
@


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
@d11 2
a12 2
  $query  = "SELECT post_id FROM read_posts WHERE topic = '$topic' ";
  $query .= "AND user_id = $user_id";
@

