diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-21 19:09:31 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-21 19:09:31 +0000 |
commit | 022d59ef35049061c6ae344f7bc63678cfdfbc8e (patch) | |
tree | fd33cc64b6ffb758cb95df9c69edf6997bf0b179 | |
parent | b79e137f99f2376fd2d2ab95a249d458c675d595 (diff) | |
download | elgg-022d59ef35049061c6ae344f7bc63678cfdfbc8e.tar.gz elgg-022d59ef35049061c6ae344f7bc63678cfdfbc8e.tar.bz2 |
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
-rw-r--r-- | mod/blog/blog_lib.php | 14 |
1 files changed, 9 insertions, 5 deletions
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 |