function rpf_custom_template($sourcelink, $feed_id) { global $rpf_options; $custom_template = $rpf_options['custom_template']; if (false === strpos($custom_template, '%SOURCE_URL%')) { $custom_template .= ' <a href="%SOURCE_URL%">%SOURCE_URL%</a> '; } $feed = rpf_get_feed($feed_id); $user = get_userdata($feed['author']); $author = $user->nickname; $category = get_cat_name($feed['category']); $feed_url = $feed['url']; $feed_name = $feed['name']; $custom_template = str_replace(array('%SOURCE_URL%', '%AUTHOR%', '%CATEGORY%', '%FEED_URL%', '%FEED_NAME%'), array($sourcelink, $author, $category, $feed_url, $feed_name), $custom_template); return $custom_template; }
<?php require_once dirname(__FILE__) . '/../../../wp-config.php'; require_once dirname(__FILE__) . '/RSSPoster.php'; if (!empty($_POST['feed_id'])) { $feed = rpf_get_feed($_POST['feed_id']); rpf_process_feed($feed); }