--- a/web/wp-content/plugins/network-publisher/networkpub.php Wed Dec 19 12:35:13 2012 -0800
+++ b/web/wp-content/plugins/network-publisher/networkpub.php Wed Dec 19 17:46:52 2012 -0800
@@ -3,7 +3,7 @@
Plugin Name: Network Publisher
Plugin URI: http://wordpress.org/extend/plugins/network-publisher/
Description: Automatically publish your blog posts to multiple Social Networks including Twitter, Facebook Profile, Facebook Pages, LinkedIn, MySpace, Yammer, Yahoo, Identi.ca, and <a href="http://www.linksalpha.com/networks" target="_blank">more</a>. Click <a href="http://help.linksalpha.com/networks/getting-started">here</a> for instructions. Email us at post@linksalpha.com if you have any queries.
- Version: 5.6
+ Version: 5.7.1
Author: linksalpha
Author URI: http://www.linksalpha.com
*/
@@ -41,7 +41,7 @@
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', '5.6');
+define('NETWORKPUB_PLUGIN_VERSION', '5.7.1');
$networkpub_settings['api_key'] = array('label' => 'API Key:', 'type' => 'text', 'default' => '');
$networkpub_settings['id'] = array('label' => 'id', 'type' => 'text', 'default' => '');
@@ -50,7 +50,6 @@
/**
* This is the intialization function
*/
-
function networkpub_init() {
networkpub_options();
//Following will run only if the user is admin of wordpress
@@ -100,6 +99,7 @@
add_action('wp_head', 'networkpub_add_metatags');
add_filter('language_attributes', 'networkpub_html_schema');
+
function networkpub_options() {
$options = get_option(NETWORKPUB_WIDGET_NAME_INTERNAL);
if (!array_key_exists('networkpub_auth_error_show', $options)) {
@@ -141,6 +141,9 @@
if (!array_key_exists('networkpub_post_image_video', $options)) {
$options['networkpub_post_image_video'] = 'image';
}
+ if (!array_key_exists('networkpub_install_extension_alert_show', $options)) {
+ $options['networkpub_install_extension_alert_show'] = 1;
+ }
update_option(NETWORKPUB_WIDGET_NAME_INTERNAL, $options);
}
@@ -182,12 +185,30 @@
}
//HTML
$html = '';
+ //Extension download
+ $networkpub_install_extension_alert_show = $options['networkpub_install_extension_alert_show'];
+ if($networkpub_install_extension_alert_show) {
+ global $is_gecko, $is_safari, $is_chrome;
+ $html .= '<div style="display: none;" id="linksalpha_post_download_chrome" class="misc-pub-section networkpublisher_post_meta_box_first"><img src="//lh4.ggpht.com/RcHmTiAjiRPW5GSamTaet1etjiNYaeHVT2yOtEsJDEs9IRWTdt1P64zpDmh6XzAbN4HH9byl9YhgTK_NbcXq=s16" style="vertical-align: text-bottom" /> Install <a class="linksalpha_post_download_chrome_link" target="_blank" href="https://chrome.google.com/webstore/detail/ffifmkcjncgmnnmkedgkiabklmjdmpgi">Post extension for Chrome</a>.</div>';
+ $html .= '<div style="display: none;" id="linksalpha_post_download_firefox" class="misc-pub-section networkpublisher_post_meta_box_first"><img src="//lh5.ggpht.com/HE6TEsIgCGZgRKAZJ8SI1Yq7rGGxy5s_TQhleiphoEY2QFye1OlFRm8r_6JmGq4OUfHq07OE2dk6XeHWcYyU=s16" style="vertical-align: text-bottom" /> Install <a class="linksalpha_post_download_firefox_link" href="http://www.linksalpha.com/files/post.xpi">Post extension for Firefox</a>.</div>';
+ $html .= '<div style="display: none;" id="linksalpha_post_download_safari" class="misc-pub-section networkpublisher_post_meta_box_first"><img src="//lh6.ggpht.com/4FQoS1Pn8OQOlahH5ESbjJv8iuVPV2If34-fABfBWcrJLUja5wiyLgWAekHWEuk_WaZg_iU9bf4Jli07WDQrRQ=s16" style="vertical-align: text-bottom" /> Install <a class="linksalpha_post_download_safari_link" href="http://www.linksalpha.com/files/post.safariextz">Post extension for Safari</a>.</div>';
+ if($is_gecko) {
+ $browser = 'firefox';
+ } elseif($is_chrome) {
+ $browser = 'chrome';
+ } elseif($is_safari) {
+ $browser = 'safari';
+ } else {
+ $browser = '';
+ }
+ $html .= '<input type="hidden" name="linksalpha_browser" id="linksalpha_browser" value="'.$browser.'" autocomplete="off" />';
+ }
//Publish
$curr_val_publish = get_post_meta($object->ID, '_networkpub_meta_publish', true);
if ($curr_val_publish == '') {
$curr_val_publish = 1;
}
- $html .= '<div class="misc-pub-section">';
+ $html .= '<div class="misc-pub-section networkpublisher_post_meta_box_first">';
$html_label = ' <label for="networkpub_meta_cb_publish">' . __('Publish this') . ' <i>' . $this_post_type .'</i>'. __(' to') . ' <a href="' . NETWORKPUB_PLUGIN_ADMIN_URL . '">' . __('configured Networks') . '</a></label>';
$html_label_type_disabled = ' <label for="networkpub_meta_cb_publish" style="background-color:yellow;">' . __('Publishing of') . ' <i>' . $this_post_type .'</i>'. ' <a href="http://codex.wordpress.org/Post_Types" target="_blank">' . __('Post Type') . '</a>' . __(' to') . ' <a href="' . NETWORKPUB_PLUGIN_ADMIN_URL . '">' . __('configured Networks') . '</a>' . ' ' . __('has been disabled. ') . '<a href="' . NETWORKPUB_PLUGIN_ADMIN_URL . '#setting_networkpub_post_types">' . __('Click Here') . '</a>' . __(' to enable again.') . '</label>';
if ($curr_val_publish) {
@@ -219,6 +240,12 @@
$html .= '<div class="networkpublisher_post_meta_box_label_box"><label class="networkpublisher_post_meta_box_label" for="networkpub_postmessage"><a target="_blank" href="http://help.linksalpha.com/wordpress-plugin-network-publisher/message">'. __('Message').'</a>'.(' to be included in the post:') . '</label></div>';
$html .= '<textarea ' . $inputs_disabled . ' name="networkpub_postmessage" id="networkpub_postmessage">' . $curr_val_message . '</textarea>';
$html .= '</div>';
+ //Summary
+ $curr_val_summary = get_post_meta($object->ID, 'networkpub_postsummary', true);
+ $html .= '<div class="misc-pub-section">';
+ $html .= '<div class="networkpublisher_post_meta_box_label_box"><label class="networkpublisher_post_meta_box_label" for="networkpub_postsummary"><a target="_blank" href="http://help.linksalpha.com/wordpress-plugin-network-publisher/summary">'. __('Summary').'</a>'.(' to be included in the post:') . '</label></div>';
+ $html .= '<textarea ' . $inputs_disabled . ' name="networkpub_postsummary" id="networkpub_postsummary">' . $curr_val_summary . '</textarea>';
+ $html .= '</div>';
//Twitter handle
$curr_val_twitterhandle = get_post_meta($object->ID, 'networkpub_twitterhandle', true);
$html .= '<div class="misc-pub-section">';
@@ -278,7 +305,7 @@
} else {
$html .= '<div class="misc-pub-section" style="border-bottom:0px;padding-bottom:0px;">';
}
- $html .= '<div class="networkpublisher_post_meta_box">';
+ $html .= '<div class="networkpublisher_post_meta_box_label_box">';
if ($curr_val_content) {
$html .= '<input type="checkbox" name="networkpub_meta_cb_content" id="networkpub_meta_cb_content" checked ' . $inputs_disabled . ' />';
} else {
@@ -289,12 +316,20 @@
$html .= '</div>';
//Content Sent successfully
if ($networkpub_meta_published == 'failed') {
- $html .= '<div class="misc-pub-section" style="border-bottom:0px;padding-bottom:0px;">';
- $html .= '<div class="networkpublisher_post_meta_box" style="color:red;"><img src="' . NETWORKPUB_WP_PLUGIN_URL . 'alert.png" /> ' . __('Post to social networks failed.') . '</div>';
+ $html .= '<div class="misc-pub-section">';
+ $html .= '<div class="networkpublisher_post_meta_box_label_box" style="color:red;"><img src="' . NETWORKPUB_WP_PLUGIN_URL . 'alert.png" /> ' . __('Post to social networks failed.') . '</div>';
$html .= '</div>';
} elseif ($networkpub_meta_published == 'done') {
+ $html .= '<div class="misc-pub-section">';
+ $html .= '<div class="networkpublisher_post_meta_box_label_box" style="color:green;"><input type="checkbox" checked disabled="disabled" /> <label for="networkpub_meta_cb_content">' . __('Data sent successfully.') . '</label></div>';
+ $html .= '</div>';
+ }
+ if(in_array($networkpub_meta_published, array('failed', 'done'))) {
$html .= '<div class="misc-pub-section" style="border-bottom:0px;padding-bottom:0px;">';
- $html .= '<div class="networkpublisher_post_meta_box" style="color:green;"><input type="checkbox" checked disabled="disabled" /> <label for="networkpub_meta_cb_content">' . __('Data sent successfully.') . '</label></div>';
+ $html .= '<input type="button" class="button-primary" id="networkpub_post_update" value="Post an Update">';
+ $post_data = networkpub_get_post_data_republish($object);
+ $post_data_string = http_build_query($post_data);
+ $html .= '<input type="hidden" id="networkpub_post_data" value="'.$post_data_string.'">';
$html .= '</div>';
}
//nonce
@@ -325,6 +360,14 @@
}
}
update_post_meta($post_id, 'networkpub_postmessage', $new_meta_value_postmessage);
+ #Summary
+ $new_meta_value_postsummary = '';
+ if (!empty($_POST['networkpub_postsummary'])) {
+ if ($_POST['networkpub_postsummary']) {
+ $new_meta_value_postsummary = strip_tags($_POST['networkpub_postsummary']);
+ }
+ }
+ update_post_meta($post_id, 'networkpub_postsummary', $new_meta_value_postsummary);
#Twitter Handle
$new_meta_value_twitterhandle = '';
if (!empty($_POST['networkpub_twitterhandle'])) {
@@ -383,7 +426,7 @@
echo '
<div class="updated fade" style="padding:10px;text-align:left">
<div style="font-weight:bold;"><a href="http://wordpress.org/extend/plugins/network-publisher/" target="_blank">' . NETWORKPUB_WIDGET_NAME . '</a> ' . __('plugin is almost ready.') . '</div>
- <div>' . __('You must') . ' <a href="' . NETWORKPUB_PLUGIN_ADMIN_URL . '">' . __('enter API key') . '</a> ' . __(' on the settings page for plugin') . ' ' . NETWORKPUB_WIDGET_NAME . ' ' . __('for automatic posting of your blog articles to 20+ Social Networks including Twitter, Facebook Profile, Facebook Pages, LinkedIn, MySpace, Yammer, Yahoo, Identi.ca, and more to work') . '</div>
+ <div>' . __('You must') . ' <a href="' . NETWORKPUB_PLUGIN_ADMIN_URL . '">' . __('enter API key') . '</a> ' . __(' on the settings page for plugin') . ' ' . NETWORKPUB_WIDGET_NAME . ' ' . __('for automatic posting of your blog articles to 20+ Social Networks including Twitter, Facebook Profile, Facebook Pages, LinkedIn, MySpace, Yammer, Yahoo, Identi.ca, and more.') . '</div>
</div>';
}
}
@@ -575,6 +618,7 @@
return;
}
$post_message = get_post_meta($post_id, 'networkpub_postmessage', true);
+ $post_summary = get_post_meta($post_id, 'networkpub_postsummary', true);
$post_twitterhandle = get_post_meta($post_id, 'networkpub_twitterhandle', true);
$post_twitterhash = get_post_meta($post_id, 'networkpub_twitterhash', true);
$post_ogtypefacebook = get_post_meta($post_id, 'networkpub_ogtype_facebook', true);
@@ -635,6 +679,7 @@
'twitterhandle' => $post_twitterhandle,
'hashtag' => $post_twitterhash,
'content_message' => $post_message,
+ 'content_summary' => $post_summary,
'post_image_video' => $networkpub_post_image_video,
);
$post_image = networkpub_thumbnail_link($post_id, $post_data['post_content']);
@@ -774,6 +819,13 @@
$networkpub_thumbnail_size = 'medium';
}
networkpub_update_option('networkpub_thumbnail_size', $networkpub_thumbnail_size);
+ } elseif ($_POST['networkpub_form_type'] == 'networkpub_install_extension_alert_show') {
+ if (array_key_exists('networkpub_install_extension_alert_show', $_POST)) {
+ $networkpub_install_extension_alert_show = 1;
+ } else {
+ $networkpub_install_extension_alert_show = 0;
+ }
+ networkpub_update_option('networkpub_install_extension_alert_show', $networkpub_install_extension_alert_show);
}
}
}
@@ -871,6 +923,16 @@
} else {
$networkpub_thumbnail_size = 'medium';
}
+ if (array_key_exists('networkpub_install_extension_alert_show', $options)) {
+ $networkpub_install_extension_alert_show = $options['networkpub_install_extension_alert_show'];
+ if ($networkpub_install_extension_alert_show) {
+ $networkpub_install_extension_alert_show = 'checked';
+ } else {
+ $networkpub_install_extension_alert_show = '';
+ }
+ } else {
+ $networkpub_install_extension_alert_show = 'checked';
+ }
} else {
$networkpub_enable = 'checked';
$networkpub_auth_error_show = 'checked';
@@ -884,6 +946,7 @@
$networkpub_custom_field_image = '';
$networkpub_custom_field_image_url = '';
$networkpub_thumbnail_size = 'medium';
+ $networkpub_install_extension_alert_show = 'checked';
}
$fb_langs = networkpub_fb_langs();
$fb_langs_options = '';
@@ -934,25 +997,39 @@
<div class="networkpublisher_share_box">
<table>
<tr>
- <td>
- <a href="' . networkpub_postbox_url() . '">' . __('Postbox') . '</a> | ' . __('Share') . '
+ <td class="networkpublisher_share_box_left">
+ <span>Install Browser Extension </span>
+ <span><img src="//lh4.ggpht.com/RcHmTiAjiRPW5GSamTaet1etjiNYaeHVT2yOtEsJDEs9IRWTdt1P64zpDmh6XzAbN4HH9byl9YhgTK_NbcXq=s16" style="vertical-align: text-bottom" /> <a target="_blank" href="https://chrome.google.com/webstore/detail/ffifmkcjncgmnnmkedgkiabklmjdmpgi">Chrome</a></span>
+ <span><img src="//lh5.ggpht.com/HE6TEsIgCGZgRKAZJ8SI1Yq7rGGxy5s_TQhleiphoEY2QFye1OlFRm8r_6JmGq4OUfHq07OE2dk6XeHWcYyU=s16" style="vertical-align: text-bottom" /> <a href="http://www.linksalpha.com/files/post.xpi">Firefox</a></span>
+ <span><img src="//lh6.ggpht.com/4FQoS1Pn8OQOlahH5ESbjJv8iuVPV2If34-fABfBWcrJLUja5wiyLgWAekHWEuk_WaZg_iU9bf4Jli07WDQrRQ=s16" style="vertical-align: text-bottom" /> <a href="http://www.linksalpha.com/files/post.safariextz">Safari</a></span>
</td>
- <td>
- <div class="linksalpha-email-button" id="linksalpha_tag_208867858" data-url="http://www.linksalpha.com" data-text="LinksAlpha - Making Social Media Easy!" data-desc="LinksAlpha provides quick and easy way for companies and users to connect and share on social web. Using LinksAlpha tools, you can integrate Social Media Buttons into your website, Publish your Website Content Automatically to Social Media Sites, and Track Social Media Profiles, all from one place." data-image="http://www.linksalpha.com/images/LALOGO_s175.png"></div>
- <script type="text/javascript" src="http://www.linksalpha.com/social/loader?tag_id=linksalpha_tag_208867858&fblikefont=arial&vkontakte=1&livejournal=1&twitter=1&xinglang=de&linkedin=1&tumblr=1&hyves=1&fblikelang=en_US&delicious=1&twitterw=110&gpluslang=en-US&gmail=1&weibo=1&posterous=1&xing=1&sonico=1&twitterlang=en&pinterest=1&myspace=1&msn=1&print=1&mailru=1&email=1&counters=googleplus%2Cfacebook%2Clinkedin%2Ctwitter&reddit=1&hotmail=1&netlog=1&twitterrelated=linksalpha&aolmail=1&link=http%3A%2F%2Fwww.linksalpha.com&diigo=1&evernote=1&digg=1&yahoomail=1&yammer=1&stumbleupon=1&instapaper=1&facebookw=90&googleplus=1&fblikeverb=like&fblikeref=linksalpha&halign=left&readitlater=1&v=2&facebook=1&button=googleplus%2Cfacebook%2Clinkedin%2Ctwitter&identica=1"></script>
+ <td class="networkpublisher_share_box_right">
+ <table>
+ <tr>
+ <td>
+ <span style="float:right">
+ <div class="linksalpha-email-button" id="linksalpha_tag_208867858" data-url="http://www.linksalpha.com" data-text="LinksAlpha - Making Social Media Easy!" data-desc="LinksAlpha provides quick and easy way for companies and users to connect and share on social web. Using LinksAlpha tools, you can integrate Social Media Buttons into your website, Publish your Website Content Automatically to Social Media Sites, and Track Social Media Profiles, all from one place." data-image="http://www.linksalpha.com/images/LALOGO_s175.png"></div>
+ <script type="text/javascript" src="http://www.linksalpha.com/social/loader?tag_id=linksalpha_tag_208867858&fblikefont=arial&vkontakte=1&livejournal=1&twitter=1&xinglang=de&linkedin=1&tumblr=1&hyves=1&fblikelang=en_US&delicious=1&twitterw=110&gpluslang=en-US&gmail=1&weibo=1&posterous=1&xing=1&sonico=1&twitterlang=en&pinterest=1&myspace=1&msn=1&print=1&mailru=1&email=1&counters=googleplus%2Cfacebook%2Clinkedin%2Ctwitter&reddit=1&hotmail=1&netlog=1&twitterrelated=linksalpha&aolmail=1&link=http%3A%2F%2Fwww.linksalpha.com&diigo=1&evernote=1&digg=1&yahoomail=1&yammer=1&stumbleupon=1&instapaper=1&facebookw=90&googleplus=1&fblikeverb=like&fblikeref=linksalpha&halign=left&readitlater=1&v=2&facebook=1&button=googleplus%2Cfacebook%2Clinkedin%2Ctwitter&identica=1"></script>
+ </span>
+ <span>' . __('Share') . ' </span>
+ </td>
+ </tr>
+ </table>
</td>
</tr>
</table>
</div>
- <div>
- <div class="networkpublisher_started">
+ <div>';
+ if (empty($options['api_key'])) {
+ $html .= '<div class="networkpublisher_started">
<div style="padding:0px 0px 5px 0px;"><strong>' . __('Network Publisher') . '</strong> ' . __('makes it easy to Publish your Blog Posts to Social Networks. To configure:') . '</div>
<div><b>1.</b> ' . __('Connect to your Social Networks at') . ' <a target="_blank" href="http://www.linksalpha.com/networks">' . __('LinksAlpha.com') . '</a></div>
<div><b>2.</b> ' . __('Get your') . ' <a target="_blank" href="http://www.linksalpha.com/account/your_api_key">' . __('User API Key') . '</a> ' . __('or') . ' <a target="_blank" href="http://www.linksalpha.com/networks">' . __('Network API Key') . '</a> ' . __('and enter it below.') . '</div>
<div style="padding:5px 0px 0px 0px;">' . __('Once setup, your Blog posts content appears on the social networks as soon as you hit the Publish button.') . '</div>
<div>' . __('You can') . ' <a href="http://help.linksalpha.com/networks/getting-started" target="_blank">' . __('read more about this process at LinksAlpha.com.') . '</a></div>
- </div>
- <div class="networkpublisher_header">
+ </div>';
+ }
+ $html .= '<div class="networkpublisher_header">
<strong>' . __('Setup') . '</strong>
</div>
<div style="padding-left:0px;margin-bottom:40px;">
@@ -972,9 +1049,12 @@
</tr>
<tr>
<td>
- <div style="padding-bottom:10px;padding-top:3px;">
+ <div style="padding-top:3px;">
<input style="width:400px; border-width:1px;border-color:gray;border-style:solid" class="widefat" id="' . $field_name . '" name="' . $field_name . '" type="text" TABINDEX=1000 />
</div>
+ <div style="padding-top:3px;padding-bottom:10px;color:gray;">
+ <a href="http://help.linksalpha.com/networks/getting-started" target="_blank">' . __('Click here').'</a>'.__(' to read getting started document.').'
+ </div>
</td>
</tr>
</table>
@@ -1231,6 +1311,24 @@
</div>
</div>
</a>
+ <div style="padding:40px 0px 0px 0px;">
+ <div class="networkpublisher_header">
+ <strong>' . __('Show/Hide message to Install Browser Extension') . '</strong>
+ </div>
+ <div class="networkpublisher_content_box">
+ <div style="padding-bottom:10px;">
+ <form action="" method="post">
+ <div>
+ <input type="checkbox" id="networkpub_install_extension_alert_show" name="networkpub_install_extension_alert_show" ' . $networkpub_install_extension_alert_show . ' /><label for="networkpub_install_extension_alert_show"> ' . __('Check this box to show the message in Network Publisher widget to install browser extension from LinksAlpha.com.') . ' <a target="_blank" href="http://www.linksalpha.com/downloads">' . __('Click Here') . '</a> ' . __('to learn more.') . '</label>
+ </div>
+ <div style="padding-top:5px;">
+ <input type="hidden" name="networkpub_form_type" value="networkpub_install_extension_alert_show" />
+ <input type="submit" name="submit" class="button-primary" value="' . __('Update') . '" />
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
<div style="font-size:13px;margin:40px 0px 0px 0px;">
<div class="networkpublisher_header">
<strong>' . __('Note') . '</strong>
@@ -1243,15 +1341,10 @@
</div>
</div>
<div style="vertical-align:top;padding-left:2%;text-align:right;width:20%;float:left;">
- <div style="margin-bottom:20px;width:150px;margin-top:10px;float:right;">
- <a href="' . networkpub_postbox_url() . '" style="text-decoration:none;">
- <div class="networkpublisher_button_yellow">' . __('View Postbox') . '</div>
- </a>
- </div>
<div class="networkpub_clear_both"></div>
- <div class="networkpublisher_header_3" style="float:right;margin-right:-20px;">' . __('Supported Networks') . '</div>
+ <div class="networkpublisher_header_3" style="float:right;margin-right:-35px;">' . __('Supported Networks') . '</div>
<div class="networkpub_clear_both"></div>
- <div class="networkpublisher_content_box_3" style="float:right;margin-right:-20px;">
+ <div class="networkpublisher_content_box_3" style="float:right;margin-right:-35px;">
' . networkpub_supported_networks() . '
</div>
<div class="networkpub_clear_both"></div>
@@ -1757,7 +1850,6 @@
}
function networkpub_get_plugin_dir() {
-
global $wp_version;
if (version_compare($wp_version, '2.8', '<')) {
$path = dirname(plugin_basename(__FILE__));
@@ -2166,7 +2258,7 @@
if ($xml) {
$images = $xml -> xpath('//img');
if (!empty($images)) {
- return $images[0]['src'];
+ return (string)$images[0]['src'];
}
} else {
return False;
@@ -2201,5 +2293,21 @@
return;
}
+function networkpub_get_post_data_republish($p) {
+ $post_data = array();
+ $post_data['page_url'] = get_permalink($p);
+ if($p->post_title) {
+ $post_data['page_title'] = networkpub_prepare_text($p->post_title);
+ }
+ if($p->post_content) {
+ $post_data['page_text'] = networkpub_prepare_text($p->post_content);
+ }
+ $page_url_image = networkpub_thumbnail_link($p->ID, $p->post_content);
+ if($page_url_image) {
+ $post_data['page_url_image'] = $page_url_image;
+ }
+ return $post_data;
+}
+
register_deactivation_hook(__FILE__, 'networkpub_deactivate');
?>
\ No newline at end of file