]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Removing publish_date interface for blogs pending better l10n for dates.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 24 May 2010 19:27:32 +0000 (19:27 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 24 May 2010 19:27:32 +0000 (19:27 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6186 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/actions/blog/save.php
mod/blog/blog_lib.php
mod/blog/views/default/blog/forms/edit.php

index 46af1bafba7a45a57a5b8ef46cd86afbee6e45f4..0e8a696b936090a70ab7f3f92221906a962b418e 100644 (file)
@@ -110,13 +110,16 @@ foreach ($values as $name => $default) {
 }
 
 // build publish_date
-$publish_month = get_input('publish_month');
-$publish_day = get_input('publish_day');
-$publish_year = get_input('publish_year');
-$publish_hour = get_input('publish_hour');
-$publish_minute = get_input('publish_minute');
-$datetime = "$publish_year-$publish_month-$publish_day $publish_hour:$publish_minute:00";
-$values['publish_date'] = date('U', strtotime($datetime));
+//$publish_month = get_input('publish_month');
+//$publish_day = get_input('publish_day');
+//$publish_year = get_input('publish_year');
+//$publish_hour = get_input('publish_hour');
+//$publish_minute = get_input('publish_minute');
+//$datetime = "$publish_year-$publish_month-$publish_day $publish_hour:$publish_minute:00";
+//$values['publish_date'] = date('U', strtotime($datetime));
+
+// setting publish_date to now until the problems with locale dates can be resolved.
+$values['publish_date'] = time();
 
 // assign values to the entity, stopping on error.
 if (!$error) {
index 50ba5e92d323533816b6b66b209631e621861147..9876b0a349979d7c55d8d39c25608f6462cb8a83 100644 (file)
@@ -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);
                }
index 81e4dae444990762f815eccb550b0196a54b0cc4..f8b39d96496e23f6d3b8309483f304ddba929577 100644 (file)
@@ -189,12 +189,6 @@ $body_input
        $save_status <span id="blog_save_status_time">$saved</span>
 </p>
 
-<p>
-       <label for="blog_publish_date">$publish_date_label</label>
-       $publish_date_input
-</p>
-
-
 <p>
        <label for="blog_tags">$tags_label</label>
        $tags_input