<?php
/**
* function publish ()
* Immediately publishes this article so users can see it.
*
* @version $Id: A_publish.php,v 1.3 2004/10/10 15:36:10 adarkling Exp $
*
* @author Eloi George <eloi@NOSPAM.bygeorgeware.com>
* @module Article Manager
* @param none
* @return none
*/

$now = date("Y-m-d H:i:s");
/* Make sure that the expiration date is good. */
if (!($this->expiration_date > $now || $this->expiration_date==NULL))
  $this->expiration_date = $query_data['expiration_date'] = date("Y-m-d H:i:s", mktime(0,0,0
          ,date('m')+$_SESSION['SES_ART_master']->val['expiration_months']
          ,date('d')+$_SESSION['SES_ART_master']->val['expiration_days']
          ,date('Y')+$_SESSION['SES_ART_master']->val['expiration_years']));

$this->publication_date = $query_data['publication_date'] = date("Y-m-d H:i:s");
$GLOBALS['core']->sqlUpdate($query_data, 'mod_article', 'id', $this->id);
PHPWS_Fatcat::activate($this->id, 'article');
?>
