Feed enhanced by the Add To Feed Plugin by Ajay D\'Souza';
$str_before ='';
$str_after ='
';
if(is_feed()&&$atf_settings[enable_plugin]) {
if($atf_settings[addhtmlbefore])
{
$str_before .= stripslashes($atf_settings[htmlbefore]);
$str_before .= '
';
}
if($atf_settings[addhtmlafter])
{
$str_after .= stripslashes($atf_settings[htmlafter]);
$str_after .= '
';
}
if($atf_settings[addtitle])
{
$str_after .= ''.the_title('','',false).' was first posted on '.get_the_time('F j, Y').' at '.get_the_time('g:i a').'.';
$str_after .= '
';
}
if($atf_settings[addcopyright])
{
$str_after .= stripslashes($atf_settings[copyrightnotice]);
$str_after .= '
';
}
if($atf_settings[addcredit])
{
$str_after .= $creditline;
$str_after .= '
';
}
return $str_before.$content.$str_after;
} else {
return $content;
}
}
add_filter('the_content', 'ald_atf',99999999);
// Default Options
function atf_default_options() {
$copyrightnotice = '©'. date("Y").' "'.get_option('blogname').'". ';
$copyrightnotice .= __('Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at ','ald_atf_plugin');
$copyrightnotice .= get_option('admin_email');
$atf_settings = Array (
'enable_plugin' => false, // Add HTML to Feed?
'htmlbefore' => '', // HTML you want added to the feed
'htmlafter' => '', // HTML you want added to the feed
'copyrightnotice' => $copyrightnotice, // Copyright Notice
'emailaddress' => get_option('admin_email'), // Admin Email
'addhtmlbefore' => false, // Add HTML to Feed?
'addhtmlafter' => false, // Add HTML to Feed?
'addtitle' => true, // Add title to the post?
'addcopyright' => true, // Add copyright notice?
'addcredit' => false, // Show credits?
);
return $atf_settings;
}
// Function to read options from the database
function atf_read_options()
{
$atf_settings_changed = false;
$defaults = atf_default_options();
$atf_settings = array_map('stripslashes',(array)get_option('ald_atf_settings'));
unset($atf_settings[0]); // produced by the (array) casting when there's nothing in the DB
foreach ($defaults as $k=>$v) {
if (!isset($atf_settings[$k]))
$atf_settings[$k] = $v;
$atf_settings_changed = true;
}
if ($atf_settings_changed == true)
update_option('ald_atf_settings', $atf_settings);
return $atf_settings;
}
// This function adds an Options page in WP Admin
if (is_admin() || strstr($_SERVER['PHP_SELF'], 'wp-admin/')) {
require_once(ALD_ATF_DIR . "/admin.inc.php");
// Add meta links
function atf_plugin_actions( $links, $file ) {
static $plugin;
if (!$plugin) $plugin = plugin_basename(__FILE__);
// create link
if ($file == $plugin) {
$links[] = '' . __('Settings', ATF_LOCAL_NAME ) . '';
$links[] = '' . __('Support', ATF_LOCAL_NAME ) . '';
$links[] = '' . __('Donate', ATF_LOCAL_NAME ) . '';
}
return $links;
}
global $wp_version;
if ( version_compare( $wp_version, '2.8alpha', '>' ) )
add_filter( 'plugin_row_meta', 'atf_plugin_actions', 10, 2 ); // only 2.8 and higher
else add_filter( 'plugin_action_links', 'atf_plugin_actions', 10, 2 );
}
?>