NS_SNAutoPoster

The NextScripts: Social Networks Auto-Poster NS SNAutoPoster class.

Defined (1)

The class is defined in the following location(s).

/inc/nxs_snap_class.php  
  1. class NS_SNAutoPoster {//## General Functions  
  2. var $dbOptionsName = "NS_SNAutoPoster";  
  3. var $nxs_options = ""; var $nxs_ntoptions = ""; var $sMode = array('s'=>'S', 'l'=>'F', 'u'=>'O', 'a'=>'S');  
  4.  
  5. function __construct() { load_plugin_textdomain('social-networks-auto-poster-facebook-twitter-g', FALSE, substr(dirname( plugin_basename( __FILE__ ) ), 0, -4).'/lang/'); $this->nxs_options = $this->getAPOptions(); }  
  6. //## Constructor 
  7. function NS_SNAutoPoster() { } 
  8. //## Initialization function 
  9. function init() { $this->nxs_options = $this->getAPOptions(); } 
  10. //## Administrative Functions 
  11. //## Options loader function 
  12. function getAPOptions() { global $nxs_isWPMU, $blog_id; $dbMUOptions = array();  
  13. //## Some Default Values  
  14. //$options = array('nsOpenGraph'=>1);  
  15. $dbOptions = get_option($this->dbOptionsName); $dbOptions['ver'] = 306; $this->nxs_ntoptions = get_site_option($this->dbOptionsName); $nxs_UPPath = 'nxs-snap-pro-upgrade';  
  16. $dir = plugin_dir_path( __FILE__ ); $dir = explode('social-networks-auto-poster-facebook-twitter-g', $dir); $dir = $dir[0];  
  17. $pf = $dir.$nxs_UPPath.'/'.$nxs_UPPath.'.php'; if (file_exists($pf) && !function_exists('nxs_getInitAdd') ) require_once $pf;  
  18. if ($nxs_isWPMU && $blog_id>1) { global $wpdb; switch_to_blog(1); //$dbMUOptions = get_option($this->dbOptionsName);  
  19. $row = $wpdb->get_row("SELECT option_value from ".$wpdb->options." WHERE option_name='NS_SNAutoPoster'"); if ( is_object( $row ) ) $dbMUOptions = maybe_unserialize($row->option_value); 
  20. if (function_exists('nxs_getInitAdd')) nxs_getInitAdd($dbMUOptions); if (function_exists("restore_current_blog")) restore_current_blog();  
  21. $dbOptions['lk'] = $dbMUOptions['lk']; $dbOptions['ukver'] = $dbMUOptions['ukver']; $dbOptions['uklch'] = $dbMUOptions['uklch']; $dbOptions['uk'] = $dbMUOptions['uk']; 
  22. }  
  23. if (!empty($dbOptions) && is_array($dbOptions)) foreach ($dbOptions as $key => $option) if (trim($key)!='') $options[$key] = $option;  
  24. if ( (!$nxs_isWPMU || $blog_id==1) && function_exists('nxs_getInitAdd')) nxs_getInitAdd($options);  
  25. if (!empty($options['uk'])) $options['uk']='API'; if (defined('NXSAPIVER') && (empty($options['ukver']) || $options['ukver']!=NXSAPIVER)) {$options['ukver']=NXSAPIVER; update_option($this->dbOptionsName, $options);}  
  26. if (!empty($options['ukver']) && $options['ukver'] == nsx_doDecode('q234t27414r2q2')) $options['ht'] = 104; 
  27. $options['isMA'] = function_exists('nxs_doSMAS1') && isset($options['lk']) && isset($options['uk']) && $options['uk']!='';  
  28. $options['isMU'] = function_exists('showSNAP_WPMU_OptionsPageExt') && isset($options['lk']) && isset($options['uk']) && $options['uk']!='';  
  29. $options['isMUx'] = function_exists('showSNAP_WPMU_OptionsPageExtX') && isset($options['lk']) && isset($options['uk']) && $options['uk']!=''; // prr($options); 
  30. if (isset($options['skipSSLSec'])) $nxs_skipSSLCheck = $options['skipSSLSec']; $options['useSSLCert'] = nsx_doDecode('8416o4u5d4p2o22646060474k5b4t2a4u5s4'); 
  31. if(!empty($options['K1']) && $options['K1']=='1') $options = array('isMA'=>false);  
  32.  
  33. $liGRP = 0; if (!empty($options) && !empty($options['li'])) foreach ($options['li'] as $lii) if (!empty($lii['grpID'])) $liGRP++; 
  34. if ($liGRP>0) { 
  35. if (!function_exists("nxs_noLiGrps")) { function nxs_noLiGrps() { global $nxs_snapThisPageUrl; echo '<div class="error"><p><b>Message from NextScripts SNAP Plugin for Wordpress</b></p><p><a target="_blank" href="https://developer.linkedin.com/support/developer-program-transition">LinkedIn has discontinued support for groups</a> from it\'s free native API. You have LinkedIn group accounts configured. Please switch those accounts to NextScipts API or remove them</p></div>'; } add_action( 'admin_notices', 'nxs_noLiGrps' ); } 
  36. }  
  37. $bgFree = 0; if ( (!class_exists('nxsAPI_GP')) && !empty($options) && !empty($options['bg']) ) foreach ($options['bg'] as $lii) if (!empty($lii['bgUName']) && empty($lii['APIKey'])) $bgFree++; 
  38. if ($bgFree>0) { 
  39. if (!function_exists("nxs_noBGFree")) { function nxs_noBGFree() { global $nxs_snapThisPageUrl; echo '<div class="error"><p><b>Message from NextScripts SNAP Plugin for Wordpress</b></p><p><a target="_blank" href="https://developers.google.com/identity/protocols/AuthForInstalledApps">Blogger has discontinued support for "ClientLogin"</a> authentication method that SNAP was using for several years. You have Blogger accounts configured. Please either remove those accounts and re-setup with oAuth authentication method or get <a href="'.$nxs_snapThisPageUrl.'">Premium NextScipts API</a></p></div>'; } add_action( 'admin_notices', 'nxs_noBGFree' ); } 
  40. }  
  41. return $options; 
  42.  
  43. function showSNAP_WPMU_OptionsPage() { global $nxs_snapAvNts, $nxs_snapThisPageUrl, $nxsOne, $wpdb, $nxs_isWPMU; $nxsOne = ''; $options = $this->nxs_options;  
  44. $this->NS_SNAP_ShowPageTop();  
  45. if ($nxs_isWPMU && function_exists('showSNAP_WPMU_OptionsPageExt')) { showSNAP_WPMU_OptionsPageExt($this); } elseif ($nxs_isWPMU && function_exists('showSNAP_WPMU_OptionsPageExtX')) { ?>  
  46. <br/><br/><b style="font-size:16px; line-height:24px; color:red;">You are running SNAP <?php echo $options['isMA']?'Single Site Pro':'Free'; ?> <br/> </b>  
  47. This version does not fully support Wordpress Multisite (ex Wordpress MU) Advanced Features. SNAP is available for all sites/blogs in your networks and each individual blog admin can setup and manage it. 
  48. <br/>Please upgrade to <a href="http://www.nextscripts.com/social-networks-auto-poster-pro-for-wpmu/" target="_blank"> SNAP For Wordpress Multisite</a> if you need advanced Super Admin management of SNAP for sites/blogs in your networks. Please see <a href="http://www.nextscripts.com/social-networks-auto-poster-pro-for-wpmu/" target="_blank">here</a> for more info  
  49. <br/><br/>Please <a href="http://www.nextscripts.com/contact-us/" target="_blank"> contact us</a> if you got the SNAP PRO before Oct 1st, 2012. You may be eligible for upgrade discount.  
  50. <br/><br/>  
  51. <?php return; 
  52. } elseif ( !$options['isMA']) {  
  53. ?> <br/><br/><b style="font-size:16px; line-height:24px; color:red;">You are running SNAP <?php echo $options['isMA']?'Single Site Pro':'Free'; ?> <br/> This version does not support Wordpress Multisite (ex Wordpress MU). <br/>Please upgrade to <a href="http://www.nextscripts.com/social-networks-auto-poster-pro-for-wpmu/" target="_blank"> SNAP Pro for Wordpress Multisite</a></b>  
  54. <br/><br/><hr/> 
  55. <h3>FAQ:</h3> <b>Question:</b> I am not running Wordpress Multisite! Why I am seeing this?<br/><b>Answer:</b>  
  56. Your Wordpress is configured to run as a Wordpress Multisite. Please open your wp-config.php and change: <br/><br/> 
  57. define('WP_ALLOW_MULTISITE', true);<br/>to<br/>define('WP_ALLOW_MULTISITE', false);<br/><br/>and<br/><br/>define('MULTISITE', true);<br/>to<br/>define('MULTISITE', false);<br/><br/> 
  58. <b>Question:</b> I am running Wordpress Multisite, but I need SNAP on one blog only? Can I use it?<br/><b>Answer:</b>We are sorry, but it is not possible to run "SNAP Free" on Wordpress Multisite. You need to either upgrade plugin to "SNAP Pro" to run it on one blog or to "SNAP Pro for WPNU" to run it on all blogs or disable Wordpress Multisite.  
  59. <br/><br/><hr/>  
  60. <?php return;  
  61. } else { 
  62. ?> <br/><b style="font-size:16px; line-height:24px; color:red;">You are running SNAP <?php echo $options['isMA']?'Single Site Pro':'Free'; ?> <br/> This version does not fully support Wordpress Multisite (ex Wordpress MU).</b> <br/> 
  63.  
  64. <br/><span style="font-size: 16px;"> You can use SNAP for your main blog only. <a href="<?php echo nxs_get_admin_url(); ?>options-general.php?page=NextScripts_SNAP.php">Click here to setup it.</a></span><br/><br/> 
  65.  
  66. <span style="font-size: 12px; font-weight: bold;">Please upgrade to <a href="http://www.nextscripts.com/social-networks-auto-poster-pro-for-wpmu/" target="_blank"> SNAP Pro for Wordpress Multisite</a> to get all features: </span>  
  67. <br/> 
  68. - All Blogs/Sites autopost to networks configured by Super Admin <br/> 
  69. - Each Blog/Site Admin can configure and auto-post to it's own networks <br/>  
  70. - Super Admin can enable/disable auto-posting for each site and the whole network<br/> 
  71. - Super Admin can also manage/setup/disable/override SNAP settings for each Blog/Site.<br/> 
  72.  
  73. <br/> 
  74. <?php return;  
  75.  
  76. function showSNAutoPosterOptionsPage() { global $nxs_snapAvNts, $nxs_snapThisPageUrl, $nxsOne, $nxs_plurl, $nxs_isWPMU, $nxs_tpWMPU; $cst=strrev('enifed'); $nxsOne = ''; $options = $this->nxs_options; $trrd=0; 
  77. //if($acid==1) $options = $this->nxs_options; else { switch_to_blog($acid); $options = $this->getAPOptions(); } 
  78. if (function_exists('nxs_doSMAS2')) { $rf = new ReflectionFunction('nxs_doSMAS2'); $trrd++; $rff = $rf->getFileName(); if (stripos($rff, "'d code")===false) $cst(chr(100).$trrd, $trrd); } 
  79. //## Import Settings  
  80. if (isset($_POST['upload_NS_SNAutoPoster_settings'])) { if (get_magic_quotes_gpc() || $_POST['nxs_mqTest']=="\'") {array_walk_recursive($_POST, 'nsx_stripSlashes');} array_walk_recursive($_POST, 'nsx_fixSlashes');  
  81. $secCheck = wp_verify_nonce($_POST['nxsChkUpl_wpnonce'], 'nxsChkUpl'); 
  82. if ($secCheck!==false && isset($_FILES['impFileSettings_button']) && is_uploaded_file($_FILES['impFileSettings_button']['tmp_name'])) { $fileData = trim(file_get_contents($_FILES['impFileSettings_button']['tmp_name'])); 
  83. while (substr($fileData, 0, 1)!=='a') $fileData = substr($fileData, 1);  
  84. $uplOpt = maybe_unserialize($fileData); if (is_array($uplOpt) && isset($uplOpt['imgNoCheck'])) { $options = $uplOpt; $this->nxs_options = $options; update_option($this->dbOptionsName, $options); } else { ?><div class="error" id="message"><p><strong>Incorrect Import file.</div><?php }  
  85. }  
  86. //## Save Settings 
  87. if (isset($_POST['nxsMainFromElementAccts']) || isset($_POST['nxsMainFromSupportFld'])) { check_ajax_referer('nxsSsPageWPN');  
  88. if (get_magic_quotes_gpc() || (!empty($_POST['nxs_mqTest']) && $_POST['nxs_mqTest']=="\'")) {array_walk_recursive($_POST, 'nsx_stripSlashes');} array_walk_recursive($_POST, 'nsx_fixSlashes');  
  89. //## Load Networks Settings update_NS_SNAutoPoster_settings 
  90. $acctsInfoPost = $_POST['nxsMainFromElementAccts']; unset($_POST['nxsMainFromElementAccts']); $acctsInfo = array();  
  91. $acctsInfo = NXS_parseQueryStr($acctsInfoPost); // prr($acctsInfo); 
  92.  
  93. foreach ($nxs_snapAvNts as $avNt) if (isset($acctsInfo[$avNt['lcode']])) { $clName = 'nxs_snapClass'.$avNt['code']; if (!isset($options[$avNt['lcode']])) $options[$avNt['lcode']] = array();  
  94. $ntClInst = new $clName(); $ntOpt = $ntClInst->setNTSettings($acctsInfo[$avNt['lcode']], $options[$avNt['lcode']]); $options[$avNt['lcode']] = $ntOpt; 
  95. }  
  96. if (isset($_POST['apCats'])) $options['apCats'] = $_POST['apCats'];  
  97. if (isset($_POST['nxsHTDP'])) $options['nxsHTDP'] = $_POST['nxsHTDP'];  
  98. if (isset($_POST['ogImgDef'])) $options['ogImgDef'] = $_POST['ogImgDef']; 
  99. if (isset($_POST['featImgLoc'])) $options['featImgLoc'] = $_POST['featImgLoc'];  
  100. if (isset($_POST['anounTagLimit'])) $options['anounTagLimit'] = $_POST['anounTagLimit'];  
  101. if (isset($_POST['nxsHTSpace'])) $options['nxsHTSpace'] = $_POST['nxsHTSpace']; else $options['nxsHTSpace'] = ""; 
  102. if (isset($_POST['nxsHTSepar'])) $options['nxsHTSepar'] = $_POST['nxsHTSepar']; else $options['nxsHTSepar'] = "c_"; 
  103. if (isset($_POST['featImgLocPrefix'])) $options['featImgLocPrefix'] = $_POST['featImgLocPrefix']; 
  104. if (isset($_POST['featImgLocArrPath'])) $options['featImgLocArrPath'] = $_POST['featImgLocArrPath']; 
  105. if (isset($_POST['featImgLocRemTxt'])) $options['featImgLocRemTxt'] = $_POST['featImgLocRemTxt']; 
  106.  
  107. if (isset($_POST['extDebug'])) $options['extDebug'] = $_POST['extDebug']; else $options['extDebug'] = 0; 
  108. if (isset($_POST['numLogRows'])) $options['numLogRows'] = $_POST['numLogRows']; 
  109.  
  110. if (isset($_POST['errNotifEmailCB'])) $options['errNotifEmailCB'] = 1; else $options['errNotifEmailCB'] = 0; 
  111. if (isset($_POST['errNotifEmail']))$options['errNotifEmail'] = $_POST['errNotifEmail'];  
  112.  
  113. if (isset($_POST['forceBrokenCron'])) $options['forceBrokenCron'] = 1; else $options['forceBrokenCron'] = 0;  
  114.  
  115. if (isset($_POST['nxsURLShrtnr']))$options['nxsURLShrtnr'] = $_POST['nxsURLShrtnr'];  
  116. if (isset($_POST['bitlyUname'])) $options['bitlyUname'] = $_POST['bitlyUname'];  
  117. if (isset($_POST['bitlyAPIKey'])) $options['bitlyAPIKey'] = $_POST['bitlyAPIKey'];  
  118.  
  119. if (isset($_POST['adflyUname'])) $options['adflyUname'] = $_POST['adflyUname'];  
  120. if (isset($_POST['adflyAPIKey'])) $options['adflyAPIKey'] = $_POST['adflyAPIKey'];  
  121. if (isset($_POST['adflyDomain'])) $options['adflyDomain'] = $_POST['adflyDomain'];  
  122.  
  123. if (isset($_POST['YOURLSKey'])) $options['YOURLSKey'] = $_POST['YOURLSKey'];  
  124. if (isset($_POST['YOURLSURL'])) $options['YOURLSURL'] = $_POST['YOURLSURL']; 
  125.  
  126.  
  127. if (isset($_POST['xcoAPIKey'])) $options['xcoAPIKey'] = $_POST['xcoAPIKey'];  
  128. if (isset($_POST['clkimAPIKey'])) $options['clkimAPIKey'] = $_POST['clkimAPIKey'];  
  129. if (isset($_POST['postAPIKey'])) $options['postAPIKey'] = $_POST['postAPIKey'];  
  130.  
  131. if (isset($_POST['gglAPIKey'])) $options['gglAPIKey'] = $_POST['gglAPIKey'];  
  132.  
  133. if ($options['nxsURLShrtnr']=='B' && (trim($_POST['bitlyAPIKey'])=='' || trim($_POST['bitlyAPIKey'])=='')) $options['nxsURLShrtnr'] = 'G';  
  134. if ($options['nxsURLShrtnr']=='Y' && (trim($_POST['YOURLSKey'])=='' || trim($_POST['YOURLSURL'])=='')) $options['nxsURLShrtnr'] = 'G'; 
  135. if ($options['nxsURLShrtnr']=='A' && (trim($_POST['adflyAPIKey'])=='' || trim($_POST['adflyAPIKey'])=='')) $options['nxsURLShrtnr'] = 'G';  
  136.  
  137. if ($options['nxsURLShrtnr']=='C' && trim($_POST['clkimAPIKey'])=='') $options['nxsURLShrtnr'] = 'G'; 
  138. if ($options['nxsURLShrtnr']=='P' && trim($_POST['postAPIKey'])=='') $options['nxsURLShrtnr'] = 'G';  
  139. if ($options['nxsURLShrtnr']=='X' && trim($_POST['xcoAPIKey'])=='') $options['nxsURLShrtnr'] = 'G';  
  140.  
  141.  
  142. if (isset($_POST['forceSURL'])) $options['forceSURL'] = 1; else $options['forceSURL'] = 0; 
  143.  
  144. if (isset($_POST['brokenCntFilters'])) $options['brokenCntFilters'] = 1; else $options['brokenCntFilters'] = 0; 
  145.  
  146. if (isset($_POST['nsOpenGraph'])) $options['nsOpenGraph'] = $_POST['nsOpenGraph']; else $options['nsOpenGraph'] = 0;  
  147. if (isset($_POST['imgNoCheck'])) $options['imgNoCheck'] = 0; else $options['imgNoCheck'] = 1; 
  148. if (isset($_POST['useForPages'])) $options['useForPages'] = 1; else $options['useForPages'] = 0; 
  149.  
  150. if (isset($_POST['showPrxTab'])) $options['showPrxTab'] = 1; else $options['showPrxTab'] = 0; 
  151. if (isset($_POST['useRndProxy'])) $options['useRndProxy'] = 1; else $options['useRndProxy'] = 0; 
  152.  
  153. if (isset($_POST['prxList'])) $options['prxList'] = $_POST['prxList'];  
  154. if (isset($_POST['addURLParams'])) $options['addURLParams'] = $_POST['addURLParams'];  
  155. if (isset($_POST['forcessl'])) $options['forcessl'] = $_POST['forcessl'];  
  156.  
  157.  
  158. if (isset($_POST['riActive'])) $options['riActive'] = 1; else $options['riActive'] = 0; 
  159. if (isset($_POST['riHowManyPostsToTrack'])) $options['riHowManyPostsToTrack'] = $_POST['riHowManyPostsToTrack'];  
  160.  
  161. if (isset($_POST['useUnProc'])) $options['useUnProc'] = $_POST['useUnProc']; else $options['useUnProc'] = 0;  
  162. if (!empty($_POST['nxsCPTSeld']) && is_array($_POST['nxsCPTSeld'])) $cpTypes = $_POST['nxsCPTSeld']; else $cpTypes = array(); $options['nxsCPTSeld'] = serialize($cpTypes);  
  163. if (isset($_POST['post_category'])) { $pk = $_POST['post_category']; if (!is_array($pk)) { $pk = urldecode($pk); parse_str($pk); }  
  164. remove_action( 'get_terms', 'order_category_by_id', 10); $cIds = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );  
  165. if(is_array($pk) && $cIds) $options['exclCats'] = serialize(array_diff($cIds, $pk)); else $options['exclCats'] = ''; 
  166. } //prr($options['exclCats']); 
  167. if (!isset($_POST['whoCanSeeSNAPBox'])) $_POST['whoCanSeeSNAPBox'] = array(); $_POST['whoCanSeeSNAPBox'][] = 'administrator';  
  168. if (isset($_POST['whoCanSeeSNAPBox'])) $options['whoCanSeeSNAPBox'] = $_POST['whoCanSeeSNAPBox'];  
  169. if (!isset($_POST['whoCanMakePosts'])) $_POST['whoCanMakePosts'] = array(); $_POST['whoCanMakePosts'][] = 'administrator';  
  170. if (isset($_POST['whoCanMakePosts'])) $options['whoCanMakePosts'] = $_POST['whoCanMakePosts'];  
  171.  
  172. if (isset($_POST['skipSecurity'])) $options['skipSecurity'] = 1; else $options['skipSecurity'] = 0;  
  173.  
  174. if (isset($_POST['quLimit'])) $options['quLimit'] = 1; else $options['quLimit'] = 0; 
  175.  
  176. //## Query has been activated 
  177. $isTimeChanged = ((isset($_POST['quDays']) && isset($options['quDays']) && $_POST['quDays']!=$options['quDays']) || !isset($options['quDays'])) ||  
  178. ((isset($_POST['quHrs']) && isset($options['quHrs']) && $_POST['quHrs']!=$options['quHrs']) || !isset($options['quHrs'])) ||  
  179. ((isset($_POST['quMins']) && isset($options['quMins']) && $_POST['quMins']!=$options['quMins']) || !isset($options['quMins'])); 
  180.  
  181. if (isset($_POST['nxsOverLimit'])) $options['nxsOverLimit'] = $_POST['nxsOverLimit'];  
  182. if (isset($_POST['quLimitRndMins'])) $options['quLimitRndMins'] = $_POST['quLimitRndMins'];  
  183. if (isset($_POST['quDays'])) $options['quDays'] = $_POST['quDays'];  
  184. if (isset($_POST['quHrs'])) $options['quHrs'] = $_POST['quHrs'];  
  185. if (isset($_POST['quMins'])) $options['quMins'] = $_POST['quMins'];  
  186.  
  187. if ($isTimeChanged) { $currTime = time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );  
  188. $pstEvrySec = $options['quDays']*86400+$options['quHrs']*3600+$options['quMins']*60; $options['quNxTime'] = $currTime + $pstEvrySec;  
  189.  
  190.  
  191. if (isset($_POST['rpstActive'])) $options['rpstActive'] = 1; else $options['rpstActive'] = 0;  
  192.  
  193.  
  194. if ($nxs_isWPMU && (!isset($options['suaMode'])||$options['suaMode'] == '')) $options['suaMode'] = $nxs_tpWMPU;  
  195. $editable_roles = get_editable_roles(); foreach ( $editable_roles as $roleX => $details ) {$role = get_role($roleX); $role->remove_cap('see_snap_box'); $role->remove_cap('make_snap_posts'); } 
  196.  
  197. foreach ($options['whoCanSeeSNAPBox'] as $uRole) { $role = get_role($uRole); $role->add_cap('see_snap_box'); $role->add_cap('make_snap_posts'); }  
  198. foreach ($options['whoCanMakePosts'] as $uRole) { $role = get_role($uRole); $role->add_cap('make_snap_posts'); }  
  199.  
  200. update_option($this->dbOptionsName, $options); $this->nxs_options = $options; 
  201. ?><div class="updated"><p><strong><?php _e("Settings Updated.", 'social-networks-auto-poster-facebook-twitter-g');?></strong></p></div><?php  
  202. }  
  203. $isNoNts = true; foreach ($nxs_snapAvNts as $avNt) if (isset($options[$avNt['lcode']]) && is_array($options[$avNt['lcode']]) && count($options[$avNt['lcode']])>0) {$isNoNts = false; break;}  
  204. remove_action( 'get_terms', 'order_category_by_id', 10); $category_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') ); 
  205. if(isset($options['exclCats'])) $pk = maybe_unserialize($options['exclCats']); else $pk = ''; 
  206. if ( is_array($category_ids) && is_array($pk) && count($category_ids) == count($pk)) { ?> 
  207. <div class="error" id="message"><p><strong>All your categories are excluded from auto-posting.</strong> Nothing will be auto-posted. Please Click "Settings Tab" and select some categories.</div> 
  208. <?php } 
  209.  
  210. if(!$nxs_isWPMU) $this->NS_SNAP_ShowPageTop(); ?> 
  211. Please see the <a target="_blank" href="http://www.nextscripts.com/installation-of-social-networks-auto-poster-for-wordpress">detailed installation/configuration instructions</a> (will open in a new tab)<br/> 
  212. <?php if(!isset($options['hideTopTip']) || (int)$options['hideTopTip'] != 1) { /** ?> 
  213. <div id="nxs_TopTip" class="nxsInfoMsg" style="font-size: 11px; margin-left: 3px; max-width: 1100px; display: block; font-style: italic; margin-bottom: 5px;">Tip: If autoposting works when you click "Test" buttons, but is not working when you publish new posts, try to switch from "Scheduled" to "Immediately" in the Plugin Settings->Other Settings->How to make auto-posts.  
  214. <span style="float: right;"><a style="text-decoration: none" href="#" onclick="nxs_hideTip('nxs_TopTip'); return false;">[Hide]</a></span> 
  215. </div>  
  216. <?php */ } else { ?><br/><?php } ?> 
  217.  
  218. <?php ?> 
  219.  
  220. <ul class="nsx_tabs"> 
  221. <li><a href="#nsx_tab1">Your Social Networks Accounts</a></li> 
  222. <li><a href="#nsx_tab2"><?php _e('Settings', 'social-networks-auto-poster-facebook-twitter-g') ?></a></li> 
  223. <?php if ((function_exists("nxs_showPRXTab")) && (int)$options['showPrxTab'] == 1) { ?> <li><a href="#nsx_tab5">Proxies</a></li> <?php } ?> 
  224. <li><a href="#nsx_tab3">Log/History</a></li> 
  225. <li><a href="#nsx_tab4">Help/Support</a></li> 
  226. <li><a class="ab-item" href="#nsx_tab5"><span style="font-weight:bold; font-size: 16px; color:#2ecc2e;">⇒</span> New Post to Social Networks</a></li>  
  227.  
  228. </ul> 
  229.  
  230. <div class="nsx_tab_container"> 
  231.  
  232. <div id="nsx_tab1" class="nsx_tab_content"> 
  233. <form method="post" id="nsStForm" action=""> <input style="display:none" type="text" name="nxs_fk_UserName" id="nxs_FakeUserNameToBePreFilledByChrome"/> 
  234. <input style="display:none" name="nxs_fk_password" type="password" id="nxs_FakePasswordToBePreFilledByChrome"/> 
  235. <a href="#" class="NXSButton" id="nxs_snapAddNew">Add new account</a> <div class="nxsInfoMsg"><img style="position: relative; top: 8px;" alt="Arrow" src="<?php echo $nxs_plurl; ?>img/arrow_l_green_c1.png"/> You can add Facebook, Twitter, Google+, Pinterest, LinkedIn, Tumblr, Blogger/Blogspot, Delicious, etc accounts</div><br/><br/> 
  236. <div id="nxs_spPopup"><span class="nxspButton bClose"><span>X</span></span>Add New Network: <select onchange="doShowFillBlockX(this.value);" id="nxs_ntType"><option value =""></option> 
  237. <?php foreach ($nxs_snapAvNts as $avNt) { if (!isset($options[$avNt['lcode']]) || count($options[$avNt['lcode']])==0) $mt=0; else $mt = 1+max(array_keys($options[$avNt['lcode']])); 
  238. echo '<option value ="'.$avNt['code'].$mt.'">'.$avNt['name'].'</option>';  
  239. } ?> 
  240. </select>  
  241. <div id="nsx_addNT"> 
  242. <?php foreach ($nxs_snapAvNts as $avNt) { $clName = 'nxs_snapClass'.$avNt['code']; $ntClInst = new $clName();  
  243. if (!isset($options[$avNt['lcode']]) || count($options[$avNt['lcode']])==0) { $ntClInst->showNewNTSettings(0); } else {  
  244. $mt = 1+max(array_keys($options[$avNt['lcode']])); if (function_exists('getNSXOption') && function_exists('nxs_doSMAS1')) nxs_doSMAS1($ntClInst, $mt); else nxs_doSMAS($avNt['name'], $avNt['code'].$mt);  
  245. }} ?>  
  246. </div> 
  247.  
  248. </div> 
  249.  
  250. <div class="popShAtt" id="popOnlyCat"><?php _e('Filters are "ON". Only selected categories/tags will be autoposted to this account. Click "Show Settings->Advanced" to change', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 
  251. <div class="popShAtt" id="popReActive"><?php _e('Reposter is activated for this account', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 
  252.  
  253. <div id="showCatSel" style="display: none;background-color: #fff; width: 300px; padding: 25px;"><span class="nxspButton bClose"><span>X</span></span><?php _e('Select Categories', 'social-networks-auto-poster-facebook-twitter-g'); ?>:  
  254. <div id="fbSelCatsGLB" class="categorydivInd" style="padding-left: 15px; background-color: #fff;">  
  255. <a href="#" onclick="nxs_chAllCatsL(1, 'fbSelCatsGLB'); return false;">Check all</a>  |  <a href="#" onclick="nxs_chAllCatsL(0, 'fbSelCatsGLB'); return false;">UnCheck all</a> 
  256. <div id="category-all" class="tabs-panel"> <input type="hidden" id="tmpCatSelNT" name="tmpCatSelNT" value="" /> 
  257. <?php $num_cats = wp_count_terms('category'); if ($num_cats>1000) echo "Sorry, You have too many categories - (".$num_cats.') to show the list. Please use "Tags and Custom Taxonomies" field with category|category_slug format'; else { ?> 
  258. <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 
  259. <?php  
  260. $args = array( 'descendants_and_self' => 0, 'selected_cats' => '', 'taxonomy' => 'category', 'checked_ontop' => false); if (function_exists('wp_terms_checklist')) wp_terms_checklist(0, $args );  
  261. /** //## Show Hierarcical custom taxonomies as categories. 
  262. $args = array('hierarchical' => true, 'public' => true, '_builtin' => false ); $output = 'names'; $operator = 'and'; $taxonomies = get_taxonomies( $args, $output, $operator );  
  263. if ( $taxonomies ) foreach ( $taxonomies as $taxonomy ) { ?> <b><br/>  <?php _e($taxonomy, 'social-networks-auto-poster-facebook-twitter-g'); ?></b><br/> <?php 
  264. $args = array( 'descendants_and_self' => 0, 'selected_cats' => '', 'taxonomy' => $taxonomy, 'checked_ontop' => false); if (function_exists('wp_terms_checklist')) wp_terms_checklist(0, $args );  
  265. }  
  266. */  
  267. ?> 
  268. </ul> <?php } ?> 
  269. </div>  
  270. </div> <div class="submitX"><input type="button" id="" class="button-primary" name="btnSelCats" onclick="nxs_doSetSelCats( jQuery('#tmpCatSelNT').val() ); jQuery('#showCatSel').bPopup().close();" value="Select Categories" /></div> 
  271. </div> 
  272. <?php  
  273. foreach ($nxs_snapAvNts as $avNt) { $clName = 'nxs_snapClass'.$avNt['code']; $ntClInst = new $clName(); 
  274. if ( isset($options[$avNt['lcode']]) && count($options[$avNt['lcode']])>0) { $ntClInst->showGenNTSettings($options[$avNt['lcode']]); } // else $ntClInst->showNewNTSettings(0); 
  275. if ($isNoNts) { ?><br/><br/><br/>You don't have any configured social networks yet. Please click "Add new account" button.<br/><br/> 
  276. <input onclick="jQuery('#impFileSettings_button').click(); return false;" type="button" class="button" name="impSettings_repostButton" id="impSettings_button" value="<?php _e('Import Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  277. <?php } else {?>  
  278.  
  279. <div style="float: right; padding: 1.5em;"> 
  280.  
  281. <input onclick="nxs_expSettings(); return false;" type="button" class="button" name="expSettings_repostButton" id="expSettings_button" value="<?php _e('Export Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  282. <input onclick="jQuery('#impFileSettings_button').click(); return false;" type="button" class="button" name="impSettings_repostButton" id="impSettings_button" value="<?php _e('Import Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  283. </div> 
  284. <input value="'" type="hidden" name="nxs_mqTest" />  
  285. <div class="submitX"><input type="submit" id="nxs-button-primary-submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" /></div> 
  286.  
  287. <?php } ?>  
  288. </form>  
  289. </div> <!-- END TAB --> 
  290.  
  291. <div id="nsx_tab2" class="nsx_tab_content"> <script type="text/javascript">setTimeout( function() { document.getElementById( "nsStFormMisc" ).reset();}, 5);</script> 
  292. <form method="post" id="nsStFormMisc" action="<?php echo $nxs_snapThisPageUrl?>"> <input type="hidden" name="nxsMainFromElementAccts" id="nxsMainFromElementAccts" value="" /> 
  293.  
  294.  
  295.  
  296. <input type="hidden" name="_wpnonce" id="_wpnonce" value="" /> <input type="hidden" name="nxsMainFromSupportFld" id="nxsMainFromSupportFld" value="1" /> 
  297. <!-- ##################### OTHER #####################-->  
  298.  
  299. <!-- How to make auto-posts? -->  
  300. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('How to make auto-posts?', 'social-networks-auto-poster-facebook-twitter-g') ?> <-- (<a id="showShAttIS" onmouseover="showPopShAtt('IS', event);" onmouseout="hidePopShAtt('IS');" onclick="return false;" class="underdash" href="#"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g') ?></a>)</h3></div> 
  301. <div class="popShAtt" id="popShAttIS"> 
  302. <h3><?php _e('The difference between "Immediately" and "Scheduled"', 'social-networks-auto-poster-facebook-twitter-g') ?></h3> 
  303. <?php _e('<b>"Immediately"</b> - Once you click "Publish" button plugin starts pushing your update to configured social networks. At this time you need to wait and look at the turning circle. Some APIs are pretty slow, so you have to wait and wait and wait until all updates are posted and page released back to you.', 'social-networks-auto-poster-facebook-twitter-g') ?><br/><br/> 
  304. <?php _e('<b>"Scheduled"</b> - Releases the page immediately back to you, so you can proceed with something else and it schedules all auto-posting jobs to your WP-Cron. This is much faster and much more efficient, but it could not work if your WP-Cron is disabled or broken.', 'social-networks-auto-poster-facebook-twitter-g') ?> 
  305. </div> 
  306. <div class="nxs_box_inside">  
  307.  
  308. <div class="itemDiv"> 
  309. <input type="radio" name="nxsHTDP" value="I" <?php if (isset($options['nxsHTDP']) && $options['nxsHTDP']=='I') echo 'checked="checked"'; ?> /> <b><?php _e('Publish Immediately', 'social-networks-auto-poster-facebook-twitter-g') ?></b> - <i><?php _e('No WP Cron will be used. Choose if WP Cron is disabled or broken on your website', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 
  310. </div>  
  311.  
  312. <div class="itemDiv"> 
  313. <input type="radio" name="nxsHTDP" value="S" <?php if (!isset($options['nxsHTDP']) || $options['nxsHTDP']=='S') echo 'checked="checked"'; ?> /> <b><?php _e('Use WP Cron to Schedule autoposts', 'social-networks-auto-poster-facebook-twitter-g') ?></b> - <i><?php _e('Recommended for most sites. Faster Performance - requires working WP Cron', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> <?php /** ?> 
  314.       <input type="checkbox" name="runNXSCron" value="1"> <b><?php _e('Try to process missed "Scheduled" posts.', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <i><?php _e('Usefull when WP Cron is disabled or broken, but can cause some short perfomance issues and duplicates. It is <b>highly</b> recomended to setup a proper cron job of fix WP Cron instead', 'social-networks-auto-poster-facebook-twitter-g') ?></i>. <?php */ ?> 
  315. </div>  
  316.  
  317. <div class="itemDiv"> 
  318. <div style="margin-left: 20px;"> 
  319.  
  320. <?php $cr = get_option('NXS_cronCheck'); if (!empty($cr) && is_array($cr) && isset($cr['status']) && $cr['status']=='0') { ?> <span style="color: red"> *** <?php _e('Your WP Cron is not working correctly. This feature may not work properly, and might cause duplicate postings and stability problems.<br/> Please see the test results and recommendations here:', 'social-networks-auto-poster-facebook-twitter-g'); ?> 
  321.  - <a target="_blank" href="<?php global $nxs_snapThisPageUrl; echo $nxs_snapThisPageUrl; ?>&do=crtest">WP Cron Test Results</a></span> <br/> 
  322. <?php } ?> 
  323.  
  324. <input type="checkbox" name="quLimit" value="1" <?php if (isset($options['quLimit']) && $options['quLimit']=='1') echo 'checked="checked"'; ?> /> <b><?php _e('Limit autoposting speed', 'social-networks-auto-poster-facebook-twitter-g') ?></b> - <i><?php _e('Recommended for busy sites with a lot of new posts.', 'social-networks-auto-poster-facebook-twitter-g') ?> </i><br/>  
  325. <div style="margin-left: 10px;"> 
  326. Do not autopost more than one post per network every <input name="quDays" style="width: 24px;" value="<?php echo isset($options['quDays'])?$options['quDays']:'0'; ?>" /> Days,    
  327. <input name="quHrs" style="width: 24px;" value="<?php echo isset($options['quHrs'])?$options['quHrs']:'0'; ?>" /> Hours,    
  328. <input name="quMins" style="width: 24px;" value="<?php echo isset($options['quMins'])?$options['quMins']:'3'; ?>" /> Minutes. 
  329. <div style="margin-left: 10px;"> 
  330. <b><?php _e('Randomize posting time ±', 'social-networks-auto-poster-facebook-twitter-g'); ?> </b> 
  331. <input type="text" name="quLimitRndMins" style="width: 35px;" value="<?php echo isset($options['quLimitRndMins'])?$options['quLimitRndMins']:'2'; ?>" /> <?php _e('Minutes', 'social-networks-auto-poster-facebook-twitter-g'); ?> 
  332. </div> 
  333.  
  334. <div style="margin-left: 10px;"> 
  335. <?php _e('What to do with the rest of the posts if there are more posts then daily limit?', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 
  336. <input type="radio" name="nxsOverLimit" value="D" <?php if (!isset($options['nxsOverLimit']) || $options['nxsOverLimit']=='D') echo 'checked="checked"'; ?> /> <b><?php _e('Skip/Discard/Don\'t Autopost ', 'social-networks-auto-poster-facebook-twitter-g') ?></b><br/> 
  337. <input type="radio" name="nxsOverLimit" value="S" <?php if (isset($options['nxsOverLimit']) && $options['nxsOverLimit']=='S') echo 'checked="checked"'; ?> /> <b><?php _e('Schedule for tomorrow', 'social-networks-auto-poster-facebook-twitter-g') ?></b> - <i><?php _e('Not recommended, may cause significant delays', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 
  338. </div> 
  339. </div> 
  340. </div> 
  341. </div>  
  342.  
  343.  
  344. </div></div> 
  345. <!-- #### Who can see auto-posting options on the "New Post" pages? ##### -->  
  346. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('User Privileges/Security', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  347. <div class="nxs_box_inside">  
  348. <div class="itemDiv"> 
  349.  
  350. <input value="set" id="skipSecurity" name="skipSecurity" type="checkbox" <?php if (!empty($options['skipSecurity']) && (int)$options['skipSecurity'] == 1) echo "checked"; ?> /> <b><?php _e('Skip User Security Verification.', 'social-networks-auto-poster-facebook-twitter-g') ?></b>  
  351. <span style="font-size: 11px; margin-left: 1px;"><?php _e('NOT Recommended, but useful in some situations. This will allow autoposting for everyone even for the non-existent users.', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  352.  
  353. <h4><?php _e('Who can make autoposts without seeing any auto-posting options?', 'social-networks-auto-poster-facebook-twitter-g') ?></h4> 
  354.  
  355. <?php $editable_roles = get_editable_roles(); if (!isset($options['whoCanMakePosts']) || !is_array($options['whoCanMakePosts'])) $options['whoCanMakePosts'] = array();  
  356.  
  357. foreach ( $editable_roles as $role => $details ) { $name = translate_user_role($details['name'] ); echo '<input type="checkbox" ';  
  358. if (in_array($role, $options['whoCanMakePosts']) || $role=='administrator') echo ' checked="checked" '; if ($role=='administrator') echo ' disabled="disabled" '; 
  359. echo 'name="whoCanMakePosts[]" value="'.esc_attr($role).'"> '.$name;  
  360. if ($role=='administrator') echo ' - Somebody who has access to all the administration features'; 
  361. if ($role=='editor') echo " - Somebody who can publish and manage posts and pages as well as manage other users' posts, etc. "; 
  362. if ($role=='author') echo ' - Somebody who can publish and manage their own posts '; 
  363. if ($role=='contributor') echo ' - Somebody who can write and manage their posts but not publish them'; 
  364. if ($role=='subscriber') echo ' - Somebody who can only manage their profile';  
  365. echo '<br/>';  
  366. } ?> 
  367.  
  368. <h4><?php _e('Who can see auto-posting options on the "New Post" and "Edit Post" pages and make autoposts?', 'social-networks-auto-poster-facebook-twitter-g') ?></h4> 
  369.  
  370. <?php $editable_roles = get_editable_roles(); if (!isset($options['whoCanSeeSNAPBox']) || !is_array($options['whoCanSeeSNAPBox'])) $options['whoCanSeeSNAPBox'] = array();  
  371.  
  372. foreach ( $editable_roles as $role => $details ) { $name = translate_user_role($details['name'] ); echo '<input type="checkbox" ';  
  373. if (in_array($role, $options['whoCanSeeSNAPBox']) || $role=='administrator') echo ' checked="checked" '; if ($role=='administrator' || $role=='subscriber') echo ' disabled="disabled" '; 
  374. echo 'name="whoCanSeeSNAPBox[]" value="'.esc_attr($role).'"> '.$name;  
  375. if ($role=='administrator') echo ' - Somebody who has access to all the administration features'; 
  376. if ($role=='editor') echo " - Somebody who can publish and manage posts and pages as well as manage other users' posts, etc. "; 
  377. if ($role=='author') echo ' - Somebody who can publish and manage their own posts '; 
  378. if ($role=='contributor') echo ' - Somebody who can write and manage their posts but not publish them'; 
  379. if ($role=='subscriber') echo ' - Somebody who can only manage their profile';  
  380. echo '<br/>';  
  381. } ?> 
  382.  
  383.  
  384.  
  385.  
  386. </div> 
  387.  
  388. </div></div>  
  389. <!-- #### Include/Exclude Wordpress Pages and Custom Post Types ##### -->  
  390. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('Include/Exclude Wordpress Pages and Custom Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div>  
  391. <div class="nxs_box_inside">  
  392. <div class="itemDiv">  
  393. <input value="set" id="useForPages" name="useForPages" type="checkbox" <?php if (!empty($options['useForPages'])&&(int)$options['useForPages'] == 1) echo "checked"; ?> /> <b><?php _e('Use for Wordpress Pages', 'social-networks-auto-poster-facebook-twitter-g') ?></b>  
  394. <span style="font-size: 11px; margin-left: 1px;"><?php _e('Show the SNAP metabox and auto-post for pages, not just posts.', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  395. </div> 
  396. <div class="itemDiv"><b><br/><?php _e('Custom Post Types:', 'social-networks-auto-poster-facebook-twitter-g') ?></b>  
  397. <span style="font-size: 11px; margin-left: 1px;"><?php _e('Please select "Custom Post Types" that you would like to be autoposted to your social networks', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  398. <?php $nxsOne = base64_encode("v=".$nxsOne); 
  399. $args=array('public'=>true, '_builtin'=>false); $output = 'names'; $operator = 'and'; $post_types = array(); if (function_exists('get_post_types')) $post_types=get_post_types($args, $output, $operator);  
  400. if (!empty($options['nxsCPTSeld'])) $nxsCPTSeld = unserialize($options['nxsCPTSeld']); else $nxsCPTSeld = array_keys($post_types); 
  401.  
  402. ?> <div class="taxonomydiv"><div class="tabs-panel" style="padding: 10px;"><input type="hidden" name="nxsCPTSeld[]" value="0" /> <?php //prr($nxsCPTSeld); prr($post_types); prr($_POST['nxsCPTSeld']);  
  403. foreach ($post_types as $cptID=>$cptName) { if (in_array($cptID, $nxsCPTSeld)) $dCh = ' checked="checked" '; else $dCh = ""; 
  404. ?><input type="checkbox" name="nxsCPTSeld[]" value="<?php echo esc_attr($cptID); ?>"<?php echo $dCh ?>> <?php echo $cptName ?><br/> <?php 
  405. ?></div></div>  
  406. </div>  
  407. </div></div>  
  408. <!-- #### Categories to Include/Exclude: ##### -->  
  409. <script type="text/javascript"> function nxs_chAllCats(ch) { jQuery("form input:checkbox[name='post_category[]']").attr('checked', ch==1);} 
  410. (function($) { $(function() { 
  411. jQuery('.button-primary[name="update_NS_SNAutoPoster_settings"]').bind('click', function(e) { var str = jQuery('input[name="post_category[]"]').serialize(); jQuery('div.categorydivInd').replaceWith('<input type="hidden" name="pcInd" value="" />');  
  412. str = str.replace(/post_category/g, "pk"); jQuery('div.categorydiv').replaceWith('<input type="hidden" name="post_category" value="'+str+'" />');  
  413. }); }); })(jQuery); </script>  
  414. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('Categories to Include/Exclude:', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  415. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;"><?php _e('Each blogpost will be autoposted to all categories selected below. All categories are selected by default.  
  416. <b>Uncheck</b> categories that you would like <b>NOT</b> to auto-post by default. Assigning the unchecked category to the new blogpost will turn off auto-posting to all configured networks.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  417. <div class="itemDiv"> 
  418. <a href="#" onclick="nxs_chAllCats(1); return false;">Check all</a>  |  <a href="#" onclick="nxs_chAllCats(0); return false;">UnCheck all</a> 
  419.  
  420. <div id="taxonomy-category" class="categorydiv"> 
  421. <div id="category-all" class="tabs-panel"><input type='hidden' name='post_category[]' value='0' />  
  422. <?php $num_cats = wp_count_terms('category'); if ($num_cats>1000) echo "Sorry, You have too many categories - ".$num_cats; else { ?> 
  423. <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 
  424. <?php if(isset($options['exclCats'])) $pk = maybe_unserialize($options['exclCats']); else $pk = '';  
  425. if (is_array($pk) && count($pk)>0 ) $selCats = array_diff($category_ids, $pk); else $selCats = $category_ids;  
  426. $args = array( 'descendants_and_self' => 0, 'selected_cats' => $selCats, 'taxonomy' => 'category', 'checked_ontop' => false);  
  427. if (function_exists('wp_terms_checklist')) wp_terms_checklist(0, $args );  
  428. ?> 
  429. </ul> <?php } ?> 
  430. </div>  
  431. </div> 
  432. </div>  
  433. </div></div>  
  434. <!-- ##################### URL Shortener #####################--> 
  435. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('URL Shortener', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  436. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;">Please use %SURL% in "Message Format" to get shortened urls or check "Force Shortened Links". </span> <br/> 
  437. <!-- <div class="itemDiv"> 
  438. <input type="radio" name="nxsURLShrtnr" value="G" <?php if (!isset($options['nxsURLShrtnr']) || $options['nxsURLShrtnr']=='' || $options['nxsURLShrtnr']=='G') echo 'checked="checked"'; ?> /> <b>gd.is</b> (Default) - fast, simple, free, no configuration nessesary.  
  439. </div> --> 
  440. <div class="itemDiv"> 
  441.  
  442. <input type="checkbox" name="forceSURL" value="1" <?php if (isset($options['forceSURL']) && $options['forceSURL']=='1') echo 'checked="checked"'; ?> /> <b><?php _e('Force Shortened Links', 'social-networks-auto-poster-facebook-twitter-g') ?></b> 
  443. <br/><br/>  
  444. <input type="radio" name="nxsURLShrtnr" value="O" <?php if (!isset($options['nxsURLShrtnr']) || (isset($options['nxsURLShrtnr']) && ($options['nxsURLShrtnr']=='O' || $options['nxsURLShrtnr']=='G'))) echo 'checked="checked"'; ?> /> <b>goo.gl</b> - <i> Enter goo.gl <a target="_blank" href="https://developers.google.com/url-shortener/v1/getting_started#APIKey">API Key</a> below [Optional]</i><br/> 
  445.        goo.gl  API Key:      <input name="gglAPIKey" style="width: 20%;" value="<?php if (isset($options['gglAPIKey'])) _e(apply_filters('format_to_edit', $options['gglAPIKey']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  446. </div> 
  447.  
  448. <?php if (function_exists('wp_get_shortlink')) { ?><div class="itemDiv"> 
  449. <input type="radio" name="nxsURLShrtnr" value="W" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='W') echo 'checked="checked"'; ?> /> <b>Wordpress Built-in Shortener</b> (wp.me if you use Jetpack)<br/>  
  450. </div><?php } ?> 
  451. <!-- ## bitly ##--> 
  452. <div class="itemDiv"> 
  453. <input type="radio" name="nxsURLShrtnr" value="B" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='B') echo 'checked="checked"'; ?> /> <b>bit.ly</b> - <i>Enter bit.ly username and <a target="_blank" href="http://bitly.com/a/your_api_key">API Key</a> below.</i> (<i style="font-size: 12px;">If https://bitly.com/a/your_api_key is not working, please go for the API key to "Your Account->Advanced Settings->API Support"</i>)<br/> 
  454.        bit.ly Username: <input name="bitlyUname" style="width: 20%;" value="<?php if (isset($options['bitlyUname'])) _e(apply_filters('format_to_edit', $options['bitlyUname']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 
  455.        bit.ly  API Key:      <input name="bitlyAPIKey" style="width: 20%;" value="<?php if (isset($options['bitlyAPIKey'])) _e(apply_filters('format_to_edit', $options['bitlyAPIKey']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  456. </div> 
  457.  
  458. <!-- ## u.to ##--> 
  459. <div class="itemDiv"> 
  460. <input type="radio" name="nxsURLShrtnr" value="U" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='U') echo 'checked="checked"'; ?> /> <b>u.to</b> <i>Simple and anonymous (no accounts, no stats) use only, No additional configuration required.</i> 
  461. </div> 
  462.  
  463. <!-- ## x.co ##--> 
  464. <div class="itemDiv"> 
  465. <input type="radio" name="nxsURLShrtnr" value="X" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='X') echo 'checked="checked"'; ?> /> <b>x.co</b> - <i>Enter x.co <a target="_blank" href="http://app.x.co/Settings.aspx">API Key</a> below. You can get API key from your x.co settings page: <a target="_blank" href="http://app.x.co/Settings.aspx">http://app.x.co/Settings.aspx</a>.</i><br/>  
  466.        x.co  API Key:      <input name="xcoAPIKey" style="width: 20%;" value="<?php if (isset($options['xcoAPIKey'])) _e(apply_filters('format_to_edit', $options['xcoAPIKey']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  467. </div> 
  468. <!-- ## clk.im ##--> 
  469. <div class="itemDiv"> 
  470. <input type="radio" name="nxsURLShrtnr" value="C" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='C') echo 'checked="checked"'; ?> /> <b>clk.im</b> - <i>Enter clk.im <a target="_blank" href="http://clk.im/apikey">API Key</a> below. You can get API key from your clk.im page: <a target="_blank" href="http://clk.im/apikey">http://clk.im/apikey</a>. Please see the "Developers/Publishers" section on the right</i><br/>  
  471.        clk.im  API Key:      <input name="clkimAPIKey" style="width: 20%;" value="<?php if (isset($options['clkimAPIKey'])) _e(apply_filters('format_to_edit', $options['clkimAPIKey']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  472. </div> 
  473. <!-- ## po.st ##--> 
  474. <div class="itemDiv"> 
  475. <input type="radio" name="nxsURLShrtnr" value="P" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='P') echo 'checked="checked"'; ?> /> <b>po.st</b> - <i>Enter po.st <a target="_blank" href="https://re.po.st/partner/campaigns">API Key</a> below. You can get API key from your "Campaigns" page: <a target="_blank" href="https://re.po.st/partner/campaigns">https://re.po.st/partner/campaigns</a></i><br/> 
  476.        po.st  API Key:      <input name="postAPIKey" style="width: 20%;" value="<?php if (isset($options['postAPIKey'])) _e(apply_filters('format_to_edit', $options['postAPIKey']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  477. </div> 
  478.  
  479. <div class="itemDiv"> 
  480. <input type="radio" name="nxsURLShrtnr" value="A" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='A') echo 'checked="checked"'; ?> /> <b>adf.ly</b> - <i>Enter adf.ly user ID and <a target="_blank" href="https://adf.ly/publisher/tools#tools-api">API Key</a> below</i><br/> 
  481.        adf.ly User ID: <input name="adflyUname" style="width: 20%;" value="<?php if (isset($options['bitlyUname'])) _e(apply_filters('format_to_edit', $options['adflyUname']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 
  482.        adf.ly  API Key:      <input name="adflyAPIKey" style="width: 20%;" value="<?php if (isset($options['adflyAPIKey'])) _e(apply_filters('format_to_edit', $options['adflyAPIKey']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  483. <div style="width:100%;">       adf.ly Domain: <select name="adflyDomain" id="adflyDomain"> 
  484. <?php $adflyDomains = '<option value="adf.ly">adf.ly</option><option value="q.gs">q.gs</option>'; 
  485. if (isset($options['adflyDomain']) && $options['adflyDomain']!='') $adflyDomains = str_replace($options['adflyDomain'].'"', $options['adflyDomain'].'" selected="selected"', $adflyDomains); echo $adflyDomains;  
  486. ?> 
  487. </select> <i>Please note that j.gs is not availabe for API use.</i> </div> 
  488. </div> 
  489.  
  490. <div class="itemDiv"> 
  491. <input type="radio" name="nxsURLShrtnr" value="Y" <?php if (isset($options['nxsURLShrtnr']) && $options['nxsURLShrtnr']=='Y') echo 'checked="checked"'; ?> /> <b>YOURLS (Your Own URL Shortener)</b> -  
  492.  <i>YOURLS API URL - usually sonething like http://yourdomain.cc/yourls-api.php; YOURLS API Secret Signature Token can be found in your YOURLS Admin Panel->Tools</i><br/> 
  493.        YOURLS API URL: <input name="YOURLSURL" style="width: 19.4%;" value="<?php if (isset($options['YOURLSURL'])) _e(apply_filters('format_to_edit', $options['YOURLSURL']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 
  494.        YOURLS API Secret Signature Token:   <input name="YOURLSKey" style="width: 13%;" value="<?php if (isset($options['YOURLSKey'])) _e(apply_filters('format_to_edit', $options['YOURLSKey']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  495. </div> 
  496.  
  497. </div></div> 
  498.  
  499. <!-- ##################### Auto-Import comments from Social Networks #####################--> 
  500. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('Auto-Import comments from Social Networks', 'social-networks-auto-poster-facebook-twitter-g') ?><span class="nxs_newLabel">[<?php _e('New', 'social-networks-auto-poster-facebook-twitter-g') ?>]</span></h3></div> 
  501. <div class="nxs_box_inside">  
  502.  
  503. <?php $cr = get_option('NXS_cronCheck'); if (!empty($cr) && is_array($cr) && isset($cr['status']) && $cr['status']=='0') { ?> <span style="color: red"> *** <?php _e('Your WP Cron is not working correctly. This feature may not work properly, and might cause duplicate postings and stability problems.<br/> Please see the test results and recommendations here:', 'social-networks-auto-poster-facebook-twitter-g'); ?> 
  504.  - <a target="_blank" href="<?php global $nxs_snapThisPageUrl; echo $nxs_snapThisPageUrl; ?>&do=crtest">WP Cron Test Results</a></span> <br/> 
  505. <?php } ?>  
  506.  
  507. <span style="font-size: 11px; margin-left: 1px;">Plugin will automatically grab the comments posted on Social Networks and insert them as "Comments to your post". Plugin will check for the new comments every hour. </span> <br/> 
  508. <div class="itemDiv"> 
  509. <input value="set" id="riActive" name="riActive" type="checkbox" <?php if (!empty($options['riActive']) && (int)$options['riActive'] == 1) echo "checked"; ?> />  
  510. <strong>Enable "Comments Import"</strong> 
  511. </div> 
  512. <div class="itemDiv"> 
  513. <strong style="font-size: 12px; margin: 10px; margin-left: 1px;">How many posts should be tracked:</strong> 
  514. <input name="riHowManyPostsToTrack" style="width: 50px;" value="<?php if (isset($options['riHowManyPostsToTrack'])) _e(apply_filters('format_to_edit', $options['riHowManyPostsToTrack']), 'social-networks-auto-poster-facebook-twitter-g'); else echo "10"; ?>" /> <br/> 
  515.  
  516. <span style="font-size: 11px; margin-left: 1px;">Setting two many will degrade your website's performance. 10-20 posts are recommended</span>  
  517. </div> 
  518.  
  519. </div></div> 
  520.  
  521. <!-- ##################### Additional URL Parameters #####################-->  
  522. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('URL Parameters', 'social-networks-auto-poster-facebook-twitter-g') ?> <span class="nxs_newLabel">[<?php _e('New', 'social-networks-auto-poster-facebook-twitter-g') ?>]</span></h3></div>  
  523.  
  524. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;"><?php _e('Here you can set what should be done to backlinks.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  525. <div class="itemDiv"> 
  526. <b><?php _e('Force HTTPS/SSL?', 'social-networks-auto-poster-facebook-twitter-g') ?></b><br/> <?php if (empty($options['forcessl'])) $options['forcessl'] = 'D'; ?> 
  527. <input type="radio" name="forcessl" value="D" <?php if ($options['forcessl'] == 'D') echo 'checked="checked"'; ?> /> <?php _e('Don\'t do anything, let Wordpress to set the links.', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('All links will be exactly as provided by Wordpress', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>  
  528. <input type="radio" name="forcessl" value="S" <?php if ($options['forcessl'] == 'S') echo 'checked="checked"'; ?> /> <?php _e('Force SSL', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('All links will be https/ssl', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>  
  529. <input type="radio" name="forcessl" value="N" <?php if ($options['forcessl'] == 'N') echo 'checked="checked"'; ?> /> <?php _e('Force NON-SSL', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('All links will be http', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>  
  530. </div>  
  531.  
  532. <div class="itemDiv"> 
  533. <b><?php _e('Additional URL Parameters:', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="addURLParams" style="width: 800px;" value="<?php if (isset($options['addURLParams'])) _e(apply_filters('format_to_edit', $options['addURLParams']), 'social-networks-auto-poster-facebook-twitter-g'); ?>" /> 
  534. </div>  
  535. <span style="font-size: 11px; margin-left: 1px;"> <?php _e('You can use %NTNAME% for social network name, %NTCODE% for social network two-letter code, %ACCNAME% for account name, %POSTID% for post ID, %POSTTITLE% for post title, %SITENAME% for website name. <b>Any text must be URL Encoded</b><br/>Example: utm_source=%NTCODE%&utm_medium=%ACCNAME%&utm_campaign=SNAP%2Bfrom%2B%SITENAME%', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  536. </div></div>  
  537.  
  538. <!-- ##### HashTag Settings ##### -->  
  539. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('Auto-HashTags Settings', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  540. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;"><?php _e('How to generate hashtags if tag is longer then one word', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  541. <div class="itemDiv"> 
  542. <b><?php _e('Replace spaces in hashtags with ', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <select name="nxsHTSpace" id="nxsHTSpace"> 
  543. <option <?php if (empty($options['nxsHTSpace'])) echo "selected" ?> value="">Nothing</option> 
  544. <option <?php if (!empty($options['nxsHTSpace']) && $options['nxsHTSpace']=='_') echo "selected" ?> value ="_">_ (Underscore)</option> 
  545. <option <?php if (!empty($options['nxsHTSpace']) && $options['nxsHTSpace']=='-') echo "selected" ?> value ="-">- (Dash)</option> 
  546. </select> 
  547. </div>  
  548. <span style="font-size: 11px; margin-left: 1px;"><?php _e('How to separate hashtags', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  549. <div class="itemDiv"> 
  550. <b><?php _e('Separate hashtags with ', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <select name="nxsHTSepar" id="nxsHTSepar"> 
  551. <option <?php if (!empty($options['nxsHTSepar']) && $options['nxsHTSepar']=='_') echo "selected" ?> value ="_">[ ] Space</option> 
  552. <option <?php if (empty($options['nxsHTSepar']) || $options['nxsHTSepar']=='c_') echo "selected" ?> value="c_">[, ] Comma and Space</option> 
  553. <option <?php if (!empty($options['nxsHTSepar']) && $options['nxsHTSepar']=='c') echo "selected" ?> value ="c">[, ] Comma</option>  
  554. </select> 
  555. </div>  
  556. </div></div> 
  557.  
  558. <!-- ##### ANOUNCE TAG ##### -->  
  559. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('%ANNOUNCE% tag settings', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  560. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;"><?php _e('Plugin will take text untill the <!--more--> tag. Please specify how many characters should it get if <!--more--> tag is not found', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  561. <div class="itemDiv"> 
  562. <b><?php _e('How many characters:', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="anounTagLimit" style="width: 100px;" value="<?php if (isset($options['anounTagLimit'])) _e(apply_filters('format_to_edit', $options['anounTagLimit']), 'social-networks-auto-poster-facebook-twitter-g'); else echo "300"; ?>" />  
  563. </div>  
  564. </div></div>  
  565.  
  566. <!-- ##################### Open Graph #####################--> 
  567. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('"Open Graph" Tags', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  568. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;"><?php _e('This is simple and useful implementation of "Open Graph" Tags, as this option will only add tags needed for "Auto Posting". If you use other specialized plugins, uncheck this option.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  569. <div class="itemDiv"> 
  570. <input value="1" id="nsOpenGraph" name="nsOpenGraph" type="checkbox" <?php if (!empty($options['nsOpenGraph']) && (int)$options['nsOpenGraph'] == 1) echo "checked"; ?> /> <b><?php _e('Add Open Graph Tags', 'social-networks-auto-poster-facebook-twitter-g') ?></b> 
  571. </div>  
  572. <div class="itemDiv"> 
  573. <b><?php _e('Default Image URL for og:image tag:', 'social-networks-auto-poster-facebook-twitter-g') ?></b>  
  574. <input name="ogImgDef" style="width: 30%;" value="<?php if (isset($options['ogImgDef'])) _e(apply_filters('format_to_edit', $options['ogImgDef']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  575. </div>  
  576. </div></div>  
  577. <!-- #### "Featured" Image ##### -->  
  578. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('Advanced "Featured" Image Settings', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  579. <div class="nxs_box_inside">  
  580. <div class="itemDiv"> 
  581. <input value="set" id="imgNoCheck" name="imgNoCheck" type="checkbox" <?php /** ## Reversed Intentionally!!! */ if (empty($options['imgNoCheck']) || (int)$options['imgNoCheck'] != 1) echo "checked"; ?> /> <strong>Verify "Featured" Image</strong>  
  582. <br/><span style="font-size: 11px; margin-left: 1px;"><?php _e('Advanced Setting. Uncheck only if you are 100% sure that your images are valid or if you have troubles with image verification.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  583. </div> 
  584.  
  585. <div class="itemDiv"> 
  586. <input value="1" id="useUnProc" name="useUnProc" type="checkbox" <?php if (isset($options['useUnProc']) && (int)$options['useUnProc'] == 1) echo "checked"; ?> />  
  587. <b><?php _e('Use advanced image finder', 'social-networks-auto-poster-facebook-twitter-g') ?></b> 
  588. <br/>  
  589. <span style="font-size: 11px; margin-left: 1px;"> <?php _e('Check this if your images could be found only in the fully processed posts. <br/>This feature could interfere with some plugins using post processing functions incorrectly. Your site could become messed up, have troubles displaying content or start giving you "ob_start() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers" errors.', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  590. </div>  
  591.  
  592. </div></div>  
  593.  
  594. <!-- ##### Alternative "Featured Image" location ##### -->  
  595. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('Alternative "Featured Image" location', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  596. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;"><?php _e('Plugin uses standard Wordpress "Featured Image" by default. If your theme stores "Featured Image" in the custom field, please enter the name of it. Use prefix if your custom field has only partial location.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  597. <div class="itemDiv"> 
  598. <b><?php _e('Custom field name:', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="featImgLoc" style="width: 200px;" value="<?php if (isset($options['featImgLoc'])) _e(apply_filters('format_to_edit', $options['featImgLoc']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  599. <br/>  
  600. <span style="font-size: 11px; margin-left: 1px;"><?php _e('Set the name of the custom field that contains image info', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  601. </div> 
  602. <div class="itemDiv"> 
  603. <b><?php _e('Custom field Array Path:', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="featImgLocArrPath" style="width: 200px;" value="<?php if (isset($options['featImgLocArrPath'])) _e(apply_filters('format_to_edit', $options['featImgLocArrPath']), 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  604. <br/>  
  605. <span style="font-size: 11px; margin-left: 1px;">[<?php _e('Optional', 'social-networks-auto-poster-facebook-twitter-g') ?>] <?php _e('If your custom field contain an array, please enter the path to the image field. For example: [\'images\'][\'image\']', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  606. </div> 
  607. <div class="itemDiv"> 
  608. <b><?php _e('Custom field Image Prefix:', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="featImgLocPrefix" style="width: 200px;" value="<?php if (isset($options['featImgLocPrefix'])) _e(apply_filters('format_to_edit', $options['featImgLocPrefix']), 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  609. <br/>  
  610. <span style="font-size: 11px; margin-left: 1px;">[<?php _e('Optional', 'social-networks-auto-poster-facebook-twitter-g') ?>] <?php _e('If your custom field contain only the last part of the image path, please enter the prefix', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  611. </div> 
  612.  
  613. <div class="itemDiv"> 
  614. <b><?php _e('Custom field Image text to remove:', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="featImgLocRemTxt" style="width: 200px;" value="<?php if (isset($options['featImgLocRemTxt'])) _e(apply_filters('format_to_edit', $options['featImgLocRemTxt']), 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  615. <br/>  
  616. <span style="font-size: 11px; margin-left: 1px;">[<?php _e('Optional', 'social-networks-auto-poster-facebook-twitter-g') ?>] <?php _e('If your custom field contain the last part of the image path that need to be removed, please enter it here', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  617. </div> 
  618.  
  619. </div></div>  
  620.  
  621. <!-- ##### Ext Debug/Report Settings ##### -->  
  622. <div class="nxs_box"> <div class="nxs_box_header"><h3><?php _e('Debug/Report Settings', 'social-networks-auto-poster-facebook-twitter-g') ?></h3></div> 
  623. <div class="nxs_box_inside"> <span style="font-size: 11px; margin-left: 1px;"><?php _e('Debug/Report Settings', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  624.  
  625. <div class="itemDiv"> 
  626. <input value="1" id="brokenCntFilters" name="brokenCntFilters" type="checkbox" <?php if (isset($options['brokenCntFilters']) && (int)$options['brokenCntFilters'] == 1) echo "checked"; ?> />  
  627. <strong>My Content Filters (<i>apply_filters('the_content'</i>) are broken, don't use them</strong> 
  628. - <span style="font-size: 11px; margin-left: 1px;"><?php _e('Some third party plugin break content filters. Check this if some networks do not post silently(without any errors in the log). This will make %EXCERPT% work as %RAWEXCERPT%, %FULLTEXT% as %RAWTEXT%, etc... ', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  629. <br/>  
  630. </div>  
  631.  
  632. <div class="itemDiv"> 
  633. <b><?php _e('How many log records show?', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="numLogRows" style="width: 200px;" value="<?php if (isset($options['numLogRows'])) _e(apply_filters('format_to_edit', $options['numLogRows']), 'social-networks-auto-poster-facebook-twitter-g'); else echo "250"; ?>" />  
  634. </div> 
  635. <div class="itemDiv"><input value="1" name="dbg[cron]" type="checkbox" <?php if (isset($options['dbg']['cron']) && (int)$options['dbg']['cron'] == 1) echo "checked"; ?> /> <?php _e('Log Cron Events', 'social-networks-auto-poster-facebook-twitter-g') ?> - <span style="font-size: 11px; margin-left: 1px;"><?php _e('All WP Cron requests will be logged. Please check this if you have any issues with scheduling, delayed postings, reposter, etc..', 'social-networks-auto-poster-facebook-twitter-g') ?> </span></div> 
  636.  
  637. <div class="itemDiv"> 
  638. <strong>Log/History Info Level</strong><select name="extDebug" id="extDebug"> 
  639. <option <?php if (!empty($options['extDebug']) && $options['extDebug']=='2') echo "selected" ?> value ="2">Minimal</option> 
  640. <option <?php if (empty($options['extDebug'])) echo "selected" ?> value="0">Normal</option>  
  641. <option <?php if (!empty($options['extDebug']) && $options['extDebug']=='1') echo "selected" ?> value ="1">Extended/Debug</option> 
  642. </select> <br/> 
  643.  
  644. <?php _e('Minimal', 'social-networks-auto-poster-facebook-twitter-g') ?> - <span style="font-size: 11px; margin-left: 1px;"><?php _e('Only important action info will be added to the log. "Debug", "Skipped", informational info will be ignored.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  645. <?php _e('Normal', 'social-networks-auto-poster-facebook-twitter-g') ?> - <span style="font-size: 11px; margin-left: 1px;"><?php _e('All info except extended debug queryies will be added to the log.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  646. <?php _e('Extended/Debug', 'social-networks-auto-poster-facebook-twitter-g') ?> - <span style="font-size: 11px; margin-left: 1px;"><?php _e('Advanced Setting. Extended debug Info will be added to the log.', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  647. </div> 
  648.  
  649. <div class="itemDiv"> 
  650. <input value="set" id="errNotifEmailCB" name="errNotifEmailCB" type="checkbox" <?php if (isset($options['errNotifEmailCB']) && (int)$options['errNotifEmailCB'] == 1) echo "checked"; ?> />  
  651. <strong>Send Email notification for errors</strong> 
  652. - <span style="font-size: 11px; margin-left: 1px;"><?php _e('Send Email notification for all autoposting errors. No more then one email per hour will be sent.', 'social-networks-auto-poster-facebook-twitter-g') ?></span>  
  653. <br/>  
  654. <div style="margin-left: 18px;"> 
  655. <b><?php _e('Email:', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <input name="errNotifEmail" style="width: 200px;" value="<?php if (isset($options['errNotifEmail'])) _e(apply_filters('format_to_edit', $options['errNotifEmail']), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  656. <span style="font-size: 11px; margin-left: 1px;"><?php _e('wp_mail will be used. Some email providers (gmail, hotmail) might have problems getting such mail', 'social-networks-auto-poster-facebook-twitter-g') ?> </span> <br/> 
  657. </div> 
  658. </div> 
  659.  
  660. <?php $cr = get_option('NXS_cronCheck'); if (!empty($cr) && is_array($cr) && isset($cr['status']) && $cr['status']=='0') { ?>  
  661. <div class="itemDiv">  
  662. <span style="color: red"> *** <?php _e('Your WP Cron is not working correctly.', 'social-networks-auto-poster-facebook-twitter-g'); ?> 
  663.  - <a target="_blank" href="<?php global $nxs_snapThisPageUrl; echo $nxs_snapThisPageUrl; ?>&do=crtest">WP Cron Test Results</a></span> <br/> 
  664.  
  665. <input value="set" id="forceBrokenCron" name="forceBrokenCron" type="checkbox" <?php if (isset($options['forceBrokenCron']) && (int)$options['forceBrokenCron'] == 1) echo "checked"; ?> />  
  666. <strong>Enable Cron functions even if WP Cron is not working correctly.</strong> 
  667. <br/><span style="color:red; font-weight: bold;"><?php _e('I understand that this could cause duplicate postings as well as perfomance and stability problems.', 'social-networks-auto-poster-facebook-twitter-g') ?></span> -  
  668. <span style="margin-left: 1px; color:red;"><?php _e('Please do not check this unless you absolutely sure that you know what are you doing.', 'social-networks-auto-poster-facebook-twitter-g') ?></span> 
  669. <br/><span style="margin-left: 1px; color:#005800;"><?php _e('Setting up WP Cron correctly will be much better solution:', 'social-networks-auto-poster-facebook-twitter-g') ?> 
  670. <a href="http://www.nextscripts.com/tutorials/wp-cron-scheduling-tasks-in-wordpress/" target="_blank">WP-Cron: Scheduling Tasks in WordPress</a> 
  671. </span> 
  672.  
  673.  
  674.  
  675. </div>  
  676. <?php } ?>  
  677.  
  678. </div></div>  
  679.  
  680.  
  681.  
  682. <?php if (function_exists("nxs_showPRXTab")) { ?>  
  683. <h3 style="font-size: 14px; margin-bottom: 2px;">Show "Proxies" Tab</h3>  
  684. <p style="margin: 0px;margin-left: 5px;"><input value="set" id="showPrxTab" name="showPrxTab" type="checkbox" <?php if ((int)$options['showPrxTab'] == 1) echo "checked"; ?> />  
  685. <strong>Show "Proxies" Tab</strong> <span style="font-size: 11px; margin-left: 1px;">Advanced Setting. Check to enable "Proxies" tab where you can setup autoposting proxies.</span>  
  686. </p>  
  687. <?php } ?>  
  688.  
  689. <div class="submitX"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" /></div>  
  690. </form> 
  691. </div> 
  692.  
  693. <?php if ((function_exists("nxs_showPRXTab")) && (int)$options['showPrxTab'] == 1) { nxs_showPRXTab($options); } ?> 
  694. <div id="nsx_tab3" class="nsx_tab_content">  
  695. <div style="width:760px;"> 
  696. <a href="#" style="float: right" onclick="nxs_rfLog();return false;" class="NXSButton" id="nxs_clearLog">Refresh</a> 
  697.  
  698. Showing last 150 records <a href="#" onclick="nxs_clLog();return false;" class="NXSButton" id="nxs_clearLog">Clear Log</a><br/><br/>  
  699. <div style="overflow: auto; border: 1px solid #999; width: 920px; height: 600px; font-size: 11px;" class="logDiv" id="nxslogDiv"> 
  700. <?php //$logInfo = maybe_unserialize(get_option('NS_SNAutoPosterLog'));  
  701. $logInfo = nxs_getnxsLog(); 
  702. if (is_array($logInfo))  
  703. foreach (array_reverse($logInfo) as $logline) {  
  704. if ($logline['type']=='E') $actSt = "color:#FF0000;"; elseif ($logline['type']=='M') $actSt = "color:#585858;"; elseif ($logline['type']=='BG') $actSt = "color:#008000; font-weight:bold;"; 
  705. elseif ($logline['type']=='I') $actSt = "color:#0000FF;"; elseif ($logline['type']=='W') $actSt = "color:#DB7224;"; elseif ($logline['type']=='BI') $actSt = "color:#0000FF; font-weight:bold;";  
  706. elseif ($logline['type']=='GR') $actSt = "color:#008080;"; elseif ($logline['type']=='S') $actSt = "color:#005800; font-weight:bold;"; else $actSt = "color:#585858;";  
  707. if ($logline['type']=='E') $msgSt = "color:#FF0000;"; elseif ($logline['type']=='BG') $msgSt = "color:#008000; font-weight:bold;"; else $msgSt = "color:#585858;";  
  708. if ($logline['nt']!='') $ntInfo = ' ['.$logline['nt'].'] '; else $ntInfo = '';  
  709. echo '<snap style="color:#008000">['.$logline['date'].']</snap> - <snap style="'.$actSt.'">['.$logline['act'].']</snap>'.$ntInfo.'- <snap style="'.$msgSt.'">'.$logline['msg'].'</snap> '.$logline['extInfo'].'<br/>';  
  710. } ?> 
  711. </div>  
  712. <?php $quPosts = maybe_unserialize(get_option('NSX_PostsQuery')); if (!is_array($quPosts)) $quPosts = array(); if (count($quPosts)>0) { ?> 
  713. <br/>Query:<br/> 
  714. <div style="overflow: auto; border: 1px solid #999; width: 920px; height: 200px; font-size: 11px;" class="logDiv" id="nxsQUDiv"> 
  715. <?php  
  716. $pstEvrySec = $options['quDays']*86400+$options['quHrs']*3600+$options['quMins']*60; $offSet = ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); $currTime = time() + $offSet; 
  717. if (count($quPosts)>0) { $nxTime = (isset($options['quNxTime']) && (int)$options['quNxTime']>0)?$options['quNxTime']:($currTime+$pstEvrySec);  
  718. echo "<snap style='color:#008000;'>Current Time:</snap> ".date_i18n('Y-m-d H:i', $currTime)." | <snap style='color:#000080;'>Next Shedulled Time:</snap> ~".date_i18n('Y-m-d H:i', $nxTime)." | <snap style='color:#580058;'>Last Post made from query:</snap> ".date_i18n('Y-m-d H:i', $options['quLastShTime'])."<br/>----====== Query:<br/>"; 
  719. foreach ($quPosts as $spostID) { $pst = get_post($spostID); echo $spostID." - ".$pst->post_title."<br/>";} 
  720.  
  721.  
  722. ?> 
  723. </div> 
  724. <?php } ?> 
  725.  
  726. </div>  
  727. </div> 
  728.  
  729. <div id="nsx_tab4" class="nsx_tab_content">  
  730.  
  731. <div style="max-width:1000px;">  
  732.  
  733. <h3> Setup/Installation/Configuration Instructions </h3> 
  734.  
  735. <?php nxs_memCheck(); ?><br/> 
  736.  
  737. <table style="max-width:1000px"><tr><td valign="top" width="250"> 
  738.  
  739. <div style="margin:0 25px 0 0; line-height: 24px;">  
  740.  
  741. <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/application_form.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/installation-of-social-networks-auto-poster-for-wordpress/">Plugin Setup/Installation</a> 
  742. <br/> 
  743.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/facebook.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-facebook-social-networks-auto-poster-wordpress/"> Facebook </a> 
  744. <br/> 
  745.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/twitter.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-twitter-social-networks-auto-poster-wordpress/"> Twitter </a> 
  746. <br/> 
  747.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/googleplus.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-google-plus-social-networks-auto-poster-wordpress/"> Google+ </a> 
  748. <br> 
  749.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/pinterest.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-pinterest-social-networks-auto-poster-wordpress/"> Pinterest</a> 
  750. <br> 
  751.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/tumblr.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-tumblr-social-networks-auto-poster-wordpress/"> Tumblr </a> 
  752. <br> 
  753.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/linkedin.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-linkedin-social-networks-auto-poster-wordpress/"> LinkedIn </a> 
  754. <br> 
  755.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/blogger.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-blogger-social-networks-auto-poster-wordpress/"> Blogger </a> 
  756. <br> 
  757.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/delicious.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-delicious-social-networks-auto-poster-wordpress/"> Delicious </a> 
  758. <br> 
  759.     <a style="background-image:url(<?php echo $nxs_plurl; ?>img/led/blogcom.png) !important;" class="nxs_icon16" target="_parent" href="http://www.nextscripts.com/setup-installation-wp-based-social-networks-auto-poster-wordpress/"> Wordpress.com/Blog.com</a> 
  760. <br/><br/> 
  761. <a style="font-weight: normal; font-size: 16px; line-height: 24px;" target="_blank" href="http://www.nextscripts.com/faq">FAQ</a><br/> 
  762. <a style="font-weight: normal; font-size: 16px; line-height: 24px;" target="_blank" href="http://www.nextscripts.com/troubleshooting-social-networks-auto-poster">Troubleshooting FAQ</a> 
  763.  
  764. </div> 
  765.  
  766. </td> 
  767. <td valign="top" style="font-size: 14px;"> 
  768. <h3 style="margin-top: 0px;">Have questions/suggestions?</h3> 
  769. <a style="font-weight: normal; font-size: 18px; line-height: 24px;" target="_blank" href="http://www.nextscripts.com/contact-us">===> Contact us <===</a> <br/> 
  770. <h3 style="margin-top: 20px;">Have troubles/problems/found a bug?</h3> 
  771. <a style="font-weight: normal; font-size: 18px; line-height: 24px;" target="_blank" href="http://www.nextscripts.com/support">===> Open support ticket <===</a> 
  772.  
  773.  
  774. <h3 style="margin-top: 30px;">Like the Plugin? Would you like to support developers?</h3> 
  775. <div style="line-height: 24px;"> 
  776. <b>Here is what you can do:</b><br/> 
  777. <?php if(function_exists('doPostToGooglePlus')) { ?><s><?php } ?><img src="<?php echo $nxs_plurl; ?>img/snap-icon12.png"/> Get the <a href="http://www.nextscripts.com/social-networks-auto-poster-for-wp-multiple-accounts/#getit">"Pro" Edition</a>. You will be able to add several accounts for each network as well as post to Google+, Pinterest and LinkedIn company pages.<?php if(function_exists('doPostToGooglePlus')) { ?></s> <i>Done! Thank you!</i><?php } ?><br/> 
  778. <img src="<?php echo $nxs_plurl; ?>img/snap-icon12.png"/> Rate the plugin 5 stars at <a href="http://wordpress.org/extend/plugins/social-networks-auto-poster-facebook-twitter-g/">wordpress.org page</a>.<br/> 
  779. <img src="<?php echo $nxs_plurl; ?>img/snap-icon12.png"/> <a href="<?php echo nxs_get_admin_url(); ?>post-new.php">Write a blogpost</a> about the plugin and don't forget to auto-post this blogpost to all your social networks ;-).<br/> 
  780. </div> 
  781. </td></tr></table> 
  782.  
  783. <br/><br/> 
  784. <h3>Solutions for the most common problems: <a style="font-weight: normal; font-size: 16px; line-height: 24px;" target="_blank" href="http://www.nextscripts.com/troubleshooting-social-networks-auto-poster">Troubleshooting FAQ</a> </h3> 
  785.  
  786.  
  787. </div> </div>  
  788.  
  789. <div id="nsx_tab5" class="nsx_tab_content"><?php nxs_showNewPostForm($options); ?> </div> 
  790. </div>  
  791. <div class="popShAtt" id="popShAttRPST1"><div class="nxs_tls_sbInfo2"><?php _e('Set random delays around your interval time, to make your posts appear more human', 'social-networks-auto-poster-facebook-twitter-g'); ?></div></div> 
  792. <form method="post" enctype="multipart/form-data" id="nsStFormUpl" action="<?php echo $nxs_snapThisPageUrl?>"> 
  793. <input type="file" accept="text/plain" onchange="jQuery('#nsStFormUpl').submit();" id="impFileSettings_button" name="impFileSettings_button" style="display: block; visibility: hidden; width: 1px; height: 0;" size="chars"> 
  794. <input type="hidden" value="1" name="upload_NS_SNAutoPoster_settings" /> <input value="'" type="hidden" name="nxs_mqTest" /> <?php wp_nonce_field( 'nxsChkUpl', 'nxsChkUpl_wpnonce' ); ?>  
  795. </form> 
  796. <br/> <br/> <?php 
  797. function showSNAutoPosterOptionsPagex() { global $nxs_snapAvNts, $nxs_snapThisPageUrl, $nxsOne, $nxs_plurl, $nxs_isWPMU; $nxsOne = ''; $options = $this->nxs_options; ?>  
  798. <br/><br/><br/>This version of the plugin is not compatible with <b>Wordpress Multisite Edition</b>. Please contact your Network Admin for the upgrade. <?php } 
  799.  
  800. function NS_SNAP_ShowPageTop() { global $nxs_snapAvNts, $nxs_snapThisPageUrl, $nxsOne, $nxs_plurl, $nxs_isWPMU, $nxs_skipSSLCheck; $nxsOne = ''; $cstIt=0; $options = $this->nxs_options;  
  801.  
  802. if ($_GET['page']=='NextScripts_SNAP.php' && isset($_GET['do']) && $_GET['do']=='h') { nxs_do_this_hourly(); die(); } 
  803. if ($_GET['page']=='NextScripts_SNAP.php' && isset($_GET['do']) && $_GET['do']=='q') { nxs_do_post_from_query(); die(); }  
  804. if (function_exists('nxs_doSMAS5')) { $rf = new ReflectionFunction('nxs_doSMAS5'); $cstIt++; $rff = $rf->getFileName(); } 
  805. $nxsOne = NextScripts_SNAP_Version; if (defined('NXSAPIVER')) $nxsOne .= " (<span id='nxsAPIUpd'>API</span> Version: ".NXSAPIVER.")"; ?> 
  806. <div style="float:right; padding-top: 10px; padding-right: 10px;"> 
  807. <div style="float:right; text-align: center;"><a target="_blank" href="http://www.nextscripts.com"><img src="<?php echo $nxs_plurl; ?>img/Next_Scripts_Logo2.1-HOR-100px.png"></a><br/> 
  808. <a style="font-weight: normal; font-size: 16px; line-height: 24px;" target="_blank" href="http://www.nextscripts.com/support">[<?php _e('Contact support', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a>  
  809. <?php if(!$options['isMA']) { ?><br/> <span style="color:#800000;"><?php _e('Ready to to Upgrade to Multiple Accounts Edition<br/> and get Google+ and Pinterest Auto-Posting?', 'social-networks-auto-poster-facebook-twitter-g'); ?></span> 
  810. <?php if(function_exists('nxsDoLic_ajax')) { ?> <br/><a style="font-weight: normal; font-size: 12px; line-height: 24px;" target="_blank" id="showLic" href="#">[<?php _e('Enter your Activation Key', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a>     <?php } ?> 
  811. <a target="_blank" href="http://www.nextscripts.com/social-networks-auto-poster-for-wp-multiple-accounts#getit">[<?php _e('Get It here', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> <?php } ?> 
  812. </div> 
  813. <div id="showLicForm"><span class="nxspButton bClose"><span>X</span></span><div style="position: absolute; right: 10px; top:10px; font-size: 34px; font-weight: lighter;"><?php _e('Activation', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 
  814. <br/><br/> 
  815. <h3><?php _e('Multiple Accounts Edition and Google+ and Pinterest Auto-Posting', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><br/><?php _e('You can find your key on this page', 'social-networks-auto-poster-facebook-twitter-g'); ?>: <a href="http://www.nextscripts.com/mypage">http://www.nextscripts.com/mypage</a> 
  816. <br/><br/> <?php _e('Enter your Key', 'social-networks-auto-poster-facebook-twitter-g'); ?>: <input name="eLic" id="eLic" style="width: 50%;"/> 
  817. <input type="button" class="button-primary" name="eLicDo" onclick="doLic();" value="Enter" /> 
  818. <br/><br/><?php _e('Your plugin will be automatically upgraded', 'social-networks-auto-poster-facebook-twitter-g'); ?>. <?php wp_nonce_field( 'doLic', 'doLic_wpnonce' ); ?> 
  819. </div>  
  820. </div>  
  821.  
  822.  
  823. <div class=wrap><h2><?php _e('Next Scripts: Social Networks Auto Poster Options', 'social-networks-auto-poster-facebook-twitter-g'); ?></h2> <?php _e('Plugin Version', 'social-networks-auto-poster-facebook-twitter-g'); ?>: <span style="color:#008000;font-weight: bold;"><?php echo $nxsOne; ?></span> <?php if($options['isMA']) { ?> [Pro - Multiple Accounts Edition]  <?php } else {?> 
  824. <span style="color:#800000; font-weight: bold;">[Single Accounts Edition]</span> 
  825. <?php if(!$nxs_isWPMU) { ?> 
  826. - <a target="_blank" href="http://www.nextscripts.com/social-networks-auto-poster-for-wp-multiple-accounts"><?php _e('Get', 'social-networks-auto-poster-facebook-twitter-g'); ?> PRO - Multiple Accounts Edition</a><br/><br/> 
  827.  
  828. <?php _e('Here you can setup "Social Networks Auto Poster".', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> <?php _e('You can start by clicking "Add new account" button and choosing the Social Network you would like to add.', 'social-networks-auto-poster-facebook-twitter-g'); ?><?php }} ?><br/>  
  829. <?php $disabled_functions = @ini_get('disable_functions'); 
  830. if (!function_exists('curl_init')) {  
  831. echo ("<br/><b style='font-size:16px; color:red;'>Error: No CURL Found</b> - <i style='font-size:12px; color:red;'>Social Networks AutoPoster needs the CURL PHP extension. Please install it or contact your hosting company to install it.</i><br/><br/>");  
  832. if (stripos($disabled_functions, 'curl_exec')!==false) {  
  833. echo ("<br/><b style='font-size:16px; color:red;'>curl_exec function is disabled in php.ini</b> - <i style='font-size:12px; color:red;'>Social Networks AutoPoster needs the CURL PHP extension. Please enable it or contact your hosting company to enable it.</i><br/><br/>");  
  834. if (!empty($rff) && stripos($rff, "'d code")===false) { $options[chr(75).$cstIt] = $cstIt; update_option($this->dbOptionsName, $options); $this->nxs_options = $options; }  
  835. if (!isset($options['skipSSLSec'])) { $err = nxsCheckSSLCurl('https://www.google.com');  
  836. if ($err!==false && $err['errNo']=='60') { $nxs_skipSSLCheck = true; $options['skipSSLSec'] = true; } else { $nxs_skipSSLCheck = false; $options['skipSSLSec'] = false; }  
  837. update_option($this->dbOptionsName, $options); $this->nxs_options = $options; 
  838.  
  839. /** 
  840. if ((defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE==true) || (defined('MULTISITE') && MULTISITE==true) ) {  
  841. echo "<br/><br/><br/><b style=\"font-size:16px; color:red;\">Sorry, we do not support Multiuser Wordpress at this time</b>"; return;  
  842. */ 
  843. ?> 
  844.  
  845. <?php if (function_exists('yoast_analytics')) { $plgnsLink = nxs_get_admin_url().'/plugins.php' ?> 
  846. <div class="error" id="message"><p><strong><?php _e('You have Google Analytics Plugin installed and activated.', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> <?php _e('This plugin hijacks the authorization workflow.', 'social-networks-auto-poster-facebook-twitter-g'); ?>  
  847. <?php printf( __( 'Please temporary <a href="%s">deactivate</a> Google Analytics plugin, do all authorizations and then activate it back.', 'social-networks-auto-poster-facebook-twitter-g' ), $plgnsLink ); ?></div> 
  848. <?php }  
  849.  
  850. function NS_SNAP_SavePostMetaTags($id) { global $nxs_snapAvNts, $plgn_NS_SNAutoPoster;  
  851. if (!empty($_POST['nxs_snapPostOptions'])) { $NXS_POSTX = $_POST['nxs_snapPostOptions']; $NXS_POST = array(); $NXS_POST = NXS_parseQueryStr($NXS_POSTX); } else $NXS_POST = $_POST; 
  852. if (count($NXS_POST)<1 || !isset($NXS_POST["snapEdIT"]) || empty($NXS_POST["snapEdIT"])) return;  
  853. if (get_magic_quotes_gpc() || (!empty($_POST['nxs_mqTest']) && $_POST['nxs_mqTest']=="\'")) { array_walk_recursive($NXS_POST, 'nsx_stripSlashes'); } array_walk_recursive($NXS_POST, 'nsx_fixSlashes');  
  854. if (!isset($plgn_NS_SNAutoPoster)) return; $options = $plgn_NS_SNAutoPoster->nxs_options; // echo "| NS_SNAP_SavePostMetaTags - ".$id." |"; 
  855. $post = get_post($id); if ($post->post_type=='revision' && $post->post_status=='inherit' && $post->post_parent!='0') return; // prr($NXS_POST);  
  856. if (empty($NXS_POST["useSURL"])) $NXS_POST["useSURL"] = '2'; delete_post_meta($id, '_snap_forceSURL'); add_post_meta($id, '_snap_forceSURL', $NXS_POST["useSURL"]);  
  857. delete_post_meta($id, 'snap_MYURL'); add_post_meta($id, 'snap_MYURL', $NXS_POST["urlToUse"]); delete_post_meta($id, 'snapEdIT'); add_post_meta($id, 'snapEdIT', '1' );  
  858. $snap_isAutoPosted = get_post_meta($id, 'snap_isAutoPosted', true); if ($snap_isAutoPosted=='1' && $post->post_status=='future') { delete_post_meta($id, 'snap_isAutoPosted'); add_post_meta($id, 'snap_isAutoPosted', '2'); } 
  859. foreach ($nxs_snapAvNts as $avNt) { // echo "--------------------------------------------"; prr($avNt);  
  860. if (isset($options[$avNt['lcode']]) && count($options[$avNt['lcode']])>0 && isset($NXS_POST[$avNt['lcode']]) && count($NXS_POST[$avNt['lcode']])>0) { $savedMeta = maybe_unserialize(get_post_meta($id, 'snap'.$avNt['code'], true));  
  861. if(is_array($NXS_POST[$avNt['lcode']])) { $ii=0; 
  862. foreach ($NXS_POST[$avNt['lcode']] as $pst ) { // echo "###########"; prr($pst); 
  863. if (is_array($pst) && empty( $pst['do'.$avNt['code']]) && empty($NXS_POST[$avNt['lcode']][$ii]['do'.$avNt['code']])) $NXS_POST[$avNt['lcode']][$ii]['do'.$avNt['code']] = 0; $ii++; 
  864. } $newMeta = $NXS_POST[$avNt['lcode']];  
  865. if (is_array($savedMeta) && is_array($newMeta)) $newMeta = nxsMergeArraysOV($savedMeta, $newMeta); // echo "#####~~~~~~~~~ ".$id."| snap".$avNt['code']; prr($savedMeta); echo "||"; prr($newMeta);// $newMeta = 'AAA'; 
  866. delete_post_meta($id, 'snap'.$avNt['code']); add_post_meta($id, 'snap'.$avNt['code'], str_replace('\\', '\\\\', serialize($newMeta)));  
  867. } // die(); 
  868. // prr($_POST); 
  869.  
  870. function NS_SNAP_AddPostMetaTags() { global $post, $nxs_snapAvNts, $plgn_NS_SNAutoPoster; $post_id = $post; if (is_object($post_id)) $post_id = $post_id->ID;  
  871. if (!is_object($post) || empty($post->post_status)) $post = get_post($post_id); 
  872. if (!isset($plgn_NS_SNAutoPoster)) return; $options = $plgn_NS_SNAutoPoster->nxs_options;  
  873. ?> 
  874. <style type="text/css">div#popShAtt {display: none; position: absolute; width: 600px; padding: 10px; background: #eeeeee; color: #000000; border: 1px solid #1a1a1a; font-size: 90%; } 
  875. .underdash {border-bottom: 1px #21759B dashed; text-decoration:none;} 
  876. .underdash a:hover {border-bottom: 1px #21759B dashed} 
  877. </style> 
  878.  
  879. <div id="NXS_MetaFields" class="NXSpostbox"> <input value="'" type="hidden" name="nxs_mqTest" /> <input value="" type="hidden" id="nxs_snapPostOptions" name="nxs_snapPostOptions" /> 
  880. <div id="NXS_MetaFieldsIN" class="NXSpostbox"> 
  881. <?php /** ################## WHAT URL to USE */ ###################### ?> 
  882. <div style="text-align: left; font-size: 14px; " class="showURL"> 
  883. <div class="inside" style="border: 1px #E0E0E0 solid; padding: 5px;"><div id="postftfp"> 
  884. <b>URL to use for links, attachments and %MYURL%: </b> <a href="#" onclick="nxs_doResetPostSettings('<?php echo $post_id; ?>'); return false;" style="float:right;">Reset all SNAP data</a> 
  885. <input type="checkbox" class="isAutoURL" <?php $forceSURL = get_post_meta($post_id, '_snap_forceSURL', true);  
  886. if (empty($forceSURL) && !empty($options['forceSURL']) || $forceSURL=='1') { ?>checked="checked"<?php } ?> id="useSURL" name="useSURL" value="1"/> <?php _e('Shorten URL', 'social-networks-auto-poster-facebook-twitter-g'); ?> 
  887.      
  888. <input type="checkbox" class="isAutoURL" <?php $urlToUse = get_post_meta($post_id, 'snap_MYURL', true);  
  889. if ($urlToUse=='') { ?>checked="checked"<?php } ?> id="isAutoURL-" name="isAutoURL" value="A"/> <?php _e('Auto', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post URL will be used', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> 
  890.  
  891. <div class="nxs_prevURLDiv" <?php if (trim($urlToUse)=='') { ?> style="display:none;"<?php } ?> id="isAutoURLFld-"> 
  892.    <?php _e('URL:', 'social-networks-auto-poster-facebook-twitter-g') ?> <input size="90" type="text" name="urlToUse" value="<?php echo $urlToUse ?>" id="URLToUse" />  
  893. </div> 
  894. </div></div></div> 
  895.  
  896.  
  897. <div id="NXS_MetaFieldsBox" class="postbox">  
  898. <div class="inside"><div id="postftfp">  
  899.  
  900.  
  901. <input value="1" type="hidden" name="snapEdIT" />  
  902. <div class="popShAtt" style="width: 200px;" id="popShAttSV"><?php _e('If you made any changes to the format, please "Update" the post before reposting', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 
  903. <?php if($post->post_status != "publish" ) { ?> 
  904. <div style="float: right;"> <input type="hidden" id="nxsLockIt" value="0" />  
  905. <a href="#" onclick="jQuery('#nxsLockIt').val('1'); jQuery('.nxsGrpDoChb').attr('checked', 'checked'); return false;"><?php _e('Check All', 'social-networks-auto-poster-facebook-twitter-g'); ?></a> <a href="#" onclick="jQuery('#nxsLockIt').val('1');jQuery('.nxsGrpDoChb').removeAttr('checked'); return false;"><?php _e('Uncheck All', 'social-networks-auto-poster-facebook-twitter-g'); ?></a> 
  906. </div> 
  907. <?php } ?> 
  908.  
  909. <table style="margin-bottom:40px; clear:both;" width="100%" border="0"><?php 
  910. foreach ($nxs_snapAvNts as $avNt) { $clName = 'nxs_snapClass'.$avNt['code'];  
  911. if ( isset($avNt['lcode']) && isset($options[$avNt['lcode']]) && count($options[$avNt['lcode']])>0) { $ntClInst = new $clName(); $ntClInst->showEdPostNTSettings($options[$avNt['lcode']], $post); } 
  912. ?></table> 
  913.  
  914. <div id="showSetTime" style="display: none;background-color: #fff; width: 350px; padding: 25px;"><span class="nxspButton bClose"><span>X</span></span> 
  915.  
  916. Set Time: (Current Time: <?php echo date_i18n('Y-m-d H:i'); ?> ) <div id="nxs_timestampdiv" class="hide-if-js" style="display: block;"><div class="timestamp-wrap"><select id="nxs_mm" name="nxs_mm"> 
  917. <option value="1" <?php if (date_i18n('n')=='1') echo 'selected="selected"' ?>>01-Jan</option> <option value="2" <?php if (date_i18n('n')=='2') echo 'selected="selected"' ?>>02-Feb</option>  
  918. <option value="3" <?php if (date_i18n('n')=='3') echo 'selected="selected"' ?>>03-Mar</option> <option value="4" <?php if (date_i18n('n')=='4') echo 'selected="selected"' ?>>04-Apr</option>  
  919. <option value="5" <?php if (date_i18n('n')=='5') echo 'selected="selected"' ?>>05-May</option> <option value="6" <?php if (date_i18n('n')=='6') echo 'selected="selected"' ?>>06-Jun</option>  
  920. <option value="7" <?php if (date_i18n('n')=='7') echo 'selected="selected"' ?>>07-Jul</option> <option value="8" <?php if (date_i18n('n')=='8') echo 'selected="selected"' ?>>08-Aug</option>  
  921. <option value="9" <?php if (date_i18n('n')=='9') echo 'selected="selected"' ?>>09-Sep</option> <option value="10" <?php if (date_i18n('n')=='10') echo 'selected="selected"' ?>>10-Oct</option> 
  922. <option value="11" <?php if (date_i18n('n')=='11') echo 'selected="selected"' ?>>11-Nov</option> <option value="12" <?php if (date_i18n('n')=='12') echo 'selected="selected"' ?>>12-Dec</option> </select> 
  923.  
  924. <input type="text" id="nxs_jj" name="nxs_jj" value="<?php echo date_i18n('d'); ?>" size="2" maxlength="2" autocomplete="off">, <input type="text" id="nxs_aa" name="nxs_aa" value="<?php echo date_i18n('Y'); ?>" size="4" maxlength="4" autocomplete="off"> @ <input type="text" id="nxs_hh" name="nxs_hh" value="<?php echo date_i18n('H'); ?>" size="2" maxlength="2" autocomplete="off"> : <input type="text" id="nxs_mn" name="nxs_mn" value="<?php echo date_i18n('i'); ?>" size="2" maxlength="2" autocomplete="off"></div><input type="hidden" id="nxs_ss" name="nxs_ss" value="58"> 
  925. <p> 
  926. <a href="#" class="button bClose" onclick="var tid = jQuery('#nxs_timeID').val(); var tmTxt = nxs_makeTimeTxt(); var d=new Date(tmTxt); var tm = d.getTime() / 1000; jQuery('#'+tid+'timeToRunTxt').html(tmTxt); jQuery('#'+tid+'timeToRun').val(tm); return false;">OK</a> 
  927. <a href="#" class="bClose">Cancel</a> 
  928. <input type="hidden" id="nxs_timeID" value="" /> 
  929. </p> 
  930. </div> 
  931.  
  932.  
  933. </div> 
  934.  
  935. </div></div></div> </div> </div> <?php  
  936. //## Add MetaBox to Post->Edit 
  937. function NS_SNAP_addCustomBoxes() { add_meta_box( 'NS_SNAP_AddPostMetaTags', __( 'NextScripts: Social Networks Auto Poster - Post Options', 'social-networks-auto-poster-facebook-twitter-g' ), array($this, 'NS_SNAP_AddPostMetaTags'), 'post' ); 
  938. global $plgn_NS_SNAutoPoster; if (!isset($plgn_NS_SNAutoPoster)) return; $options = $plgn_NS_SNAutoPoster->nxs_options;  
  939.  
  940. if (!empty($options['useForPages']) && $options['useForPages']=='1') add_meta_box( 'NS_SNAP_AddPostMetaTags', __( 'NextScripts: Social Networks Auto Poster - Post Options', 'social-networks-auto-poster-facebook-twitter-g' ), array($this, 'NS_SNAP_AddPostMetaTags'), 'page' ); 
  941.  
  942. $args=array('public'=>true, '_builtin'=>false); $output = 'names'; $operator = 'and'; $post_types = array(); if (function_exists('get_post_types')) $post_types=get_post_types($args, $output, $operator);  
  943. if ((isset($options['nxsCPTSeld'])) && $options['nxsCPTSeld']!='') $nxsCPTSeld = unserialize($options['nxsCPTSeld']); else $nxsCPTSeld = array_keys($post_types); // prr($nxsCPTSeld); prr($post_types); 
  944. foreach ($post_types as $cptID=>$cptName) if (in_array($cptID, $nxsCPTSeld)) {  
  945. add_meta_box( 'NS_SNAP_AddPostMetaTags', __('NextScripts: Social Networks Auto Poster - Post Options', 'social-networks-auto-poster-facebook-twitter-g'), array($this, 'NS_SNAP_AddPostMetaTags'), $cptID ); 
  946. }