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


1.3
date	2000.08.28.02.28.22;	author chuck;	state dead;
branches;
next	1.2;

1.2
date	99.08.03.04.12.54;	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.3
log
@starting to modernize babel - nothing autogenerated, standard
directory/library names, etc.
@
text
@function mark_as_closed (&$request_ref, $post_id) {
  global $babel;
  
  if (!$post_id)
    return error("'post_id' not set");
  
  if (!(folder_is_open($request_ref, $post_id)))
    return success();
  
  if (!($topic = $request_ref->topic))
    return error("topic undefined");
  
  unset($babel['open_posts'][$topic][$post_id]);
  unset($request_ref->open_posts[$post_id]);
  
  return success();
}
@


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


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
@d2 2
a9 3
  if (!($dbh = $request_ref->dbh))
    return error("database undefined");
  
d13 1
a13 15
  if (!($user_id = $request_ref->user_id))
    return error("'user_id' not specified");
  
  $query  = "DELETE FROM open_posts ";
  $query .= "WHERE topic = '$topic' AND post_id = $post_id ";
  $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); 
  
  $sth->finish();
    
@

