aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/blog_lib.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 19:27:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 19:27:32 +0000
commit88cb569fa0c4669ca928448facfaded32b8c8cf4 (patch)
treed57901edccef30e7666d6fcce0b940239819282d /mod/blog/blog_lib.php
parentd89f95004db35020fc812d719a10f7e0e5f49a55 (diff)
downloadelgg-88cb569fa0c4669ca928448facfaded32b8c8cf4.tar.gz
elgg-88cb569fa0c4669ca928448facfaded32b8c8cf4.tar.bz2
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
Diffstat (limited to 'mod/blog/blog_lib.php')
-rw-r--r--mod/blog/blog_lib.php14
1 files changed, 12 insertions, 2 deletions
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);
}