The WP Autoblog plugin is great. It allows you add multiple feeds from external sites or blogs which act as normal posts. The problem I am having with this plugin is that I want the post title to link to the actual blog post from the feed, as opposed to keeping it on my blog and going to the single.php page.
For example I have multiple feeds that are syndicated on my homepage using autoblog, but I have blog 1 which is on my list of feeds that autoblog uses. Instead of the blog going to blog 1 or http://blog1.mysite.com/post it stays on my blog and goes to http://mysite.com/post.
Here is the code from the plugin that I need to modify but I am not a php expert: (I can usually modify things here and there but this ones is beyond me)
// Title
$post['post_title'] = strip_tags(trim($item['title']));
// Categories
$post['post_category'] = array();
if(isset($item['category#'])){
for ($i = 1; $i <= $item['category#']; $i++){
$cat_idx = (($i > 1) ? "#{$i}" : "");
$cat = $item["category{$cat_idx}"];
$post['post_category'][] = $cat;
}
} else if($item['dc']['subject'] != ""){
$post['post_category'][] = $item['dc']['subject'];
}
for($i = 0; $i < count($post['post_category']); $i++){
$post['post_category'][$i] = $wpdb->escape($post['post_category']);
$post['post_category'][$i] = lookup_cat(strip_tags(trim($post['post_category'][$i])));
}
// Post date
$date = "";
if($item['published'] != "") $date = auto_blog_parse_w3cdtf($item['published']); // Atom 1.0
else if($item['issued'] != "") $date = auto_blog_parse_w3cdtf($item['issued']); // Atom 0.3
else if($item['dcterms']['issued'] != "") $date = auto_blog_parse_w3cdtf($item['dcterms']['issued']);
else if($item['dc']['date'] != "") $date = auto_blog_parse_w3cdtf($item['dc']['date']);
else if($item['pubdate'] != "") $date = strtotime($item['pubdate']); // RSS 2.0
else $date = time();
$post['post_date'] = date('Y-m-d H:i:s', $date);
// Post status
$post['post_status'] = 'publish';
// Attribution
if(get_option('wp_autoblog_attribution') == 1){
if($item['author'] != "") $author = $item['author'];
else if($item['dc']['creator'] != "") $author = $item['dc']['creator'];
else if($item['author_name'] != "") $author = $item['author_name'];
else if($item['source'] != "") $author = $item['source'];
else if($item['dc']['contributor'] != "") $author = $item['dc']['contributor'];
// if there is no author, try two things:
if($author == "") $author = $rss->channel['title'];
if($author == "") $author = 'Unknown';
$author = strip_tags(trim($author));
$post['post_content'] .= '<p>';
if($author != ""){
$post['post_content'] .= ' Read the full post by <em><a href="' . htmlentities(strip_tags(trim($item['link']))) . '" title="' . htmlentities($post['title']) . '">' . htmlentities($author) . '</a></em>';
$post['post_content'] .= '';
} else {
$post['post_content'] .= '';
}
$post['post_content'] .= '</p>';
}
If someone can let me know what I need to do to modify this code, that wold be great. Thanks.