In sp-linking-blog.php I’ve added what’s in blue:
add_action(‘sph_new_post’, ‘my_linking_code’); add_action(‘sph_new_post’, ‘my_linking_code’); function my_linking_code($newpost) { global $spVars; $spVars[‘linkedpost’] = $newpost[‘postid’];
$p->saveData();
if (!$p->abort) { $editmode = ‘0’; if ((isset($_POST[‘sfedit’]) && $_POST[‘sfedit’] == true) || $links->syncedit == ‘1’) $editmode = ‘1’;
# and then update links table with forum AND topic sp_blog_links_control(‘save’, $post->ID, $forumid, $p->newpost[‘topicid’], $editmode);
# sync blog and forum tags sp_sync_blog_tags($post->ID, $forumid, $topicid);
# Add the blog post id into the topic record $sql = “UPDATE “.SFTOPICS.” SET blog_post_id = “.$post->ID.” WHERE topic_id = “.$p->newpost[‘topicid’]; spdb_query($sql);
$sql = “UPDATE “.SFPOSTS.” SET post_date = “.$post->post_date.” WHERE post_id = “.$spVars[‘linkedpost’];spdb_query($sql);
} else {
I know, it seems like .$post->post_date. should be in the scope. I just get today’s date (at the time I update it) instead of the original published date though.
If I add show($post); die(); after that sql statement and then do an ‘update’ in the wp page editor, it just crashes the page. I don’t get a string.