Enable Widget | Settings]
Version: .9.6.3
Author: Add to Any
Author URI: http://www.addtoany.com/contact/
*/
if( !isset($A2A_javascript) )
$A2A_javascript = '';
if( !isset($A2A_locale) )
$A2A_locale = '';
$A2A_SUBSCRIBE_plugin_basename = plugin_basename(__FILE__);
function A2A_SUBSCRIBE_textdomain() {
global $A2A_SUBSCRIBE_plugin_basename;
load_plugin_textdomain('add-to-any-subscribe',
PLUGINDIR.'/'.dirname($A2A_SUBSCRIBE_plugin_basename),
dirname($A2A_SUBSCRIBE_plugin_basename));
}
add_action('init', 'A2A_SUBSCRIBE_textdomain');
class Add_to_Any_Subscribe_Widget {
// static init callback
function init() {
// Check for the required plugin functions. This will prevent fatal
// errors occurring when you deactivate the dynamic-sidebar plugin.
if ( !function_exists('register_sidebar_widget') )
return;
$widget = new Add_to_Any_Subscribe_Widget();
// This registers our widget so it appears with the other available
// widgets and can be dragged and dropped into any active sidebars.
register_sidebar_widget('Add to Any Subscribe', array($widget,'display'));
//Registering the control form.
register_widget_control('Add to Any Subscribe', 'A2A_SUBSCRIBE_options_widget', 450);
}
function display( $args = false ) {
global $A2A_SUBSCRIBE_plugin_basename;
if( $args )
extract( $args );
$feedname = ($feedname) ? $feedname : get_bloginfo('name');
$feedname_enc = rawurlencode( $feedname );
$feedurl = ($feedurl) ? $feedurl : get_bloginfo('rss2_url');
$feedurl_enc = rawurlencode( $feedurl );
$button_target = (get_option('A2A_SUBSCRIBE_button_opens_new_window')=='1' && (get_option('A2A_SUBSCRIBE_onclick')!='1')) ? ' target="_blank"' : '';
if( !get_option('A2A_SUBSCRIBE_button') ) {
$button_fname = 'subscribe_120_16.png';
$button_width = ' width="120"';
$button_height = ' height="16"';
$button_src = trailingslashit(get_option('siteurl')).PLUGINDIR.'/'.dirname($A2A_SUBSCRIBE_plugin_basename).'/'.$button_fname;
} else if( get_option('A2A_SUBSCRIBE_button') == 'CUSTOM' ) {
$button_src = get_option('A2A_SUBSCRIBE_button_custom');
$button_width = '';
$button_height = '';
} else if( get_option('A2A_SUBSCRIBE_button') == 'TEXT' ) {
$button_text = stripslashes(get_option('A2A_SUBSCRIBE_button_text'));
} else {
$button_attrs = explode( '|', get_option('A2A_SUBSCRIBE_button') );
$button_fname = $button_attrs[0];
$button_width = ' width="'.$button_attrs[1].'"';
$button_height = ' height="'.$button_attrs[2].'"';
$button_src = trailingslashit(get_option('siteurl')).PLUGINDIR.'/'.dirname($A2A_SUBSCRIBE_plugin_basename).'/'.$button_fname;
}
if( $button_text ) {
$button = $button_text;
} else
$button = '
';
echo $before_widget;
if( trim(get_option('A2A_SUBSCRIBE_widget_title')) != "" ) {
echo $before_title
. stripslashes(get_option('A2A_SUBSCRIBE_widget_title'))
. $after_title;
} ?>
>
';
$A2A_SUBSCRIBE_external_script_called = true;
}
else
$external_script_call = 'a2a_init("feed");';
$A2A_javascript .= '