aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-14 07:53:34 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-14 07:53:34 +0000
commit19f08d9848271c0f88a46c6cb74cd35323ddec7e (patch)
tree3d60478eb06ba69f229471be5adfcfbdbcb144a0
parent30df49bbb363d47b4a3961bb3ec07cdecea7619b (diff)
downloadelgg-19f08d9848271c0f88a46c6cb74cd35323ddec7e.tar.gz
elgg-19f08d9848271c0f88a46c6cb74cd35323ddec7e.tar.bz2
Switching blog over to autoload method for plugin classes
git-svn-id: http://code.elgg.org/elgg/trunk@7075 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/blog/classes/ElggBlog.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/mod/blog/classes/ElggBlog.php b/mod/blog/classes/ElggBlog.php
new file mode 100644
index 000000000..8dfe0585c
--- /dev/null
+++ b/mod/blog/classes/ElggBlog.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Extended class to override the time_created
+ */
+class ElggBlog extends ElggObject {
+ protected function initialise_attributes() {
+ parent::initialise_attributes();
+
+ // override the default file subtype.
+ $this->attributes['subtype'] = 'blog';
+ }
+
+ /**
+ * @todo this won't work until we have date l10n working.
+ * Rewrite the time created to be publish time.
+ * This is a bit dirty, but required for proper sorting.
+ */
+// public function save() {
+// if (parent::save()) {
+// global $CONFIG;
+//
+// // 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);
+// }
+//
+// return FALSE;
+// }
+} \ No newline at end of file