From 022d59ef35049061c6ae344f7bc63678cfdfbc8e Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 21 Apr 2010 19:09:31 +0000 Subject: Rewriting time_created and time_updated instead of trying to be tricky with metadata. git-svn-id: http://code.elgg.org/elgg/trunk@5837 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/blog_lib.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/blog/blog_lib.php b/mod/blog/blog_lib.php index de7cc1b96..4d330c295 100644 --- a/mod/blog/blog_lib.php +++ b/mod/blog/blog_lib.php @@ -307,13 +307,17 @@ class ElggBlog extends ElggObject { } /** - * Override the value returned for time_created + * Rewrite the time created to be publish time. + * This is a bit dirty, but required for proper sorting. */ - public function __get($name) { - if ($name == 'time_created') { - $name = 'time_created'; + public function save() { + if (parent::save()) { + global $CONFIG; + $published = $this->publish_date; + $sql = "UPDATE {$CONFIG->dbprefix}entities SET time_created = '$published', time_updated = '$published'"; + return update_data($sql); } - return $this->get($name); + return FALSE; } } \ No newline at end of file -- cgit v1.2.3