linc / vanilla-glue

Use WordPress as an addon to Vanilla Forums
GNU General Public License v2.0
14 stars 0 forks source link

Wrong timestamp for new article/discussion #16

Closed linc closed 11 years ago

linc commented 12 years ago

http://icrontic.com/discussion/comment/831347#Comment_831347

Probably only effects discussion's DateInserted, not comments.

austins commented 11 years ago

Here's a workaround that I just came up with that reinserts DateUpdated and DateLastComment into the new discussion that is created after the WP post is published. It seemed to do the trick when I tested it several minutes ago.

At the end of function glue_add_discussion($postid) in glue.php:

// Workaround for incorrect DateUpdated and DateLastComment timestamps after the discussion is created on Vanilla. 
// Reinserts DateUpdated and DateLastComment to the newly created discussion on Vanilla. 
global $wpdb; 
$wpdb->update(VANILLA_PREFIX.'Discussion', array('DateUpdated' => $the_post->post_date, 'DateLastComment' => $the_post->post_date), array('DiscussionID' => $DiscussionID));