WordPress.org

Forums

Reblog: same post date as original posts? (4 posts)

  1. symmetrium
    Member
    Posted 8 years ago #

    I have installed reblog successfully and so far it seems to work fine. However the reblogged posts resulting from reblog posts are not dated with the original item date.

    Feedworpress seems to be doing the right thing, i.e. it posts the items into WP with the right, original date, yet I really like the extra functionality provided by reblog.

    So I was wondering if there exists a plugin, hack or modification that would fix this, or if anyone had any suggestions about how I could modify the code to solve this (i.e. obtain posts carrying the same post date as the original posts being reblogged)...

    Thanks in advance...

    - symm

  2. symmetrium
    Member
    Posted 8 years ago #

    ...Was this a real stupid question? or was it somehow unclear? :(

  3. symmetrium
    Member
    Posted 8 years ago #

    ...Was this a real stupid question? or was it somehow unclear? :(

  4. Irishman
    Member
    Posted 8 years ago #

    I had a similar desire and couldn't find it on the web so I spent some time and hacked it. This seems to work. Go to your WP plugins folder for Reblog and open the Refeed plugin. Towards the bottom of the document you will find this code:

    $q = sprintf("INSERT INTO {$GLOBALS['tableposts']}
    (post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_name, post_modified, post_modified_gmt)
    VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
    1, // pick an author, any author
    date('Y-m-d H:i:s', parse_w3cdtf($item['dc']['date'])),
    gmdate('Y-m-d H:i:s', parse_w3cdtf($item['dc']['date'])),
    mysql_real_escape_string(format_to_post(balanceTags($post_content))),
    mysql_real_escape_string($item['title']),
    mysql_real_escape_string(format_to_post(balanceTags($item['summary']))),
    mysql_real_escape_string($item['title']),
    date('Y-m-d H:i:s', parse_w3cdtf($item['dc']['date'])),
    gmdate('Y-m-d H:i:s', parse_w3cdtf($item['dc']['date'])));

    Change it to this code:

    $q = sprintf("INSERT INTO {$GLOBALS['tableposts']}
    (post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_name, post_modified, post_modified_gmt)
    VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
    1, // pick an author, any author
    date('Y-m-d H:i:s', intval($item['rb']['source_published_date'])), //date('Y-m-d H:i:s',intval($item['rb']['source_published_date']) - parse_w3cdtf($item['dc']['date'])
    gmdate('Y-m-d H:i:s', intval($item['rb']['source_published_date'])),
    mysql_real_escape_string(format_to_post(balanceTags($post_content))),
    mysql_real_escape_string($item['title']),
    mysql_real_escape_string(format_to_post(balanceTags($item['summary']))),
    mysql_real_escape_string($item['title']),
    date('Y-m-d H:i:s', intval($item['rb']['source_published_date'])),
    gmdate('Y-m-d H:i:s', intval($item['rb']['source_published_date'])));

Topic Closed

This topic has been closed to new replies.

About this Topic