aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-21 19:09:31 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-21 19:09:31 +0000
commit022d59ef35049061c6ae344f7bc63678cfdfbc8e (patch)
treefd33cc64b6ffb758cb95df9c69edf6997bf0b179
parentb79e137f99f2376fd2d2ab95a249d458c675d595 (diff)
downloadelgg-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.php14
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