more. Click here for instructions. Email us at post@linksalpha.com if you have any queries.
Version: 4.2
Author: LinksAlpha
Author URI: http://www.linksalpha.com
*/
/*
Copyright (C) 2010 LinksAlpha.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
define('NETWORKPUB_WP_PLUGIN_URL', networkpub_get_plugin_dir());
define('NETWORKPUB_WIDGET_NAME', 'Network Publisher');
define('NETWORKPUB_WIDGET_NAME_INTERNAL', 'networkpub');
define('NETWORKPUB_WIDGET_NAME_POSTBOX', 'Postbox');
define('NETWORKPUB_WIDGET_NAME_POSTBOX_INTERNAL', 'networkpubpostbox');
define('NETWORKPUB_WIDGET_PREFIX', 'networkpub');
define('NETWORKPUB', __('Automatically publish your blog posts to 30+ Social Networks including Facebook, Twitter, LinkedIn, Yahoo, Yammer, MySpace, Identi.ca'));
define('NETWORKPUB_ERROR_INTERNAL', 'internal error');
define('NETWORKPUB_ERROR_INVALID_URL', 'invalid url');
define('NETWORKPUB_ERROR_INVALID_KEY', 'invalid key');
define('NETWORKPUB_CURRENTLY_PUBLISHING', __('You are currently Publishing your Blog to'));
define('NETWORKPUB_SOCIAL_NETWORKS', __('Social Networks'));
define('NETWORKPUB_SOCIAL_NETWORK', __('Social Network'));
define('NETWORKPUB_PLUGIN_VERSION', '4.2.0');
$networkpub_settings['api_key'] = array('label'=>'API Key:', 'type'=>'text', 'default'=>'');
$networkpub_settings['id'] = array('label'=>'id', 'type'=>'text', 'default'=>'');
$options = get_option(NETWORKPUB_WIDGET_NAME_INTERNAL);
function networkpub_init() {
if ( is_admin() ) {
wp_enqueue_style('thickbox');
wp_enqueue_script('jquery');
wp_enqueue_script('thickbox');
wp_register_script('networkpubjs', NETWORKPUB_WP_PLUGIN_URL .'networkpub.js');
wp_enqueue_script('networkpubjs');
wp_register_script('postmessagejs', NETWORKPUB_WP_PLUGIN_URL .'jquery.ba-postmessage.min.js');
wp_enqueue_script('postmessagejs');
wp_register_style('networkpubcss', NETWORKPUB_WP_PLUGIN_URL . 'networkpub.css');
wp_enqueue_style('networkpubcss');
add_action('admin_menu', 'networkpub_pages');
add_action('activate_{$plugin}', 'networkpub_pushpresscheck');
add_action("activated_plugin", "networkpub_pushpresscheck");
register_deactivation_hook( __FILE__, 'networkpub_deactivate' );
}
}
add_action('init', 'networkpub_init');
register_activation_hook( __FILE__, 'networkpub_activate' );
add_action('admin_notices', 'networkpub_warning');
add_action('init', 'networkpub_remove');
add_action('{$new_status}_{$post->post_type}', 'networkpub_ping');
add_action('publish_post', 'networkpub_ping');
add_action('future_to_publish', 'networkpub_ping');
add_action('xmlrpc_publish_post', 'networkpub_post_xmlrpc');
add_action('{$new_status}_{$post->post_type}', 'networkpub_post');
add_action('publish_post', 'networkpub_post');
add_action('future_to_publish', 'networkpub_post');
add_action('{$new_status}_{$post->post_type}', 'networkpub_convert');
add_action('publish_post', 'networkpub_convert');
add_action('future_to_publish', 'networkpub_convert');
add_action('admin_menu', 'networkpub_create_post_meta_box' );
add_action('save_post', 'networkpub_save_post_meta_box', 5, 2 );
add_action('save_post', 'networkpub_post_publish_status', 4, 2 );
function networkpub_create_post_meta_box() {
add_meta_box( 'networkpub_meta_box', 'Network Publisher', 'networkpub_post_meta_box', 'post', 'side', 'high' );
}
function networkpub_post_meta_box( $object, $box ) {
//Publish
$curr_val_publish = get_post_meta( $object->ID, '_networkpub_meta_publish', true );
if($curr_val_publish == '') {
$curr_val_publish = 1;
}
$html = '
".__('Network Publisher plugin is almost ready.')." ".
sprintf(__('You must enter API key (under Plugins->Network Publisher) for automatic posting of your blog articles to 30+ Social Networks including Twitter, Facebook Profile, Facebook Pages, LinkedIn, MySpace, Yammer, Yahoo, Identi.ca, etc. to work.'),
"plugins.php?page=networkpub")."
You should typically use this option when you are making mass updates to your posts to prevent them from getting published to the configured networks
Deactivating the plugin will not disable publishing. You need to use this checkbox to disable publishing
Note: If you decide to stop using this plugin permanently, pls also remove your blog URL by logging into http://www.linksalpha.com/publish.Otherwise, your blog posts may continue to get posted even after you remove this plugin.
'.__('Please try again').' '.__('There was an unknown error. Please try again.
You can also email us at').' post@linksalpha.com '.__('with error description (your blog URL and the error)').'.
';
return $html;
break;
case 'invalid url':
$html = '
'.__('Your blog URL is invalid').':'.$arr_errCodes[$errCodesCount-1];
if($errCodesCount == 3) {
$html .= '. '.__('Error Code').' ='.$arr_errCodes[$errCodesCount-2];
}
$html .= '
'.__('You can also').' '.__('Click here').''.__(' to enter blog URL on LinksAlpha manually.
Also ensure that in ').''.__('Settings').'->'.__('General').'->"'.__('Blog address (URL)').'" '.__('the URL is filled-in correctly').'.
'.__('If you still face issues then email us at').' post@linksalpha.com '.__('with error description').'.
';
return $html;
break;
case 'localhost url':
$html = '
'.__('Website/Blog inaccessible').'
';
$html .= '
'.__('You are trying to use the plugin on ').'localhost '.__('or behind a').' '.__('firewall').', '.__('which is not supported. Please install the plugin on a Wordpress blog on a live server').'.
'.__('Description:').''.__('Please try again').'. '.__('Your site either did not respond (it is extremely slow) or it is not operational').'.
'.__('You can also').' '.__('Click here').' '.__('to enter blog URL on LinksAlpha manually').'.
'.__('Also ensure that in').' '.__('Settings').'->'.__('General').'->"'.__('Blog address (URL)').'" '.__('the URL is filled-in correctly').'.
'.__('If you still face issues then email us at').' post@linksalpha.com '.__('with error description').'.
'.__('Description').':
'.__('Your RSS feed has errors. Pls go to').' href=http://beta.feedvalidator.org/ '.__('to validate your RSS feed').'.
'.__('If it comes out to be correct, try again and email as at ').'post@linksalpha.com '.__('with your blog URL and error description').'.
';
return $html;
break;
case 'feed not found':
$html ='
'.__('We could not find feed URL for your blog').'.
'.__('Click here').' '.__('to enter feed URL on LinksAlpha manually').'.
'.__('Also ensure that in ').''.__('Settings').'->'.__('General').'->"'.__('Blog address (URL)').'" '.__('the URL is filled-in correctly').'.
'.__('If you still face issues then email us at ').'post@linksalpha.com '.__('with error description').'
';
return $html;
break;
case 'invalid key':
$html = '
'.__('Invalid Key').': '.__('the key that you entered is incorrect. Please try again').'.
'.__('Getting Errors').'? '.__('See help page').' '.__('here').'
'.__('Or').', '.__('Click here').' '.__('to enter your blog URL on LinksAlpha manually').'.
'.__('If you still face issues then email us at ').'post@linksalpha.com '.__('with error description').'