From 88cb569fa0c4669ca928448facfaded32b8c8cf4 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 24 May 2010 19:27:32 +0000 Subject: Removing publish_date interface for blogs pending better l10n for dates. git-svn-id: http://code.elgg.org/elgg/trunk@6186 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/blog_lib.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'mod/blog/blog_lib.php') diff --git a/mod/blog/blog_lib.php b/mod/blog/blog_lib.php index 50ba5e92d..9876b0a34 100644 --- a/mod/blog/blog_lib.php +++ b/mod/blog/blog_lib.php @@ -58,7 +58,7 @@ function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) { if (!(isadminloggedin() || (isloggedin() && $owner_guid == $loggedin_userid))) { $options['metadata_name_value_pairs'] = array( array('name' => 'status', 'value' => 'published'), - array('name' => 'publish_date', 'operand' => '<', 'value' => time()) + //array('name' => 'publish_date', 'operand' => '<', 'value' => time()) ); } @@ -320,7 +320,17 @@ class ElggBlog extends ElggObject { public function save() { if (parent::save()) { global $CONFIG; - $published = $this->publish_date; + + // try to grab the publish date, but default to now. + foreach (array('publish_date', 'time_created') as $field) { + if (isset($this->$field) && $this->field) { + $published = $this->field; + break; + } + } + if (!$published) { + $published = time(); + } $sql = "UPDATE {$CONFIG->dbprefix}entities SET time_created = '$published', time_updated = '$published' WHERE guid = '{$this->getGUID()}'"; return update_data($sql); } -- cgit v1.2.3