Changeset 2757212
- Timestamp:
- 07/16/2022 01:23:13 AM (4 years ago)
- Location:
- social-networks-auto-poster-facebook-twitter-g/trunk
- Files:
-
- 5 deleted
- 54 edited
-
NextScripts_SNAP.php (modified) (2 diffs)
-
inc-cl/apis/liOAuth.php (deleted)
-
inc-cl/apis/plurkOAuth.php (modified) (3 diffs)
-
inc-cl/apis/scOAuth.php (modified) (5 diffs)
-
inc-cl/apis/tmhOAuth.php (deleted)
-
inc-cl/apis/tmhUtilities.php (deleted)
-
inc-cl/apis/trOAuth.php (modified) (1 diff)
-
inc-cl/apis/xmlrpc-client.php (modified) (4 diffs)
-
inc-cl/bg.php (modified) (5 diffs)
-
inc-cl/di.php (modified) (1 diff)
-
inc-cl/fb.api.php (modified) (2 diffs)
-
inc-cl/fb.php (modified) (15 diffs)
-
inc-cl/fl.php (modified) (4 diffs)
-
inc-cl/fp.php (modified) (1 diff)
-
inc-cl/gmb.php (modified) (6 diffs)
-
inc-cl/gp.api.php (deleted)
-
inc-cl/gp.php (deleted)
-
inc-cl/ig.api.php (modified) (1 diff)
-
inc-cl/ig.php (modified) (2 diffs)
-
inc-cl/li.api.php (modified) (1 diff)
-
inc-cl/li.php (modified) (18 diffs)
-
inc-cl/lj.php (modified) (1 diff)
-
inc-cl/ln.php (modified) (3 diffs)
-
inc-cl/mc.php (modified) (1 diff)
-
inc-cl/md.php (modified) (4 diffs)
-
inc-cl/ok.php (modified) (4 diffs)
-
inc-cl/pk.php (modified) (2 diffs)
-
inc-cl/pn.php (modified) (6 diffs)
-
inc-cl/rd.php (modified) (5 diffs)
-
inc-cl/sc.php (modified) (8 diffs)
-
inc-cl/st.php (modified) (1 diff)
-
inc-cl/tg.php (modified) (3 diffs)
-
inc-cl/tr.api.php (modified) (1 diff)
-
inc-cl/tr.php (modified) (8 diffs)
-
inc-cl/tw.api.php (modified) (2 diffs)
-
inc-cl/tw.php (modified) (6 diffs)
-
inc-cl/vb.php (modified) (2 diffs)
-
inc-cl/vk.api.php (modified) (2 diffs)
-
inc-cl/vk.php (modified) (4 diffs)
-
inc-cl/wb.php (modified) (6 diffs)
-
inc-cl/wl.php (modified) (9 diffs)
-
inc-cl/wp.api.php (modified) (1 diff)
-
inc-cl/wp.php (modified) (2 diffs)
-
inc-cl/xi.php (modified) (18 diffs)
-
inc-cl/yo.api.php (modified) (1 diff)
-
inc-cl/yo.php (modified) (1 diff)
-
inc-cl/yt.php (modified) (1 diff)
-
inc/nxs_class_flt.php (modified) (6 diffs)
-
inc/nxs_class_http.php (modified) (3 diffs)
-
inc/nxs_class_mgmt.php (modified) (11 diffs)
-
inc/nxs_class_ntlist.php (modified) (22 diffs)
-
inc/nxs_class_oauth.php (modified) (5 diffs)
-
inc/nxs_class_snap.php (modified) (9 diffs)
-
inc/nxs_functions.php (modified) (1 diff)
-
inc/nxs_functions_adv.php (modified) (8 diffs)
-
inc/nxs_functions_engine.php (modified) (5 diffs)
-
inc/nxs_functions_wp.php (modified) (7 diffs)
-
js-css/js.js (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
social-networks-auto-poster-facebook-twitter-g/trunk/NextScripts_SNAP.php
r2749165 r2757212 5 5 Description: This plugin automatically publishes posts from your blog to your social media accounts on Twitter, FB, Telegram, LinkedIn, and 25 more networks. 6 6 Author: NextScripts 7 Version: 4.3.2 67 Version: 4.3.27 8 8 Author URI: https://www.nextscripts.com 9 9 Text Domain: social-networks-auto-poster-facebook-twitter-g … … 11 11 */ 12 12 13 define( 'NextScripts_SNAP_Version' , '4.3.2 6' ); define( 'NextScripts_SNAP_Version_Date' , 'June 28, 2022' ); require_once "inc/nxs_functions_wp.php"; if(!defined( 'NXSSNAP_BASENAME' ) ) define( 'NXSSNAP_BASENAME', plugin_basename( __FILE__ ) );13 define( 'NextScripts_SNAP_Version' , '4.3.27' ); define( 'NextScripts_SNAP_Version_Date' , 'July 15, 2022' ); require_once "inc/nxs_functions_wp.php"; if(!defined( 'NXSSNAP_BASENAME' ) ) define( 'NXSSNAP_BASENAME', plugin_basename( __FILE__ ) ); 14 14 15 15 if (true===nxs_doSystemInitCheck()) { // error_reporting(E_ALL); ini_set('display_errors', '1'); -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/apis/plurkOAuth.php
r1905522 r2757212 26 26 public function sign($request, $consumer_secret, $token) { 27 27 $key_raw = $this->signing_base($request, $consumer_secret, $token);// prr($key_raw); 28 $basestring = base64_encode (hash_hmac('sha1', $key_raw[1], $key_raw[0], true)); //echo $basestring;28 $basestring = base64_encode (hash_hmac('sha1', $key_raw[1], $key_raw[0], true)); 29 29 return rawurlencode($basestring); 30 30 } … … 149 149 $cbu = nxspk_SigMethod_HMAC_SHA1::urlencode_rfc3986($cbu); 150 150 $url = $this->baseURL.PLURK_REQUEST_TOKEN_PATH.'?oauth_nonce='.$args['oauth_nonce'].'&oauth_timestamp='.$args['oauth_timestamp'].'&oauth_consumer_key='.$this->consumer_key.'&oauth_signature_method='.$args['oauth_signature_method'].'&oauth_version='.$args['oauth_version'].'&oauth_callback='.$cbu.'&oauth_signature='.$args['oauth_signature']; 151 echo "<br/>REQ Token URL: ". $url."<br/>";151 echo "<br/>REQ Token URL: ".esc_url($url)."<br/>"; 152 152 $hdrsArr = $this->makeHTTPHeaders($url); $ckArr = $nxs_vbCkArray; 153 153 $response = nxs_remote_get($url, array( 'method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr, 'cookies' => $ckArr)); 154 154 if (is_nxs_error($response)){ $badOut = print_r($response, true)." - Connection ERROR"; return $badOut; } 155 155 $this->http_code = $response['response']['code']; // prr($response); 156 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'. $response['body']; else return $this->oAuthRespToArr($response['body']);156 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'.esc_html($response['body']); else return $this->oAuthRespToArr($response['body']); 157 157 } 158 158 function getAccToken($verifier){ … … 167 167 'oauth_signature_method' => 'HMAC-SHA1' 168 168 ); 169 $req = array(); $req['method'] = 'GET'; $req['normalized_url'] = $this->baseURL.PLURK_ACCESS_TOKEN_PATH; // echo "ARGS:"; prr($args);169 $req = array(); $req['method'] = 'GET'; $req['normalized_url'] = $this->baseURL.PLURK_ACCESS_TOKEN_PATH; 170 170 $req['normalized_parameters'] = $this->get_normalized_parameters($args); 171 171 $args['oauth_signature'] = $this->sign_method->sign2($req, $this->consumer_secret, $this->access_secret); 172 172 $url = $this->baseURL.PLURK_ACCESS_TOKEN_PATH.'?oauth_nonce='.$args['oauth_nonce'].'&oauth_timestamp='.$args['oauth_timestamp'].'&oauth_token_secret='.$this->access_secret.'&oauth_signature_method='.$args['oauth_signature_method'].'&oauth_consumer_key='.$this->consumer_key.'&oauth_verifier='.$verifier.'&oauth_version='.$args['oauth_version'].'&oauth_token='.$this->access_token.'&oauth_signature='.$args['oauth_signature']; 173 echo "<br/>REQ Token URL: ". $url."<br/>";173 echo "<br/>REQ Token URL: ".esc_url($url)."<br/>"; 174 174 $hdrsArr = $this->makeHTTPHeaders($url); $ckArr = array(); 175 175 $response = nxs_remote_get($url, array( 'method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr, 'cookies' => $ckArr)); 176 176 if ( is_nxs_error($response) ) return $response; 177 177 $this->http_code = $response['response']['code']; 178 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'. $response['body']; else return $this->oAuthRespToArr($response['body']);178 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'.esc_html($response['body']); else return $this->oAuthRespToArr($response['body']); 179 179 } 180 180 function makeReq($url, $params){ -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/apis/scOAuth.php
r1905522 r2757212 22 22 public function sign($request, $consumer_secret, $token) { 23 23 $key_raw = $this->signing_base($request, $consumer_secret, $token);// prr($key_raw); 24 $basestring = base64_encode (hash_hmac('sha1', $key_raw[1], $key_raw[0], true)); //echo $basestring;24 $basestring = base64_encode (hash_hmac('sha1', $key_raw[1], $key_raw[0], true)); 25 25 return rawurlencode($basestring); 26 26 } … … 147 147 $cbu = nxssc_SigMethod_HMAC_SHA1::urlencode_rfc3986($cbu); 148 148 $url = $this->baseURL.$this->request_token_path.'?oauth_nonce='.$args['oauth_nonce'].'&oauth_timestamp='.$args['oauth_timestamp'].'&oauth_consumer_key='.$this->consumer_key.'&oauth_signature_method='.$args['oauth_signature_method'].'&oauth_version='.$args['oauth_version'].'&oauth_callback='.$cbu.'&oauth_signature='.$args['oauth_signature']; 149 echo "<br/>REQ Token URL: ". $url."<br/>";149 echo "<br/>REQ Token URL: ".esc_url($url)."<br/>"; 150 150 $hdrsArr = $this->makeHTTPHeaders($url); $ckArr = ''; 151 151 $response = nxs_remote_get($url, array( 'method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr, 'cookies' => $ckArr)); 152 152 if ( is_nxs_error($response) ) return print_r($response, true); 153 153 $this->http_code = $response['response']['code']; // prr($response); 154 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'. $response['body']; else return $this->oAuthRespToArr($response['body']);154 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'.esc_html($response['body']); else return $this->oAuthRespToArr($response['body']); 155 155 } 156 156 function getAccToken($verifier){ … … 165 165 'oauth_signature_method' => 'HMAC-SHA1' 166 166 ); 167 $req = array(); $req['method'] = 'GET'; $req['normalized_url'] = $this->baseURL.$this->access_token_path; // echo "ARGS:"; prr($args);167 $req = array(); $req['method'] = 'GET'; $req['normalized_url'] = $this->baseURL.$this->access_token_path; 168 168 $req['normalized_parameters'] = $this->get_normalized_parameters($args); 169 169 $args['oauth_signature'] = $this->sign_method->sign2($req, $this->consumer_secret, $this->access_secret); 170 170 $url = $this->baseURL.$this->access_token_path.'?oauth_nonce='.$args['oauth_nonce'].'&oauth_timestamp='.$args['oauth_timestamp'].'&oauth_token_secret='.$this->access_secret.'&oauth_signature_method='.$args['oauth_signature_method'].'&oauth_consumer_key='.$this->consumer_key.'&oauth_verifier='.$verifier.'&oauth_version='.$args['oauth_version'].'&oauth_token='.$this->access_token.'&oauth_signature='.$args['oauth_signature']; 171 echo "<br/>REQ Token URL: ". $url."<br/>";171 echo "<br/>REQ Token URL: ".esc_url($url)."<br/>"; 172 172 $hdrsArr = $this->makeHTTPHeaders($url); $ckArr = ''; 173 173 $response = nxs_remote_get($url, array( 'method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr, 'cookies' => $ckArr)); 174 174 if ( is_nxs_error($response) ) return $response; 175 175 $this->http_code = $response['response']['code']; 176 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'. $response['body']; else return $this->oAuthRespToArr($response['body']);176 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'.esc_html($response['body']); else return $this->oAuthRespToArr($response['body']); 177 177 } 178 178 … … 218 218 $parameters['oauth_signature'] = base64_encode(hash_hmac('sha1', $string, $this->consumer_secret.'&'.$this->access_secret, true)); 219 219 } 220 private function httpRequest($url, $parameters) { $curl = curl_init(); 221 curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($curl, CURLOPT_TIMEOUT, '25'); curl_setopt($curl, CURLOPT_URL, $url); 222 curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); 223 $response = curl_exec($curl); $headers = curl_getinfo($curl); $errmsg = curl_error($curl); curl_close($curl); 224 if (!empty($errmsg)) return $errmsg; else return $response; 225 } 226 227 public function flUploadPhoto ($imgFile, $parameters) { $url = 'https://www.flickr.com/services/upload/'; $requestParams = ($parameters == NULL ? array() : $parameters); $phid = ''; 220 221 public function flUploadPhoto ($imgFile, $parameters) { $url = 'https://www.flickr.com/services/upload/'; $requestParams = ($parameters == NULL ? array() : $parameters); $phid = ''; 228 222 $oauthParams = array ( 229 223 'oauth_nonce' => $this->genRndString(), … … 234 228 'oauth_version' => '1.0', 235 229 ); 236 $requestParams = array_merge($requestParams, $oauthParams); $this->sign($url, $requestParams); $requestParams['photo'] = $imgFile; // prr($requestParams); 237 $xml = $this->httpRequest($url, $requestParams); if (stripos($xml, '</photoid>')!==false && stripos($xml, 'stat="ok"')!==false) $phid = CutFromTo($xml, '<photoid>','</photoid>'); 230 $requestParams = array_merge($requestParams, $oauthParams); $this->sign($url, $requestParams); $requestParams['photo'] = $imgFile; 231 $rq = new nxsHttp; $args = nxs_mkRmReqArgs(); $rq->postData = $requestParams; $xml = $rq->request($url, $args); 232 if (stripos($xml, '</photoid>')!==false && stripos($xml, 'stat="ok"')!==false) $phid = CutFromTo($xml, '<photoid>','</photoid>'); 238 233 return empty($phid) ? "Problem: ".$xml."<pre>".print_r($requestParams, true)."</pre>" : $phid; 239 234 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/apis/trOAuth.php
r1905522 r2757212 172 172 * Format and sign an OAuth / API request 173 173 */ 174 function oAuthRequest($url, $method, $parameters) { 174 function oAuthRequest($url, $method, $parameters) { $rq = new nxsHttp; 175 175 if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) { 176 176 $url = "{$this->host}{$url}"; 177 177 } 178 178 $request = nsx_trOAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters); 179 $request->sign_request($this->sha1_method, $this->consumer, $this->token); 180 switch ($method) { 181 case 'GET': 182 return $this->http($request->to_url(), 'GET'); 183 default: 184 return $this->http($request->get_normalized_http_url(), $method, $request->to_postdata()); 185 } 186 } 187 188 /** 189 * Make an HTTP request 190 * 191 * @return API results 192 */ 193 function http($url, $method, $postfields = NULL) { $ref = ''; 194 $this->http_info = array(); 195 if ($method=='DELETE') $ci = curl_init(); else $ci = curl_init($url); 196 197 $headers = array(); 198 $headers[] = 'Connection: keep-alive'; 199 $headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.34 Safari/536.11'; 200 $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'; 201 $headers[] = 'Accept-Encoding: gzip,deflate,sdch'; 202 $headers[] = 'Accept-Language: en-US,en;q=0.8'; 203 $headers[] = 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3'; 204 205 $options = array( 206 CURLOPT_RETURNTRANSFER => true, // return web page 207 CURLOPT_HEADER => false, // don't return headers 208 // CURLOPT_FOLLOWLOCATION => true, // follow redirects 209 CURLOPT_ENCODING => "", // handle all encodings 210 CURLOPT_USERAGENT => "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E; .NET CLR 1.1.4322)", 211 CURLOPT_AUTOREFERER => true, // set referer on redirect 212 CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect 213 CURLOPT_TIMEOUT => 120, // timeout on response 214 // CURLOPT_MAXREDIRS => $redirs, // stop after 10 redirects 215 CURLOPT_REFERER => $ref, // stop after 10 redirects 216 CURLINFO_HEADER_OUT => true 217 ); 218 curl_setopt_array($ci, $options); 219 220 curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout); 221 curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout); 222 curl_setopt($ci, CURLOPT_HTTPHEADER, $headers); 223 curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer); 224 // curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader')); 225 226 227 switch ($method) { 228 case 'POST': 229 curl_setopt($ci, CURLOPT_POST, TRUE); 230 if (!empty($postfields)) { 231 curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); 232 } 233 break; 234 case 'DELETE': 235 curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE'); 236 if (!empty($postfields)) { 237 $url = "{$url}?{$postfields}"; 238 } 239 } 240 //prr($url); 241 if ($method=='DELETE') curl_setopt($ci, CURLOPT_URL, $url); 242 243 global $nxs_skipSSLCheck; if ($nxs_skipSSLCheck===true) curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false); 244 245 $response = curl_exec($ci); $out = array(); 246 247 /* 248 $err = curl_errno($ci); if ($err==28){ sleep(10); $tm = true; $response = curl_exec($ci); } // echo "##".$err; $errmsg = curl_error($ci); $out['errno'] = $err; $out['errmsg'] = $errmsg; prr($out); 249 $err = curl_errno($ci); if ($err>0){ $errmsg = curl_error($ci); $out['errno'] = $err; $out['errmsg'] = $errmsg; curl_close($ci); return $out; } 250 */ 251 //$err = curl_errno($ci); $errmsg = curl_error($ci); $header = curl_getinfo($ci); $header['errno'] = $err; $header['errmsg'] = $errmsg; $header['content'] = $response; prr($header); //die(); 252 253 $err = curl_errno($ci); if ($err>0){ $errmsg = curl_error($ci); $out['errno'] = $err; $out['errmsg'] = $errmsg.". Tumblr API is down. Please try later."; $this->http_code = '404'; curl_close($ci); return json_encode($out); } 254 255 $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE); 256 $this->http_info = array_merge($this->http_info, curl_getinfo($ci)); 257 $this->url = $url; //prr($this); 258 curl_close ($ci); // prr($response); 259 return $response; 179 $request->sign_request($this->sha1_method, $this->consumer, $this->token); 180 if ($method=='POST') $argArr['flds'] = $request->to_postdata(); 181 $url = $method=='GET'?$request->to_url():$request->get_normalized_http_url(); //prr($url); 182 $args = nxs_mkRmReqArgs($argArr); $ret = $rq->request($url, $args); 183 $this->http_code = $ret['response']['code']; 184 $this->http_info = $ret['response']; 185 $this->url = $url; 186 return $ret['body']; 260 187 } 261 188 -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/apis/xmlrpc-client.php
r2144651 r2757212 515 515 * @since 0.1.0 516 516 */ 517 517 518 function query() 518 519 { … … 527 528 } 528 529 529 //This is where we deviate from the normal query() 530 //Rather than open a normal sock, we will actually use the cURL 531 //extensions to make the calls, and handle the SSL stuff. 532 533 //Since 04Aug2004 (0.1.3) - Need to include the port (duh...) 534 //Since 06Oct2004 (0.1.4) - Need to include the colon!!! 535 // (I swear I've fixed this before... ESP in live... But anyhu...) 536 $curl=curl_init($this->scheme.'://' . $this->server . ':' . $this->port . $this->path); 537 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 538 539 curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.44 Safari/537.36"); 540 541 //Since 23Jun2004 (0.1.2) - Made timeout a class field 542 curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout); 543 544 if ($this->debug) { 545 curl_setopt($curl, CURLOPT_VERBOSE, 1); 546 } 547 548 549 curl_setopt($curl, CURLOPT_HEADER, 1); 550 curl_setopt($curl, CURLOPT_POST, 1); 551 curl_setopt($curl, CURLOPT_POSTFIELDS, $xml); 552 curl_setopt($curl, CURLOPT_PORT, $this->port); 553 //curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml","Content-length: {$length}")); 554 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml")); 555 556 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); 557 global $nxs_skipSSLCheck; if ($nxs_skipSSLCheck===true) curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 558 559 // Call cURL to do it's stuff and return us the content 560 $contents = curl_exec($curl); $err = curl_errno($curl); $errmsg = curl_error($curl); 561 curl_close($curl); 530 $rq = new nxsHttp2; 531 $url = 'https://' . $this->server . ':' . $this->port . $this->path; 532 $argArr['flds'] = $xml; $argArr['extraHeaders']['Content-Type'] = 'text/xml'; 533 $args = nxs_mkRmReqArgs($argArr); $ret = $rq->request($url, $args); 534 $contents = is_array($ret)?$ret['body']:''; $err = $ret['response']['code']; 562 535 563 536 // Check for 200 Code in $contents 564 if ( !strstr($contents, '200')) {537 if ($err!='200') { 565 538 //There was no "200 OK" returned - we failed 566 $this->error = new NXS_XMLRPC_Error(-32300, 'transport error - HTTP status code was not 200 - '.$err.' - '.$errmsg.'| '.print_r($contents, true));539 $this->error = new NXS_XMLRPC_Error(-32300, 'transport error - HTTP status code was not 200 - '.$err.' - | '.print_r($contents, true)); 567 540 return false; 568 541 } … … 895 868 * @since 0.1.0 896 869 */ 870 897 871 function query() 898 872 { … … 907 881 } 908 882 909 //This is where we deviate from the normal query() 910 //Rather than open a normal sock, we will actually use the cURL 911 //extensions to make the calls, and handle the SSL stuff. 912 913 //Since 04Aug2004 (0.1.3) - Need to include the port (duh...) 914 //Since 06Oct2004 (0.1.4) - Need to include the colon!!! 915 // (I swear I've fixed this before... ESP in live... But anyhu...) 916 $curl=curl_init('https://' . $this->server . ':' . $this->port . $this->path); 917 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 918 919 //Since 23Jun2004 (0.1.2) - Made timeout a class field 920 curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout); 921 922 if ($this->debug) { 923 curl_setopt($curl, CURLOPT_VERBOSE, 1); 924 } 925 926 curl_setopt($curl, CURLOPT_HEADER, 1); 927 curl_setopt($curl, CURLOPT_POST, 1); 928 curl_setopt($curl, CURLOPT_POSTFIELDS, $xml); 929 curl_setopt($curl, CURLOPT_PORT, $this->port); 930 //curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml","Content-length: {$length}")); 931 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml")); 932 933 // Process the SSL certificates, etc. to use 934 if (!($this->_certFile === false)) { 935 // We have a certificate file set, so add these to the cURL handler 936 curl_setopt($curl, CURLOPT_SSLCERT, $this->_certFile); 937 curl_setopt($curl, CURLOPT_SSLKEY, $this->_keyFile); 938 939 if ($this->debug) { 940 echo "SSL Cert at : " . $this->_certFile . "\n"; 941 echo "SSL Key at : " . $this->_keyFile . "\n"; 942 } 943 944 // See if we need to give a passphrase 945 if (!($this->_passphrase === '')) { 946 curl_setopt($curl, CURLOPT_SSLCERTPASSWD, $this->_passphrase); 947 } 948 949 if ($this->_caFile === false) { 950 // Don't verify their certificate, as we don't have a CA to verify against 951 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); 952 } else { 953 // Verify against a CA 954 curl_setopt($curl, CURLOPT_CAINFO, $this->_caFile); 955 } 956 } 957 global $nxs_skipSSLCheck; if ($nxs_skipSSLCheck===true) curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 958 // Call cURL to do it's stuff and return us the content 959 $contents = curl_exec($curl); $err = curl_errno($curl); $errmsg = curl_error($curl); 960 curl_close($curl); 883 884 $rq = new nxsHttp; $url = 'https://' . $this->server . ':' . $this->port . $this->path; 885 $argArr['flds'] = $xml; $argArr['extraHeaders']['Content-Type'] = 'text/xml'; 886 $args = nxs_mkRmReqArgs($argArr); $ret = $rq->request($url, $args); 887 $contents = is_array($ret)?$ret['body']:''; $err = $ret['response']['code']; 961 888 962 889 // Check for 200 Code in $contents 963 if ( !strstr($contents, '200')) {890 if ($err!=='200') { 964 891 //There was no "200 OK" returned - we failed 965 $this->error = new NXS_XMLRPC_Error(-32300, 'transport error - HTTP status code was not 200! - '.$err.' - '.$errmsg.' | '.print_r($contents, true));892 $this->error = new NXS_XMLRPC_Error(-32300, 'transport error - HTTP status code was not 200! - '.$err.' - | '.print_r($ret, true)); 966 893 return false; 967 894 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/bg.php
r2650607 r2757212 25 25 function checkIfSetupFinished($options) { return !empty($options['accessToken']) || !empty($options['uPass']); } 26 26 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 27 if ( isset($_GET['code']) && $_GET['code']!='' && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-bg-'){ $at = $_GET['code']; $ii = str_replace('nxs-bg-','',$_GET['state']);27 if ( isset($_GET['code']) && $_GET['code']!='' && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-bg-'){ $at = sanitize_text_field($_GET['code']); $ii = str_replace('nxs-bg-','',sanitize_text_field($_GET['state'])); 28 28 echo "----=={ oAuth 2.0 Wordflow }==----<br/>-= This is normal technical authorization info that will dissapear (Unless you get some errors) =- <br/><br/><br/>"; 29 29 $gGet = $_GET; unset($gGet['code']); unset($gGet['state']); unset($gGet['scope']); unset($gGet['post_type']); unset($gGet['post']); //prr($nxs_snapSetPgURL); … … 54 54 55 55 function accTab($ii, $options, $isNew=false){ global $nxs_snapSetPgURL; $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; if (empty($options['sid'])) $options['sid']=''; if (empty($options['ssid'])) $options['ssid']=''; if (empty($options['nid'])) $options['nid']=''; if (empty($options['hsid'])) $options['hsid']='';?> 56 <div style="width:100%;"><strong><?php _e('Blogger Blog ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Log to your Blogger management panel and look at the URL of your blog: http://www.blogger.com/blogger.g?blogID=8959085979163812093#allposts. Your Blog ID will be: 8959085979163812093', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][blogID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['blogID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>56 <div style="width:100%;"><strong><?php _e('Blogger Blog ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Log to your Blogger management panel and look at the URL of your blog: http://www.blogger.com/blogger.g?blogID=8959085979163812093#allposts. Your Blog ID will be: 8959085979163812093', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][blogID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['blogID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 57 57 <div style="display: <?php echo (empty($options['apiToUse']))?"block":"none"; ?>;"> 58 58 <div style="width:100%; text-align: center; color:#005800; font-weight: bold; font-size: 14px;">You can choose what API you would like to use. </div> … … 60 60 <span style="color:#005800; font-weight: bold; font-size: 14px;">NextScripts API for Blogger:</span> Premium API with extended functionality. Easier to configure, but less secure - requires your password.<br/><br/> 61 61 62 <select name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiToUse]" onchange="if (jQuery(this).val()=='<?php echo $nt; ?>') { jQuery('.nxs_<?php echo $nt; ?>_nxapi_<?php echo $ii; ?>').hide(); jQuery('.nxs_<?php echo $nt; ?>_bgapi_<?php echo $ii; ?>').show(); }else { jQuery('.nxs_<?php echo $nt; ?>_bgapi_<?php echo $ii; ?>').hide(); jQuery('.nxs_<?php echo $nt; ?>_nxapi_<?php echo $ii; ?>').show(); }"><option <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='bg')?"selected":""; ?> value="bg">Blogger API</option><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"selected":""; ?> value="nx">NextScripts API</option></select><hr/>62 <select name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiToUse]" onchange="if (jQuery(this).val()=='<?php echo esc_attr($nt); ?>') { jQuery('.nxs_<?php echo esc_attr($nt); ?>_nxapi_<?php echo esc_attr($ii); ?>').hide(); jQuery('.nxs_<?php echo esc_attr($nt); ?>_bgapi_<?php echo esc_attr($ii); ?>').show(); }else { jQuery('.nxs_<?php echo esc_attr($nt); ?>_bgapi_<?php echo esc_attr($ii); ?>').hide(); jQuery('.nxs_<?php echo esc_attr($nt); ?>_nxapi_<?php echo esc_attr($ii); ?>').show(); }"><option <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='bg')?"selected":""; ?> value="bg">Blogger API</option><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"selected":""; ?> value="nx">NextScripts API</option></select><hr/> 63 63 64 64 </div> 65 65 66 <div id="nxsAPIBG<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_bgapi_<?php echo $ii; ?>" style="display: <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='bg')?"block":"none"; ?>;"><h3>Blogger API</h3>67 <div class="subDiv" id="sub<?php echo $ii; ?>DivL" style="display: block;"> <?php $this->elemKeySecret($ii,'Client ID','Client Secret', $options['appKey'], $options['appSec'],'appKey','appSec','https://console.developers.google.com/'); ?>66 <div id="nxsAPIBG<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_bgapi_<?php echo esc_attr($ii); ?>" style="display: <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='bg')?"block":"none"; ?>;"><h3>Blogger API</h3> 67 <div class="subDiv" id="sub<?php echo esc_attr($ii); ?>DivL" style="display: block;"> <?php $this->elemKeySecret($ii,'Client ID','Client Secret', $options['appKey'], $options['appSec'],'appKey','appSec','https://console.developers.google.com/'); ?> 68 68 <br/><br/> 69 69 <?php if($options['appKey']=='') { ?> … … 77 77 </div> 78 78 </div> 79 <div id="nxsAPINX<?php echo $ii; ?>" class="nxs_bg_nxapi_<?php echo $ii; ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;"><h3>NextScripts API</h3>79 <div id="nxsAPINX<?php echo esc_attr($ii); ?>" class="nxs_bg_nxapi_<?php echo esc_attr($ii); ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;"><h3>NextScripts API</h3> 80 80 <?php if (class_exists('nxsAPI_GP')) { ?> 81 <div class="subDiv" id="sub<?php echo $ii; ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div>81 <div class="subDiv" id="sub<?php echo esc_attr($ii); ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div> 82 82 83 83 84 <div id="ups<?php echo $nt.$ii; ?>UPS" style="padding-top: 10px;"><a href="#" onclick="jQuery('#ups<?php echo $nt.$ii; ?>S').show();return false;">Use session</a> (Optional - use only if you are having login problems)</div>85 <div id="ups<?php echo $nt.$ii; ?>S" class="ups<?php echo $nt.$ii; ?>" style="padding-left: 15px; padding-top: 10px; display:none;">86 SID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][sid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['sid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>87 SSID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][ssid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ssid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>88 HSID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][hsid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['hsid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>84 <div id="ups<?php echo esc_attr($nt.$ii); ?>UPS" style="padding-top: 10px;"><a href="#" onclick="jQuery('#ups<?php echo esc_attr($nt.$ii); ?>S').show();return false;">Use session</a> (Optional - use only if you are having login problems)</div> 85 <div id="ups<?php echo esc_attr($nt.$ii); ?>S" class="ups<?php echo esc_attr($nt.$ii); ?>" style="padding-left: 15px; padding-top: 10px; display:none;"> 86 SID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][sid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['sid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 87 SSID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][ssid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ssid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 88 HSID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][hsid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['hsid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 89 89 </div> 90 90 … … 94 94 95 95 <br/><?php $this->elemTitleFormat($ii,'Message Title Format','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?> 96 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>97 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclCatsAsTags]" <?php if ((int)$options['inclCatsAsTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Add Categories as tags/labels', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>96 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 97 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclCatsAsTags]" <?php if ((int)$options['inclCatsAsTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Add Categories as tags/labels', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 98 98 99 99 <?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/di.php
r1905522 r2757212 23 23 function accTab($ii, $options, $isNew=false){ $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; ?><div id="altFormat" style=""> 24 24 <div style="width:100%;"><strong id="altFormatText">Diigo API Key:</strong> <span style="font-size: 11px; margin: 0px;">Get it from <a target="_blank" href="http://www.diigo.com/api_keys/">http://www.diigo.com/api_keys</a>.</span></div> 25 <input name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiKey]" style="width: 60%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['apiKey'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>25 <input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiKey]" style="width: 60%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['apiKey'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 26 26 </div><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); $this->elemTitleFormat($ii,'Message Title Format','msgTFormat',$options['msgTFormat']); 27 27 $this->elemMsgFormat($ii,'Message Text Format','msgFormat',$options['msgFormat']);?><br/ > 28 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> />28 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> 29 29 <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> <?php _e('Tags from the blogpost will be included', 'social-networks-auto-poster-facebook-twitter-g'); ?> 30 30 </div> <?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/fb.api.php
r2609158 r2757212 22 22 $options['tpt'] = ''; $options['uMsg'] = ''; 23 23 if (empty($options['tpt']) && !empty($options['uPass'])) { //echo "<br/>.........NO TPT PASS......."; 24 if (!class_exists('nxsAPI_FB')) { $badOut['Error'] = 'Premium FacebookAPI Library not found'; return $badOut; }24 if (!class_exists('nxsAPI_FB')) { $badOut['Error'] = 'Premium API Library not found'; return $badOut; } 25 25 $email = $options['uName']; $pass = (substr($options['uPass'], 0, 5)=='n5g9a' || substr($options['uPass'], 0, 5)=='g9c1a')?nsx_doDecode(substr($options['uPass'], 5)):$options['uPass']; 26 26 $opVal = array(); $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$email.$pass); $opVal = nxs_getOption($opNm); if (!empty($opVal) & is_array($opVal)) $options = array_merge($options, $opVal); … … 39 39 $t = $nt->checkToken($options['tpt'], $options['uInfo']['tknUrl']); //echo "<br/>.....checking token...."; 40 40 if (!empty($t)) { $options['accessToken'] = $t; $options = nxs_snapClassFB::getPageToken($options); 41 42 41 if (function_exists('user_can')) { $isItUserWhoCan = (!user_can($postUser, 'manage_options' ) && user_can($postUser, 'haveown_snap_accss')); global $nxs_SNAP; 43 42 if ($isItUserWhoCan) $networks = $nxs_SNAP->nxs_acctsU; else $networks = $nxs_SNAP->nxs_accts; -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/fb.php
r2375508 r2757212 38 38 public function makeUName($options, $ii) { return !empty($options['pgName'])?$options['pgName']: $this->ntInfo['name'].' #'.$ii; } 39 39 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 40 if ( !empty($_GET['code']) && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-fb-'){ $this->showAuthTop(); echo "--== Auth ==--"; $at = $_GET['code']; $ii = str_replace('nxs-fb-','',$_GET['state']); $gGet = array();41 if (!empty($_SERVER['QUERY_STRING'])) parse_str($_SERVER['QUERY_STRING'], $gGet); elseif (!empty($_SERVER['argv'][0])) parse_str($_SERVER['argv'][0], $gGet); else { $gGet = $_GET; prr($_GET); unset($gGet['post_type']);} prr($gGet);unset($gGet['code']); unset($gGet['state']); prr($gGet);40 if ( !empty($_GET['code']) && isset($_GET['state']) && substr($_GET['state'], 0, 7) == 'nxs-fb-'){ $this->showAuthTop(); echo "--== Auth ==--"; $at = sanitize_text_field($_GET['code']); $ii = str_replace('nxs-fb-','',$_GET['state']); $gGet = array(); 41 if (!empty($_SERVER['QUERY_STRING'])) parse_str($_SERVER['QUERY_STRING'], $gGet); elseif (!empty($_SERVER['argv'][0])) parse_str($_SERVER['argv'][0], $gGet); else { $gGet = $_GET; unset($gGet['post_type']);} unset($gGet['code']); unset($gGet['state']); prr($gGet); 42 42 $sturl = explode('?',$nxs_snapSetPgURL); $nxs_snapSetPgURL = $sturl[0].((!empty($gGet))?'?'.http_build_query($gGet):''); $fbo = $this->nt[$ii]; $advSet = nxs_mkRemOptsArr(nxs_getNXSHeaders()); prr($fbo); $fbo['uMsg'] = ''; 43 43 $tknURL = 'https://graph.facebook.com/oauth/access_token?client_id='.nxs_gak($fbo['appKey']).'&state=nxs-fb-'.$ii.'&redirect_uri='.urlencode($nxs_snapSetPgURL).'&client_secret='.nxs_gas($fbo['appSec']).'&code='.$at; $response = nxs_remote_get($tknURL, $advSet); echo "<br/>TKN URL: "; prr($tknURL); … … 119 119 } 120 120 121 function getListOfPagesNX(){ $opVal = array(); $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = $_POST['ii'];121 function getListOfPagesNX(){ $opVal = array(); $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); 122 122 global $nxs_SNAP; $networks = (!current_user_can( 'manage_options' ) && current_user_can( 'haveown_snap_accss' ) ) ? $nxs_SNAP->nxs_acctsU : $nxs_SNAP->nxs_accts; $options = $networks['fb'][$ii]; 123 123 if ($options['apiToUse'] =='nxv2') return $this->getListOfPages($networks); … … 139 139 $opVal['pageList'] = $pgs; array_walk_recursive($opVal,'nxs_uarr_string'); nxs_saveOption($opNm, $opVal); return $opVal; 140 140 } 141 function getListOfPages($networks){ $opVal = array(); $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; $pgs = '';141 function getListOfPages($networks){ $opVal = array(); $opNm = 'nxs_snap_fb_'.sha1('nxs_snap_fb'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $pgs = ''; 142 142 $currPstAs = !empty($_POST['pgID'])?$_POST['pgID']:(!empty($networks['fb'][$ii])?$networks['fb'][$ii]['pgID']:''); 143 143 if (empty($_POST['force']) && !empty($opVal['pageList']) ) $pgs = $opVal['pageList']; else { $options = $networks['fb'][$ii]; … … 205 205 function accTab($ii, $options, $isNew=false){ global $nxs_snapSetPgURL; $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; $ntU = strtoupper($nt); //prr($options); 206 206 if (!empty($options['appSec']) && !empty($options['appKey']) && $options['appKey']!=='x5g9a') $options['apiToUse'] = 'fbfb'; ?> 207 <?php if ( empty($options['apiToUse']) ) { ?><div >207 <?php if ( empty($options['apiToUse']) ) { ?><div style="display: none;"> 208 208 <div style="width:100%; text-align: center; color:#005800; font-weight: bold; font-size: 15px;">You can choose what API you would like to use. </div><br/> 209 209 <span style="color:#005800; font-weight: bold; font-size: 14px;">Native Facebook API:</span> Free official API from Facebook. Approved Facebook Apps can post to Facebook Pages<br/><span style="color:red;">Please note that Facebook closed an unrestricted access to its API on May 1st, 2018. All Facebook apps require review and approval from Facebook. <a href="https://nxs.fyi/fbe4" target="_blank">More info here</a>.</span> <br/><br/> 210 210 <span style="color:#005800; font-weight: bold; font-size: 14px;">NextScripts API for Facebook:</span> Premium API with extended functionality. Can post to Profiles, Pages and Groups.<br/><br/> 211 211 212 <span style="font-size: 14px;"><b>Please select what API to use:</b> </span><select name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?>').hide(); jQuery('.nxs_<?php echo $nt; ?>_api'+jQuery(this).val()+'div_<?php echo $ii; ?>').show(); ">212 <span style="font-size: 14px;"><b>Please select what API to use:</b> </span><select name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?>').hide(); jQuery('.nxs_<?php echo esc_attr($nt); ?>_api'+jQuery(this).val()+'div_<?php echo esc_attr($ii); ?>').show(); "> 213 213 <option <?php echo (empty($options['apiToUse']) || $options['apiToUse'] == 'fbfb')?"selected":""; ?> value="fbfb">Native Facebook API</option> 214 214 <option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] == 'nx')?"selected":""; ?> value="nx">NextScripts Premium API</option> … … 217 217 218 218 <?php if ( empty($options['apiToUse']) || $options['apiToUse'] =='nx' || $options['apiToUse'] =='nxv2') { //############# NXS API ?> 219 <div id="nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" style="display:<?php echo(!empty($options['apiToUse']) && ($options['apiToUse'] =='nx' || $options['apiToUse'] =='nxv2') )?"block":"none";?>;">219 <div id="nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" style="display:<?php echo(!empty($options['apiToUse']) && ($options['apiToUse'] =='nx' || $options['apiToUse'] =='nxv2') )?"block":"none";?>;"> 220 220 221 221 <h3>NextScripts API<span style="color: #800080; font-size: 13px;">(Beta)</span><span style="font-size: 13px;"> >> <a target="_blank" href="https://www.nextscripts.com/snap-nextscripts-api-for-facebook-configuration/">NextScripts API for Facebook Configuration Instructions</a></span></h3> 222 222 <?php if ( empty($options['apiToUse'])) { ?> 223 223 224 <div><center><input type="radio" checked="checked" name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiToUse2]" value="S" onchange="if (jQuery(this).val()=='S') { jQuery('#fbuName<?php echo $ii; ?>l').html('Facebook User ID (c_user)');jQuery('#fbuPass<?php echo $ii; ?>l').html('Session ID (xs)');}"><?php _e('Use Session', 'social-networks-auto-poster-facebook-twitter-g'); ?> <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiToUse2]" value="U" onchange="if (jQuery(this).val()=='U') { jQuery('#fbuName<?php echo $ii; ?>l').html('Facebook Username/Email ');jQuery('#fbuPass<?php echo $ii; ?>l').html('Password');}"><?php _e('Use username/password', 'social-networks-auto-poster-facebook-twitter-g'); ?></center></div>224 <div><center><input type="radio" checked="checked" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiToUse2]" value="S" onchange="if (jQuery(this).val()=='S') { jQuery('#fbuName<?php echo esc_attr($ii); ?>l').html('Facebook User ID (c_user)');jQuery('#fbuPass<?php echo esc_attr($ii); ?>l').html('Session ID (xs)');}"><?php _e('Use Session', 'social-networks-auto-poster-facebook-twitter-g'); ?> <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiToUse2]" value="U" onchange="if (jQuery(this).val()=='U') { jQuery('#fbuName<?php echo esc_attr($ii); ?>l').html('Facebook Username/Email ');jQuery('#fbuPass<?php echo esc_attr($ii); ?>l').html('Password');}"><?php _e('Use username/password', 'social-networks-auto-poster-facebook-twitter-g'); ?></center></div> 225 225 226 226 <?php } ?> … … 231 231 $_POST['u']=$options['uName']; $_POST['p']=$pass; $_POST['ii']=$ii; $ntw[$nt][$ii]=$options; $opVal = $this->getListOfPagesNX(); $_POST = $tPST; 232 232 } if (!empty($opVal) & !is_array($opVal)) $options['uMsg'] = $opVal; else { if (!empty($opVal) & is_array($opVal)) $options = array_merge($options, $opVal); } ?> 233 <div class="subDiv" id="sub<?php echo $ii; ?>DivN" style="display: block;"><?php if ( empty($options['apiToUse']) || $options['apiToUse'] =='nx') { $l1 = 'Facebook User ID (c_user)'; $l2 = 'Session ID (xs)'; } else {$l1 = 'Facebook Username/Email'; $l2 = 'Password';} $this->elemKeySecret($ii,$l1,$l2, $options['uName'], $pass,'uName','uPass'); //prr($options); ?>234 235 <a onclick="nxs_svSetAdv('<?php echo $nt; ?>', '<?php echo $ii; ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo $ii; ?>','<?php echo $isNew?'r':''; ?>','1'); nxs_setAllXS(jQuery(this)); return false;" id="<?php echo $nt.'-uPass-'.$ii; ?>BT" data-nid="<?php echo $nt.'-uPass-'.$ii; ?>" data-uid="uName" href="#">[Update All]</a>233 <div class="subDiv" id="sub<?php echo esc_attr($ii); ?>DivN" style="display: block;"><?php if ( empty($options['apiToUse']) || $options['apiToUse'] =='nx') { $l1 = 'Facebook User ID (c_user)'; $l2 = 'Session ID (xs)'; } else {$l1 = 'Facebook Username/Email'; $l2 = 'Password';} $this->elemKeySecret($ii,$l1,$l2, $options['uName'], $pass,'uName','uPass'); //prr($options); ?> 234 235 <a onclick="nxs_svSetAdv('<?php echo esc_attr($nt); ?>', '<?php echo esc_attr($ii); ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo esc_attr($ii); ?>','<?php echo $isNew?'r':''; ?>','1'); nxs_setAllXS(jQuery(this)); return false;" id="<?php echo $nt.'-uPass-'.$ii; ?>BT" data-nid="<?php echo $nt.'-uPass-'.$ii; ?>" data-uid="uName" href="#">[Update All]</a> 236 236 237 237 </div><br/> 238 238 239 239 <script type="text/javascript"> 240 jQuery('#fbuName<?php echo $ii; ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#fbuPass<?php echo $ii; ?>').val(); if( u!='' && p!='' ) { nxs_fb2GetPages(<?php echo $ii; ?>,u,p); } });241 jQuery('#fbuPass<?php echo $ii; ?>').change(function() { var u = jQuery('#fbuName<?php echo $ii; ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_fb2GetPages(<?php echo $ii; ?>,u,p); } });242 jQuery('.fbWhereToPost<?php echo $ii; ?>').change(function() { if (jQuery(this).val()!='P') jQuery('#fbPostType<?php echo $ii; ?>').show(); else jQuery('#fbPostType<?php echo $ii; ?>').hide(); });240 jQuery('#fbuName<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#fbuPass<?php echo esc_attr($ii); ?>').val(); if( u!='' && p!='' ) { nxs_fb2GetPages(<?php echo esc_attr($ii); ?>,u,p); } }); 241 jQuery('#fbuPass<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery('#fbuName<?php echo esc_attr($ii); ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_fb2GetPages(<?php echo esc_attr($ii); ?>,u,p); } }); 242 jQuery('.fbWhereToPost<?php echo esc_attr($ii); ?>').change(function() { if (jQuery(this).val()!='P') jQuery('#fbPostType<?php echo esc_attr($ii); ?>').show(); else jQuery('#fbPostType<?php echo esc_attr($ii); ?>').hide(); }); 243 243 </script> 244 244 <?php } else { nxs_show_noLibWrn('"NextScripts API Library for Facebook" is NOT installed'); } ?></div> … … 246 246 247 247 <?php if ( empty($options['apiToUse']) || $options['apiToUse'] =='fbfb') { //############# FBFB API ?> 248 <div id="nxs_<?php echo $nt; ?>_apifbfbdiv_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apifbfbdiv_<?php echo $ii; ?>" style="display: <?php echo ((!empty($options['appKey'])&& $options['appKey']!='x5g9a') || empty($options['apiToUse']) || $options['apiToUse'] =='fbfb')?"block":"none"; ?>;"> <h3>Facebook Native API</h3>248 <div id="nxs_<?php echo esc_attr($nt); ?>_apifbfbdiv_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apifbfbdiv_<?php echo esc_attr($ii); ?>" style="display: <?php echo ((!empty($options['appKey'])&& $options['appKey']!='x5g9a') || empty($options['apiToUse']) || $options['apiToUse'] =='fbfb')?"block":"none"; ?>;"> <h3>Facebook Native API</h3> 249 249 <?php if (!empty($options['tpt'])) { echo '<span style="color:red;">*************'; _e('Third Party Auth Token is used', 'social-networks-auto-poster-facebook-twitter-g'); echo '</span><br/><br/>'; } else { 250 250 $this->elemKeySecret($ii,'App ID','App Secret', $options['appKey'], $options['appSec'],'appKey','appSec','https://developers.facebook.com/apps/'); ?><br/><?php … … 254 254 <?php _e('Your Facebook Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['authUser'].(!empty($options['authUserName'])?" - ".$options['authUserName']:''), ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>.<?php } ?> 255 255 256 <br/> ⇒ <a href="#" onclick="var url = 'https://www.facebook.com/v7.0/dialog/oauth?client_id='+jQuery('#fbappKey<?php echo $ii; ?>').val()+'&scope=pages_manage_posts&state=nxs-fb-<?php echo $ii; ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo $nt; ?>', '<?php echo $ii; ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo $ii; ?>',url,'1'); return false;">Authorize Your Facebook Account</a> <?php if (!isset($options['authUser']) || $options['authUser']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div><br/><?php }?>256 <br/> ⇒ <a href="#" onclick="var url = 'https://www.facebook.com/v7.0/dialog/oauth?client_id='+jQuery('#fbappKey<?php echo esc_attr($ii); ?>').val()+'&scope=pages_manage_posts&state=nxs-fb-<?php echo esc_attr($ii); ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo esc_attr($nt); ?>', '<?php echo esc_attr($ii); ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo esc_attr($ii); ?>',url,'1'); return false;">Authorize Your Facebook Account</a> <?php if (!isset($options['authUser']) || $options['authUser']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div><br/><?php }?> 257 257 258 258 … … 278 278 ?><div style="display:<?php echo((!empty($options['apiToUse']) && ($options['apiToUse']=='nx' || $options['apiToUse']=='nxv2')) || (!empty($options['appKey'])&&!empty($options['accessToken'])) )?"block":"none";?>;"> 279 279 <br/ ><div style="width:100%; font-size: 14px;"><b><?php _e('Where to Post', 'nxs_snap'); ?></b>. <?php _e('Please select your profile/page/group', 'social-networks-auto-poster-facebook-twitter-g'); ?>.<span style="color:#580058; font-size: 12px;"> (<?php _e('Please see ', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <a href="http://nxs.fyi/fb-not-in-the-list" target="_blank"><?php _e('Why Page/Group is not in the list and how to add it', 'social-networks-auto-poster-facebook-twitter-g'); ?>)</a></span></div> 280 <div id="nxsFBInfoDiv<?php echo $ii; ?>">280 <div id="nxsFBInfoDiv<?php echo esc_attr($ii); ?>"> 281 281 <div style="width:100%;"> 282 282 <div> 283 <select id="fbpgID<?php echo $ii; ?>" onchange="nxs_fbPageChange('<?php echo $ii;?>',jQuery(this));" name="fb[<?php echo $ii;?>][pgID]">283 <select id="fbpgID<?php echo esc_attr($ii); ?>" onchange="nxs_fbPageChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="fb[<?php echo esc_attr($ii);?>][pgID]"> 284 284 <?php $pgi = !empty($options['pageList'])?$options['pageList']:''; 285 285 if (!empty($options['pgID'])) { echo (!empty($options['pgID']) && stripos($pgi,$options['pgID'])===false)?'<option selected="selected" value="'.$options['pgID'].'">'.$options['pgID'].'</option>':''; } … … 288 288 } echo $pgi; 289 289 ?><option value="a"><?php _e('.... Enter the Page ID'); ?></option> 290 </select> <div id="nxsFBInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;">291 <input type="text" name="fb[<?php echo $ii;?>][pgIDCst]" style="width:450px;display: none;" id="fbInpCst<?php echo $ii; ?>" value="<?php echo $options['pgID']; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="fbpgID<?php echo $ii; ?>" />292 <div style="display: inline-block;"><a onclick="<?php echo (!empty($options['apiToUse'])&&($options['apiToUse']=='nx' || $options['apiToUse']=='nxv2'))?'nxs_fb2GetPages('.$ii.',jQuery(\'#fbuName'.$ii.'\').val(),jQuery(\'#fbuPass'.$ii.'\').val(), 1);':'nxs_fbGetPages('.$ii.', 1);'; ?> jQuery(this).blur(); return false;" href="#"><img id="<?php echo $nt.$ii;?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo $nt.$ii;?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />290 </select> <div id="nxsFBInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> 291 <input type="text" name="fb[<?php echo esc_attr($ii);?>][pgIDCst]" style="width:450px;display: none;" id="fbInpCst<?php echo esc_attr($ii); ?>" value="<?php echo $options['pgID']; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="fbpgID<?php echo esc_attr($ii); ?>" /> 292 <div style="display: inline-block;"><a onclick="<?php echo (!empty($options['apiToUse'])&&($options['apiToUse']=='nx' || $options['apiToUse']=='nxv2'))?'nxs_fb2GetPages('.$ii.',jQuery(\'#fbuName'.$ii.'\').val(),jQuery(\'#fbuPass'.$ii.'\').val(), 1);':'nxs_fbGetPages('.$ii.', 1);'; ?> jQuery(this).blur(); return false;" href="#"><img id="<?php echo esc_attr($nt.$ii);?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo esc_attr($nt.$ii);?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 293 293 <?php if (empty($options['pgID'])) {?> <div style="display: inline-block;" class="blnkg"><=== <?php _e('Please select where to post', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div><?php } ?> 294 294 </div> 295 295 </div> 296 </div> <input type="hidden" id="fbAuthUser<?php echo $ii; ?>" value="<?php if(!empty($options['authUser'])) echo $options['authUser']; ?>"/> <br/></div>296 </div> <input type="hidden" id="fbAuthUser<?php echo esc_attr($ii); ?>" value="<?php if(!empty($options['authUser'])) echo $options['authUser']; ?>"/> <br/></div> 297 297 <?php 298 298 299 299 if ( empty($options['apiToUse']) && empty($options['appKey']) ) { ?> <div style="width:100%; font-size: 14px;"><b><?php _e('Where to Post', 'nxs_snap'); ?></b><br/><span style="color:#008000"> <?php _e('Please enter App ID, App Secret and Authorize Your Account or enter the Facebook User ID and Session ID to be able to choose where to post....', 'social-networks-auto-poster-facebook-twitter-g'); ?></span></div> 300 300 <?php } ?> 301 <div style="color:#BB2727;" id="nxsFBMsgDiv<?php echo $ii; ?>"><pre><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?></pre></div>301 <div style="color:#BB2727;" id="nxsFBMsgDiv<?php echo esc_attr($ii); ?>"><pre><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?></pre></div> 302 302 <?php 303 303 //######## END of where to post 304 $this->elemMsgFormat($ii,'Post Format','msgFormat',$options['msgFormat']); ?><div style="width:100%;"><strong style="font-size: 16px;" id="altFormatText">Post Type:</strong><-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo $ii; ?>X');" onmouseover="showPopShAtt('<?php echo $ii; ?>X', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div>304 $this->elemMsgFormat($ii,'Post Format','msgFormat',$options['msgFormat']); ?><div style="width:100%;"><strong style="font-size: 16px;" id="altFormatText">Post Type:</strong><-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo esc_attr($ii); ?>X');" onmouseover="showPopShAtt('<?php echo esc_attr($ii); ?>X', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div> 305 305 <div style="margin-left: 10px;"> 306 306 307 <input type="radio" name="fb[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> onchange="if (jQuery(this).is(':checked')) jQuery('.nxsDivFBPostTypeOpts<?php echo $ii; ?>').hide();"/> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>308 309 <input type="radio" name="fb[<?php echo $ii; ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> onchange="if (jQuery(this).is(':checked')) { jQuery('.nxsDivFBPostTypeOpts<?php echo $ii; ?>').hide(); jQuery('#nxsDivFBImgUplOpts<?php echo $ii; ?>').show();}"/> <?php _e('Image', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Upload image along with the text message. No automatic backlink to the original post.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>310 <div style="width:100%; margin-left: 15px;<?php if (empty($options['postType']) || $options['postType'] != 'I') echo "display:none;"; ?>" id="nxsDivFBImgUplOpts<?php echo $ii; ?>" class="nxsDivFBPostTypeOpts<?php echo $ii; ?>" ><strong><?php _e('Upload Images to', 'social-networks-auto-poster-facebook-twitter-g'); ?>: </strong>311 <input value="A" id="apFBImgUplAPP<?php echo $ii; ?>" type="radio" name="fb[<?php echo $ii; ?>][imgUpl]" <?php if ($options['imgUpl'] == 'A') echo "checked"; ?> /> <?php _e('App Album', 'social-networks-auto-poster-facebook-twitter-g'); ?>312 <input value="T" id="apFBImgUplTML<?php echo $ii; ?>" type="radio" name="fb[<?php echo $ii; ?>][imgUpl]" <?php if ($options['imgUpl'] != 'A') echo "checked"; ?> />313 <?php _e('Timeline', 'social-networks-auto-poster-facebook-twitter-g'); ?> <-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo $ii; ?>I');" onmouseover="showPopShAtt('<?php echo $ii; ?>I', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>)307 <input type="radio" name="fb[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> onchange="if (jQuery(this).is(':checked')) jQuery('.nxsDivFBPostTypeOpts<?php echo esc_attr($ii); ?>').hide();"/> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 308 309 <input type="radio" name="fb[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> onchange="if (jQuery(this).is(':checked')) { jQuery('.nxsDivFBPostTypeOpts<?php echo esc_attr($ii); ?>').hide(); jQuery('#nxsDivFBImgUplOpts<?php echo esc_attr($ii); ?>').show();}"/> <?php _e('Image', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Upload image along with the text message. No automatic backlink to the original post.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 310 <div style="width:100%; margin-left: 15px;<?php if (empty($options['postType']) || $options['postType'] != 'I') echo "display:none;"; ?>" id="nxsDivFBImgUplOpts<?php echo esc_attr($ii); ?>" class="nxsDivFBPostTypeOpts<?php echo esc_attr($ii); ?>" ><strong><?php _e('Upload Images to', 'social-networks-auto-poster-facebook-twitter-g'); ?>: </strong> 311 <input value="A" id="apFBImgUplAPP<?php echo esc_attr($ii); ?>" type="radio" name="fb[<?php echo esc_attr($ii); ?>][imgUpl]" <?php if ($options['imgUpl'] == 'A') echo "checked"; ?> /> <?php _e('App Album', 'social-networks-auto-poster-facebook-twitter-g'); ?> 312 <input value="T" id="apFBImgUplTML<?php echo esc_attr($ii); ?>" type="radio" name="fb[<?php echo esc_attr($ii); ?>][imgUpl]" <?php if ($options['imgUpl'] != 'A') echo "checked"; ?> /> 313 <?php _e('Timeline', 'social-networks-auto-poster-facebook-twitter-g'); ?> <-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo esc_attr($ii); ?>I');" onmouseover="showPopShAtt('<?php echo esc_attr($ii); ?>I', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) 314 314 </div> 315 315 316 <input type="radio" name="fb[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') echo 'checked="checked"'; ?> onchange="if (jQuery(this).is(':checked')) { jQuery('.nxsDivFBPostTypeOpts<?php echo $ii; ?>').hide(); jQuery('#nxsDivFBAttchLinkOpts<?php echo $ii; ?>').show();}" /> <?php _e('Shared Link', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Shared link along with the text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>317 318 <div id="nxsDivFBAttchLinkOpts<?php echo $ii; ?>" class="nxsDivFBPostTypeOpts<?php echo $ii; ?>" style="width:100%; margin-left: 15px; line-height: 22px;<?php if (!empty($options['postType']) && $options['postType'] != 'A') echo "display:none;"; ?>">316 <input type="radio" name="fb[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( !isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') echo 'checked="checked"'; ?> onchange="if (jQuery(this).is(':checked')) { jQuery('.nxsDivFBPostTypeOpts<?php echo esc_attr($ii); ?>').hide(); jQuery('#nxsDivFBAttchLinkOpts<?php echo esc_attr($ii); ?>').show();}" /> <?php _e('Shared Link', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Shared link along with the text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 317 318 <div id="nxsDivFBAttchLinkOpts<?php echo esc_attr($ii); ?>" class="nxsDivFBPostTypeOpts<?php echo esc_attr($ii); ?>" style="width:100%; margin-left: 15px; line-height: 22px;<?php if (!empty($options['postType']) && $options['postType'] != 'A') echo "display:none;"; ?>"> 319 319 <div style="font-style: italic;"><b><?php _e('Please note:', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> <?php _e('SNAP does not set or control image, title and description for shared links previews. Facebook sets that by itself, using your opengraph metatags.', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/><?php _e('Please see here for more info:', 'social-networks-auto-poster-facebook-twitter-g'); ?> <a href="http://nxs.fyi/fblp" target="_blank">Facebook Link Preview</a></div> 320 320 </div><br/></div> 321 321 322 <div class="popShAtt" style="z-index: 9999; width: 350px;" id="popShAtt<?php echo $ii; ?>I"><h3><?php _e('Where to upload Images', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3> <b><?php _e('(App Album)', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> <?php _e('Facebook automatically creates an album for your app. Images will be grouped there as in any regular album.', 'social-networks-auto-poster-facebook-twitter-g'); ?> <br/><br/><b><?php _e('(Timeline)', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> <?php _e('Images will be posted to the special "Wall/Timeline" album and won\'t be grouped. "Wall/Timeline" album must exist. It\'s created when first image posted to timeline manually.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div>323 <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo $ii; ?>"><h3><?php _e('Two ways of attaching post on Facebook', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/fb2wops.png" width="600" height="257" alt="<?php _e('Two ways of attaching post on Facebook', 'social-networks-auto-poster-facebook-twitter-g'); ?>"/></div>324 <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo $ii; ?>X"><h3><?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/fbPostTypesDiff6.png" width="600" height="398" alt="<?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?>"/></div>322 <div class="popShAtt" style="z-index: 9999; width: 350px;" id="popShAtt<?php echo esc_attr($ii); ?>I"><h3><?php _e('Where to upload Images', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3> <b><?php _e('(App Album)', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> <?php _e('Facebook automatically creates an album for your app. Images will be grouped there as in any regular album.', 'social-networks-auto-poster-facebook-twitter-g'); ?> <br/><br/><b><?php _e('(Timeline)', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> <?php _e('Images will be posted to the special "Wall/Timeline" album and won\'t be grouped. "Wall/Timeline" album must exist. It\'s created when first image posted to timeline manually.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 323 <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo esc_attr($ii); ?>"><h3><?php _e('Two ways of attaching post on Facebook', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/fb2wops.png" width="600" height="257" alt="<?php _e('Two ways of attaching post on Facebook', 'social-networks-auto-poster-facebook-twitter-g'); ?>"/></div> 324 <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo esc_attr($ii); ?>X"><h3><?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/fbPostTypesDiff6.png" width="600" height="398" alt="<?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?>"/></div> 325 325 326 326 <br/> … … 334 334 335 335 <?php global $nxs_SNAP; $gOptions = $nxs_SNAP->nxs_options; if ( !empty($gOptions['riActive']) && $gOptions['riActive'] == '1' ) { ?> 336 <input value="1" id="apFBMsgAFrmtA<?php echo $ii; ?>" <?php if (!empty($options['riComments']) && trim($options['riComments'])=='1') echo "checked"; ?> type="checkbox" name="fb[<?php echo $ii; ?>][riComments]"/> <strong><?php _e('Import Facebook Comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong>336 <input value="1" id="apFBMsgAFrmtA<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riComments']) && trim($options['riComments'])=='1') echo "checked"; ?> type="checkbox" name="fb[<?php echo esc_attr($ii); ?>][riComments]"/> <strong><?php _e('Import Facebook Comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> 337 337 <br/> 338 338 339 339 <div style="margin-bottom: 5px; margin-left: 10px; "> 340 <input value="1" id="apFBMsgAFrmtA<?php echo $ii; ?>" <?php if (!empty($options['riCommentsAA']) && trim($options['riCommentsAA'])=='1') echo "checked"; ?> type="checkbox" name="fb[<?php echo $ii; ?>][riCommentsAA]"/> <strong><?php _e('Auto-approve imported comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>340 <input value="1" id="apFBMsgAFrmtA<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riCommentsAA']) && trim($options['riCommentsAA'])=='1') echo "checked"; ?> type="checkbox" name="fb[<?php echo esc_attr($ii); ?>][riCommentsAA]"/> <strong><?php _e('Auto-approve imported comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 341 341 <?php } else { echo "<br/>"; _e('Please activate the "Comments Import" from SNAP Settings Tab', 'social-networks-auto-poster-facebook-twitter-g'); } ?> 342 342 … … 346 346 -<?php _e('If you are posting to a group and have a page linked to that group, you can enter its Page ID and posts will appear as posted from "Page Name"', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 347 347 <div style="margin-bottom: 5px; margin-left: 10px;"> <b style="font-size: 16px;"><?php _e('Page ID:', 'social-networks-auto-poster-facebook-twitter-g'); ?></b><?php if (empty($options['glpid'])) $options['glpid'] = ''; ?> 348 <input type="text" name="fb[<?php echo $ii; ?>][glpid]" style="width: 40%;border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['glpid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />348 <input type="text" name="fb[<?php echo esc_attr($ii); ?>][glpid]" style="width: 40%;border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['glpid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 349 349 </div> 350 350 </div> … … 361 361 <a href="#" style="margin-left:50px; " class="button" onclick="jQuery(this).next().show(); jQuery(this).hide(); return false;">I understand that this risky feature is provided "as is" with <b>no support</b> and might not work correctly.</a> 362 362 <div style="margin-bottom: 5px; margin-left: 10px; display: none;"> <b style="font-size: 16px;"><?php _e('Auth Token:', 'social-networks-auto-poster-facebook-twitter-g'); ?></b><?php if (empty($options['tpt'])) $options['tpt'] = ''; ?> 363 <input type="text" name="fb[<?php echo $ii; ?>][tpt]" style="width: 40%;border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['tpt'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />363 <input type="text" name="fb[<?php echo esc_attr($ii); ?>][tpt]" style="width: 40%;border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['tpt'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 364 364 </div> </div> </div> 365 365 … … 445 445 446 446 <div class="nxsPostEd_ElemWrap"> <div class="nxsPostEd_ElemLabel"> 447 <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?>(<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo $ii; ?>X');" onmouseover="showPopShAtt('<?php echo $ii; ?>X', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>)447 <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?>(<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo esc_attr($ii); ?>X');" onmouseover="showPopShAtt('<?php echo esc_attr($ii); ?>X', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) 448 448 </div> 449 449 <div class="nxsPostEd_Elem"> 450 <input type="radio" name="fb[<?php echo $ii; ?>][postType]" value="T" class="nxsEdElem nxsImgCtrlCb nxs_ajOnChnage" data-nt="<?php echo $nt; ?>" data-ii="<?php echo $ii; ?>" <?php if ($ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>451 <input type="radio" name="fb[<?php echo $ii; ?>][postType]" value="I" class="nxsEdElem nxsImgCtrlCb nxs_ajOnChnage" data-nt="<?php echo $nt; ?>" data-ii="<?php echo $ii; ?>" <?php if ($ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>452 <input type="radio" name="fb[<?php echo $ii; ?>][postType]" value="A" class="nxsEdElem nxsImgCtrlCb nxs_ajOnChnage" data-nt="<?php echo $nt; ?>" data-ii="<?php echo $ii; ?>" <?php if ( empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?>450 <input type="radio" name="fb[<?php echo esc_attr($ii); ?>][postType]" value="T" class="nxsEdElem nxsImgCtrlCb nxs_ajOnChnage" data-nt="<?php echo esc_attr($nt); ?>" data-ii="<?php echo esc_attr($ii); ?>" <?php if ($ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 451 <input type="radio" name="fb[<?php echo esc_attr($ii); ?>][postType]" value="I" class="nxsEdElem nxsImgCtrlCb nxs_ajOnChnage" data-nt="<?php echo esc_attr($nt); ?>" data-ii="<?php echo esc_attr($ii); ?>" <?php if ($ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 452 <input type="radio" name="fb[<?php echo esc_attr($ii); ?>][postType]" value="A" class="nxsEdElem nxsImgCtrlCb nxs_ajOnChnage" data-nt="<?php echo esc_attr($nt); ?>" data-ii="<?php echo esc_attr($ii); ?>" <?php if ( empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?> 453 453 </div> 454 <div class="popShAtt" id="popShAtt<?php echo $ii; ?>X"><h3><?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/fbPostTypesDiff6.png" width="600" height="398" alt="<?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?>"/></div>454 <div class="popShAtt" id="popShAtt<?php echo esc_attr($ii); ?>X"><h3><?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/fbPostTypesDiff6.png" width="600" height="398" alt="<?php _e('Facebook Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?>"/></div> 455 455 </div> 456 456 … … 503 503 504 504 function importComments($options='', $postID='', $po='', $fbID='') { $ci = 0; if (empty($postID)) $postID = $_POST['pid']; //echo "Getting comments....";// $fbID = '1019404527_10212971242848671'; 505 if (empty($options)) { global $nxs_SNAP; $options = $nxs_SNAP->nxs_options; } if (isset($_POST['ii'])) $options = $options[$_POST['nt']][ $_POST['ii']]; $ptype = get_post_type( $postID );506 if (empty($po)) { $po = maybe_unserialize(get_post_meta($postID, 'snap'.strtoupper($_POST['nt']), true)); $po = $po[ $_POST['ii']]; }505 if (empty($options)) { global $nxs_SNAP; $options = $nxs_SNAP->nxs_options; } if (isset($_POST['ii'])) $options = $options[$_POST['nt']][sanitize_key($_POST['ii'])]; $ptype = get_post_type( $postID ); 506 if (empty($po)) { $po = maybe_unserialize(get_post_meta($postID, 'snap'.strtoupper($_POST['nt']), true)); $po = $po[sanitize_key($_POST['ii'])]; } 507 507 //NXS API 508 508 if (!empty($options) && !empty($options['apiToUse']) && $options['apiToUse']=='nx' && !empty($options['uPass'])) { echo "[FB] Getting comments (Session)...<br/>\r\n"; //## Session ID -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/fl.php
r1905522 r2757212 23 23 //#### Show Unit Settings 24 24 function checkIfSetupFinished($options) { return !empty($options['appAppUserID']) && !empty($options['accessToken']); } 25 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 26 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ require_once('apis/scOAuth.php'); $options = $this->nt[$_GET['acc']]; 25 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 26 if (isset($_GET['acc'])) { $acc = sanitize_text_field($_GET['acc']); $options = $this->nt[$acc]; 27 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ require_once('apis/scOAuth.php'); 27 28 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); 28 $callback_url = $nxs_snapSetPgURL."&auth=".$ntInfo['lcode']."a&acc=".$ _GET['acc'];29 $callback_url = $nxs_snapSetPgURL."&auth=".$ntInfo['lcode']."a&acc=".$acc; 29 30 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret); 30 31 $tum_oauth->baseURL = 'https://www.flickr.com/services'; $tum_oauth->request_token_path = '/oauth/request_token'; $tum_oauth->access_token_path = '/oauth/access_token'; 31 32 $request_token = $tum_oauth->getReqToken($callback_url); $options['oAuthToken'] = $request_token['oauth_token']; $options['oAuthTokenSecret'] = $request_token['oauth_token_secret']; 32 33 switch ($tum_oauth->http_code) { case 200: $url = 'https://www.flickr.com/services/oauth/authorize?oauth_token='.$options['oAuthToken']; 33 nxs_save_glbNtwrks($ntInfo['lcode'],$ _GET['acc'],$options,'*');34 nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 34 35 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; break; 35 36 default: echo '<br/><b style="color:red">Could not connect to Flickr. Refresh the page or try again later.</b>'; die(); 36 37 } die(); 37 }38 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode'].'a'){ require_once('apis/scOAuth.php'); $options = $this->nt[$_GET['acc']];38 } 39 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode'].'a'){ require_once('apis/scOAuth.php'); 39 40 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); 40 41 41 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret, $options['oAuthToken'], $options['oAuthTokenSecret']); //prr($tum_oauth); 42 42 $tum_oauth->baseURL = 'https://www.flickr.com/services'; $tum_oauth->request_token_path = '/oauth/request_token'; $tum_oauth->access_token_path = '/oauth/access_token'; 43 43 $access_token = $tum_oauth->getAccToken($_GET['oauth_verifier']); prr($access_token); 44 44 $options['accessToken'] = $access_token['oauth_token']; $options['accessTokenSec'] = $access_token['oauth_token_secret']; 45 nxs_save_glbNtwrks($ntInfo['lcode'],$ _GET['acc'],$options,'*');45 nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 46 46 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 47 47 echo "OK. Let's Get Profile: "; prr($access_token); … … 50 50 if (is_array($uinfo) && isset($uinfo['user'])) { $options['appAppUserName'] = $access_token['username']."(".urldecode($access_token['fullname']).")"; 51 51 $options['appAppUserID'] = urldecode($uinfo['user']['nsid']); $options['userURL'] = urldecode($uinfo['user']['url']); 52 nxs_save_glbNtwrks($ntInfo['lcode'],$ _GET['acc'],$options,'*');52 nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 53 53 } //die(); 54 54 if (!empty($options['appAppUserID'])) { … … 57 57 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$nxs_snapSetPgURL.'"</script>'; die(); 58 58 } else die("<span style='color:red;'>ERROR: Authorization Error: <span style='color:darkred; font-weight: bold;'>".print_r($uinfo, true)."</span></span>"); 59 } 59 60 } 60 61 } 61 62 62 63 function accTab($ii, $options, $isNew=false){ global $nxs_snapSetPgURL; $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; $this->elemKeySecret($ii,'Consumer Key','Consumer Secret', $options['appKey'], $options['appSec'],'appKey','appSec','https://www.flickr.com/services/apps/'); ?> 63 <div style="width:100%;"><strong><?php _e('Flickr Set ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('(Optional)', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][setID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['setID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>64 <div style="width:100%;"><strong><?php _e('Flickr Set ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('(Optional)', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][setID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['setID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 64 65 65 66 <?php $this->elemTitleFormat($ii,'Post Title Format','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Post Format','msgFormat',$options['msgFormat']); ?> 66 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>67 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 67 68 68 <div style="width:100%;"><strong><?php _e('Default Image to use', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('If your post does not have any images this will be used instead.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][defImg]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>69 <div style="width:100%;"><strong><?php _e('Default Image to use', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('If your post does not have any images this will be used instead.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][defImg]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 69 70 70 71 … … 75 76 <?php _e('Your '.$ntInfo['name'].' Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['appAppUserID'].' - '.$options['appAppUserName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>. 76 77 <?php _e('You can', 'social-networks-auto-poster-facebook-twitter-g'); ?> Re- <?php } ?> 77 <a href="<?php echo $nxs_snapSetPgURL.(stripos($nxs_snapSetPgURL, '?')!==false?'&':'?');?>auth=<?php echo $nt; ?>&acc=<?php echo $ii; ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a>78 <a href="<?php echo $nxs_snapSetPgURL.(stripos($nxs_snapSetPgURL, '?')!==false?'&':'?');?>auth=<?php echo esc_attr($nt); ?>&acc=<?php echo esc_attr($ii); ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a> 78 79 79 80 <?php if (!isset($options['appAppUserID']) || $options['appAppUserID']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div> <?php }?> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/fp.php
r1905522 r2757212 29 29 <div style="font-size: 11px; margin: 0px;"><?php _e('[Optional] Please use this only if you are having troubles to login/post without it.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 30 30 </div> 31 <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][session]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['session'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />31 <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][session]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['session'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 32 32 <br/> 33 33 <div style="width:100%;"><strong><?php _e('User ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> 34 34 <div style="font-size: 11px; margin: 0px;"><?php _e('[Optional] Please use this only if you are having troubles to login/post without it.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 35 35 </div> 36 <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][cuid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['cuid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />36 <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][cuid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['cuid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 37 37 <br/><br/> 38 38 39 39 40 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Flipboard Magazine URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="fp[<?php echo $ii; ?>][mgzURL]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['mgzURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>40 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Flipboard Magazine URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="fp[<?php echo esc_attr($ii); ?>][mgzURL]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['mgzURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 41 41 <br/><?php $this->elemMsgFormat($ii,'Comment Text Format','msgFormat',$options['msgFormat']); 42 42 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/gmb.php
r2062476 r2757212 18 18 $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; ?> <div style="color:darkred; font-size: 16px;">*****[Early Beta] Can make only "What's New" posts<br/><br/></div> 19 19 20 <div id="ups<?php echo $nt.$ii; ?>UP" class="ups<?php echo $nt.$ii; ?>">20 <div id="ups<?php echo esc_attr($nt.$ii); ?>UP" class="ups<?php echo esc_attr($nt.$ii); ?>"> 21 21 <?php $p = $options['uPass']; $this->elemUserPass($ii, $options['uName'], $p); ?> 22 22 </div> 23 <div id="ups<?php echo $nt.$ii; ?>UPS" style="padding-top: 10px;"><a href="#" onclick="jQuery('#ups<?php echo $nt.$ii; ?>S').show();return false;">Use session</a> (Optional - use only if you are having login problems)</div>24 <div id="ups<?php echo $nt.$ii; ?>S" class="ups<?php echo $nt.$ii; ?>" style="padding-left: 15px; padding-top: 10px; display:none;">25 SID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][sid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['sid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>26 SSID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][ssid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ssid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>27 HSID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][hsid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['hsid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>23 <div id="ups<?php echo esc_attr($nt.$ii); ?>UPS" style="padding-top: 10px;"><a href="#" onclick="jQuery('#ups<?php echo esc_attr($nt.$ii); ?>S').show();return false;">Use session</a> (Optional - use only if you are having login problems)</div> 24 <div id="ups<?php echo esc_attr($nt.$ii); ?>S" class="ups<?php echo esc_attr($nt.$ii); ?>" style="padding-left: 15px; padding-top: 10px; display:none;"> 25 SID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][sid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['sid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 26 SSID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][ssid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ssid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 27 HSID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][hsid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['hsid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 28 28 </div> 29 29 … … 40 40 41 41 <br/> 42 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Your Google My Business URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="gmb[<?php echo $ii; ?>][postTo]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['postTo'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>42 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Your Google My Business URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="gmb[<?php echo esc_attr($ii); ?>][postTo]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['postTo'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 43 43 44 44 <div style="width:100%;"><strong id="altFormatText">Post Type:</strong> </div> 45 45 <div style="margin-left: 10px;"> 46 <div id="<?php echo $nt.$ii; ?>PostTypeT" style="margin-left: 5px;">47 <input type="radio" name="gmb[<?php echo $ii; ?>][postType]" value="A" <?php if (empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('What\'s New Post', 'nxs_snap'); ?> - <i><?php _e('Blogpost with link', 'nxs_snap'); ?></i><br/>48 <div id="<?php echo $nt.$ii; ?>PostTypeTSub" style="margin-left: 15px;">49 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 50 <select id="<?php echo $nt.$ii; ?>PostTypeTSubButSel" onchange="" name="<?php echo $nt; ?>[<?php echo $ii; ?>][btnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option>46 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeT" style="margin-left: 5px;"> 47 <input type="radio" name="gmb[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if (empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('What\'s New Post', 'nxs_snap'); ?> - <i><?php _e('Blogpost with link', 'nxs_snap'); ?></i><br/> 48 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeTSub" style="margin-left: 15px;"> 49 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 50 <select id="<?php echo esc_attr($nt.$ii); ?>PostTypeTSubButSel" onchange="" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][btnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 51 51 <option <?php if ( $options['btnType'] =='BOOK') echo 'selected="selected"'; ?> value="BOOK"><?php _e('Book', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 52 52 <option <?php if ( $options['btnType'] =='ORDER') echo 'selected="selected"'; ?> value="ORDER"><?php _e('Order Online', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> … … 58 58 </div> 59 59 </div> 60 <div id="<?php echo $nt.$ii; ?>PostTypeT" style="margin-left: 5px;">61 <input type="radio" name="gmb[<?php echo $ii; ?>][postType]" value="E" <?php if (!empty($options['postType']) && $options['postType'] == 'E') echo 'checked="checked"'; ?> /> <?php _e('Event', 'nxs_snap'); ?> - <i><?php _e('Event', 'nxs_snap'); ?></i><br/>60 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeT" style="margin-left: 5px;"> 61 <input type="radio" name="gmb[<?php echo esc_attr($ii); ?>][postType]" value="E" <?php if (!empty($options['postType']) && $options['postType'] == 'E') echo 'checked="checked"'; ?> /> <?php _e('Event', 'nxs_snap'); ?> - <i><?php _e('Event', 'nxs_snap'); ?></i><br/> 62 62 63 63 64 64 65 <div id="<?php echo $nt.$ii; ?>PostTypeTSub" style="margin-left: 15px;"> <?php $this->elemTitleFormat($ii,'Event Title','eTtlFormat',$options['eTtlFormat']);?>66 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 67 <select id="<?php echo $nt.$ii; ?>PostTypeTSubButSel" onchange="" name="<?php echo $nt; ?>[<?php echo $ii; ?>][ebtnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option>65 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeTSub" style="margin-left: 15px;"> <?php $this->elemTitleFormat($ii,'Event Title','eTtlFormat',$options['eTtlFormat']);?> 66 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 67 <select id="<?php echo esc_attr($nt.$ii); ?>PostTypeTSubButSel" onchange="" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][ebtnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 68 68 <option <?php if ( $options['ebtnType'] =='BOOK') echo 'selected="selected"'; ?> value="BOOK"><?php _e('Book', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 69 69 <option <?php if ( $options['ebtnType'] =='ORDER') echo 'selected="selected"'; ?> value="ORDER"><?php _e('Order Online', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> … … 87 87 88 88 <?php global $nxs_SNAP; $gOptions = $nxs_SNAP->nxs_options; if ( !empty($gOptions['riActive']) && $gOptions['riActive'] == '1' ) { ?> 89 <input value="1" id="apFBMsgAFrmtA<?php echo $ii; ?>" <?php if (!empty($options['riComments']) && trim($options['riComments'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo $ii; ?>][riComments]"/> <strong><?php _e('Import Facebook Comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong>89 <input value="1" id="apFBMsgAFrmtA<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riComments']) && trim($options['riComments'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo esc_attr($ii); ?>][riComments]"/> <strong><?php _e('Import Facebook Comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> 90 90 <br/> 91 91 92 92 <div style="margin-bottom: 5px; margin-left: 10px; "> 93 <input value="1" id="apFBMsgAFrmtA<?php echo $ii; ?>" <?php if (!empty($options['riCommentsAA']) && trim($options['riCommentsAA'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo $ii; ?>][riCommentsAA]"/> <strong><?php _e('Auto-approve imported comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>93 <input value="1" id="apFBMsgAFrmtA<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riCommentsAA']) && trim($options['riCommentsAA'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo esc_attr($ii); ?>][riCommentsAA]"/> <strong><?php _e('Auto-approve imported comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 94 94 <?php } else { echo "<br/>"; _e('Please activate the "Comments Import" from SNAP Settings Tab', 'social-networks-auto-poster-facebook-twitter-g'); } ?> 95 95 … … 133 133 <div class="nxsPostEd_ElemLabel"><?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 134 134 <div class="nxsPostEd_Elem"> 135 <div id="<?php echo $nt.$ii; ?>PostTypeT" style="margin-left: 5px;">136 <input type="radio" name="gmb[<?php echo $ii; ?>][postType]" value="A" <?php if (empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" /> <?php _e('What\'s New Post', 'nxs_snap'); ?> - <i><?php _e('Blogpost with link', 'nxs_snap'); ?></i><br/>137 <div id="<?php echo $nt.$ii; ?>PostTypeTSub" style="margin-left: 15px;">138 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 139 <select class="nxsEdElem" id="<?php echo $nt.$ii; ?>PostTypeTSubButSel" onchange="" name="<?php echo $nt; ?>[<?php echo $ii; ?>][btnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option>135 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeT" style="margin-left: 5px;"> 136 <input type="radio" name="gmb[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if (empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" /> <?php _e('What\'s New Post', 'nxs_snap'); ?> - <i><?php _e('Blogpost with link', 'nxs_snap'); ?></i><br/> 137 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeTSub" style="margin-left: 15px;"> 138 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 139 <select class="nxsEdElem" id="<?php echo esc_attr($nt.$ii); ?>PostTypeTSubButSel" onchange="" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][btnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 140 140 <option <?php if ( $ntOpt['btnType'] =='BOOK') echo 'selected="selected"'; ?> value="BOOK"><?php _e('Book', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 141 141 <option <?php if ( $ntOpt['btnType'] =='ORDER') echo 'selected="selected"'; ?> value="ORDER"><?php _e('Order Online', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> … … 151 151 152 152 <div class="nxsPostEd_Elem"> 153 <div id="<?php echo $nt.$ii; ?>PostTypeE" style="margin-left: 5px;">154 <input type="radio" name="gmb[<?php echo $ii; ?>][postType]" value="E" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'E') echo 'checked="checked"'; ?> class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" /> <?php _e('Event', 'nxs_snap'); ?><br/>155 <div id="<?php echo $nt.$ii; ?>PostTypeESub" style="margin-left: 15px;">156 157 158 Event Title:<input name="<?php echo $nt; ?>[<?php echo $ii; ?>][eTtlFormat]" style="width: 95%;max-width: 610px;" value="<?php echo $ntOpt['eTtlFormat']; ?>" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" /> <br/>159 Event Start Date:<input name="<?php echo $nt; ?>[<?php echo $ii; ?>][evStDate]" style="width: 95%;max-width: 610px;" value="<?php echo date("F j, Y, g:i a", strtotime('+10 min')); ?>" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" /><br/>160 Event End Date:<input name="<?php echo $nt; ?>[<?php echo $ii; ?>][evEndDate]" style="width: 95%;max-width: 610px;" value="<?php echo date("F j, Y, g:i a", strtotime('+1 day')); ?>" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" /><br/>161 162 163 164 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 165 <select class="nxsEdElem" id="<?php echo $nt.$ii; ?>PostTypeTSubButSel" onchange="" name="<?php echo $nt; ?>[<?php echo $ii; ?>][ebtnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option>153 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeE" style="margin-left: 5px;"> 154 <input type="radio" name="gmb[<?php echo esc_attr($ii); ?>][postType]" value="E" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'E') echo 'checked="checked"'; ?> class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" /> <?php _e('Event', 'nxs_snap'); ?><br/> 155 <div id="<?php echo esc_attr($nt.$ii); ?>PostTypeESub" style="margin-left: 15px;"> 156 157 158 Event Title:<input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][eTtlFormat]" style="width: 95%;max-width: 610px;" value="<?php echo $ntOpt['eTtlFormat']; ?>" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" /> <br/> 159 Event Start Date:<input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][evStDate]" style="width: 95%;max-width: 610px;" value="<?php echo date("F j, Y, g:i a", strtotime('+10 min')); ?>" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" /><br/> 160 Event End Date:<input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][evEndDate]" style="width: 95%;max-width: 610px;" value="<?php echo date("F j, Y, g:i a", strtotime('+1 day')); ?>" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" /><br/> 161 162 163 164 <?php _e('Add Button with link', 'social-networks-auto-poster-facebook-twitter-g'); ?>: 165 <select class="nxsEdElem" id="<?php echo esc_attr($nt.$ii); ?>PostTypeTSubButSel" onchange="" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][ebtnType]"> <option value="X"><?php _e('No Button', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 166 166 <option <?php if ( $ntOpt['ebtnType'] =='BOOK') echo 'selected="selected"'; ?> value="BOOK"><?php _e('Book', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> 167 167 <option <?php if ( $ntOpt['ebtnType'] =='ORDER') echo 'selected="selected"'; ?> value="ORDER"><?php _e('Order Online', 'social-networks-auto-poster-facebook-twitter-g'); ?></option> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/ig.api.php
r2087759 r2757212 8 8 var $ntLCode = 'ig'; 9 9 10 function nxsCptCheck(){ if (function_exists('nxs_getOption')) { $opVal = array(); $opNm = $_POST['svc']; $opVal = nxs_getOption($opNm); $nt = new nxsAPI_IG(); if(!empty($opVal['ck'])) $nt->ck = $opVal['ck'];10 function nxsCptCheck(){ if (function_exists('nxs_getOption')) { $opVal = array(); $opNm = sanitize_key($_POST['svc']); $opVal = nxs_getOption($opNm); $nt = new nxsAPI_IG(); if(!empty($opVal['ck'])) $nt->ck = $opVal['ck']; 11 11 if (!empty($opVal['proxy'])&&!empty($opVal['proxyOn'])){ $nt->proxy['proxy'] = $opVal['proxy']['proxy']; if (!empty($opVal['proxy']['up'])) $nt->proxy['up'] = $opVal['proxy']['up']; }; $ck = $nt->checkCode($opVal['url'], $_POST['code']); 12 12 if ($ck!==false){ $opVal['ck'] = $ck; nxs_saveOption($opNm, $opVal); -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/ig.php
r2194031 r2757212 21 21 <div style="font-size: 11px; margin: 0px;"><?php _e('[Optional] Please use this only if you are having troubles to login/post without it.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 22 22 </div> 23 <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][session]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['session'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />23 <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][session]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['session'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 24 24 <br/><br/> 25 25 26 26 <br/><?php $this->elemMsgFormat($ii,'Image Description Format','msgFormat',$options['msgFormat']); ?> <br/ > 27 <div style="width:100%;"><strong id="altFormatText"><?php _e('What do to with the image', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</strong><-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo $ii; ?>IG');" onmouseover="showPopShAtt('<?php echo $ii; ?>IG', event);" onclick="return false;" class="underdash" href="#"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div>27 <div style="width:100%;"><strong id="altFormatText"><?php _e('What do to with the image', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</strong><-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo esc_attr($ii); ?>IG');" onmouseover="showPopShAtt('<?php echo esc_attr($ii); ?>IG', event);" onclick="return false;" class="underdash" href="#"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div> 28 28 <div style="margin-left: 10px;"> 29 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][imgAct]" value="E" <?php if (empty($options['imgAct']) || $options['imgAct'] == 'E') echo 'checked="checked"'; ?> /> <?php _e('Make it Square: Extend', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Image will be extended to square', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>30 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][imgAct]" value="C" <?php if (!empty($options['imgAct']) && $options['imgAct'] == 'C') echo 'checked="checked"'; ?> /> <?php _e('Make it Square: Crop', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Image will be cropped to square', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>31 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][imgAct]" value="D" <?php if (!empty($options['imgAct']) && $options['imgAct'] == 'D') echo 'checked="checked"'; ?> /> <?php _e("Don't change", 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Image will be untouched. (Could cause "Uploaded image isn\'t in an allowed aspect ratio" Error)', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>29 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][imgAct]" value="E" <?php if (empty($options['imgAct']) || $options['imgAct'] == 'E') echo 'checked="checked"'; ?> /> <?php _e('Make it Square: Extend', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Image will be extended to square', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 30 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][imgAct]" value="C" <?php if (!empty($options['imgAct']) && $options['imgAct'] == 'C') echo 'checked="checked"'; ?> /> <?php _e('Make it Square: Crop', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Image will be cropped to square', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 31 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][imgAct]" value="D" <?php if (!empty($options['imgAct']) && $options['imgAct'] == 'D') echo 'checked="checked"'; ?> /> <?php _e("Don't change", 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Image will be untouched. (Could cause "Uploaded image isn\'t in an allowed aspect ratio" Error)', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 32 32 <br/></div> 33 33 <div style="width:100%;"><strong><?php _e('URL of the Default Image', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> 34 34 <div style="font-size: 11px; margin: 0px;"><?php _e('If your post does not have any images this will be used instead.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 35 </div><input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][defImg]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />35 </div><input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][defImg]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 36 36 <br/><br/> 37 37 <div style="width:100%;"><strong><?php _e('Location ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <i><?php _e('You can find location ID from Facebook Places', 'social-networks-auto-poster-facebook-twitter-g'); ?>. Please see the "Location" section in the <a href="https://nxs.fyi/igl" target="_blank">instructions</a></i> 38 </div><input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][loc]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['loc'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />38 </div><input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][loc]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['loc'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 39 39 <br/><br/> 40 40 <?php … … 77 77 <strong><?php _e('Location ID', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong><i>Please see the "Location" section in the <a href="https://nxs.fyi/igl" target="_blank">instructions</a></i> 78 78 79 <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][loc]" style="width: 30%;" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" value="<?php _e(apply_filters('format_to_edit', htmlentities($ntOpt['loc'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />79 <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][loc]" style="width: 30%;" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" value="<?php _e(apply_filters('format_to_edit', htmlentities($ntOpt['loc'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 80 80 81 81 </div> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/li.api.php
r2087759 r2757212 59 59 if (!empty($options['proxy'])&&!empty($options['proxyOn'])){ $nt->proxy['proxy'] = $options['proxy']['proxy']; if (!empty($options['proxy']['up'])) $nt->proxy['up'] = $options['proxy']['up']; } 60 60 $loginErr = $nt->connect($uname, $pass); 61 //## LinkedIn Email Code Verification. 62 if (is_array($loginErr) && !empty($loginErr['out']) ) { if (function_exists('update_option')) update_option('nxs_li_ctp_save', $loginErr['ser'], false); $text = $loginErr['out']; 63 echo "#2. LinkedIn asked you to enter verification code. Please check your email or phone, enter the code and click \"Confirm Code\""; $text = str_ireplace('This login attempt seems suspicious. ', '', $text); echo $text; 64 echo '<br/><input type="hidden" id="nxsLiNum" name="nxsLiNum" value="'.$options['ii'].'" /><input type="button" value="Click to Confirm Code" onclick="doCtpSave(); return false;" id="results_ok_button" name="nxs_go" class="button" /><br/><br/><div style="color:red;" id="nxsLITestResults"></div>'; 65 ?><script type="text/javascript"> function doCtpSave(){ var u = jQuery('#verification-code').val(); var ii = jQuery('#nxsLiNum').val(); //alert(ii); 66 jQuery.post(ajaxurl,{s:u, i:ii, action: 'nxs_snap_aj',"nxsact":"getItFromNT", "fName":"nxsCptCheck", nt:"LI", id: 0, _wpnonce: jQuery('input#nxsSsPageWPN_wpnonce').val()}, function(j){ 67 jQuery('#nxsLITestResults').html(j); 68 }, "html") 69 }</script> <?php return '<br/>#2. LinkedIn asked you to enter verification code<br/>'; 70 } 71 if ($loginErr) { $badOut['Error'] .= 'Can\'t Connect - '.print_r($loginErr, true); return $badOut; } 61 62 if ($loginErr) { $badOut['Error'] .= 'Can\'t Connect (Please try to use session) - '.print_r($loginErr, true); return $badOut; } 72 63 $opVal['ck'] = $nt->ck; nxs_saveOption($opNm,$opVal); //$options['ck'] = $nt->ck; if (function_exists('nxs_save_glbNtwrks')) nxs_save_glbNtwrks('li', $options['ii'], $nt->ck, 'ck'); 73 64 if ( $options['whToPost']=='C' && !empty($options['pgcID'])) $to = 'https://www.linkedin.com/company/'.$options['pgcID']; elseif ( $options['whToPost']=='G' && !empty($options['pggID'])) $to = 'https://www.linkedin.com/groups/'.$options['pggID']; -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/li.php
r2277661 r2757212 1 1 <?php 2 3 if (isset($_GET['pg']) && $_GET['pg']=='nxs' && isset($_GET['ca']) && $_GET['ca']!='') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/image?c='.$_GET['ca']);4 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, 'https://www.google.com/'); global $nxs_skipSSLCheck; if ($nxs_skipSSLCheck===true) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);5 $imageData = curl_exec($ch); if ($imageData === false) { echo 'Curl error: ' . curl_error($ch); die(); }6 header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");7 header("Cache-Control: private",false); header("Content-Type: image/jpg"); header("Content-Transfer-Encoding: binary"); echo $imageData; die();8 }9 10 2 //## NextScripts Facebook Connection Class 11 3 $nxs_snapAvNts[] = array('code'=>'LI', 'lcode'=>'li', 'name'=>'LinkedIn', 'type'=>'Social Networks', 'ptype'=>'B', 'status'=>'A', 'desc'=>'Post text, article, image or share a link to your profile, group, or company page. '); … … 56 48 57 49 ?> 58 <a href="#" onclick="var url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=<?php echo nxs_gak($nto['appKey']);?>&scope=r_liteprofile+r_emailaddress+w_member_social&state=nxs-li-<?php echo $ii; ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo $nt; ?>', '<?php echo $ii; ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo $ii; ?>',url,'1'); return false;">Authorize Your LinkedIn Account (<b>without</b> Marketing API)</a>50 <a href="#" onclick="var url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=<?php echo nxs_gak($nto['appKey']);?>&scope=r_liteprofile+r_emailaddress+w_member_social&state=nxs-li-<?php echo esc_attr($ii); ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo esc_attr($nt); ?>', '<?php echo esc_attr($ii); ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo esc_attr($ii); ?>',url,'1'); return false;">Authorize Your LinkedIn Account (<b>without</b> Marketing API)</a> 59 51 <?php 60 52 die('</div></div></div>'); … … 99 91 } 100 92 101 function getListOfPagesLIV2($networks){ $opVal = array(); if (empty($_POST['u'])) return $opVal; $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; if (empty($networks['li'][$ii]['accessToken'])) return $opVal;102 $currPstAs = !empty($_POST['pgID'])? $_POST['pgID']:(!empty($networks['li'][$ii])?$networks['li'][$ii]['pgID']:'');93 function getListOfPagesLIV2($networks){ $opVal = array(); if (empty($_POST['u'])) return $opVal; $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); if (empty($networks['li'][$ii]['accessToken'])) return $opVal; 94 $currPstAs = !empty($_POST['pgID'])?sanitize_text_field($_POST['pgID']):(!empty($networks['li'][$ii])?$networks['li'][$ii]['pgID']:''); 103 95 if (empty($_POST['force']) && !empty($opVal['pgList']) ) $pgs = $opVal['pgList']; else { $options = $networks['li'][$ii]; 104 96 … … 121 113 } 122 114 123 function getListOfPagesNXS($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; $nt = new nxsAPI_LI(); // prr($opVal);115 function getListOfPagesNXS($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_LI(); // prr($opVal); 124 116 $currPstAs = !empty($_POST['pgcID'])?$_POST['pgcID']:(!empty($networks['li'][$ii])?$networks['li'][$ii]['pgcID']:''); $options = $networks['li'][$ii]; 125 117 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['pgsList']) ) $pgs = $opVal['pgsList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; 126 118 if (!empty($message['session']) || !empty($options['session'])) { $sid = !empty($message['session'])?$message['session']:$options['session']; if (empty($nt->ck)) $nt->ck = array(); foreach ($nt->ck as $ci=>$cc) if ( $nt->ck[$ci]->name=='li_at') unset($nt->ck[$ci]); 127 119 $c = new NXS_Http_Cookie( array('name' => 'li_at', 'value' => $sid) ); $nt->ck[] = $c; 128 } $loginError=$nt->connect( $_POST['u'],$_POST['p']);120 } $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']); 129 121 if (!$loginError){ $opVal['ck'] = $nt->ck; $pgs = $nt->getPgsList($currPstAs); } 130 122 else { $outMsg = '<b style="color:red;">'.__('Login Problem').' - '.strip_tags($loginError).'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } … … 133 125 $opVal['pgsList'] = $pgs; nxs_saveOption($opNm, $opVal); return $opVal; 134 126 } 135 function getListOfGroupsNXS($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; $nt = new nxsAPI_LI(); // prr($opVal);127 function getListOfGroupsNXS($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_LI(); // prr($opVal); 136 128 $currPstAs = !empty($_POST['pggID'])?$_POST['pggID']:(!empty($networks['li'][$ii]['pggID'])?$networks['li'][$ii]['pggID']:''); $options = (!empty($networks['li'][$ii]))?$networks['li'][$ii]:array(); 137 129 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpList']) ) $pgs = $opVal['grpList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; … … 139 131 $c = new NXS_Http_Cookie( array('name' => 'li_at', 'value' => $sid) ); $nt->ck[] = $c; 140 132 } 141 $loginError=$nt->connect( $_POST['u'],$_POST['p']);133 $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']); 142 134 if (!$loginError){ $opVal['ck'] = $nt->ck; $pgs = $nt->getGrpList($currPstAs); } 143 135 else { $outMsg = '<b style="color:red;">'.__('Login Problem').' - '.strip_tags($loginError).'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } … … 154 146 <span style="color:#005800; font-weight: bold; font-size: 14px;">NextScripts API for LinkedIn:</span> Premium API with extended functionality. <br/><b>Can post Articles and to Profile, Company pages, and Groups.</b> <br/><span style="color:#000080"><?php _e('Advantages', 'nxs_snap'); ?></span>: Easier to configure. Only API that can post Articles and to Groups and make Image posts.<br/><span style="color:#800000"><?php _e('Disadvantages', 'nxs_snap'); ?></span>: Not free. Less secure - requires your password.<br/><br/> 155 147 156 <select name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?>').hide(); jQuery('.nxs_<?php echo $nt; ?>_api'+jQuery(this).val()+'div_<?php echo $ii; ?>').show(); ">148 <select name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?>').hide(); jQuery('.nxs_<?php echo esc_attr($nt); ?>_api'+jQuery(this).val()+'div_<?php echo esc_attr($ii); ?>').show(); "> 157 149 <option <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='liv2')?"selected":""; ?> value="liv2">LinkedIn Native API</option> 158 150 <option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"selected":""; ?> value="nx">NextScripts API</option> … … 162 154 163 155 164 <div id="nxs_<?php echo $nt; ?>_apiliv2div_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apiliv2div_<?php echo $ii; ?>" style="display: <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='liv2' || $options['apiToUse'] =='liv1')?"block":"none"; ?>;"><h3>LinkedIn API</h3>165 <div class="subDiv" id="sub<?php echo $ii; ?>DivL" style="display: block;"> <?php $this->elemKeySecret($ii,'Client ID','Client Secret', $options['appKey'], $options['appSec'],'appKey2','appSec2','https://www.linkedin.com/developer/apps'); ?><br/><br/>156 <div id="nxs_<?php echo esc_attr($nt); ?>_apiliv2div_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apiliv2div_<?php echo esc_attr($ii); ?>" style="display: <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='liv2' || $options['apiToUse'] =='liv1')?"block":"none"; ?>;"><h3>LinkedIn API</h3> 157 <div class="subDiv" id="sub<?php echo esc_attr($ii); ?>DivL" style="display: block;"> <?php $this->elemKeySecret($ii,'Client ID','Client Secret', $options['appKey'], $options['appSec'],'appKey2','appSec2','https://www.linkedin.com/developer/apps'); ?><br/><br/> 166 158 <?php if(!empty($options['accessToken'])) { 167 159 _e('Your '.$ntInfo['name'].' Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> <br/>User: <?php _e(apply_filters('format_to_edit', htmlentities($options['liUserInfo'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?>. 168 160 <?php } ?> <br/> 169 <a href="#" onclick="var url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id='+jQuery('#liappKey2<?php echo $ii; ?>').val()+'&scope=r_liteprofile+r_emailaddress+w_member_social+w_organization_social+rw_organization_admin&state=nxs-li-<?php echo $ii; ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo $nt; ?>', '<?php echo $ii; ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo $ii; ?>',url,'1'); return false;">Authorize Your LinkedIn Account (<b>with</b> Marketing API)</a>161 <a href="#" onclick="var url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id='+jQuery('#liappKey2<?php echo esc_attr($ii); ?>').val()+'&scope=r_liteprofile+r_emailaddress+w_member_social+w_organization_social+rw_organization_admin&state=nxs-li-<?php echo esc_attr($ii); ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo esc_attr($nt); ?>', '<?php echo esc_attr($ii); ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo esc_attr($ii); ?>',url,'1'); return false;">Authorize Your LinkedIn Account (<b>with</b> Marketing API)</a> 170 162 <br/> 171 <a href="#" onclick="var url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id='+jQuery('#liappKey2<?php echo $ii; ?>').val()+'&scope=r_liteprofile+r_emailaddress+w_member_social&state=nxs-li-<?php echo $ii; ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo $nt; ?>', '<?php echo $ii; ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo $ii; ?>',url,'1'); return false;">Authorize Your LinkedIn Account (<b>without</b> Marketing API)</a>163 <a href="#" onclick="var url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id='+jQuery('#liappKey2<?php echo esc_attr($ii); ?>').val()+'&scope=r_liteprofile+r_emailaddress+w_member_social&state=nxs-li-<?php echo esc_attr($ii); ?>&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL));?>'; nxs_svSetAdv('<?php echo esc_attr($nt); ?>', '<?php echo esc_attr($ii); ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo esc_attr($ii); ?>',url,'1'); return false;">Authorize Your LinkedIn Account (<b>without</b> Marketing API)</a> 172 164 <?php if (empty($options['accessToken'])) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div> <?php } ?><br/><br/> 173 165 </div> … … 178 170 if (!empty($opVal) & !is_array($opVal)) $options['uMsg'] = $opVal; else { if (!empty($opVal) & is_array($opVal)) $options = array_merge($options, $opVal); } 179 171 ?><br/ ><div style="width:100%;"><b><?php _e('Where to Post', 'nxs_snap'); ?></b> (<?php _e('Please select your Profile or Company Page', 'nxs_snap'); ?>)</div> 180 <div id="nxsLIInfoDiv<?php echo $ii; ?>" style="<?php echo empty($options['accessToken'])?'display:none;':''; ?>">172 <div id="nxsLIInfoDiv<?php echo esc_attr($ii); ?>" style="<?php echo empty($options['accessToken'])?'display:none;':''; ?>"> 181 173 <div style="width:100%;"> 182 174 <div> 183 <select id="lipgID<?php echo $ii; ?>" onchange="nxs_liPageChange('<?php echo $ii;?>',jQuery(this));" name="li[<?php echo $ii;?>][pgID]">175 <select id="lipgID<?php echo esc_attr($ii); ?>" onchange="nxs_liPageChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="li[<?php echo esc_attr($ii);?>][pgID]"> 184 176 <?php $pgi = !empty($options['pgList'])?$options['pgList']:''; 185 177 if (!empty($options['pgID'])) { echo (!empty($options['pgID']) && stripos($pgi,$options['pgID'])===false)?'<option selected="selected" value="'.$options['pgID'].'">'.$options['pgID'].'</option>':''; } … … 187 179 echo '<option '.($options['pgID']=='p'?'selected="selected" ':'').'value="p">'.__('Profile').'</option>'; echo $pgi; 188 180 ?><option value="a"><?php _e('.... Enter the Page ID'); ?></option> 189 </select><div id="nxsLIInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="liInpCst<?php echo $ii; ?>" value="<?php echo $options['pgID']; ?>" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="lipgID<?php echo $ii; ?>" />190 <div style="display: inline-block;"><a onclick="nxs_liGetPages(<?php echo $ii;?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo $nt.$ii;?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo $nt.$ii;?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />181 </select><div id="nxsLIInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="liInpCst<?php echo esc_attr($ii); ?>" value="<?php echo $options['pgID']; ?>" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="lipgID<?php echo esc_attr($ii); ?>" /> 182 <div style="display: inline-block;"><a onclick="nxs_liGetPages(<?php echo esc_attr($ii);?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo esc_attr($nt.$ii);?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo esc_attr($nt.$ii);?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 191 183 </div> 192 </div> <div id="nxsLIMsgDiv<?php echo $ii; ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please authorize your account', 'nxs_snap'); ?><?php } ?></div>193 </div> <input type="hidden" id="liAuthUser<?php echo $ii; ?>" value="<?php echo !empty($options['authUser'])?$options['authUser']:''; ?>"/> <br/>184 </div> <div id="nxsLIMsgDiv<?php echo esc_attr($ii); ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please authorize your account', 'nxs_snap'); ?><?php } ?></div> 185 </div> <input type="hidden" id="liAuthUser<?php echo esc_attr($ii); ?>" value="<?php echo !empty($options['authUser'])?$options['authUser']:''; ?>"/> <br/> 194 186 195 187 196 188 </div> 197 <div id="nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;"><h3>NextScripts API</h3>189 <div id="nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;"><h3>NextScripts API</h3> 198 190 199 191 <?php if (class_exists('nxsAPI_LI')) { if (!empty($options['uPass'])&&!empty($options['uName'])) { $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$options['uName'].$options['uPass']); $opVal = nxs_getOption($opNm); … … 203 195 } if (empty($options['uPass'])) $options['uPass'] = ''; if (empty($options['uName'])) $options['uName'] = ''; if (empty($options['session'])) $options['session'] = ''; 204 196 ?> 205 <div class="subDiv" id="sub<?php echo $ii; ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div><br/>197 <div class="subDiv" id="sub<?php echo esc_attr($ii); ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div><br/> 206 198 207 199 <div style="width:100%;"><strong><?php _e('Session ID (li_at)', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> 208 200 <div style="font-size: 11px; margin: 0px;"><?php _e('[Optional] Please use this only if you are having troubles to login/post without it.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 209 201 </div> 210 <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][session]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['session'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />202 <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][session]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['session'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 211 203 <br/><br/> 212 204 213 205 <script type="text/javascript"> 214 jQuery('#apLIUName<?php echo $ii; ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apLIPass<?php echo $ii; ?>').val(); if( u!='' && p!='' ) { nxs_li2GetPages(<?php echo $ii; ?>,0); } });215 jQuery('#apLIPass<?php echo $ii; ?>').change(function() { var u = jQuery('#apLIUName<?php echo $ii; ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_li2GetPages(<?php echo $ii; ?>,0); } });216 217 jQuery('.liWhereToPost<?php echo $ii; ?>').change(function() { if (jQuery(this).val()!='P') jQuery('#liPostType<?php echo $ii; ?>').show(); else jQuery('#liPostType<?php echo $ii; ?>').hide(); });206 jQuery('#apLIUName<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apLIPass<?php echo esc_attr($ii); ?>').val(); if( u!='' && p!='' ) { nxs_li2GetPages(<?php echo esc_attr($ii); ?>,0); } }); 207 jQuery('#apLIPass<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery('#apLIUName<?php echo esc_attr($ii); ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_li2GetPages(<?php echo esc_attr($ii); ?>,0); } }); 208 209 jQuery('.liWhereToPost<?php echo esc_attr($ii); ?>').change(function() { if (jQuery(this).val()!='P') jQuery('#liPostType<?php echo esc_attr($ii); ?>').show(); else jQuery('#liPostType<?php echo esc_attr($ii); ?>').hide(); }); 218 210 219 211 </script> 220 212 <div style="width:100%;"><b style="font-size: 15px;"><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); if (empty($options['whToPost'])) $options['whToPost'] = 'PR'; ?>:</b> </div> 221 213 <div style="margin-left: 10px;"> 222 <input class="liWhereToPost<?php echo $ii; ?>" type="radio" name="li[<?php echo $ii; ?>][whToPost]" value="PR" <?php if ($options['whToPost'] == 'PR') echo 'checked="checked"'; ?> /> <?php _e('Profile Update', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to your profile', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>223 <input class="liWhereToPost<?php echo $ii; ?>" type="radio" name="li[<?php echo $ii; ?>][whToPost]" value="C" <?php if ($options['whToPost'] == 'C') echo 'checked="checked"'; ?> /> <?php _e('Company Page', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to Company page', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>224 225 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsLI2InfoDiv<?php echo $ii; ?>">214 <input class="liWhereToPost<?php echo esc_attr($ii); ?>" type="radio" name="li[<?php echo esc_attr($ii); ?>][whToPost]" value="PR" <?php if ($options['whToPost'] == 'PR') echo 'checked="checked"'; ?> /> <?php _e('Profile Update', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to your profile', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 215 <input class="liWhereToPost<?php echo esc_attr($ii); ?>" type="radio" name="li[<?php echo esc_attr($ii); ?>][whToPost]" value="C" <?php if ($options['whToPost'] == 'C') echo 'checked="checked"'; ?> /> <?php _e('Company Page', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to Company page', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 216 217 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsLI2InfoDiv<?php echo esc_attr($ii); ?>"> 226 218 <div style="width:100%;"> 227 219 <div> 228 <select id="li2pgID<?php echo $ii; ?>" onchange="nxs_li2PageChange('<?php echo $ii;?>',jQuery(this));" name="li[<?php echo $ii;?>][pgcID]">220 <select id="li2pgID<?php echo esc_attr($ii); ?>" onchange="nxs_li2PageChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="li[<?php echo esc_attr($ii);?>][pgcID]"> 229 221 <?php $pgi = !empty($options['pgsList'])?$options['pgsList']:''; 230 222 if (!empty($options['pgcID'])) { echo (!empty($options['pgcID']) && stripos($pgi,$options['pgcID'])===false)?'<option selected="selected" value="'.$options['pgcID'].'">'.$options['pgcID'].'</option>':''; } … … 235 227 ?><option value="a"><?php _e('.... Enter the Company Page ID'); ?></option> 236 228 </select> 237 <div id="nxsLI2InfoDivBlock<?php echo $ii; ?>" style="display: inline-block;">238 <input type="text" style="display: none;" id="li2InpCst<?php echo $ii; ?>" value="<?php echo $options['pgcID']; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="li2pgID<?php echo $ii; ?>" />239 <div style="display: inline-block;"><a onclick="nxs_li2GetPages(<?php echo $ii;?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo $nt.$ii;?>2rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo $nt.$ii;?>2ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />229 <div id="nxsLI2InfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> 230 <input type="text" style="display: none;" id="li2InpCst<?php echo esc_attr($ii); ?>" value="<?php echo $options['pgcID']; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="li2pgID<?php echo esc_attr($ii); ?>" /> 231 <div style="display: inline-block;"><a onclick="nxs_li2GetPages(<?php echo esc_attr($ii);?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo esc_attr($nt.$ii);?>2rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo esc_attr($nt.$ii);?>2ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 240 232 </div> 241 </div> <div id="nxsLI2MsgDiv<?php echo $ii; ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><i style="color: #800080"><?php _e('Please Enter your username and password to select your page', 'nxs_snap'); ?><?php } ?></i></div>233 </div> <div id="nxsLI2MsgDiv<?php echo esc_attr($ii); ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><i style="color: #800080"><?php _e('Please Enter your username and password to select your page', 'nxs_snap'); ?><?php } ?></i></div> 242 234 </div> 243 <input class="liWhereToPost<?php echo $ii; ?>" type="radio" name="li[<?php echo $ii; ?>][whToPost]" value="G" <?php if ($options['whToPost'] == 'G') echo 'checked="checked"'; ?> /> <?php _e('Group', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to LinkedIn Group', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>244 245 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsLI2GInfoDiv<?php echo $ii; ?>">235 <input class="liWhereToPost<?php echo esc_attr($ii); ?>" type="radio" name="li[<?php echo esc_attr($ii); ?>][whToPost]" value="G" <?php if ($options['whToPost'] == 'G') echo 'checked="checked"'; ?> /> <?php _e('Group', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to LinkedIn Group', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 236 237 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsLI2GInfoDiv<?php echo esc_attr($ii); ?>"> 246 238 <div style="width:100%;"> 247 239 <div> 248 <select id="li2GpgID<?php echo $ii; ?>" onchange="nxs_li2GPageChange('<?php echo $ii;?>',jQuery(this));" name="li[<?php echo $ii;?>][pggID]">240 <select id="li2GpgID<?php echo esc_attr($ii); ?>" onchange="nxs_li2GPageChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="li[<?php echo esc_attr($ii);?>][pggID]"> 249 241 <?php $pgi = !empty($options['grpList'])?$options['grpList']:''; 250 242 if (!empty($options['pggID'])) { echo (!empty($options['pggID']) && stripos($pgi,$options['pggID'])===false)?'<option selected="selected" value="'.$options['pggID'].'">'.$options['pggID'].'</option>':''; } … … 255 247 ?><option value="a"><?php _e('.... Enter the Group ID'); ?></option> 256 248 </select> 257 <div id="nxsLI2GInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;">258 <input type="text" style="display: none;" id="li2GInpCst<?php echo $ii; ?>" value="<?php echo $options['pgcID']; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="li2GpgID<?php echo $ii; ?>" />259 </div> <img id="<?php echo $nt.$ii;?>3ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />249 <div id="nxsLI2GInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> 250 <input type="text" style="display: none;" id="li2GInpCst<?php echo esc_attr($ii); ?>" value="<?php echo $options['pgcID']; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="li2GpgID<?php echo esc_attr($ii); ?>" /> 251 </div> <img id="<?php echo esc_attr($nt.$ii);?>3ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 260 252 </div> 261 253 </div> 262 254 <?php // $this->elemTitleFormat($ii,'Group Title Format','msgTFormat',empty($options['msgTFormat'])?'%TITLE%':$options['msgTFormat']); ?> 263 255 </div> 264 <input class="liWhereToPost<?php echo $ii; ?>" type="radio" name="li[<?php echo $ii; ?>][whToPost]" value="P" <?php if ($options['whToPost'] == 'P') echo 'checked="checked"'; ?> /> <?php _e('Article', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Rich text post article shared to the "Articles" section', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>256 <input class="liWhereToPost<?php echo esc_attr($ii); ?>" type="radio" name="li[<?php echo esc_attr($ii); ?>][whToPost]" value="P" <?php if ($options['whToPost'] == 'P') echo 'checked="checked"'; ?> /> <?php _e('Article', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Rich text post article shared to the "Articles" section', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 265 257 266 258 <div style="margin-left: 30px;"> … … 277 269 <?php $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?> 278 270 279 <div id="liPostType<?php echo $ii; ?>" style="<?php echo (!empty($options['whToPost']) && $options['whToPost']=='P')?'display:none;':''; ?>">271 <div id="liPostType<?php echo esc_attr($ii); ?>" style="<?php echo (!empty($options['whToPost']) && $options['whToPost']=='P')?'display:none;':''; ?>"> 280 272 <div style="width:100%;"><strong id="altFormatText">Post Type:</strong> </div> 281 273 <div style="margin-left: 10px;"> 282 274 <?php if(empty($options['postType'])) {if (( !empty($options['liAttch']) && (int)$options['liAttch'] == 1) || $isNew) $options['postType'] = 'A';} ?> 283 <input class="liPostType<?php echo $ii; ?>" type="radio" name="li[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>284 <span class="nxs_li_nxapi_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;">285 <input class="liPostType<?php echo $ii; ?>" type="radio" name="li[<?php echo $ii; ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message (Profiles and Company pages only)', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> </span>286 <input class="liPostType<?php echo $ii; ?>" type="radio" name="li[<?php echo $ii; ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Add blogpost to LinkedIn message as an attachment', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>275 <input class="liPostType<?php echo esc_attr($ii); ?>" type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 276 <span class="nxs_li_nxapi_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;"> 277 <input class="liPostType<?php echo esc_attr($ii); ?>" type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message (Profiles and Company pages only)', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> </span> 278 <input class="liPostType<?php echo esc_attr($ii); ?>" type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Add blogpost to LinkedIn message as an attachment', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 287 279 288 280 … … 290 282 <div style="margin-left: 10px;"> 291 283 <strong><?php _e('Attachment Text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><br/> 292 <input value="1" id="apLIMsgAFrmtA<?php echo $ii; ?>" <?php if (empty($options['msgAFormat']) || trim($options['msgAFormat'])=='' ) echo "checked"; ?> onchange="if (jQuery(this).is(':checked')) { jQuery('#apLIMsgAFrmtDiv<?php echo $ii; ?>').hide(); jQuery('#apLIMsgAFrmt<?php echo $ii; ?>').val(''); }else jQuery('#apLIMsgAFrmtDiv<?php echo $ii; ?>').show();" type="checkbox" name="li[<?php echo $ii; ?>][msgAFormatCB]"/> <strong><?php _e('Auto', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong>284 <input value="1" id="apLIMsgAFrmtA<?php echo esc_attr($ii); ?>" <?php if (empty($options['msgAFormat']) || trim($options['msgAFormat'])=='' ) echo "checked"; ?> onchange="if (jQuery(this).is(':checked')) { jQuery('#apLIMsgAFrmtDiv<?php echo esc_attr($ii); ?>').hide(); jQuery('#apLIMsgAFrmt<?php echo esc_attr($ii); ?>').val(''); }else jQuery('#apLIMsgAFrmtDiv<?php echo esc_attr($ii); ?>').show();" type="checkbox" name="li[<?php echo esc_attr($ii); ?>][msgAFormatCB]"/> <strong><?php _e('Auto', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> 293 285 <i> - <?php _e('Recommended. Info from SEO Plugins will be used, then post excerpt, then post text', 'social-networks-auto-poster-facebook-twitter-g'); ?> </i><br/> 294 <div id="apLIMsgAFrmtDiv<?php echo $ii; ?>" style="<?php if (empty($options['msgAFormat']) || trim($options['msgAFormat'])=='' ) echo "display:none;"; ?>" >286 <div id="apLIMsgAFrmtDiv<?php echo esc_attr($ii); ?>" style="<?php if (empty($options['msgAFormat']) || trim($options['msgAFormat'])=='' ) echo "display:none;"; ?>" > 295 287 <?php $this->elemTitleFormat($ii,'Title Format','msgATFormat',$options['msgATFormat']); $this->elemMsgFormat($ii,'Message Format','msgAFormat',$options['msgAFormat']); ?> 296 288 … … 350 342 </th><td> 351 343 352 <input type="radio" name="li[<?php echo $ii; ?>][postType]" value="T" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /><?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>353 <span class="nxs_li_nxapi_<?php echo $ii; ?>" style="display: <?php echo (!empty($ntOpt['apiToUse']) && $ntOpt['apiToUse'] =='nx')?"block":"none"; ?>;">354 <input type="radio" name="li[<?php echo $ii; ?>][postType]" value="I" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo $nt.$ii;?>').show();" /> <?php _e('Post to LinkedIn as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> </span>355 <input type="radio" name="li[<?php echo $ii; ?>][postType]" value="A" <?php if ( empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo $nt.$ii;?>').hide();" /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>344 <input type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /><?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 345 <span class="nxs_li_nxapi_<?php echo esc_attr($ii); ?>" style="display: <?php echo (!empty($ntOpt['apiToUse']) && $ntOpt['apiToUse'] =='nx')?"block":"none"; ?>;"> 346 <input type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo esc_attr($nt.$ii);?>').show();" /> <?php _e('Post to LinkedIn as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> </span> 347 <input type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo esc_attr($nt.$ii);?>').hide();" /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 356 348 </td></tr> <?php } else { 357 349 $this->elemEdTitleFormat($ii, __('Article Title Format:', 'social-networks-auto-poster-facebook-twitter-g'),htmlentities($ntOpt['msgCTFormat'])); … … 380 372 <div class="nxsPostEd_ElemLabel"><?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 381 373 <div class="nxsPostEd_Elem"> 382 <input type="radio" name="li[<?php echo $ii; ?>][postType]" value="T" class="nxsEdElem nxsImgCtrlCb" data-nt="<?php echo $nt; ?>" data-ii="<?php echo $ii; ?>" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /><?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>383 <span class="nxs_li_nxapi_<?php echo $ii; ?>" style="display: <?php echo (!empty($ntOpt['apiToUse']) && $ntOpt['apiToUse'] =='nx')?"block":"none"; ?>;">384 <input type="radio" name="li[<?php echo $ii; ?>][postType]" value="I" class="nxsEdElem nxsImgCtrlCb" data-nt="<?php echo $nt; ?>" data-ii="<?php echo $ii; ?>" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo $nt.$ii;?>').show();" /> <?php _e('Post to LinkedIn as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> </span>385 <input type="radio" name="li[<?php echo $ii; ?>][postType]" value="A" class="nxsEdElem nxsImgCtrlCb" data-nt="<?php echo $nt; ?>" data-ii="<?php echo $ii; ?>" <?php if ( empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo $nt.$ii;?>').hide();" /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>374 <input type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="T" class="nxsEdElem nxsImgCtrlCb" data-nt="<?php echo esc_attr($nt); ?>" data-ii="<?php echo esc_attr($ii); ?>" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'T') echo 'checked="checked"'; ?> /><?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 375 <span class="nxs_li_nxapi_<?php echo esc_attr($ii); ?>" style="display: <?php echo (!empty($ntOpt['apiToUse']) && $ntOpt['apiToUse'] =='nx')?"block":"none"; ?>;"> 376 <input type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="I" class="nxsEdElem nxsImgCtrlCb" data-nt="<?php echo esc_attr($nt); ?>" data-ii="<?php echo esc_attr($ii); ?>" <?php if (!empty($ntOpt['postType']) && $ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo esc_attr($nt.$ii);?>').show();" /> <?php _e('Post to LinkedIn as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> </span> 377 <input type="radio" name="li[<?php echo esc_attr($ii); ?>][postType]" value="A" class="nxsEdElem nxsImgCtrlCb" data-nt="<?php echo esc_attr($nt); ?>" data-ii="<?php echo esc_attr($ii); ?>" <?php if ( empty($ntOpt['postType']) || $ntOpt['postType'] == 'A') echo 'checked="checked"'; ?> onchange="jQuery('#altFormatIMG<?php echo esc_attr($nt.$ii);?>').hide();" /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 386 378 </div> 387 379 </div> <?php } else { … … 423 415 } 424 416 } 425 426 function nxsCptCheck() { $advSettings = array(); 427 if (!empty($_POST['c'])) { $seForDB = get_option('nxs_li_ctp_save'); $ser = maybe_unserialize($seForDB); $ck = $ser['c']; $flds = $ser['f']; 428 $flds['recaptcha_response_field'] = $_POST['c']; $liObj = new nxsAPI_LI(); $hdrsArr = $liObj->headers('https://www.linkedin.com/uas/login-submit', 'https://www.linkedin.com', 'POST', false); 429 $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'redirection' => 0, 'cookies' => $ck, 'body' => $flds); // prr($advSet); 430 $rep = nxs_remote_post('https://www.linkedin.com/uas/captcha-submit', $advSet); if (is_nxs_error($rep)) { $badOut = print_r($rep, true)." - ERROR"; return $badOut; } $contents2 = $rep['body']; 431 if (stripos($contents2, '<span class="error">')!==false) { echo strip_tags(CutFromTo($contents2, '<span class="error">', '</span>')); die(); } 432 if (stripos($contents2, '<div id="global-error">')!==false) { echo CutFromTo($contents2, '<div role="alert" class="alert error">', '</div>'); die(); } 433 if (stripos($contents2, 'The email address or password you provided does not match our records')!==false) { echo "Invalid Login/Password"; die(); } 434 if (stripos($contents2, 'Hmm, ')!==false) { echo "Invalid Login/Password"; die(); } 435 if ($rep['response']['code']=='302' && !empty($rep['headers']['location']) && stripos($rep['headers']['location'], 'linkedin.com/uas/captcha-submit')!==false) echo "Wrong Captcha. Please try Again"; 436 if ($rep['response']['code']=='302' && !empty($rep['headers']['location']) && (stripos($rep['headers']['location'], 'linkedin.com/nhome')!==false || stripos($rep['headers']['location'], 'linkedin.com/home')!==false)) { echo "OK. You are In"; 437 $hdrsArr = $liObj->headers('http://www.linkedin.com/home', 'https://www.linkedin.com'); $ck = $rep['cookies']; 438 $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'redirection' => 0, 'cookies' => $ck); // prr($advSet); 439 $rep = nxs_remote_get('http://www.linkedin.com/profile/edit?trk=tab_pro', $advSet); if (is_nxs_error($rep)) { $badOut = print_r($rep, true)." - ERROR"; return $badOut; } $ck = $rep['cookies']; 440 if ($_POST['i']!='') { global $nxs_SNAP; if (!isset($nxs_SNAP)) return; $options = $nxs_SNAP->nxs_options; 441 $options['li'][$_POST['i']]['ck'] = $ck; if (is_array($options)) update_option('NS_SNAutoPoster', $options, false); 442 } 443 } 444 } 445 if (!empty($_POST['s'])) { echo "CODE!"; $seForDB = get_option('nxs_li_ctp_save'); $ser = maybe_unserialize($seForDB); $ck = $ser['c']; $flds = $ser['f']; $fa = $ser['fa']; // prr($ser); 446 $flds['PinVerificationForm_pinParam'] = $_POST['s']; $liObj = new nxsAPI_LI(); $hdrsArr = $liObj->headers('https://www.linkedin.com/uas/login-submit', 'https://www.linkedin.com', 'POST', true); 447 $advSet = nxs_mkRemOptsArr($hdrsArr, $ck, $flds, $liObj->proxy); $rep=nxs_remote_post('https://www.linkedin.com'.$fa,$advSet); if (is_nxs_error($rep)) {$badOut = print_r($rep, true)." - ERROR"; return $badOut; } $contents2 = $rep['body']; // prr($rep); 448 449 if (stripos($contents2, 'The email address or password you provided does not match our records')!==false) { echo "Invalid Login/Password"; die(); } 450 if (stripos($contents2, '<div id="global-error">')!==false) { echo CutFromTo($contents2, '<div role="alert" class="alert error">', '</div>'); die(); } 451 if (stripos($contents2, 'Hmm, ')!==false) { echo "Invalid Login/Password"; die(); } 452 if ($rep['response']['code']=='302' && !empty($rep['headers']['location']) && stripos($rep['headers']['location'], 'linkedin.com/uas/ato-pin-challenge-submit')!==false) echo "Wrong Code. Please try Again"; 453 if ($rep['response']['code']=='302' && !empty($rep['headers']['location']) && (stripos($rep['headers']['location'], 'linkedin.com/nhome')!==false || stripos($rep['headers']['location'], 'linkedin.com/home')!==false)) echo "OK. You are In"; 454 455 $hdrsArr = $liObj->headers('http://www.linkedin.com/home', 'https://www.linkedin.com'); $ck = nxsMergeArraysOV($ck, $rep['cookies']); $advSet = nxs_mkRemOptsArr($hdrsArr, $ck, '', $liObj->proxy); 456 $rep = nxs_remote_get('http://www.linkedin.com/profile/edit?trk=tab_pro', $advSet);if (is_nxs_error($rep)) { $badOut = print_r($rep, true)." - ERROR"; return $badOut; } $ck = nxsMergeArraysOV($ck, $rep['cookies']); 457 if (!empty($ck)) $ck = nxsClnCookies($ck); 458 459 if ($_POST['i']!='') { global $nxs_SNAP; if (!isset($nxs_SNAP)) return; $options = $nxs_SNAP->nxs_options; $nto = $options['li'][$_POST['i']]; 460 $opVal = array(); $opNm = 'nxs_snap_li_'.sha1('nxs_snap_li'.$nto['uName'].$nto['uPass']); $opVal['ck'] = $ck; nxs_saveOption($opNm, $opVal); 461 } 462 } die(); 463 } 464 417 465 418 }} 466 419 function adjAfterPost(&$options, &$ret){ if ($ret['isPosted']=='1') nxs_save_glbNtwrks('li', $options['ii'], '', 'session'); } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/lj.php
r1968023 r2757212 27 27 28 28 <br/ ><div style="width:100%;"><b><?php _e('Website', 'nxs_snap'); ?></b><br/><?php _e('Please select your website. SNAP could post to LJ Engine Based sites like DreamWidth.org', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 29 <div id="nxsLJInfoDiv<?php echo $ii; ?>">29 <div id="nxsLJInfoDiv<?php echo esc_attr($ii); ?>"> 30 30 <div style="width:100%;"> 31 <select id="lj1delayHrs" name="lj[<?php echo $ii; ?>][ljSrv]"><option <?php if ( empty($options['ljSrv']) || $options['ljSrv']=='LJ') {?> selected="selected" <?php } ?> value="LJ">LiveJournal.com</option>31 <select id="lj1delayHrs" name="lj[<?php echo esc_attr($ii); ?>][ljSrv]"><option <?php if ( empty($options['ljSrv']) || $options['ljSrv']=='LJ') {?> selected="selected" <?php } ?> value="LJ">LiveJournal.com</option> 32 32 <option <?php if ( isset($options['ljSrv']) && $options['ljSrv']=='DW') {?> selected="selected" <?php } ?> value="DW">DreamWidth.org</option> 33 33 </select> 34 34 </div> 35 35 </div><br/> 36 <div style="width:100%;"><br/><b><?php _e('Blog/Community URL or ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b><br/><?php _e('Please specify the Blog or Community URL or ID. Use this only if you are posting NOT to your own journal.', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/><input name="lj[<?php echo $ii; ?>][commID]" id="commID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['commID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />36 <div style="width:100%;"><br/><b><?php _e('Blog/Community URL or ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b><br/><?php _e('Please specify the Blog or Community URL or ID. Use this only if you are posting NOT to your own journal.', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/><input name="lj[<?php echo esc_attr($ii); ?>][commID]" id="commID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['commID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 37 37 </div> 38 38 <br/><br/> 39 39 <?php $this->elemTitleFormat($ii,'Post Title Format','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Post Text Format','msgFormat',$options['msgFormat']);?> 40 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" id="ljInclTags<?php echo $ii; ?>" type="checkbox" name="lj[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> />40 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" id="ljInclTags<?php echo esc_attr($ii); ?>" type="checkbox" name="lj[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> 41 41 <b><?php _e('Post with tags.', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <?php _e('Tags from the blogpost will be auto posted to LiveJournal', 'social-networks-auto-poster-facebook-twitter-g') ?> 42 42 43 <br/><input value="1" type="checkbox" name="lj[<?php echo $ii; ?>][useOrDate]" <?php if ((int)$options['useOrDate'] == 1) echo "checked"; ?> />43 <br/><input value="1" type="checkbox" name="lj[<?php echo esc_attr($ii); ?>][useOrDate]" <?php if ((int)$options['useOrDate'] == 1) echo "checked"; ?> /> 44 44 <strong>Keep Original Post Date</strong> Will post to LJ with original date of the post 45 45 -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/ln.php
r1905522 r2757212 13 13 function accTab($ii, $options, $isNew=false){ $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; if (empty($options['attchImg'])) $options['attchImg'] = 0; if (!isset($options['webPrev'])) $options['webPrev'] = 1; ?> <br/ > 14 14 15 <div style="width:100%;"><strong><?php _e('Channel access token (long-lived)', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong></div><input name="ln[<?php echo $ii; ?>][botTkn]" style="width: 70%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['botTkn'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>16 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i> <?php _e('User ID, Group ID or Room ID', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="ln[<?php echo $ii; ?>][whToPost]" style="width: 70%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['whToPost'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>15 <div style="width:100%;"><strong><?php _e('Channel access token (long-lived)', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong></div><input name="ln[<?php echo esc_attr($ii); ?>][botTkn]" style="width: 70%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['botTkn'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 16 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i> <?php _e('User ID, Group ID or Room ID', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="ln[<?php echo esc_attr($ii); ?>][whToPost]" style="width: 70%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['whToPost'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 17 17 <br/><?php $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?> 18 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>18 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 19 19 <br/><?php 20 20 } … … 46 46 47 47 <?php $this->elemEdMsgFormat($ii, __('Message Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgFormat); ?> 48 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][webPrev]"/>49 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][webPrev]" <?php if ((int)$ntOpt['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr>50 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]"/>51 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr>48 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"/> 49 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" <?php if ((int)$ntOpt['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr> 50 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 51 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr> 52 52 <?php 53 53 /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); nxs_showURLToUseDlg($nt, $ii, $urlToUse); $this->nxs_tmpltAddPostMetaEnd($ii); … … 64 64 <div class="nxsPostEd_ElemWrap"> 65 65 <div class="nxsPostEd_Elem"> 66 <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]"/>67 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if (!empty($ntOpt['attchImg'])) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>66 <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 67 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (!empty($ntOpt['attchImg'])) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 68 68 </div> 69 69 </div><?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/mc.php
r2361462 r2757212 13 13 function accTab($ii, $options, $isNew=false){ $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; if (!isset($options['segment'])) $options['segment'] = ''; ?> <br/ > 14 14 15 <div style="width:100%;"><strong><?php _e('API Key', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong></div><input name="mc[<?php echo $ii; ?>][apikey]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['apikey'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>16 <div style="width:100%;"><strong><?php _e('Recipients List ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('The unique recipients list id', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo $ii; ?>][listID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['listID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>17 <div style="width:100%;"><strong><?php _e('Recipients List Segment', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('[Optional] This field may contain a saved segment id', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo $ii; ?>][segment]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['segment'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>18 <div style="width:100%;"><strong><?php _e('From name', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('The [From] name on the campaign (not an email address).', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo $ii; ?>][fromName]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fromName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>19 <div style="width:100%;"><strong><?php _e('From Email', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('The reply-to email address for the campaign', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo $ii; ?>][fromEmail]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fromEmail'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>15 <div style="width:100%;"><strong><?php _e('API Key', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong></div><input name="mc[<?php echo esc_attr($ii); ?>][apikey]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['apikey'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 16 <div style="width:100%;"><strong><?php _e('Recipients List ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('The unique recipients list id', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo esc_attr($ii); ?>][listID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['listID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 17 <div style="width:100%;"><strong><?php _e('Recipients List Segment', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('[Optional] This field may contain a saved segment id', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo esc_attr($ii); ?>][segment]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['segment'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 18 <div style="width:100%;"><strong><?php _e('From name', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('The [From] name on the campaign (not an email address).', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo esc_attr($ii); ?>][fromName]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fromName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 19 <div style="width:100%;"><strong><?php _e('From Email', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('The reply-to email address for the campaign', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="mc[<?php echo esc_attr($ii); ?>][fromEmail]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fromEmail'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 20 20 <br/><?php $this->elemTitleFormat($ii,'Message Subject','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Message Text','msgFormat',$options['msgFormat']); 21 21 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/md.php
r2650607 r2757212 11 11 //#### Show Unit Settings 12 12 function checkIfSetupFinished($options) { return !empty($options['accessToken']); } 13 function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; if (isset($_GET['acc'])) $options = $this->nt[$_GET['acc']]; 14 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ 15 //if(stripos($nxs_snapSetPgURL, 'page=NextScripts_SNAP.php')===false) { $newURL = explode('?', $nxs_snapSetPgURL); $nxs_snapSetPgURL = $newURL[0]; } 16 $url = 'https://medium.com/m/oauth/authorize?client_id='.nxs_gak($options['appKey']).'&scope=basicProfile,publishPost,listPublications&state=nxsmdauth-'. $_GET['auth'].'-'.$_GET['acc'].'&response_type=code&redirect_uri='.urlencode($nxs_snapSetPgURL); 17 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; 18 die(); 19 } 20 if ( isset($_GET['state']) && strlen($_GET['state'])>13 && substr($_GET['state'],0,12)=='nxsmdauth-md'){ $ii = explode('-',$_GET['state']); $ii = $ii[2]; $options = $this->nt[$ii]; 21 $data = array('code'=>$_GET['code'], 'client_id'=>nxs_gak($options['appKey']),'client_secret'=>nxs_gas($options['appSec']),'grant_type'=>'authorization_code','redirect_uri'=>$nxs_snapSetPgURL); 22 $hdrsArr = array(); $hdrsArr['Content-Type']='application/x-www-form-urlencoded'; $hdrsArr['Accept']='application/json'; $hdrsArr['Accept-Charset']='utf-8'; 23 $hdrsArr['Cache-Control']='max-age=0'; $hdrsArr['Connection']='keep-alive'; $hdrsArr['Referer']=''; 24 $hdrsArr['User-Agent']='Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.54 Safari/537.36'; 25 $advSet = nxs_mkRemOptsArr($hdrsArr, '', $data); $rep = nxs_remote_post('https://api.medium.com/v1/tokens/', $advSet); prr($advSet); prr($rep); 26 $bd = json_decode($rep['body'], true); if (!is_array($bd)) die('ERROR'); else prr($bd); $options['accessToken'] = $bd['access_token']; 27 28 $hdrsArr['Authorization']='Bearer '.$options['accessToken']; 29 $advSet = nxs_mkRemOptsArr($hdrsArr); $rep = nxs_remote_get('https://api.medium.com/v1/me', $advSet); prr($advSet); prr($rep); if (is_nxs_error($rep)) { $badOut = print_r($rep, true)." - ERROR -02-"; return $badOut; } 30 $bd = json_decode($rep['body'], true); if (!is_array($bd) || !is_array($bd['data'])) die('ERROR'); else prr($bd); $bd = $bd['data']; 31 $options['appAppUserID'] = $bd['id']; $options['appAppUserName'] = $bd['name'].' ('.$bd['username'].')'; $options['appAppUserURL'] = $bd['url']; 32 33 $rep = nxs_remote_get('https://api.medium.com/v1/users/'.$options['appAppUserID'].'/publications', $advSet); prr($advSet); prr($rep); 34 $bd = json_decode($rep['body'], true); if (!is_array($bd) || !is_array($bd['data'])) die('ERROR'); else prr($bd); $bd = $bd['data']; $pubList = array(); 35 foreach ($bd as $d) { $repX = nxs_remote_get('https://api.medium.com/v1/publications/'.$d['id'].'/contributors', $advSet); 36 $bdX = json_decode($repX['body'], true); if (!is_array($bdX) || !is_array($bdX['data'])) die('ERROR'); else prr($bdX); $bdX = $bdX['data']; 37 foreach ($bdX as $dX) { if ($dX['userId']==$options['appAppUserID']) { $pubList[] = array('id'=>$d['id'], 'name'=>$d['name']); break; }} 38 } $options['pubList'] = $pubList; 39 40 nxs_save_glbNtwrks($ntInfo['lcode'],$ii,$options,'*'); prr($options); 41 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$nxs_snapSetPgURL.'"</script>'; die(); 13 function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 14 if (isset($_GET['acc'])) { $acc = sanitize_text_field($_GET['acc']); $options = $this->nt[$acc]; 15 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ 16 //if(stripos($nxs_snapSetPgURL, 'page=NextScripts_SNAP.php')===false) { $newURL = explode('?', $nxs_snapSetPgURL); $nxs_snapSetPgURL = $newURL[0]; } 17 $url = 'https://medium.com/m/oauth/authorize?client_id='.nxs_gak($options['appKey']).'&scope=basicProfile,publishPost,listPublications&state=nxsmdauth-'. sanitize_text_field($_GET['auth']).'-'.$acc.'&response_type=code&redirect_uri='.urlencode($nxs_snapSetPgURL); 18 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; 19 die(); 20 } 21 if ( isset($_GET['state']) && strlen($_GET['state'])>13 && substr($_GET['state'],0,12)=='nxsmdauth-md'){ $ii = explode('-',sanitize_text_field($_GET['state'])); $ii = $ii[2]; $options = $this->nt[$ii]; 22 $data = array('code'=>sanitize_text_field($_GET['code']), 'client_id'=>nxs_gak($options['appKey']),'client_secret'=>nxs_gas($options['appSec']),'grant_type'=>'authorization_code','redirect_uri'=>$nxs_snapSetPgURL); 23 $hdrsArr = array(); $hdrsArr['Content-Type']='application/x-www-form-urlencoded'; $hdrsArr['Accept']='application/json'; $hdrsArr['Accept-Charset']='utf-8'; 24 $hdrsArr['Cache-Control']='max-age=0'; $hdrsArr['Connection']='keep-alive'; $hdrsArr['Referer']=''; 25 $hdrsArr['User-Agent']='Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.54 Safari/537.36'; 26 $advSet = nxs_mkRemOptsArr($hdrsArr, '', $data); $rep = nxs_remote_post('https://api.medium.com/v1/tokens/', $advSet); prr($advSet); prr($rep); 27 $bd = json_decode($rep['body'], true); if (!is_array($bd)) die('ERROR'); else prr($bd); $options['accessToken'] = $bd['access_token']; 28 29 $hdrsArr['Authorization']='Bearer '.$options['accessToken']; 30 $advSet = nxs_mkRemOptsArr($hdrsArr); $rep = nxs_remote_get('https://api.medium.com/v1/me', $advSet); prr($advSet); prr($rep); if (is_nxs_error($rep)) { $badOut = print_r($rep, true)." - ERROR -02-"; return $badOut; } 31 $bd = json_decode($rep['body'], true); if (!is_array($bd) || !is_array($bd['data'])) die('ERROR'); else prr($bd); $bd = $bd['data']; 32 $options['appAppUserID'] = $bd['id']; $options['appAppUserName'] = $bd['name'].' ('.$bd['username'].')'; $options['appAppUserURL'] = $bd['url']; 33 34 $rep = nxs_remote_get('https://api.medium.com/v1/users/'.$options['appAppUserID'].'/publications', $advSet); prr($advSet); prr($rep); 35 $bd = json_decode($rep['body'], true); if (!is_array($bd) || !is_array($bd['data'])) die('ERROR'); else prr($bd); $bd = $bd['data']; $pubList = array(); 36 foreach ($bd as $d) { $repX = nxs_remote_get('https://api.medium.com/v1/publications/'.$d['id'].'/contributors', $advSet); 37 $bdX = json_decode($repX['body'], true); if (!is_array($bdX) || !is_array($bdX['data'])) die('ERROR'); else prr($bdX); $bdX = $bdX['data']; 38 foreach ($bdX as $dX) { if ($dX['userId']==$options['appAppUserID']) { $pubList[] = array('id'=>$d['id'], 'name'=>$d['name']); break; }} 39 } $options['pubList'] = $pubList; 40 41 nxs_save_glbNtwrks($ntInfo['lcode'],$ii,$options,'*'); prr($options); 42 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$nxs_snapSetPgURL.'"</script>'; die(); 43 } 42 44 } 43 45 } … … 49 51 <div style="font-size: 11px; margin: 0px;"><?php _e('Currently available way to connect to Medium', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 50 52 </div> 51 <label for="sesDiv<?php echo $nt; ?><?php echo $ii; ?>session">Integration token:</label>52 <input style="max-width:400px;" class="nxAccEdElem form-control" id="sesDiv<?php echo $nt; ?><?php echo $ii; ?>accessToken" name="<?php echo $nt; ?>[<?php echo $ii; ?>][accessToken]" value="<?php echo($options['accessToken']); ?>" /><br/>53 <label for="sesDiv<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>session">Integration token:</label> 54 <input style="max-width:400px;" class="nxAccEdElem form-control" id="sesDiv<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>accessToken" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][accessToken]" value="<?php echo($options['accessToken']); ?>" /><br/> 53 55 54 56 </div> … … 62 64 </div> 63 65 64 <br/><br/><div><b style="font-size: 15px;"><?php _e('Where to post:', 'social-networks-auto-poster-facebook-twitter-g'); ?></b><select name="md[<?php echo $ii; ?>][publ]"><option <?php if (empty($options['publ'])) echo 'selected="selected"'; ?> value="0">Profile</option>66 <br/><br/><div><b style="font-size: 15px;"><?php _e('Where to post:', 'social-networks-auto-poster-facebook-twitter-g'); ?></b><select name="md[<?php echo esc_attr($ii); ?>][publ]"><option <?php if (empty($options['publ'])) echo 'selected="selected"'; ?> value="0">Profile</option> 65 67 <?php if (!empty($options['pubList'])) { ?> <?php foreach ($options['pubList'] as $pb) {?> <option <?php if ((string)$pb['id']==(string)$options['publ']) echo 'selected="selected"'; ?> value="<?php echo $pb['id']; ?>">[Publication] <?php echo $pb['name']; ?></option> <?php }} ?></select> 66 68 </div> 67 69 <br/><?php $this->elemTitleFormat($ii,'Title Format','msgTFormat',$options['msgTFormat']); ?> <br/><?php $this->elemMsgFormat($ii,'Message Text Format','msgFormat',$options['msgFormat']); ?> 68 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> />70 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> 69 71 <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> <?php _e('Tags from the blogpost will be auto-posted to '.$ntInfo['name'], 'social-networks-auto-poster-facebook-twitter-g'); ?> 70 72 </div> <br/> … … 73 75 _e('Your '.$ntInfo['name'].' Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> User: <?php _e(apply_filters('format_to_edit', htmlentities($options['appAppUserName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>. 74 76 <?php _e('You can', 'social-networks-auto-poster-facebook-twitter-g'); ?> Re- <?php } ?> 75 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo $nt; ?>&acc=<?php echo $ii; ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a>77 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo esc_attr($nt); ?>&acc=<?php echo esc_attr($ii); ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a> 76 78 <?php if (!isset($options['appAppUserID']) || $options['appAppUserID']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div> <?php } 77 79 } ?><br/><br/> <?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/ok.php
r1905522 r2757212 17 17 18 18 <div style="width:100%;"><strong>Group ID:</strong> </div> 19 <input name="<?php echo $nt; ?>[<?php echo $ii; ?>][gid]"style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['gid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />19 <input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][gid]"style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['gid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 20 20 <br/><br/> 21 21 … … 24 24 <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 25 25 <div style="margin-left: 10px;"> 26 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>27 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Text with image', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>28 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Post link to the blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>26 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 27 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Text with image', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 28 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Post link to the blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 29 29 </div><br/><br/> 30 30 … … 60 60 ?> 61 61 <tr class="nxstbldo <?php echo 'nxstbldo'.strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> <br/></th><td> 62 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>63 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="I" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('Text with Image', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>64 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>62 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 63 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('Text with Image', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 64 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 65 65 </td></tr> 66 66 <?php … … 81 81 <div class="nxsPostEd_ElemLabel"><?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 82 82 <div class="nxsPostEd_Elem"> 83 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>84 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('Text with Image', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>85 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>83 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 84 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('Text with Image', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 85 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 86 86 </div> 87 87 </div><?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/pk.php
r1905522 r2757212 25 25 //#### Show Unit Settings 26 26 function checkIfSetupFinished($options) { return !empty($options['pgID']) && !empty($options['accessToken']); } 27 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 28 if ( isset($_GET['auth']) && $_GET['auth']=='pk'){ require_once('apis/plurkOAuth.php'); $options = $this->nt[$_GET['acc']]; prr($options, 'OPTS:'); prr($this->nt, 'OPTS:'); 29 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); $callback_url = $nxs_snapSetPgURL."&auth=pka&acc=".$_GET['acc']; 30 $tum_oauth = new wpPlurkOAuth($consumer_key, $consumer_secret); $request_token = $tum_oauth->getReqToken($callback_url); 31 $options['oAuthToken'] = $request_token['oauth_token']; $options['oAuthTokenSecret'] = $request_token['oauth_token_secret']; //prr($tum_oauth); prr($options); //die(); 32 switch ($tum_oauth->http_code) { case 200: $url = 'https://www.plurk.com/OAuth/authorize?oauth_token='.$options['oAuthToken']; nxs_save_glbNtwrks($ntInfo['lcode'],$_GET['acc'],$options,'*'); 33 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; break; 27 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 28 if (isset($_GET['acc'])) { $acc = sanitize_text_field($_GET['acc']); $options = $this->nt[$acc]; 29 if ( isset($_GET['auth']) && $_GET['auth']=='pk'){ require_once('apis/plurkOAuth.php'); prr($options, 'OPTS:'); prr($this->nt, 'OPTS:'); 30 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); $callback_url = $nxs_snapSetPgURL."&auth=pka&acc=".$acc; 31 $tum_oauth = new wpPlurkOAuth($consumer_key, $consumer_secret); $request_token = $tum_oauth->getReqToken($callback_url); 32 $options['oAuthToken'] = $request_token['oauth_token']; $options['oAuthTokenSecret'] = $request_token['oauth_token_secret']; //prr($tum_oauth); prr($options); //die(); 33 switch ($tum_oauth->http_code) { case 200: $url = 'https://www.plurk.com/OAuth/authorize?oauth_token='.$options['oAuthToken']; nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 34 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; break; 34 35 default: echo '<br/><b style="color:red">Could not connect to Plurk. Refresh the page or try again later.</b>'; die(); 35 36 } 36 37 die(); 37 }38 if ( isset($_GET['auth']) && $_GET['auth']=='pka'){ require_once('apis/plurkOAuth.php'); $options = $this->nt[$_GET['acc']];38 } 39 if ( isset($_GET['auth']) && $_GET['auth']=='pka'){ require_once('apis/plurkOAuth.php'); 39 40 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); prr($options, 'OPTS:'); 40 41 $tum_oauth = new wpPlurkOAuth($consumer_key, $consumer_secret, $options['oAuthToken'], $options['oAuthTokenSecret']); //prr($tum_oauth); 41 42 $access_token = $tum_oauth->getAccToken($_GET['oauth_verifier']); prr($access_token); 42 $options['accessToken'] = $access_token['oauth_token']; $options['accessTokenSec'] = $access_token['oauth_token_secret']; 43 nxs_save_glbNtwrks($ntInfo['lcode'],$ _GET['acc'],$options,'*');44 $tum_oauth = new wpPlurkOAuth($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 45 $uinfo = $tum_oauth->makeReq('https://www.plurk.com/APP/Profile/getOwnProfile', $params); 43 $options['accessToken'] = $access_token['oauth_token']; $options['accessTokenSec'] = $access_token['oauth_token_secret']; 44 nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 45 $tum_oauth = new wpPlurkOAuth($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 46 $uinfo = $tum_oauth->makeReq('https://www.plurk.com/APP/Profile/getOwnProfile', $params); 46 47 if (is_array($uinfo) && isset($uinfo['user_info'])) $userinfo = $uinfo['user_info']['display_name']; 47 if (empty($userinfo) && is_array($uinfo) && isset($uinfo['user_info'])) $userinfo = $uinfo['user_info']['nick_name']; $options['pgID'] = $userinfo; 48 nxs_save_glbNtwrks($ntInfo['lcode'],$ _GET['acc'],$options,'*');49 if ($options['pgID']!='') { 48 if (empty($userinfo) && is_array($uinfo) && isset($uinfo['user_info'])) $userinfo = $uinfo['user_info']['nick_name']; $options['pgID'] = $userinfo; 49 nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 50 if ($options['pgID']!='') { 50 51 $gGet = $_GET; unset($gGet['auth']); unset($gGet['acc']); unset($gGet['oauth_token']); unset($gGet['oauth_verifier']); unset($gGet['post_type']); 51 52 $sturl = explode('?',$nxs_snapSetPgURL); $nxs_snapSetPgURL = $sturl[0].((!empty($gGet))?'?'.http_build_query($gGet):''); 52 53 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$nxs_snapSetPgURL.'"</script>'; die(); 53 54 } 54 else die("<span style='color:red;'>ERROR: Authorization Error: <span style='color:darkred; font-weight: bold;'>".$options['pgID']."</span></span>"); 55 } 55 else die("<span style='color:red;'>ERROR: Authorization Error: <span style='color:darkred; font-weight: bold;'>".$options['pgID']."</span></span>"); 56 } 57 } 56 58 } 57 59 58 60 function accTab($ii, $options, $isNew=false){ global $nxs_snapSetPgURL; $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; ?> 59 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Your Plurk URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][pkURL]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pkURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>61 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Your Plurk URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][pkURL]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pkURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 60 62 <?php $this->elemKeySecret($ii,'App Key','App Secret', $options['appKey'], $options['appSec'],'appKey','appSec','https://www.plurk.com/PlurkApp/'); ?> 61 63 <div style=""> <div style="width:100%;"><strong id="altFormatText">Plurk prefix:</strong> </div> 62 <select name="pk[<?php echo $ii; ?>][pkCat]" id="pkCat<?php echo $ii; ?>">64 <select name="pk[<?php echo esc_attr($ii); ?>][pkCat]" id="pkCat<?php echo esc_attr($ii); ?>"> 63 65 <?php $pkCats = $this->pkCats(); if (isset($options['pkCat']) && $options['pkCat']!='') $pkCats = str_replace($options['pkCat'].'"', $options['pkCat'].'" selected="selected"', $pkCats); echo $pkCats; ?> 64 66 </select> 65 67 </div> 66 <div style="margin: 0px;"><input value="1" id="apLIAttch" type="checkbox" name="pk[<?php echo $ii; ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong>Attach Image to Plurk Post</strong></div>68 <div style="margin: 0px;"><input value="1" id="apLIAttch" type="checkbox" name="pk[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong>Attach Image to Plurk Post</strong></div> 67 69 <?php $this->elemMsgFormat($ii,'Post Format','msgFormat',$options['msgFormat']); ?> 68 70 … … 74 76 Your Plurk Account has been authorized. Your display name: <?php _e(apply_filters('format_to_edit', htmlentities($options['pgID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>. 75 77 You can Re- <?php } ?> 76 <a href="<?php echo $nxs_snapSetPgURL.(stripos($nxs_snapSetPgURL, '?')!==false?'&':'?');?>auth=pk&acc=<?php echo $ii; ?>">Authorize Your Plurk Account</a>78 <a href="<?php echo $nxs_snapSetPgURL.(stripos($nxs_snapSetPgURL, '?')!==false?'&':'?');?>auth=pk&acc=<?php echo esc_attr($ii); ?>">Authorize Your Plurk Account</a> 77 79 <?php if (empty($options['oAuthTokenSecret'])) { ?> <div class="blnkg"><=== Authorize your account ===</div> <?php } ?> 78 80 <?php } ?> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/pn.php
r2469838 r2757212 41 41 <div style="font-size: 11px; margin: 0px;"><?php _e('[Optional] Please use this only if you are having troubles to login/post without it.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 42 42 </div> 43 <label for="sesDiv<?php echo $nt; ?><?php echo $ii; ?>session">Session ID</label>44 <input style="max-width:400px;" class="nxAccEdElem form-control" id="sesDiv<?php echo $nt; ?><?php echo $ii; ?>session" name="<?php echo $nt; ?>[<?php echo $ii; ?>][session]" value="<?php echo($options['session']); ?>" /><br/>43 <label for="sesDiv<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>session">Session ID</label> 44 <input style="max-width:400px;" class="nxAccEdElem form-control" id="sesDiv<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>session" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][session]" value="<?php echo($options['session']); ?>" /><br/> 45 45 46 46 </div> 47 47 48 48 <br/ ><div style="width:100%;"><b><?php _e('Board', 'nxs_snap'); ?></b> (<?php _e('Please select the board to post to', 'nxs_snap'); ?>)</div> 49 <div id="nxsPNInfoDiv<?php echo $ii; ?>">49 <div id="nxsPNInfoDiv<?php echo esc_attr($ii); ?>"> 50 50 <div style="width:100%;"> 51 51 <div> 52 <select id="pnBoard<?php echo $ii; ?>" onchange="nxs_pnBoardChange('<?php echo $ii;?>',jQuery(this));" name="pn[<?php echo $ii;?>][pnBoard]">52 <select id="pnBoard<?php echo esc_attr($ii); ?>" onchange="nxs_pnBoardChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="pn[<?php echo esc_attr($ii);?>][pnBoard]"> 53 53 <?php $pgi = !empty($options['pnBoardsList'])?$options['pnBoardsList']:''; 54 54 echo (!empty($pgi) && stripos($pgi,$options['pnBoard'])===false)?'<option selected="selected" value="'.$options['pnBoard'].'">'.$options['pnBoard'].'</option>':''; … … 57 57 echo $pgi; 58 58 ?> 59 </select><div id="nxsPNInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="pnBRDIDCst<?php echo $ii; ?>" value="<?php echo !empty($options['pnBoard'])?$options['pnBoard']:''; ?>" class="nxs_pnBRDIDcst" data-tid="pnBoard<?php echo $ii; ?>" />60 <div style="display: inline-block;"><a onclick="nxs_pnGetBoards(<?php echo $ii;?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo $nt.$ii;?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo $nt.$ii;?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />59 </select><div id="nxsPNInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="pnBRDIDCst<?php echo esc_attr($ii); ?>" value="<?php echo !empty($options['pnBoard'])?$options['pnBoard']:''; ?>" class="nxs_pnBRDIDcst" data-tid="pnBoard<?php echo esc_attr($ii); ?>" /> 60 <div style="display: inline-block;"><a onclick="nxs_pnGetBoards(<?php echo esc_attr($ii);?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo esc_attr($nt.$ii);?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo esc_attr($nt.$ii);?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 61 61 </div> 62 62 </div> 63 <div id="nxsPNMsgDiv<?php echo $ii; ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please enter your login/password to see the list of your boards', 'nxs_snap'); ?><?php } ?></div>63 <div id="nxsPNMsgDiv<?php echo esc_attr($ii); ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please enter your login/password to see the list of your boards', 'nxs_snap'); ?><?php } ?></div> 64 64 </div> 65 65 <script type="text/javascript"> 66 jQuery('#apPNUName<?php echo $ii; ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apPNPass<?php echo $ii; ?>').val(); if( u!='' && p!='' ) { nxs_pnGetBoards(<?php echo $ii; ?>,0); } });67 jQuery('#apPNPass<?php echo $ii; ?>').change(function() { var u = jQuery('#apPNUName<?php echo $ii; ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_pnGetBoards(<?php echo $ii; ?>,0); } });66 jQuery('#apPNUName<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apPNPass<?php echo esc_attr($ii); ?>').val(); if( u!='' && p!='' ) { nxs_pnGetBoards(<?php echo esc_attr($ii); ?>,0); } }); 67 jQuery('#apPNPass<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery('#apPNUName<?php echo esc_attr($ii); ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_pnGetBoards(<?php echo esc_attr($ii); ?>,0); } }); 68 68 </script> 69 69 70 70 <br/><strong><?php _e('Clickthrough URL', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> 71 71 <div style="margin-bottom: 20px;margin-top: 5px;"> 72 <input type="radio" name="pn[<?php echo $ii; ?>][cImgURL]" value="R" <?php if ( empty($options['cImgURL']) || $options['cImgURL'] == 'R') echo 'checked="checked"'; ?> /><?php _e('Regular Post URL', 'social-networks-auto-poster-facebook-twitter-g'); ?> 73 <!-- <input type="radio" name="pn[<?php echo $ii; ?>][cImgURL]" value="S" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'S') echo 'checked="checked"'; ?> /> Shortened Post URL -->74 <input type="radio" name="pn[<?php echo $ii; ?>][cImgURL]" value="N" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'N') echo 'checked="checked"'; ?> /><?php _e('No Clickthrough URL', 'social-networks-auto-poster-facebook-twitter-g'); ?> </div>72 <input type="radio" name="pn[<?php echo esc_attr($ii); ?>][cImgURL]" value="R" <?php if ( empty($options['cImgURL']) || $options['cImgURL'] == 'R') echo 'checked="checked"'; ?> /><?php _e('Regular Post URL', 'social-networks-auto-poster-facebook-twitter-g'); ?> 73 <!-- <input type="radio" name="pn[<?php echo esc_attr($ii); ?>][cImgURL]" value="S" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'S') echo 'checked="checked"'; ?> /> Shortened Post URL --> 74 <input type="radio" name="pn[<?php echo esc_attr($ii); ?>][cImgURL]" value="N" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'N') echo 'checked="checked"'; ?> /><?php _e('No Clickthrough URL', 'social-networks-auto-poster-facebook-twitter-g'); ?> </div> 75 75 76 76 <div style="width:100%;"><strong><?php _e('URL of the Default Image to Pin', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> 77 77 <div style="font-size: 11px; margin: 0px;"><?php _e('If your post does not have any images this will be used instead.', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 78 </div><input style="width:400px;" name="pn[<?php echo $ii; ?>][defImg]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />78 </div><input style="width:400px;" name="pn[<?php echo esc_attr($ii); ?>][defImg]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 79 79 <br/><br/> 80 80 81 <div style="margin-bottom: 5px; margin-left: 0px; "><input value="1" id="isAttachVid" type="checkbox" name="pn[<?php echo $ii; ?>][isAttachVid]" <?php if (isset($options['isAttachVid']) && (int)$options['isAttachVid'] == 1) echo "checked"; ?> /> <strong><?php _e('If post has a video use it instead of image.', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong><br/><i><?php _e('Video will be pinned instead of featured image. Only Youtube is supported at this time.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i>81 <div style="margin-bottom: 5px; margin-left: 0px; "><input value="1" id="isAttachVid" type="checkbox" name="pn[<?php echo esc_attr($ii); ?>][isAttachVid]" <?php if (isset($options['isAttachVid']) && (int)$options['isAttachVid'] == 1) echo "checked"; ?> /> <strong><?php _e('If post has a video use it instead of image.', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong><br/><i><?php _e('Video will be pinned instead of featured image. Only Youtube is supported at this time.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> 82 82 <br/><br/></div> 83 83 <?php $this->elemTitleFormat($ii,'Post Title Format','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Post Text Format','msgFormat',$options['msgFormat']);?><br/ ><?php … … 110 110 $this->nxs_tmpltAddPostMeta($post, $ntOpt, $pMeta); ?> 111 111 <tr style="<?php echo !empty($ntOpt['do'])?'display:table-row;':'display:none;'; ?>" class="nxstbldo nxstbldo<?php echo strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;">Select Board</th> 112 <td><select name="pn[<?php echo $ii; ?>][pnBoard]">112 <td><select name="pn[<?php echo esc_attr($ii); ?>][pnBoard]"> 113 113 <?php $ntOpt = $this->getMergeOptInfo($ntOpt, $ii); if (!empty($ntOpt['pnBoardsList'])){ 114 114 if ($ntOpt['pnBoard']!='') $gPNBoards = str_replace($ntOpt['pnBoard'].'"', $ntOpt['pnBoard'].'" selected="selected"', str_ireplace('selected="selected" ','', $ntOpt['pnBoardsList'])); echo $gPNBoards;} else { ?> … … 133 133 <div class="nxsPostEd_ElemLabel"><?php _e('Select Board', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 134 134 <div class="nxsPostEd_Elem"> 135 <select name="pn[<?php echo $ii; ?>][pnBoard]" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>">135 <select name="pn[<?php echo esc_attr($ii); ?>][pnBoard]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>"> 136 136 <?php $ntOpt = $this->getMergeOptInfo($ntOpt, $ii); if (!empty($ntOpt['pnBoardsList'])){ 137 137 if ($ntOpt['pnBoard']!='') $gPNBoards = str_replace($ntOpt['pnBoard'].'"', $ntOpt['pnBoard'].'" selected="selected"', str_ireplace('selected="selected" ','', $ntOpt['pnBoardsList'])); echo $gPNBoards;} else { ?> … … 155 155 } 156 156 //## PN Specific 157 function getListOfPNBoards($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_pn_'.sha1('nxs_snap_pn'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = $_POST['ii'];157 function getListOfPNBoards($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_pn_'.sha1('nxs_snap_pn'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); 158 158 if (!class_exists("nxsAPI_PN")) { $outMsg = '<b style="color:red;">'.__('API Not Found').' - '.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } $nt = new nxsAPI_PN(); // prr($opVal); 159 159 $currPstAs = !empty($_POST['pnBoard'])?$_POST['pnBoard']:(!empty($networks['pn'][$ii])?$networks['pn'][$ii]['pnBoard']:''); … … 161 161 if(!empty($_POST['s'])&& property_exists ('nxsAPI_PN', 'sess')) $nt->sess['sid'] = $_POST['s']; 162 162 if (!empty($networks['pn'][$ii]['proxy'])&&!empty($networks['pn'][$ii]['proxyOn'])){ $nt->proxy['proxy'] = $networks['pn'][$ii]['proxy']['proxy']; if (!empty($networks['pn'][$ii]['proxy']['up'])) $nt->proxy['up'] = $networks['pn'][$ii]['proxy']['up']; } 163 $loginError=$nt->connect( $_POST['u'],$_POST['p']);// var_dump($loginError);163 $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']);// var_dump($loginError); 164 164 if (!$loginError){ $opVal['ck'] = $nt->ck; $pgs = $nt->getBoards($currPstAs); } 165 165 else { $outMsg = '<b style="color:red;">'.__('Login Problem').' - '.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/rd.php
r2144651 r2757212 33 33 34 34 <br/ ><div style="width:100%;"><b><?php _e('Subreddit ID', 'nxs_snap'); ?></b> (<?php _e('Please select Subreddit', 'nxs_snap'); ?>)</div> 35 <div id="nxsRDInfoDiv<?php echo $ii; ?>">35 <div id="nxsRDInfoDiv<?php echo esc_attr($ii); ?>"> 36 36 <div style="width:100%;"> 37 37 <div> 38 <select id="rdSubReddit<?php echo $ii; ?>" onchange="nxs_rdSRChange('<?php echo $ii;?>',jQuery(this));" name="rd[<?php echo $ii;?>][rdSubReddit]">38 <select id="rdSubReddit<?php echo esc_attr($ii); ?>" onchange="nxs_rdSRChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="rd[<?php echo esc_attr($ii);?>][rdSubReddit]"> 39 39 <?php $pgi = !empty($options['rdSubRedditsList'])?$options['rdSubRedditsList']:''; 40 echo (!empty($pgi) && stripos($pgi,$options['rdSubReddit'])===false)?'<option selected="selected" value="'. $options['rdSubReddit'].'">'.$options['rdSubReddit'].'</option>':'';41 if (!empty($options['rdSubReddit'])) { $pgi = str_ireplace('selected="selected" ','',$pgi); $pgi = str_ireplace('value="'.$options['rdSubReddit'].'"','selected="selected" value="'. $options['rdSubReddit'].'"',$pgi); }40 echo (!empty($pgi) && stripos($pgi,$options['rdSubReddit'])===false)?'<option selected="selected" value="'.esc_attr($options['rdSubReddit']).'">'.wp_kses($options['rdSubReddit'], wp_kses_allowed_html( 'post' )).'</option>':''; 41 if (!empty($options['rdSubReddit'])) { $pgi = str_ireplace('selected="selected" ','',$pgi); $pgi = str_ireplace('value="'.$options['rdSubReddit'].'"','selected="selected" value="'.esc_attr($options['rdSubReddit']).'"',$pgi); } 42 42 else echo '<option value="">None(Click refresh icon to retrieve your subreddits)</option>'; 43 43 echo $pgi; 44 44 ?> 45 </select><div id="nxsRDInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="rdSRIDCst<?php echo $ii; ?>" value="<?php echo $options['rdSubReddit']; ?>" class="nxs_rdSRIDcst" data-tid="rdSubReddit<?php echo $ii; ?>" />46 <div style="display: inline-block;"><a onclick="nxs_rdGetSRs(<?php echo $ii;?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo $nt.$ii;?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo $nt.$ii;?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />45 </select><div id="nxsRDInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="rdSRIDCst<?php echo esc_attr($ii); ?>" value="<?php echo esc_attr($options['rdSubReddit']); ?>" class="nxs_rdSRIDcst" data-tid="rdSubReddit<?php echo esc_attr($ii); ?>" /> 46 <div style="display: inline-block;"><a onclick="nxs_rdGetSRs(<?php echo esc_attr($ii);?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo esc_attr($nt.$ii);?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo esc_attr($nt.$ii);?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 47 47 </div> 48 48 </div> 49 <div id="nxsRDMsgDiv<?php echo $ii; ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please enter your login/password to see the list of your subreddits', 'nxs_snap'); ?><?php } ?></div>49 <div id="nxsRDMsgDiv<?php echo esc_attr($ii); ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please enter your login/password to see the list of your subreddits', 'nxs_snap'); ?><?php } ?></div> 50 50 </div><i style="color: #580000;">Please do not try to post to subredits that you do not own. Reddit is very serious about it's policy that prohibits sharing your own links. You will loose posting privileges and you account will be <b>banned</b> if you post to public subreddits. </i> 51 51 <br/> <br/> … … 53 53 <div style="width:100%;"><strong id="altFormatText">Post Type:</strong></div> 54 54 <div style="margin-left: 10px;"> 55 <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>55 <input type="radio" name="rd[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> 56 56 <br/> 57 <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="T" <?php if (!empty($options['postType']) && $options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('set the text format below', 'social-networks-auto-poster-facebook-twitter-g'); ?></i>57 <input type="radio" name="rd[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if (!empty($options['postType']) && $options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('set the text format below', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> 58 58 </div> 59 59 60 60 <script type="text/javascript"> 61 jQuery('#apRDUName<?php echo $ii; ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apRDPass<?php echo $ii; ?>').val(); if( u!='' && p!='' ) { nxs_rdGetSRs(<?php echo $ii; ?>,0); } });62 jQuery('#apRDPass<?php echo $ii; ?>').change(function() { var u = jQuery('#apRDUName<?php echo $ii; ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_rdGetSRs(<?php echo $ii; ?>,0); } });61 jQuery('#apRDUName<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apRDPass<?php echo esc_attr($ii); ?>').val(); if( u!='' && p!='' ) { nxs_rdGetSRs(<?php echo esc_attr($ii); ?>,0); } }); 62 jQuery('#apRDPass<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery('#apRDUName<?php echo esc_attr($ii); ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_rdGetSRs(<?php echo esc_attr($ii); ?>,0); } }); 63 63 </script> 64 64 … … 90 90 <?php $this->elemEdTitleFormat($ii, __('Title Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgTFormat); $this->elemEdMsgFormat($ii, __('Message Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgFormat); ?> 91 91 <tr style="<?php echo !empty($ntOpt['do'])?'display:table-row;':'display:none;'; ?>" class="nxstbldo nxstbldo<?php echo strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> </th><td> 92 <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="A" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g') ?>92 <input type="radio" name="rd[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 93 93 <br/> 94 <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?><br/>94 <input type="radio" name="rd[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?><br/> 95 95 </td></tr> 96 96 <?php … … 111 111 <div class="nxsPostEd_ElemLabel"><?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 112 112 <div class="nxsPostEd_Elem"> 113 <input type="radio" name="rd[<?php echo $ii; ?>][postType]" class="nxsEdElem" value="A" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g') ?>113 <input type="radio" name="rd[<?php echo esc_attr($ii); ?>][postType]" class="nxsEdElem" value="A" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( empty($postType) || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 114 114 <br/> 115 <input type="radio" name="rd[<?php echo $ii; ?>][postType]" class="nxsEdElem" value="T" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?>115 <input type="radio" name="rd[<?php echo esc_attr($ii); ?>][postType]" class="nxsEdElem" value="T" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 116 116 </div> 117 117 </div><?php … … 129 129 } 130 130 //## RD Specific 131 function getListOfSubReddits($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_rd_'.sha1('nxs_snap_rd'. $_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; $nt = new nxsAPI_RD(); // prr($opVal);131 function getListOfSubReddits($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_rd_'.sha1('nxs_snap_rd'.sanitize_user($_POST['u']).$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_RD(); // prr($opVal); 132 132 $currPstAs = !empty($_POST['rdSR'])?$_POST['rdSR']:(!empty($networks['rd'][$ii])?$networks['rd'][$ii]['rdSubReddit']:''); 133 133 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['rdSubRedditsList']) ) $pgs = $opVal['rdSubRedditsList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; 134 if (!empty($networks['rd'][$ii]['proxy'])&&!empty($networks['rd'][$ii]['proxyOn'])){ $nt->proxy['proxy'] = $networks['rd'][$ii]['proxy']['proxy']; if (!empty($networks['rd'][$ii]['proxy']['up'])) $nt->proxy['up'] = $networks['rd'][$ii]['proxy']['up']; } $loginError=$nt->connect( $_POST['u'],$_POST['p']);// var_dump($loginError);134 if (!empty($networks['rd'][$ii]['proxy'])&&!empty($networks['rd'][$ii]['proxyOn'])){ $nt->proxy['proxy'] = $networks['rd'][$ii]['proxy']['proxy']; if (!empty($networks['rd'][$ii]['proxy']['up'])) $nt->proxy['up'] = $networks['rd'][$ii]['proxy']['up']; } $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']);// var_dump($loginError); 135 135 if (!$loginError){ $opVal['ck'] = $nt->ck; $nt->getSubReddits($currPstAs); $pgs = $nt->srList; } 136 136 else { $outMsg = '<b style="color:red;">'.__('Login Problem').' - '.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/sc.php
r1905522 r2757212 23 23 //#### Show Unit Settings 24 24 function checkIfSetupFinished($options) { return (!empty($options['appAppUserID']) && !empty($options['accessToken'])) || !empty($options['uPass']); } 25 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 26 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ require_once('apis/scOAuth.php'); $options = $this->nt[$_GET['acc']];27 25 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 26 if (isset($_GET['acc'])) { $acc = sanitize_text_field($_GET['acc']); $options = $this->nt[$acc]; 27 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ require_once('apis/scOAuth.php'); 28 28 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); 29 $callback_url = $nxs_snapSetPgURL."&auth=".$ntInfo['lcode']."a&acc=".$_GET['acc']; 30 31 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret); 32 $request_token = $tum_oauth->getReqToken($callback_url); 29 $callback_url = $nxs_snapSetPgURL."&auth=".$ntInfo['lcode']."a&acc=".$acc; 30 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret); 31 $request_token = $tum_oauth->getReqToken($callback_url); 33 32 $options['oAuthToken'] = $request_token['oauth_token']; 34 33 $options['oAuthTokenSecret'] = $request_token['oauth_token_secret']; 35 36 34 //prr($tum_oauth); prr($options); die(); 37 38 switch ($tum_oauth->http_code) { case 200: $url = 'http://www.scoop.it/oauth/authorize?oauth_token='.$options['oAuthToken']; 39 $optionsG = get_option('nxsSNAPNetworks'); $optionsG[$ntInfo['lcode']][$_GET['acc']] = $options; update_option('nxsSNAPNetworks', $optionsG, false); 40 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; break; 35 switch ($tum_oauth->http_code) { case 200: $url = 'http://www.scoop.it/oauth/authorize?oauth_token='.$options['oAuthToken']; 36 $optionsG = get_option('nxsSNAPNetworks'); $optionsG[$ntInfo['lcode']][$acc] = $options; update_option('nxsSNAPNetworks', $optionsG, false); 37 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; break; 41 38 default: echo '<br/><b style="color:red">Could not connect to ScoopIT. Refresh the page or try again later.</b>'; die(); 42 39 } 43 40 die(); 44 41 } 45 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode'].'a'){ require_once('apis/scOAuth.php'); $options = $this->nt[$_GET['acc']];42 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode'].'a'){ require_once('apis/scOAuth.php'); 46 43 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); 47 48 44 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret, $options['oAuthToken'], $options['oAuthTokenSecret']); //prr($tum_oauth); 49 45 $access_token = $tum_oauth->getAccToken($_GET['oauth_verifier']); prr($access_token); 50 $options['accessToken'] = $access_token['oauth_token']; $options['accessTokenSec'] = $access_token['oauth_token_secret']; 51 $optionsG = get_option('nxsSNAPNetworks'); $optionsG[$ntInfo['lcode']][$ _GET['acc']] = $options; update_option('nxsSNAPNetworks', $optionsG, false);52 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 53 $uinfo = $tum_oauth->makeReq('http://www.scoop.it/api/1/profile', ''); 54 if (is_array($uinfo) && isset($uinfo['user'])) { $options['appAppUserName'] = $uinfo['user']['name']."(".$uinfo['user']['shortName'].")"; 55 $options['appAppUserID'] = $uinfo['user']['id']; $optionsG = get_option('nxsSNAPNetworks'); $optionsG[$ntInfo['lcode']][$ _GET['acc']] = $options; update_option('nxsSNAPNetworks', $optionsG, false);46 $options['accessToken'] = $access_token['oauth_token']; $options['accessTokenSec'] = $access_token['oauth_token_secret']; 47 $optionsG = get_option('nxsSNAPNetworks'); $optionsG[$ntInfo['lcode']][$acc] = $options; update_option('nxsSNAPNetworks', $optionsG, false); 48 $tum_oauth = new wpScoopITOAuth($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 49 $uinfo = $tum_oauth->makeReq('http://www.scoop.it/api/1/profile', ''); 50 if (is_array($uinfo) && isset($uinfo['user'])) { $options['appAppUserName'] = $uinfo['user']['name']."(".$uinfo['user']['shortName'].")"; 51 $options['appAppUserID'] = $uinfo['user']['id']; $optionsG = get_option('nxsSNAPNetworks'); $optionsG[$ntInfo['lcode']][$acc] = $options; update_option('nxsSNAPNetworks', $optionsG, false); 56 52 } //die(); 57 53 if (!empty($options['appAppUserID'])) { echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$nxs_snapSetPgURL.'"</script>'; die();} 58 else die("<span style='color:red;'>ERROR: Authorization Error: <span style='color:darkred; font-weight: bold;'>".print_r($uinfo, true)."</span></span>"); 59 } 54 else die("<span style='color:red;'>ERROR: Authorization Error: <span style='color:darkred; font-weight: bold;'>".print_r($uinfo, true)."</span></span>"); 55 } 56 } 60 57 } 61 58 … … 65 62 <span style="color:#005800; font-weight: bold; font-size: 14px;">Scoop.it Native API:</span> Free Native API. <div style="padding-bottom: 10px;"><b style="color: red;">Important:</b> Scoop.it announced that "Starting January 15, 2018, Scoop.it's free API will be discontinued.". <a href="http://nxs.fyi/scapi" target="_blank">More info here</a></div> 66 63 <span style="color:#005800; font-weight: bold; font-size: 14px;">NextScripts API for Scoop.it:</span> Premium API. <br/><br/><br/> 67 <select name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?>').hide(); jQuery('.nxs_<?php echo $nt; ?>_api'+jQuery(this).val()+'div_<?php echo $ii; ?>').show(); "><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='sc')?"selected":""; ?> value="sc">Scoop.it Native API</option><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"selected":""; ?> value="nx">NextScripts API for Scoop.it</option></select><hr/>64 <select name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?>').hide(); jQuery('.nxs_<?php echo esc_attr($nt); ?>_api'+jQuery(this).val()+'div_<?php echo esc_attr($ii); ?>').show(); "><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='sc')?"selected":""; ?> value="sc">Scoop.it Native API</option><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"selected":""; ?> value="nx">NextScripts API for Scoop.it</option></select><hr/> 68 65 69 66 </div> 70 67 71 <div id="nxs_<?php echo $nt; ?>_apiscdiv_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apiscdiv_<?php echo $ii; ?>" style="display: <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='sc')?"block":"none"; ?>;"><h3>Scoop.it Native API</h3>68 <div id="nxs_<?php echo esc_attr($nt); ?>_apiscdiv_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apiscdiv_<?php echo esc_attr($ii); ?>" style="display: <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='sc')?"block":"none"; ?>;"><h3>Scoop.it Native API</h3> 72 69 73 70 … … 81 78 <?php _e('Your '.$ntInfo['name'].' Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['appAppUserID'].' - '.$options['appAppUserName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>. 82 79 <?php _e('You can', 'social-networks-auto-poster-facebook-twitter-g'); ?> Re- <?php } ?> 83 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo $nt; ?>&acc=<?php echo $ii; ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a>80 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo esc_attr($nt); ?>&acc=<?php echo esc_attr($ii); ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a> 84 81 85 82 <?php if (!isset($options['appAppUserID']) || $options['appAppUserID']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div> <?php }?> … … 88 85 </div> 89 86 90 <div id="nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;"><h3>NextScripts API</h3>87 <div id="nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" style="display: <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='nx')?"block":"none"; ?>;"><h3>NextScripts API</h3> 91 88 92 89 <?php if (class_exists('nxsAPI_SC')) { if (!empty($options['uPass'])&&!empty($options['uName'])) { $opNm = 'nxs_snap_sc_'.sha1('nxs_snap_sc'.$options['uName'].$options['uPass']); $opVal = nxs_getOption($opNm); //prr($opVal); … … 96 93 } if (empty($options['uPass'])) $options['uPass'] = ''; if (empty($options['uName'])) $options['uName'] = ''; 97 94 ?> 98 <div class="subDiv" id="sub<?php echo $ii; ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div><br/>95 <div class="subDiv" id="sub<?php echo esc_attr($ii); ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div><br/> 99 96 100 97 … … 104 101 </div> 105 102 106 <div style="width:100%;"><strong><?php echo $ntInfo['name']; ?> Topic URL:</strong> </div>http://www.scoop.it/t/<input name="<?php echo $nt; ?>[<?php echo $ii; ?>][topicURL]" style="width: 20%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['topicURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>103 <div style="width:100%;"><strong><?php echo $ntInfo['name']; ?> Topic URL:</strong> </div>http://www.scoop.it/t/<input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][topicURL]" style="width: 20%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['topicURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 107 104 108 105 <?php $this->elemTitleFormat($ii,'Post Title Format','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Post Format','msgFormat',$options['msgFormat']); ?> 109 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>106 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 110 107 111 108 <div style="width:100%;"><strong id="altFormatText">Post Type:</strong></div> 112 109 <div style="margin-left: 10px;"> 113 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>114 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>115 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Add blogpost to message as an attachment', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>110 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 111 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 112 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( !isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Add blogpost to message as an attachment', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 116 113 </div> 117 114 <?php … … 143 140 ?> 144 141 <tr style="<?php echo !empty($ntOpt['do'])?'display:table-row;':'display:none;'; ?>" class="nxstbldo nxstbldo<?php echo strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> <br/></th><td> 145 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>146 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="I" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Post as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>147 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>142 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 143 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Post as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 144 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 148 145 </td></tr> 149 146 <?php … … 165 162 <div class="nxsPostEd_ElemLabel"><?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 166 163 <div class="nxsPostEd_Elem"> 167 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>168 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Post as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>169 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>164 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 165 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Post as "Image post"', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 166 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 170 167 </div> 171 168 </div><?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/st.php
r1905522 r2757212 22 22 function checkIfSetupFinished($options) { return !empty($options['uPass']); } 23 23 function accTab($ii, $options, $isNew=false){ $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?> 24 <div style="width:100%;"><strong><?php echo $ntInfo['name']; ?> Blog URL:</strong> </div>http://sett.com/<input name="<?php echo $nt; ?>[<?php echo $ii; ?>][mgzURL]" style="width: 20%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['mgzURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/>24 <div style="width:100%;"><strong><?php echo $ntInfo['name']; ?> Blog URL:</strong> </div>http://sett.com/<input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][mgzURL]" style="width: 20%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['mgzURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 25 25 <br/><?php $this->elemMsgFormat($ii,'Comment Text Format','msgFormat',$options['msgFormat']); 26 26 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tg.php
r1968023 r2757212 13 13 function accTab($ii, $options, $isNew=false){ $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; if (empty($options['attchImg'])) $options['attchImg'] = 0; if (!isset($options['webPrev'])) $options['webPrev'] = 1; ?> <br/ > 14 14 15 <div style="width:100%;"><strong><?php _e('Bot Token', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong></div><input name="tg[<?php echo $ii; ?>][botTkn]" style="width: 70%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['botTkn'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>16 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Channel ID, Group ID or Chat ID', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="tg[<?php echo $ii; ?>][whToPost]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['whToPost'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>15 <div style="width:100%;"><strong><?php _e('Bot Token', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong></div><input name="tg[<?php echo esc_attr($ii); ?>][botTkn]" style="width: 70%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['botTkn'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 16 <div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Channel ID, Group ID or Chat ID', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="tg[<?php echo esc_attr($ii); ?>][whToPost]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['whToPost'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 17 17 <br/><?php $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?> 18 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>19 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][webPrev]" <?php if ((int)$options['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>18 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 19 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" <?php if ((int)$options['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 20 20 <br/><?php 21 21 } … … 47 47 48 48 <?php $this->elemEdMsgFormat($ii, __('Message Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgFormat); ?> 49 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][webPrev]"/>50 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][webPrev]" <?php if ((int)$ntOpt['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr>51 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]"/>52 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr>49 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"/> 50 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" <?php if ((int)$ntOpt['webPrev'] == 1) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr> 51 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 52 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr> 53 53 <?php 54 54 /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); nxs_showURLToUseDlg($nt, $ii, $urlToUse); $this->nxs_tmpltAddPostMetaEnd($ii); … … 65 65 <div class="nxsPostEd_ElemWrap"> 66 66 <div class="nxsPostEd_Elem"> 67 <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][webPrev]"/>68 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][webPrev]" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if (!empty($ntOpt['webPrev'])) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>69 <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]"/>70 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if (!empty($ntOpt['attchImg'])) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>67 <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]"/> 68 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][webPrev]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (!empty($ntOpt['webPrev'])) echo "checked"; ?> /> <strong><?php _e('Enable Web Preview', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 69 <div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 70 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (!empty($ntOpt['attchImg'])) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 71 71 </div> 72 72 </div><?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tr.api.php
r2650662 r2757212 40 40 $postinfo = $tum_oauth->post("https://api.tumblr.com/v2/blog/".$options['pgID']."/post", $postArr); // prr("https://api.tumblr.com/v2/blog/".$options['pgID']."/post"); prr($postinfo); prr($postArr); 41 41 42 43 44 $code = $postinfo->meta->status;// echo "XX".print_r($code); prr($postinfo); // prr($msg); prr($postinfo); echo $code."VVVV"; die("|===="); 45 if ($code == 201) { return array('postID'=>$postinfo->response->id, 'isPosted'=>1, 'postURL'=>'https://'.$options['pgID']."/post/".$postinfo->response->id, 'pDate'=>date('Y-m-d H:i:s')); } 42 $code = $postinfo->meta->status;// echo "XX".print_r($code); prr($postinfo); // prr($msg); prr($postinfo); echo $code."VVVV"; die("|===="); 43 44 if ($code == 201) { return array('postID'=>$postinfo->response->id, 'isPosted'=>1, 'postURL'=>'https://www.tumblr.com/blog/view/'.$options['pgID']."/".$postinfo->response->id, 'pDate'=>date('Y-m-d H:i:s')); } 46 45 else $badOut['Error'] .= $code . " - ".($postinfo->meta->msg).(isset($postinfo->errmsg)?$postinfo->errmsg:'')." | ".print_r($postinfo, true); 47 46 return $badOut; -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tr.php
r2650607 r2757212 27 27 //#### Show Unit Settings 28 28 function checkIfSetupFinished($options) { return !empty($options['pgID']) && !empty($options['accessToken']); } 29 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 30 if ( isset($_GET['auth']) && $_GET['auth']=='tr'){ $this->showAuthTop(); require_once('apis/trOAuth.php'); $options = $this->nt[$_GET['acc']]; 31 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); $callback_url = $nxs_snapSetPgURL."&auth=tra&acc=".$_GET['acc']; 32 $tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret); prr($tum_oauth ); $request_token = $tum_oauth->getRequestToken($callback_url); echo "####"; prr($request_token); 33 $options['oAuthToken'] = $request_token['oauth_token']; $options['oAuthTokenSecret'] = $request_token['oauth_token_secret'];// prr($tum_oauth ); die(); 34 switch ($tum_oauth->http_code) { case 200: $url = $tum_oauth->getAuthorizeURL($options['oAuthToken']); nxs_save_glbNtwrks($ntInfo['lcode'],$_GET['acc'],$options,'*'); 35 echo '<div style="text-align:center;color:green; font-weight: bold; font-size:20px;" >ALL OK. Redirecting to authorization....</div><script type="text/javascript">setTimeout(function(){ window.location = "'.$url.'"; }, 1000);</script>'; break; 36 default: echo '<br/><b style="color:red">Could not connect to Tumblr. Refresh the page or try again later.</b>'; die('</div></div>'); 37 } die('</div></div>'); 29 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 30 if (isset($_GET['acc'])) { $acc = sanitize_text_field($_GET['acc']); $options = $this->nt[$acc]; 31 if ( isset($_GET['auth']) && $_GET['auth']=='tr'){ $this->showAuthTop(); require_once('apis/trOAuth.php'); 32 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); $callback_url = $nxs_snapSetPgURL."&auth=tra&acc=".$acc; 33 $tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret); prr($tum_oauth ); $request_token = $tum_oauth->getRequestToken($callback_url); echo "####"; prr($request_token); 34 $options['oAuthToken'] = $request_token['oauth_token']; $options['oAuthTokenSecret'] = $request_token['oauth_token_secret'];// prr($tum_oauth ); die(); 35 switch ($tum_oauth->http_code) { case 200: $url = $tum_oauth->getAuthorizeURL($options['oAuthToken']); nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 36 echo '<div style="text-align:center;color:green; font-weight: bold; font-size:20px;" >ALL OK. Redirecting to authorization....</div><script type="text/javascript">setTimeout(function(){ window.location = "'.$url.'"; }, 1000);</script>'; break; 37 default: echo '<br/><b style="color:red">Could not connect to Tumblr. Refresh the page or try again later.</b>'; die('</div></div>'); 38 } die('</div></div>'); 39 } 40 if ( isset($_GET['auth']) && $_GET['auth']=='tra'){ $this->showAuthTop(); require_once('apis/trOAuth.php'); prr($options); 41 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); 42 $tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret, $options['oAuthToken'], $options['oAuthTokenSecret']); 43 $options['accessToken'] = $tum_oauth->getAccessToken(sanitize_text_field($_REQUEST['oauth_verifier'])); prr($tum_oauth, '**tum_oauth ==1== **'); 44 prr($options['accessToken'], '**GOT ACCESS TOKEN **'); $options['accessTokenSec'] = $options['accessToken']['oauth_token_secret']; $options['accessToken'] = $options['accessToken']['oauth_token']; 45 $tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 46 $userinfo = $tum_oauth->get('https://api.tumblr.com/v2/user/info'); prr($tum_oauth, '**tum_oauth ==2== **'); prr($userinfo, '**USERINFO**'); // prr($url); die(); 47 if ($userinfo->meta->status=='401') die("<span style='color:red;'>ERROR #1: Authorized USER don't have access to the specified blog: <span style='color:darkred; font-weight: bold;'>".$options['pgID']."</span></span></div>"); 48 if (is_array($userinfo->response->user->blogs)) { $options['authUser'] = $userinfo->response->user->name; $blogs = ''; $opNm = 'nxs_snap_tr_'.sha1('nxs_snap_tr'.$options['authUser'].nxs_gak($options['appKey'])); 49 foreach ($userinfo->response->user->blogs as $blog){ if (!empty($blog->uuid)) $uuid = $blog->uuid; else $uuid = rtrim(str_ireplace('http://','',str_ireplace('https://','',$blog->url)), '/'); if (empty($options['pgID'])) $options['pgID'] = $uuid; 50 $blogs .= '<option '.($options['pgID']==$uuid ? 'selected="selected"':'').' value="'.$uuid.'">'.$blog->name.' ('.$uuid.')</option>'; 51 } nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); $opVal['blogList'] = $blogs; nxs_saveOption($opNm, $opVal); 52 echo '<div style="text-align:center;color:green; font-weight: bold; font-size:22px;" >ALL OK. You have been authorized. Refreshing page....</div><script type="text/javascript">setTimeout(function(){ window.location = "'.$nxs_snapSetPgURL.'"; }, 3000);</script>'; die('</div></div>'); 53 } prr($userinfo); die("<span style='color:red;'>ERROR #2: Authorized USER don't have access to the specified blog: <span style='color:darkred; font-weight: bold;'>".$options['pgID']."</span></span></div></div>"); 54 } 38 55 } 39 if ( isset($_GET['auth']) && $_GET['auth']=='tra'){ $this->showAuthTop(); require_once('apis/trOAuth.php'); $options = $this->nt[$_GET['acc']]; prr($options);40 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']);41 $tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret, $options['oAuthToken'], $options['oAuthTokenSecret']);42 $options['accessToken'] = $tum_oauth->getAccessToken($_REQUEST['oauth_verifier']); prr($tum_oauth, '**tum_oauth ==1== **');43 prr($options['accessToken'], '**GOT ACCESS TOKEN **'); $options['accessTokenSec'] = $options['accessToken']['oauth_token_secret']; $options['accessToken'] = $options['accessToken']['oauth_token'];44 $tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']);45 $userinfo = $tum_oauth->get('https://api.tumblr.com/v2/user/info'); prr($tum_oauth, '**tum_oauth ==2== **'); prr($userinfo, '**USERINFO**'); // prr($url); die();46 if ($userinfo->meta->status=='401') die("<span style='color:red;'>ERROR #1: Authorized USER don't have access to the specified blog: <span style='color:darkred; font-weight: bold;'>".$options['pgID']."</span></span></div>");47 if (is_array($userinfo->response->user->blogs)) { $options['authUser'] = $userinfo->response->user->name; $blogs = ''; $opNm = 'nxs_snap_tr_'.sha1('nxs_snap_tr'.$options['authUser'].nxs_gak($options['appKey']));48 foreach ($userinfo->response->user->blogs as $blog){ if (!empty($blog->uuid)) $uuid = $blog->uuid; else $uuid = rtrim(str_ireplace('http://','',str_ireplace('https://','',$blog->url)), '/'); if (empty($options['pgID'])) $options['pgID'] = $uuid;49 $blogs .= '<option '.($options['pgID']==$uuid ? 'selected="selected"':'').' value="'.$uuid.'">'.$blog->name.' ('.$uuid.')</option>';50 } nxs_save_glbNtwrks($ntInfo['lcode'],$_GET['acc'],$options,'*'); $opVal['blogList'] = $blogs; nxs_saveOption($opNm, $opVal);51 echo '<div style="text-align:center;color:green; font-weight: bold; font-size:22px;" >ALL OK. You have been authorized. Refreshing page....</div><script type="text/javascript">setTimeout(function(){ window.location = "'.$nxs_snapSetPgURL.'"; }, 3000);</script>'; die('</div></div>');52 } prr($userinfo); die("<span style='color:red;'>ERROR #2: Authorized USER don't have access to the specified blog: <span style='color:darkred; font-weight: bold;'>".$options['pgID']."</span></span></div></div>");53 }54 56 } 55 57 56 function getListOfBlogs($networks){ $opVal = array(); $opNm = 'nxs_snap_tr_'.sha1('nxs_snap_tr'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = $_POST['ii'];58 function getListOfBlogs($networks){ $opVal = array(); $opNm = 'nxs_snap_tr_'.sha1('nxs_snap_tr'.$_POST['u'].$_POST['p']); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); 57 59 $currPstAs = !empty($_POST['cBlog'])?$_POST['cBlog']:(!empty($networks['tr'][$ii])?$networks['tr'][$ii]['pgID']:''); 58 60 if (empty($_POST['force']) && !empty($opVal['blogList']) ) $pgs = $opVal['blogList']; else { $options = $networks['tr'][$ii]; require_once('apis/trOAuth.php'); … … 77 79 ?><br/ ><div style="width:100%;"><b><?php _e('Where to Post', 'nxs_snap'); ?></b> (<?php _e('Please select your blog', 'nxs_snap'); ?>)</div> 78 80 <?php if (!empty($options['authUser'])) {?> 79 <div id="nxsTRInfoDiv<?php echo $ii; ?>">81 <div id="nxsTRInfoDiv<?php echo esc_attr($ii); ?>"> 80 82 <div style="width:100%;"> 81 83 <div> 82 <select id="trpgID<?php echo $ii; ?>" onchange="nxs_trBlogChange('<?php echo $ii;?>',jQuery(this));" name="tr[<?php echo $ii;?>][pgID]">84 <select id="trpgID<?php echo esc_attr($ii); ?>" onchange="nxs_trBlogChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="tr[<?php echo esc_attr($ii);?>][pgID]"> 83 85 <?php $pgi = !empty($options['blogList'])?$options['blogList']:''; 84 86 if (!empty($options['pgID'])) { echo (!empty($options['pgID']) && stripos($pgi,$options['pgID'])===false)?'<option selected="selected" value="'.$options['pgID'].'">'.$options['pgID'].'</option>':''; } 85 87 if (!empty($options['pgID'])) { $pgi = str_ireplace('selected="selected" ','',$pgi); $pgi = str_ireplace('value="'.$options['pgID'].'"','selected="selected" value="'.$options['pgID'].'"',$pgi); } echo $pgi; 86 88 ?><option value="a"><?php _e('.... Enter the Blog ID'); ?></option> 87 </select><div id="nxsTRInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="trInpCst<?php echo $ii; ?>" value="<?php echo $options['pgID']; ?>" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="trpgID<?php echo $ii; ?>" />88 <div style="display: inline-block;"><a onclick="nxs_trGetBlogs(<?php echo $ii;?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo $nt.$ii;?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo $nt.$ii;?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />89 </select><div id="nxsTRInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> <input type="text" style="display: none;" id="trInpCst<?php echo esc_attr($ii); ?>" value="<?php echo $options['pgID']; ?>" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="trpgID<?php echo esc_attr($ii); ?>" /> 90 <div style="display: inline-block;"><a onclick="nxs_trGetBlogs(<?php echo esc_attr($ii);?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo esc_attr($nt.$ii);?>rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo esc_attr($nt.$ii);?>ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 89 91 </div> 90 </div> <div id="nxsTRMsgDiv<?php echo $ii; ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please authorize your account', 'nxs_snap'); ?><?php } ?></div>91 </div> <?php } ?> <input type="hidden" id="trAuthUser<?php echo $ii; ?>" value="<?php echo $options['authUser']; ?>"/> <br/><br/>92 </div> <div id="nxsTRMsgDiv<?php echo esc_attr($ii); ?>"><?php if (!empty($options['uMsg'])) echo $options['uMsg']; ?><?php if ($isNew) { ?><?php _e('Please authorize your account', 'nxs_snap'); ?><?php } ?></div> 93 </div> <?php } ?> <input type="hidden" id="trAuthUser<?php echo esc_attr($ii); ?>" value="<?php echo $options['authUser']; ?>"/> <br/><br/> 92 94 93 95 <?php $this->elemKeySecret($ii,'OAuth Consumer Key','Secret Key', $options['appKey'], $options['appSec'],'appKey','appSec','https://www.tumblr.com/oauth/apps'); ?> … … 96 98 <div style="margin-left: 10px;"> 97 99 98 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] != 'I') echo 'checked="checked"'; ?> onchange="nxs_TRSetEnable('T','<?php echo $ii; ?>');" /> Text Post<br/>99 100 <div style="width:100%; margin-left: 15px;"><strong id="altFormatText"><?php _e('Post Title Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> (<a href="#" id="apTRTMsgFrmt<?php echo $ii; ?>HintInfo" onclick="mxs_showHideFrmtInfo('apTRTMsgFrmt<?php echo $ii; ?>'); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div><div onblur="jQuery('#apTRMsgFrmt<?php echo $ii; ?>Hint').hide();">101 <input name="tr[<?php echo $ii; ?>][msgTFormat]" id="apTRMsgTFrmt<?php echo $ii; ?>" style="margin-left: 15px; width: 50%;" value="<?php if ($options['msgTFormat']!='') _e(apply_filters('format_to_edit', htmlentities($options['msgTFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); else echo "New Post has been published on %SITENAME%"; ?>" onfocus="jQuery('#apTRTMsgFrmt<?php echo $ii; ?>Hint').show();" <?php if ($options['postType'] == 'I') echo 'disabled="disabled"'; ?> /><br/>100 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($options['postType'] != 'I') echo 'checked="checked"'; ?> onchange="nxs_TRSetEnable('T','<?php echo esc_attr($ii); ?>');" /> Text Post<br/> 101 102 <div style="width:100%; margin-left: 15px;"><strong id="altFormatText"><?php _e('Post Title Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> (<a href="#" id="apTRTMsgFrmt<?php echo esc_attr($ii); ?>HintInfo" onclick="mxs_showHideFrmtInfo('apTRTMsgFrmt<?php echo esc_attr($ii); ?>'); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div><div onblur="jQuery('#apTRMsgFrmt<?php echo esc_attr($ii); ?>Hint').hide();"> 103 <input name="tr[<?php echo esc_attr($ii); ?>][msgTFormat]" id="apTRMsgTFrmt<?php echo esc_attr($ii); ?>" style="margin-left: 15px; width: 50%;" value="<?php if ($options['msgTFormat']!='') _e(apply_filters('format_to_edit', htmlentities($options['msgTFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); else echo "New Post has been published on %SITENAME%"; ?>" onfocus="jQuery('#apTRTMsgFrmt<?php echo esc_attr($ii); ?>Hint').show();" <?php if ($options['postType'] == 'I') echo 'disabled="disabled"'; ?> /><br/> 102 104 <?php nxs_doShowHint("apTRTMsgFrmt".$ii); ?> 103 105 </div> 104 106 105 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> onchange="nxs_TRSetEnable('I','<?php echo $ii; ?>');"/> Image Post107 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> onchange="nxs_TRSetEnable('I','<?php echo esc_attr($ii); ?>');"/> Image Post 106 108 <i>Don't forget to change default "Post Text Format" to prevent duplicate images.</i><br/> 107 109 … … 110 112 <strong>Clickthrough URL:</strong> 111 113 <div style="margin-bottom: 20px;margin-top: 5px;"> 112 <input type="radio" name="tr[<?php echo $ii; ?>][cImgURL]" value="R" <?php if ( empty($options['cImgURL']) || $options['cImgURL'] == 'R') echo 'checked="checked"'; ?> /> Regular Post URL 113 <input type="radio" name="tr[<?php echo $ii; ?>][cImgURL]" value="S" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'S') echo 'checked="checked"'; ?> /> Shortened Post URL 114 <input type="radio" name="tr[<?php echo $ii; ?>][cImgURL]" value="N" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'N') echo 'checked="checked"'; ?> /> No Clickthrough URL 114 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][cImgURL]" value="R" <?php if ( empty($options['cImgURL']) || $options['cImgURL'] == 'R') echo 'checked="checked"'; ?> /> Regular Post URL 115 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][cImgURL]" value="S" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'S') echo 'checked="checked"'; ?> /> Shortened Post URL 116 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][cImgURL]" value="N" <?php if (!empty($options['cImgURL']) && $options['cImgURL'] == 'N') echo 'checked="checked"'; ?> /> No Clickthrough URL 115 117 </div><strong>Defailt Image to Post:</strong> 116 118 <p style="font-size: 11px; margin: 0px;">If your post is missing "Featured Image" and doesn't have any images in the text body this will be used instead.</p> 117 </div><input name="tr[<?php echo $ii; ?>][defImg]" id="apTRDefImg<?php echo $ii; ?>" style=" margin-left: 15px; width: 30%;" <?php if ($options['postType'] != 'I') echo 'disabled="disabled"'; ?> value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />119 </div><input name="tr[<?php echo esc_attr($ii); ?>][defImg]" id="apTRDefImg<?php echo esc_attr($ii); ?>" style=" margin-left: 15px; width: 30%;" <?php if ($options['postType'] != 'I') echo 'disabled="disabled"'; ?> value="<?php _e(apply_filters('format_to_edit', htmlentities($options['defImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 118 120 <br/> 119 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="U" <?php if ($options['postType'] == 'U') echo 'checked="checked"'; ?> /> Audio Post<br/>120 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="V" <?php if ($options['postType'] == 'V') echo 'checked="checked"'; ?> /> Video Post<br/>121 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="U" <?php if ($options['postType'] == 'U') echo 'checked="checked"'; ?> /> Audio Post<br/> 122 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="V" <?php if ($options['postType'] == 'V') echo 'checked="checked"'; ?> /> Video Post<br/> 121 123 <i style="">Tip: Your post must contain link to Audio or Video file if you select "Audio Post" or "Video Post" , otherwise it will reverted to the "Text Post"</i> 122 124 <br/><br/> … … 125 127 126 128 <div style="margin-bottom: 20px;margin-top: 5px;"> 127 <input value="1" type="checkbox" name="tr[<?php echo $ii; ?>][fillSrcURL]" <?php if ((int)$options['fillSrcURL'] == 1) echo "checked"; ?> />129 <input value="1" type="checkbox" name="tr[<?php echo esc_attr($ii); ?>][fillSrcURL]" <?php if ((int)$options['fillSrcURL'] == 1) echo "checked"; ?> /> 128 130 <strong>Fill "Source URL"</strong> Will fill Tumblr's "Source URL" with post URL or defined URL. 129 131 130 <br/><input value="1" type="checkbox" name="tr[<?php echo $ii; ?>][useOrDate]" <?php if ((int)$options['useOrDate'] == 1) echo "checked"; ?> />132 <br/><input value="1" type="checkbox" name="tr[<?php echo esc_attr($ii); ?>][useOrDate]" <?php if ((int)$options['useOrDate'] == 1) echo "checked"; ?> /> 131 133 <strong>Keep Original Post Date</strong> Will post to Tumblr with original date of the post 132 134 133 <br/><input value="1" type="checkbox" name="tr[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> />135 <br/><input value="1" type="checkbox" name="tr[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> 134 136 <strong>Post with tags.</strong> Tags from the blogpost will be auto posted to Tumblr 135 137 136 <br/><input value="1" type="checkbox" name="tr[<?php echo $ii; ?>][inclCats]" <?php if ((int)$options['inclCats'] == 1) echo "checked"; ?> />138 <br/><input value="1" type="checkbox" name="tr[<?php echo esc_attr($ii); ?>][inclCats]" <?php if ((int)$options['inclCats'] == 1) echo "checked"; ?> /> 137 139 <strong>Post categories as tags.</strong> Categories from the blogpost will be auto posted to Tumblr as tags 138 140 </div> … … 144 146 Your Tumblr Account has been authorized. User ID: <?php echo $options['authUser']; ?>| Blog ID: <?php echo $options['pgID']; ?>. 145 147 You can Re- <?php } ?> 146 <a href="<?php echo $nxs_snapSetPgURL.(stripos($nxs_snapSetPgURL, '?')!==false?'&':'?');?>auth=tr&acc=<?php echo $ii; ?>">Authorize Your Tumblr Account</a>148 <a href="<?php echo $nxs_snapSetPgURL.(stripos($nxs_snapSetPgURL, '?')!==false?'&':'?');?>auth=tr&acc=<?php echo esc_attr($ii); ?>">Authorize Your Tumblr Account</a> 147 149 <?php if (empty($options['accessTokenSec'])) { ?> <div class="blnkg"><=== Authorize your account ===</div> <?php } ?> 148 150 <?php } ?> … … 184 186 185 187 <tr style="<?php echo !empty($ntOpt['do'])?'display:table-row;':'display:none;'; ?>" class="nxstbldo nxstbldo<?php echo strtoupper($nt).$ii; ?>" style=""><th scope="row" style="text-align:right; width:60px; padding-right:10px;"> 186 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="T" <?php if ($ntOpt['postType'] != 'I') echo 'checked="checked"'; ?> /> <br/>188 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($ntOpt['postType'] != 'I') echo 'checked="checked"'; ?> /> <br/> 187 189 </th> 188 190 <td style="align:"><table style="width:90%; display: inline-table;"><?php $this->elemEdTitleFormat($ii, __('Text Post. Title Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgTFormat); ?></table> </td></tr> 189 191 190 192 <tr style="<?php echo !empty($ntOpt['do'])?'display:table-row;':'display:none;'; ?>" class="nxstbldo nxstbldo<?php echo strtoupper($nt).$ii; ?>" style=""><th scope="row" style="text-align:right; width:60px; padding-right:10px;"> 191 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="I" <?php if ($ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <br/>193 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <br/> 192 194 </th> 193 195 <td><b>Image Post</b> 194 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="V" <?php if ($ntOpt['postType'] == 'V') echo 'checked="checked"'; ?> /> <b>Video Post</b> <?php nxs_doShowHint("apTRTMsgFrmt".$ii); ?> 195 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="U" <?php if ($ntOpt['postType'] == 'U') echo 'checked="checked"'; ?> /> <b>Audio Post</b> <?php nxs_doShowHint("apTRTMsgFrmt".$ii); ?>196 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="V" <?php if ($ntOpt['postType'] == 'V') echo 'checked="checked"'; ?> /> <b>Video Post</b> <?php nxs_doShowHint("apTRTMsgFrmt".$ii); ?> 197 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="U" <?php if ($ntOpt['postType'] == 'U') echo 'checked="checked"'; ?> /> <b>Audio Post</b> <?php nxs_doShowHint("apTRTMsgFrmt".$ii); ?> 196 198 </td></tr> 197 199 … … 210 212 <div class="nxsPostEd_ElemWrap"> <div class="nxsPostEd_ElemLabel"><?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 211 213 <div class="nxsPostEd_Elem"> 212 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($ntOpt['postType'] != 'I') echo 'checked="checked"'; ?> /><?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>214 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($ntOpt['postType'] != 'I') echo 'checked="checked"'; ?> /><?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> 213 215 <?php $this->elemEdTitleFormat($ii, __('Title Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgTFormat); ?> 214 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <b>Image Post</b><br/>215 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="V" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($ntOpt['postType'] == 'V') echo 'checked="checked"'; ?> /> <b>Video Post</b><br/>216 <input type="radio" name="tr[<?php echo $ii; ?>][postType]" value="U" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($ntOpt['postType'] == 'U') echo 'checked="checked"'; ?> /> <b>Audio Post</b>216 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($ntOpt['postType'] == 'I') echo 'checked="checked"'; ?> /> <b>Image Post</b><br/> 217 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="V" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($ntOpt['postType'] == 'V') echo 'checked="checked"'; ?> /> <b>Video Post</b><br/> 218 <input type="radio" name="tr[<?php echo esc_attr($ii); ?>][postType]" value="U" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($ntOpt['postType'] == 'U') echo 'checked="checked"'; ?> /> <b>Audio Post</b> 217 219 </div> 218 220 </div><?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tw.api.php
r2087759 r2757212 12 12 return $out; 13 13 } 14 15 function twReq($reqURL, $params_array, $options, $img=''){ $kv = array(); $proxy = ''; $sparams_array = ''; $nounce = md5(time().'666'); $ts = time(); if (empty($params_array)) $params_array = array(); uksort($params_array, 'strcmp'); 16 $arrToSign = array_merge(array('oauth_consumer_key'=>nxs_gak($options['appKey']),'oauth_nonce'=>$nounce,'oauth_signature_method'=>'HMAC-SHA1','oauth_timestamp'=>$ts,'oauth_token'=>$options['accessToken'],'oauth_version'=>'1.0'), $params_array); 17 uksort($arrToSign, 'strcmp'); foreach ($arrToSign as $k => $v) $kv[] = $k.'='.rawurlencode($v); $sparams_array = implode('&', $kv); $base = 'POST&'.rawurlencode($reqURL).'&'.rawurlencode($sparams_array); 18 $signKey = (nxs_gas($options['appSec']).'&'.$options['accessTokenSec']); $signature = rawurlencode(base64_encode(hash_hmac("sha1", $base, $signKey, true))); $hdrsArr = nxs_makeHeaders($reqURL); 19 $hdrsArr['Authorization'] = 'OAuth oauth_consumer_key="'.nxs_gak($options['appKey']).'", oauth_nonce="'.$nounce.'", oauth_signature="'.$signature.'", oauth_signature_method="HMAC-SHA1", oauth_timestamp="'.$ts.'", oauth_token="'.$options['accessToken'].'", oauth_version="1.0"'; 20 if (!empty($img)) $hdrsArr['Content-type'] = 'multipart/form-data'; $advSet = nxs_mkRemOptsArr($hdrsArr, '', (!empty($img)?$img:$sparams_array), $proxy); if (!empty($img)) $advSet['usearray'] = 1; $ret = nxs_remote_post( $reqURL, $advSet); return $ret; 21 } 22 14 23 15 function doPostToNT($options, $message){ global $nxs_urlLen; $badOut = array('pgID'=>'', 'isPosted'=>0, 'pDate'=>date('Y-m-d H:i:s'), 'Error'=>''); 24 16 if (!function_exists('nxs_remote_get') && function_exists('nxs_remote_get')) { function nxs_remote_get($url){return nxs_remote_get($url);} } … … 34 26 if (!empty($message['pText'])) $msg = $message['pText']; else $msg = nxs_doFormatMsg($options['msgFormat'], $message); 35 27 if ($options['attchImg']!=false) { if (isset($message['imageURL'])) $imgURL = trim(nxs_getImgfrOpt($message['imageURL'], $options['imgSize'])); else $imgURL = ''; } 36 if (empty($imgURL) && $img=='') $options['attchImg'] = false; 37 //$ret = $this->twReq('https://api.twitter.com/1.1/account/settings.json', '', $options); prr($ret); die(); 28 if (empty($imgURL) && $img=='') $options['attchImg'] = false; 38 29 //## Make Post 39 //$options['attchImg']='1'; $imgURL = 'http://ecx.images-amazon.com/images/I/41caE5Uc5ML._AA160_.jpg';40 30 $hdrsArr['User-Agent']='Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0'; $advSet=array('headers'=>$hdrsArr,'httpversion'=>'1.1','timeout'=>45,'sslverify'=>false); 41 //$msg = $message['message']; $imgURL = trim($message['imageURL']); $img = trim($message['img']); $nxs_urlLen = $message['urlLength'];42 31 if ($options['attchImg']!=false && $img=='' && $imgURL!='' ) { $imgURL = str_replace(' ', '%20', $imgURL); 43 32 if( ini_get('allow_url_fopen') ) { if (getimagesize($imgURL)!==false) { $img = nxs_remote_get($imgURL, $advSet); if(is_nxs_error($img)) $options['attchImg'] = false; else $img = $img['body']; } else $options['attchImg'] = false; } 44 33 else { $img = nxs_remote_get($imgURL, $advSet); if(is_nxs_error($img)) $options['attchImg'] = false; elseif (isset($img['body'])&& trim($img['body'])!='') $img = $img['body']; else $options['attchImg'] = false; } 45 34 } 46 $twLim = 280; if ($nxs_urlLen>0) { $msg = nsTrnc($msg, $twLim-22+$nxs_urlLen); } else $msg = nsTrnc($msg, $twLim); 47 if (substr($msg, 0, 1)=='@') $msg = ' '.$msg; $params_array = array('status' =>$msg); if (!empty($options['in_reply_to_id'])) $params_array['in_reply_to_status_id'] = $options['in_reply_to_id']; $mid = ''; 48 if ($options['attchImg']!=false && $img!='') { $pa =array( 'media' => $img); 49 $ret = $this->twReq('https://upload.twitter.com/1.1/media/upload.json', '', $options, $pa); $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true); 50 if ($code=='200') { if (!empty($respJ['media_id'])) $mid = $respJ['media_id_string']; } 51 } if (!empty($mid)) $params_array['media_ids'] = $mid; $ret = $this->twReq('https://api.twitter.com/1.1/statuses/update.json', $params_array, $options); $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true); 52 if ( $code=='403' && stripos($resp, 'User is over daily photo limit')!==false && $options['attchImg']!=false && $img!='') { 53 $badOut['Error'] .= "User is over daily photo limit. Will post without image\r\n"; 54 $ret = $this->twReq('https://api.twitter.com/1.1/statuses/update.json', array('status' =>$msg), $options); $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true); 55 } 56 if ($code == 200){ 57 $twResp = json_decode($resp, true); if (is_array($twResp) && isset($twResp['id_str'])) $twNewPostID = $twResp['id_str']; 58 if (is_array($twResp) && isset($twResp['user'])) $twPageID = $twResp['user']['screen_name']; 59 return array('postID'=>$twNewPostID, 'isPosted'=>1, 'postURL'=>'https://twitter.com/'.$twPageID.'/status/'.$twNewPostID, 'pDate'=>date('Y-m-d H:i:s')); 60 } else { $badOut['Error'] .= "Resp: ".print_r($resp, true)."| Error: ".print_r($respJ['errors'], true)."| MSG: ".print_r($msg, true); 61 return $badOut; 62 } 35 $twLim = 280; if ($nxs_urlLen>0) { $msg = nsTrnc($msg, $twLim-22+$nxs_urlLen); } else $msg = nsTrnc($msg, $twLim); if (substr($msg, 0, 1)=='@') $msg = ' '.$msg; 36 $params_array = array('text' =>$msg); $mid = ''; $appi = new nxsAPI_TW_Native(); $appi->conn = $options; $badOut = $appi->check(); if ($badOut) { 37 if (!empty($options['in_reply_to_id'])) $params_array['in_reply_to_status_id'] = $options['in_reply_to_id']; //## ? 38 //## Upload image and add it to the post 39 if ($options['attchImg'] != false && $img != '') { $pa = array('media' => $img); 40 $ret = $appi->twReq('https://upload.twitter.com/1.1/media/upload.json', $pa ); 41 $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true); 42 if ($code == 200 || $code == 201) { if (!empty($respJ['media_id'])) $mid = $respJ['media_id_string']; } 43 } 44 if (!empty($mid)) $params_array['media']['media_ids'][] = $mid; 45 //## Post 46 $ret = $appi->twReq('https://api.twitter.com/2/tweets', $params_array); 47 $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true); 48 //## Fallback in case no mo imgs allowed. 49 if ($code == '403' && stripos($resp, 'User is over daily photo limit') !== false && $options['attchImg'] != false && $img != '') { 50 $badOut['Error'] .= "User is over daily photo limit. Will post without image\r\n"; 51 $ret = $appi->twReq('https://api.twitter.com/2/tweets', array('text' => $msg)); 52 $code = $ret['response']['code']; $resp = $ret['body']; $respJ = json_decode($resp, true); 53 } 54 if ($code == 200 || $code == 201) { 55 $twResp = json_decode($resp, true); 56 if (is_array($twResp) && isset($twResp['id_str']) && isset($twResp['user'])) { 57 $twNewPostID = $twResp['id_str']; $twPageID = $twResp['user']['screen_name']; 58 } elseif (is_array($twResp) && isset($twResp['data']['id'])) { 59 $twNewPostID = $twResp['data']['id']; $twPageID = $appi->twUser['username']; 60 } 61 return array('postID' => $twNewPostID, 'isPosted' => 1, 'postURL' => 'https://twitter.com/' . $twPageID . '/status/' . $twNewPostID, 'pDate' => date('Y-m-d H:i:s')); 62 } else { 63 $badOut['Error'] .= "Resp: " . print_r($resp, true) . "| Error: " . print_r($respJ['errors'], true) . "| MSG: " . print_r($msg, true); 64 return $badOut; 65 } 66 } 63 67 return $badOut; 64 68 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/tw.php
r2609158 r2757212 2 2 //## NextScripts Twitter Connection Class 3 3 $nxs_snapAvNts[] = array('code'=>'TW', 'lcode'=>'tw', 'name'=>'Twitter', 'type'=>'Social Networks', 'ptype'=>'F', 'status'=>'A', 'desc'=>'Autopost to your account. Ability to attach images to tweets'); 4 5 //## V5 6 7 if (!class_exists('nxsAPI_TW_Native')) { class nxsAPI_TW_Native { 8 var $conn=[]; var $rq = ''; var $twUser = ''; var $postData = []; var $d=false; 9 10 function __construct(){ $this->rq = new nxsHttp; } 11 //## Adjusment for image/media Upload with WP Curl. 12 function imgUplcurl(&$handle){ curl_setopt($handle, CURLOPT_POSTFIELDS, $this->postData); } 13 //## Signed Request to Twitter API. 14 function twReq($reqURL, $reqArr=[], $gtArr = []){ $kv = array(); $nounce = md5(time().'666'); $ts = time(); $isMediaUpl = stripos($reqURL, 'upload.')!==false; 15 if (!empty($reqArr)) $req = !$isMediaUpl?json_encode($reqArr):$reqArr; $tp = !empty($reqArr)?'POST':'GET'; 16 $arrToSign = array_merge(array('oauth_consumer_key'=>nxs_gak($this->conn['appKey']),'oauth_nonce'=>$nounce,'oauth_signature_method'=>'HMAC-SHA1','oauth_timestamp'=>$ts,'oauth_token'=>$this->conn['accessToken'],'oauth_version'=>'1.0'), $gtArr);// prr($arrToSign); 17 uksort($arrToSign, 'strcmp'); foreach ($arrToSign as $k => $v) $kv[] = $k.'='.rawurlencode($v); $sparams_array = implode('&', $kv); $base = $tp.'&'.rawurlencode($reqURL).'&'.rawurlencode($sparams_array); //prr($base); 18 $signKey = (nxs_gas($this->conn['appSec']).'&'.$this->conn['accessTokenSec']); $signature = rawurlencode(base64_encode(hash_hmac("sha1", $base, $signKey, true))); //$hdrsArr = nxs_makeHeaders($reqURL); 19 $auth = 'OAuth oauth_consumer_key="'.nxs_gak($this->conn['appKey']).'", oauth_nonce="'.$nounce.'", oauth_signature="'.$signature.'", oauth_signature_method="HMAC-SHA1", oauth_timestamp="'.$ts.'", oauth_token="'.$this->conn['accessToken'].'", oauth_version="1.0"'; 20 $argArr = ['extraHeaders'=>['Authorization'=>$auth]]; if ($tp=='POST') { $argArr['extraHeaders']['Content-Type'] = $isMediaUpl?'multipart/form-data':'application/json; charset=UTF-8'; $argArr['flds'] = $req; } 21 if (!empty($gtArr)) $reqURL = $reqURL.'?'.http_build_query($gtArr); $args = nxs_mkRmReqArgs($argArr); 22 if ($isMediaUpl) $this->rq->postData = $req; $ret = $this->rq->request($reqURL, $args); if($this->d) prr($args); 23 return $ret; 24 } 25 26 function check(){ 27 $ret = $this->twReq('https://api.twitter.com/2/users/me'); 28 if ($ret['response']['code']=='200') { $u = json_decode($ret['body'], true); $this->twUser = $u['data']; } 29 if (!empty($this->twUser)) return true; else return $ret['body']; 30 } 31 32 function getReplies($twID){ 33 $ret = $this->twReq('https://api.twitter.com/2/tweets/' . $twID, '', ['tweet.fields' => 'conversation_id']); 34 if ($ret['response']['code'] == '200') { 35 $twInfo = json_decode($ret['body'], true); $cnvId = $twInfo['data']['conversation_id']; 36 $ret = $this->twReq('https://api.twitter.com/2/tweets/search/recent', '', ['query' => 'conversation_id:' . $cnvId, 'tweet.fields' => 'in_reply_to_user_id,author_id,conversation_id,attachments,created_at','user.fields' => 'id,username,name,profile_image_url,url', 'expansions'=>'author_id,attachments.media_keys,in_reply_to_user_id']); 37 if ($ret['response']['code'] == '200') { 38 $rpls = json_decode($ret['body'], true); //prr($rpls); 39 foreach ($rpls['data'] as $i=>$r) { 40 foreach ($rpls['includes']['users'] as $j => $u) { 41 if ($r['author_id'] == $u['id']) $rpls['data'][$i]['author'] = $rpls['includes']['users'][$j]; if ($r['in_reply_to_user_id'] == $u['id']) $rpls['data'][$i]['in_reply_to_user'] = $rpls['includes']['users'][$j]['username']; 42 } $rpls['data'][$i]['text'] = str_ireplace('@'.$rpls['data'][$i]['in_reply_to_user'],'', $r['text']); 43 } return $rpls['data']; 44 } 45 } 46 } 47 function getMentions($urlToSrch){ 48 $ret = $this->twReq('https://api.twitter.com/2/tweets/search/recent', '', ['query' => 'url:"' . $urlToSrch . '"', 'tweet.fields' => 'in_reply_to_user_id,author_id,conversation_id,attachments,created_at','user.fields' => 'id,username,name,profile_image_url,url', 'expansions'=>'author_id,attachments.media_keys']); 49 if ($ret['response']['code'] == '200') { $rpls = json_decode($ret['body'], true);// prr($rpls); 50 foreach ($rpls['data'] as $i=>$r) foreach ($rpls['includes']['users'] as $j=>$u) if ($r['author_id']==$u['id']) $rpls['data'][$i]['author'] = $rpls['includes']['users'][$j]; return $rpls['data']; 51 } 52 } 53 }} 54 55 //## /V5 4 56 5 57 if (!class_exists("nxs_snapClassTW")) { class nxs_snapClassTW extends nxs_snapClassNT { … … 25 77 26 78 function accTab($ii, $options, $isNew=false){ global $nxs_snapSetPgURL; $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; ?> 27 <div class="nxs_tls_lbl"><strong>Your <?php echo $ntInfo['name']; ?> URL:</strong> </div><input type="text" name="<?php echo $nt; ?>[<?php echo $ii; ?>][twURL]" style="width: 40%;border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['twURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>79 <div class="nxs_tls_lbl"><strong>Your <?php echo esc_attr($ntInfo['name']); ?> URL:</strong> </div><input type="text" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][twURL]" style="width: 40%;border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['twURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 28 80 <?php $this->elemKeySecret($ii,'API Key','API Secret', $options['appKey'], $options['appSec'],'appKey','appSec','https://apps.twitter.com/'); $this->elemKeySecret($ii,'Access Token','Access Token Secret', $options['accessToken'], $options['accessTokenSec'],'accessToken','accessTokenSec'); ?> 29 81 <br/><?php $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?> 30 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>82 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 31 83 <br/><br/><?php 32 84 } … … 35 87 <div class="nxs_tls_sbInfo"><?php _e('Plugin could grab Replies and Mentions from Twitter and import them as Wordpress Comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 36 88 <?php global $nxs_SNAP; $gOptions = $nxs_SNAP->nxs_options; if ( !empty($gOptions['riActive']) && $gOptions['riActive'] == '1' ) { ?> 37 <input value="1" id="riC<?php echo $ii; ?>" <?php if (!empty($options['riComments']) && trim($options['riComments'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][riComments]"/> <b><?php _e('Import Twitter Replies', 'social-networks-auto-poster-facebook-twitter-g'); ?></b>89 <input value="1" id="riC<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riComments']) && trim($options['riComments'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][riComments]"/> <b><?php _e('Import Twitter Replies', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 38 90 <br/> 39 <input value="1" id="riCM<?php echo $ii; ?>" <?php if (!empty($options['riCommentsM']) && trim($options['riCommentsM'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][riCommentsM]"/> <b><?php _e('Import Twitter Mentions', 'social-networks-auto-poster-facebook-twitter-g'); ?></b>91 <input value="1" id="riCM<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riCommentsM']) && trim($options['riCommentsM'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][riCommentsM]"/> <b><?php _e('Import Twitter Mentions', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 40 92 <br/> 41 <input value="1" id="riCA<?php echo $ii; ?>" <?php if (!empty($options['riCommentsAA']) && trim($options['riCommentsAA'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][riCommentsAA]"/> <b><?php _e('Auto-approve imported comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 93 <div style="margin-left: 12px;"><input value="1" id="riCM<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riCommentsMExMy']) && trim($options['riCommentsMExMy'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][riCommentsMExMy]"/> <b><?php _e('Exclude Mentions from myself', 'social-networks-auto-poster-facebook-twitter-g'); ?></b></div> 94 <input value="1" id="riCA<?php echo esc_attr($ii); ?>" <?php if (!empty($options['riCommentsAA']) && trim($options['riCommentsAA'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][riCommentsAA]"/> <b><?php _e('Auto-approve imported comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 42 95 <?php } else { echo "<br/>"; _e('Please activate the "Comments Import" from SNAP Settings Tab', 'social-networks-auto-poster-facebook-twitter-g'); } ?> 43 96 </div> 44 97 <div class="nxs_tls_bd"><div class="nxs_tls_sbInfo"><br/> 45 <input value="1" <?php if (!empty($options['tw140']) && trim($options['tw140'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][tw140]"/> <b><?php _e('This Twitter account is still limited to 140 characters', 'social-networks-auto-poster-facebook-twitter-g'); ?></b>98 <input value="1" <?php if (!empty($options['tw140']) && trim($options['tw140'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][tw140]"/> <b><?php _e('This Twitter account is still limited to 140 characters', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 46 99 </div></div> 47 100 <?php } … … 58 111 if (isset($pval['riComments'])) $options[$ii]['riComments'] = $pval['riComments']; else $options[$ii]['riComments'] = 0; 59 112 if (isset($pval['riCommentsM'])) $options[$ii]['riCommentsM'] = $pval['riCommentsM']; else $options[$ii]['riCommentsM'] = 0; 113 if (isset($pval['riCommentsMExMy'])) $options[$ii]['riCommentsMExMy'] = $pval['riCommentsMExMy']; else $options[$ii]['riCommentsMExMy'] = 0; 60 114 if (isset($pval['riCommentsAA'])) $options[$ii]['riCommentsAA'] = $pval['riCommentsAA']; else $options[$ii]['riCommentsAA'] = 0; 61 115 … … 76 130 <div class="nxsPostEd_ElemWrap"> 77 131 <div class="nxsPostEd_Elem"> 78 <input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]"/>79 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>132 <input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 133 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> 80 134 </div></div> 81 135 <?php … … 235 289 } 236 290 237 function importComments($options='', $postID='', $po='') { if (empty($postID)) $postID = $_POST['pid']; 291 function importComments($options='', $postID='', $po='') { if (empty($postID)) $postID = $_POST['pid']; $ci = 0; 238 292 if (empty($options)) { global $nxs_SNAP; $options = $nxs_SNAP->nxs_options; } 239 if (empty($po)) { $po = maybe_unserialize(get_post_meta($postID, 'snap'.strtoupper($_POST['nt']), true)); $po = $po[$_POST['ii']]; } 240 if (isset($_POST['ii'])) $options = $options[$_POST['nt']][$_POST['ii']]; 241 242 require_once ('apis/tmhOAuth.php'); $tmhOAuth = new NXS_tmhOAuth(array( 'consumer_key' => nxs_gak($options['appKey']), 'consumer_secret' => nxs_gas($options['appSec']), 'user_token' => $options['accessToken'], 'user_secret' => $options['accessTokenSec'])); 243 $code = $tmhOAuth->request('GET', $tmhOAuth->url('1.1/statuses/mentions_timeline')); 244 if ($code=='200' && isset($tmhOAuth->response['response']) ) $twList = json_decode($tmhOAuth->response['response'], true); else $twList = ''; 245 246 $impCmnts = get_post_meta($postID, 'snapImportedComments', true); 247 if(!is_array($impCmnts)) $impCmnts = array(); $twsToImp = array(); $lastID = ''; 248 //## Do Replies 249 if (!empty($twList) && is_array($twList)) foreach ($twList as $tw) if ($tw['in_reply_to_status_id_str'] == $po['pgID']) $twsToImp[] = $tw; 250 if (!empty($twList) && is_array($twsToImp) && count($twsToImp)>0) 251 foreach ($twsToImp as $comment){ $cid = $comment['id_str']; if (trim($cid)=='' || in_array('twxcw'.$cid, $impCmnts)) continue; else $impCmnts[] = 'twxcw'.$cid; 252 $commentdata = array( 'comment_post_ID' => $postID, 'comment_author' => $comment['user']['name'], 'comment_agent' => "SNAP||".str_ireplace('_normal.','_bigger.',$comment['user']['profile_image_url_https']), 253 'comment_author_email' => $comment['user']['screen_name'].'@twitter.com', 'comment_author_url' => 'https://twitter.com/'.$comment['user']['screen_name'], 254 'comment_content' => str_ireplace('@'.$comment['in_reply_to_screen_name'],'', $comment['text']), 'comment_date_gmt' => date('Y-m-d H:i:s', strtotime( $comment['created_at'] ) ), 'comment_type' => ''); 255 nxs_postNewComment($commentdata, $options['riCommentsAA']=='1'); $ci++; //echo $ci; 256 } 257 258 //## Do mentions. 259 require_once ('apis/tmhOAuth.php'); $tmhOAuth = new NXS_tmhOAuth(array( 'consumer_key' => nxs_gak($options['appKey']), 'consumer_secret' => nxs_gas($options['appSec']), 'user_token' => $options['accessToken'], 'user_secret' => $options['accessTokenSec'])); 260 if (isset($options['urlToUse']) && trim($options['urlToUse'])!='') $urlToSrch = $options['urlToUse']; else $urlToSrch = get_permalink($postID); 261 $code = $tmhOAuth->request('GET', $tmhOAuth->url('1.1/search/tweets'), array('rpp'=>'100', 'since_id'=>$lastID, 'q'=> urlencode($urlToSrch))); 262 if ($code=='200' && isset($tmhOAuth->response['response']) ) { $tweets = json_decode($tmhOAuth->response['response'], true); //prr($tweets); 263 if (is_array($tweets) && is_array($tweets['statuses'])) { 264 foreach ($tweets['statuses'] as $comment){ $cid = $comment['id_str']; if (trim($cid)=='' || in_array('twxcw'.$cid, $impCmnts) || $cid==$po['pgID']) continue; else $impCmnts[] = 'twxcw'.$cid; // prr($impCmnts); 265 $commentdata = array( 'comment_post_ID' => $postID, 'comment_author' => $comment['user']['name'], 'comment_author_email' => $comment['user']['screen_name'].'@twitter.com', 266 'comment_agent' => "SNAP||".str_ireplace('_normal.','_bigger.',$comment['user']['profile_image_url_https']), 267 'comment_author_url' => 'https://twitter.com/'.$comment['user']['screen_name'], 'comment_content' => $comment['text'], 'comment_date_gmt' => date('Y-m-d H:i:s', strtotime( $comment['created_at'] ) ), 'comment_type' => ''); 268 nxs_postNewComment($commentdata, $options['riCommentsAA']=='1'); $ci++; 269 } 270 }} 293 if (empty($po)) { $po = maybe_unserialize(get_post_meta($postID, 'snap'.strtoupper($_POST['nt']), true)); $po = $po[sanitize_key($_POST['ii'])]; } 294 if (isset($_POST['ii'])) $options = $options[$_POST['nt']][sanitize_key($_POST['ii'])]; 295 296 $appi = new nxsAPI_TW_Native(); $appi->conn = $options; $rplL = []; 297 if (!empty($options['riComments'])) { $rpls = $appi->getReplies($po['pgID']); $rplL = array_merge($rplL, $rpls); } 298 if (!empty($options['riCommentsM'])) { 299 if (isset($options['urlToUse']) && trim($options['urlToUse']) != '') $urlToSrch = $options['urlToUse']; else $urlToSrch = get_permalink($postID); 300 $rpls = $appi->getMentions($urlToSrch); 301 if (!empty($options['riCommentsMExMy'])) { $appi->check(); $rpls2 = []; foreach ($rpls as $rpl) if ($rpl['author_id']!=$appi->twUser['id']) $rpls2[] = $rpl; $rpls = $rpls2; } 302 $rplL = array_merge($rplL, $rpls); 303 } // prr($rplL); 304 $impCmnts = get_post_meta($postID, 'snapImportedComments', true); if(!is_array($impCmnts)) $impCmnts =[]; 305 foreach ($rplL as $comment){ $cid = $comment['id']; if (trim($cid)=='' || in_array('twxcw'.$cid, $impCmnts)) continue; else $impCmnts[] = 'twxcw'.$cid; 306 $commentdata = array( 'comment_post_ID' => $postID, 'comment_author' => $comment['author']['name'], 'comment_agent' => "SNAP||".str_ireplace('_normal.','_bigger.',$comment['author']['profile_image_url']), 307 'comment_author_email' => $comment['author']['username'].'@twitter.com', 'comment_author_url' => 'https://twitter.com/'.$comment['author']['username'], 308 'comment_content' => $comment['text'], 'comment_date_gmt' => date('Y-m-d H:i:s', strtotime( $comment['created_at'] ) ), 'comment_type' => ''); prr($commentdata); 309 nxs_postNewComment($commentdata, $options['riCommentsAA']=='1'); $ci++; //echo $ci; 310 } 271 311 delete_post_meta($postID, 'snapImportedComments'); add_post_meta($postID, 'snapImportedComments', $impCmnts ); 272 312 if ( isset($_POST['pid']) && $_POST['pid']!='') printf( _n('%d comment has been imported.', '%d comments has been imported.', $ci, 'social-networks-auto-poster-facebook-twitter-g'), $ci ); -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/vb.php
r1905522 r2757212 29 29 <div id="altFormat" style=""> 30 30 <div style="width:100%;"><strong id="altFormatText">vBulletin URL:</strong> <span style="font-size: 11px; margin: 0px;">Could be Forum URL or Thread URL. Either new thread of new post will be created.</span></div> 31 <input name="vb[<?php echo $ii; ?>][vbURL]" id="apVBURL" style="width: 60%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['vbURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>31 <input name="vb[<?php echo esc_attr($ii); ?>][vbURL]" id="apVBURL" style="width: 60%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['vbURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 32 32 33 33 </div> … … 35 35 <br/><br/> 36 36 <?php $this->elemTitleFormat($ii,'Post Title Format','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Post Text Format','msgFormat',$options['msgFormat']);?> 37 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" id="vbInclTags<?php echo $ii; ?>" type="checkbox" name="vb[<?php echo $ii; ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> />37 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" id="vbInclTags<?php echo esc_attr($ii); ?>" type="checkbox" name="vb[<?php echo esc_attr($ii); ?>][inclTags]" <?php if ((int)$options['inclTags'] == 1) echo "checked"; ?> /> 38 38 <b><?php _e('Post with tags.', 'social-networks-auto-poster-facebook-twitter-g') ?></b> <?php _e('Tags from the blogpost will be auto posted to LiveJournal', 'social-networks-auto-poster-facebook-twitter-g') ?> 39 39 </div><br/> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/vk.api.php
r2609158 r2757212 13 13 return $out; 14 14 } 15 var $postData = []; function imgUplcurl(&$handle){ curl_setopt($handle, CURLOPT_POSTFIELDS, $this->postData); echo "!x!"; } 15 16 function nxs_uplImgtoVK($imgURL, $options){ 16 17 $postUrl = 'https://api.vk.com/method/photos.getWallUploadServer?v='.$this->apiVer.'&gid='.(str_replace('-','',$options['pgIntID'])).'&access_token='.$options['appAuthToken']; … … 28 29 } else return $msg; 29 30 } rename($tmp, $tmp.='.png'); register_shutdown_function('unlink', $tmp); file_put_contents($tmp, $imgData); 30 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $VKuploadUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);31 global $nxs_skipSSLCheck; if ($nxs_skipSSLCheck===true) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);32 if (function_exists('curl_file_create')) { $file = curl_file_create($tmp); curl_setopt($ch, CURLOPT_POSTFIELDS, array('photo' => $file)); }33 else curl_setopt($ch, CURLOPT_POSTFIELDS, array('photo' => '@' . $tmp));34 $response = curl_exec($ch); $errmsg = curl_error($ch); curl_close($ch); $uploadResultObj = json_decode($response); // prr($response); prr($uploadResultObj);31 if (function_exists('curl_file_create')) { $file = curl_file_create($tmp); $req = array('photo' => $file); } else $req = array('photo' => '@' . $tmp); 32 $argArr['extraHeaders']['Content-Type'] = 'multipart/form-data'; 33 $argArr['flds'] = $req; $rq = new nxsHttp; $args = nxs_mkRmReqArgs($argArr); $rq->postData = $req;// prr($args); 34 $ret = $rq->request($VKuploadUrl, $args); //prr($VKuploadUrl); prr($ret); 35 if (is_array($ret)) $uploadResultObj = json_decode($ret['body']); 35 36 if (!empty($uploadResultObj->server) && !empty($uploadResultObj->photo) && !empty($uploadResultObj->hash)) { 36 37 $postUrl = 'https://api.vk.com/method/photos.saveWallPhoto?v='.$this->apiVer.'&server='.$uploadResultObj->server.'&photo='.$uploadResultObj->photo.'&hash='.$uploadResultObj->hash.'&gid='.(str_replace('-','',$options['pgIntID'])).'&access_token='.$options['appAuthToken']; -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/vk.php
r2650607 r2757212 28 28 <div style="width:100%;"><strong><?php echo $ntInfo['name']?> <?php _e('URL', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div> 29 29 <div style="font-size: 11px; margin: 0px;"><?php _e('Could be your VK.Com Profile, Public or Group Page', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 30 <input name="vk[<?php echo $ii; ?>][url]" id="apurl" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['url'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />30 <input name="vk[<?php echo esc_attr($ii); ?>][url]" id="apurl" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['url'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 31 31 <br/><br/> 32 32 <div style="width:100%;"><strong><?php echo $ntInfo['name']?> <?php _e('Application ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <a href="https://vk.com/apps?act=manage" target="_blank"><?php _e('[VK Apps]', 'social-networks-auto-poster-facebook-twitter-g'); ?></a> </div> 33 <input name="vk[<?php echo $ii; ?>][appID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['appID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />33 <input name="vk[<?php echo esc_attr($ii); ?>][appID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['appID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 34 34 <br/> 35 35 <?php if($options['appID']!='') { ?> 36 <div style="width:100%;"><strong><?php echo $ntInfo['name']?> <?php _e('Auth Response', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input name="vk[<?php echo $ii; ?>][authResp]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['authResp'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>36 <div style="width:100%;"><strong><?php echo $ntInfo['name']?> <?php _e('Auth Response', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input name="vk[<?php echo esc_attr($ii); ?>][authResp]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['authResp'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 37 37 <?php } ?> 38 38 <?php if($options['appID']=='') { ?> … … 45 45 <?php } ?><br/><br/> <?php $this->elemMsgFormat($ii,'Message Text Format','msgFormat',$options['msgFormat']); ?> 46 46 47 <div style="width:100%;"><strong id="altFormatText">Post Type:</strong> <-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo $ii; ?>VKX');" onmouseover="showPopShAtt('<?php echo $ii; ?>VKX', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div>47 <div style="width:100%;"><strong id="altFormatText">Post Type:</strong> <-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo esc_attr($ii); ?>VKX');" onmouseover="showPopShAtt('<?php echo esc_attr($ii); ?>VKX', event);" onclick="return false;" class="underdash" href="https://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) </div> 48 48 <div style="margin-left: 10px;"> 49 49 50 <input type="radio" name="vk[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>51 <input type="radio" name="vk[<?php echo $ii; ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>52 <input type="radio" name="vk[<?php echo $ii; ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <span><?php _e('Text Post with "attached" link', 'social-networks-auto-poster-facebook-twitter-g'); ?></span><br/>50 <input type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 51 <input type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($options['postType'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 52 <input type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( empty($options['postType']) || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <span><?php _e('Text Post with "attached" link', 'social-networks-auto-poster-facebook-twitter-g'); ?></span><br/> 53 53 54 54 </div> 55 <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo $ii; ?>VKX"><h3><?php echo $ntInfo['name']?> <?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/vkPostTypesDiff6.png" width="600" height="257"/></div>55 <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo esc_attr($ii); ?>VKX"><h3><?php echo $ntInfo['name']?> <?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g'); ?></h3><img src="<?php echo NXS_PLURL; ?>img/vkPostTypesDiff6.png" width="600" height="257"/></div> 56 56 <?php 57 57 } … … 106 106 <?php $this->elemEdMsgFormat($ii, __('Message Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgFormat); ?> 107 107 <tr style="<?php echo !empty($ntOpt['do'])?'display:table-row;':'display:none;'; ?>" class="nxstbldo nxstbldo<?php echo strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> <br/> 108 (<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo $ii; ?>VKX');" onmouseover="showPopShAtt('<?php echo $ii; ?>VKX', event);" onclick="return false;" class="underdash" href="#"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>)</th><td>109 <input class="nxs_postEditCtrl" type="radio" name="vk[<?php echo $ii; ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>110 <input class="nxs_postEditCtrl" type="radio" name="vk[<?php echo $ii; ?>][postType]" value="I" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>111 <input class="nxs_postEditCtrl" type="radio" name="vk[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /> <?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>112 <br/><div class="popShAtt" id="popShAtt<?php echo $ii; ?>VKX"><h3>vKontakte(VK) <?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?></h3><img src="<?php echo NXS_PLURL; ?>img/vkPostTypesDiff6.png" width="600" height="257" alt="<?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?>"/></div>108 (<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo esc_attr($ii); ?>VKX');" onmouseover="showPopShAtt('<?php echo esc_attr($ii); ?>VKX', event);" onclick="return false;" class="underdash" href="#"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>)</th><td> 109 <input class="nxs_postEditCtrl" type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 110 <input class="nxs_postEditCtrl" type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="I" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 111 <input class="nxs_postEditCtrl" type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /> <?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 112 <br/><div class="popShAtt" id="popShAtt<?php echo esc_attr($ii); ?>VKX"><h3>vKontakte(VK) <?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?></h3><img src="<?php echo NXS_PLURL; ?>img/vkPostTypesDiff6.png" width="600" height="257" alt="<?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?>"/></div> 113 113 </td></tr> 114 114 <?php /* ## Select Image & URL ## */ nxs_showURLToUseDlg($nt, $ii, $urlToUse); $this->nxs_tmpltAddPostMetaEnd($ii); … … 124 124 ?> 125 125 <div class="nxsPostEd_ElemWrap"> <div class="nxsPostEd_ElemLabel"> 126 <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?>(<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo $ii; ?>VKX');" onmouseover="showPopShAtt('<?php echo $ii; ?>VKX', event);" onclick="return false;" class="underdash" href="#"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>)126 <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g'); ?>(<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo esc_attr($ii); ?>VKX');" onmouseover="showPopShAtt('<?php echo esc_attr($ii); ?>VKX', event);" onclick="return false;" class="underdash" href="#"><?php _e('What\'s the difference?', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) 127 127 </div> 128 128 <div class="nxsPostEd_Elem"> 129 <input type="radio" name="vk[<?php echo $ii; ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>130 <input type="radio" name="vk[<?php echo $ii; ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>131 <input type="radio" name="vk[<?php echo $ii; ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /> <?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>129 <input type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 130 <input type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="I" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 131 <input type="radio" name="vk[<?php echo esc_attr($ii); ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /> <?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 132 132 133 133 </div> 134 <div class="popShAtt" id="popShAtt<?php echo $ii; ?>VKX"><h3>vKontakte(VK) <?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?></h3><img src="<?php echo NXS_PLURL; ?>img/vkPostTypesDiff6.png" width="600" height="257" alt="<?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?>"/></div>134 <div class="popShAtt" id="popShAtt<?php echo esc_attr($ii); ?>VKX"><h3>vKontakte(VK) <?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?></h3><img src="<?php echo NXS_PLURL; ?>img/vkPostTypesDiff6.png" width="600" height="257" alt="<?php _e('Post Types', 'social-networks-auto-poster-facebook-twitter-g') ?>"/></div> 135 135 </div> 136 136 <?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/wb.php
r1905522 r2757212 11 11 //#### Show Unit Settings 12 12 function checkIfSetupFinished($options) { return !empty($options['appAppUserID']) && !empty($options['accessToken']); } 13 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; if (isset($_GET['acc'])) $options = $this->nt[ $_GET['acc']];13 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; if (isset($_GET['acc'])) $options = $this->nt[sanitize_text_field($_GET['acc'])]; 14 14 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ 15 15 /* … … 19 19 prr($tum_oauth); prr($options); 20 20 */ 21 global $nxs_snapSetPgURL; $state = $ntInfo['lcode'].'a-'. $_GET['acc'];21 global $nxs_snapSetPgURL; $state = $ntInfo['lcode'].'a-'.sanitize_text_field($_GET['acc']); 22 22 $url = 'https://api.weibo.com/oauth2/authorize?client_id='.nxs_gak($options['appKey']).'&redirect_uri='.urlencode($nxs_snapSetPgURL).'&scope=all&response_type=code&state='.$state; 23 23 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; 24 24 die(); 25 25 } 26 if ( isset($_GET['code']) && isset($_GET['state']) && stripos($_GET['state'],$ntInfo['lcode'].'a-')!==false){ $ii = explode('-', $_GET['state']); $ii = $ii[1]; $options = $this->nt[$ii];27 $appkey = nxs_gak($options['appKey']); $appSecret = nxs_gas($options['appSec']); $url = 'https://api.weibo.com/oauth2/access_token?client_id='.$appkey.'&client_secret='.$appSecret.'&grant_type=authorization_code&redirect_uri='.urlencode($nxs_snapSetPgURL).'&code='. $_GET['code'];26 if ( isset($_GET['code']) && isset($_GET['state']) && stripos($_GET['state'],$ntInfo['lcode'].'a-')!==false){ $ii = explode('-',sanitize_text_field($_GET['state'])); $ii = $ii[1]; $options = $this->nt[$ii]; 27 $appkey = nxs_gak($options['appKey']); $appSecret = nxs_gas($options['appSec']); $url = 'https://api.weibo.com/oauth2/access_token?client_id='.$appkey.'&client_secret='.$appSecret.'&grant_type=authorization_code&redirect_uri='.urlencode($nxs_snapSetPgURL).'&code='.sanitize_text_field($_GET['code']); 28 28 $rep = nxs_remote_post($url); $cont = json_decode($rep['body'], true); if (empty($cont) || empty($cont['access_token'])) {prr($cont); prr($rep); die();} 29 29 $options['accessToken'] = $cont['access_token']; $options['appAppUserID'] = $cont['uid']; $options['appAppUserName'] = $cont['uid']; nxs_save_glbNtwrks($ntInfo['lcode'],$ii,$options,'*'); //prr($options); die(); … … 37 37 <br/><?php $this->elemMsgFormat($ii,'Message Format','msgFormat',$options['msgFormat']); ?> 38 38 39 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div>39 <div style="margin: 0px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div> 40 40 41 41 <br/><br/> … … 45 45 _e('Your '.$ntInfo['name'].' Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['appAppUserID'].' - '.$options['appAppUserName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>. 46 46 <?php _e('You can', 'social-networks-auto-poster-facebook-twitter-g'); ?> Re- <?php } ?> 47 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo $nt; ?>&acc=<?php echo $ii; ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a>47 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo esc_attr($nt); ?>&acc=<?php echo esc_attr($ii); ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a> 48 48 <?php if (!isset($options['appAppUserID']) || $options['appAppUserID']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div> <?php } 49 49 } ?><br/><br/> <?php … … 74 74 $this->elemEdMsgFormat($ii, __('Message Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgFormat); 75 75 ?> 76 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]"/>77 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr>76 <tr><td> </td><td><div style="margin: 0px;"><input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 77 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></div></td></tr> 78 78 <?php nxs_showImgToUseDlg($nt, $ii, $imgToUse); 79 79 … … 91 91 <div class="nxsPostEd_ElemWrap"> 92 92 <div class="nxsPostEd_Elem"> 93 <input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]"/>94 <input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong>93 <input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]"/> 94 <input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][attchImg]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to the Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> 95 95 </div> 96 96 </div><?php -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/wl.php
r1905522 r2757212 327 327 if (!isset($options['nHrs'])) $options['nHrs'] = 0; if (!isset($options['nMin'])) $options['nMin'] = 0; if (!isset($options['catSel'])) $options['catSel'] = 0; if (!isset($options['catSelEd'])) $options['catSelEd'] = ''; 328 328 if (!isset($options['nDays'])) $options['nDays'] = 0; if (!isset($options['qTLng'])) $options['qTLng'] = ''; ?> 329 <div id="doWL<?php echo $ii; ?>Div" class="insOneDiv<?php if ($isNew) echo " clNewNTSets"; ?>"> <input type="hidden" name="apDoSWL<?php echo $ii; ?>" value="0" id="apDoSWL<?php echo $ii; ?>" />329 <div id="doWL<?php echo esc_attr($ii); ?>Div" class="insOneDiv<?php if ($isNew) echo " clNewNTSets"; ?>"> <input type="hidden" name="apDoSWL<?php echo esc_attr($ii); ?>" value="0" id="apDoSWL<?php echo esc_attr($ii); ?>" /> 330 330 331 331 <?php if(!function_exists('doPostToWaNeLo')) {?><span style="color:#580000; font-size: 16px;"><br/><br/> … … 336 336 337 337 338 <div id="doWL<?php echo $ii; ?>Div" style="margin-left: 10px;"> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?>img/wl16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-wanelo-social-networks-auto-poster-wordpress/"><?php $nType="WaNeLo"; printf( __( 'Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a></div>339 <div style="width:100%;"><strong><?php _e('Account Nickname', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <i><?php _e('Just so you can easily identify it', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> </div><input name="wl[<?php echo $ii; ?>][nName]" id="wlnName<?php echo $ii; ?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 40%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['nName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/>338 <div id="doWL<?php echo esc_attr($ii); ?>Div" style="margin-left: 10px;"> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?>img/wl16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-wanelo-social-networks-auto-poster-wordpress/"><?php $nType="WaNeLo"; printf( __( 'Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a></div> 339 <div style="width:100%;"><strong><?php _e('Account Nickname', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <i><?php _e('Just so you can easily identify it', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> </div><input name="wl[<?php echo esc_attr($ii); ?>][nName]" id="wlnName<?php echo esc_attr($ii); ?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 40%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['nName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 340 340 <?php echo nxs_addQTranslSel('wl', $ii, $options['qTLng']); ?> 341 341 … … 346 346 </ul> 347 347 <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> 348 <div id="nsx<?php echo $nt.$ii ?>_tab1" class="nsx_tab_content" style="background-image: url(<?php echo $nxs_plurl; ?>img/<?php echo $nt; ?>-bg.png); background-repeat: no-repeat; background-position:90% 10%;">348 <div id="nsx<?php echo $nt.$ii ?>_tab1" class="nsx_tab_content" style="background-image: url(<?php echo $nxs_plurl; ?>img/<?php echo esc_attr($nt); ?>-bg.png); background-repeat: no-repeat; background-position:90% 10%;"> 349 349 350 350 351 <div style="width:100%;"><strong>WaNeLo Email:</strong> </div><input name="wl[<?php echo $ii; ?>][apWLUName]" id="apWLUName<?php echo $ii; ?>" class="apWLUName<?php echo $ii; ?>" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['wlUName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />352 <div style="width:100%;"><strong>WaNeLo Password:</strong> </div><input name="wl[<?php echo $ii; ?>][apWLPass]" id="apWLPass<?php echo $ii; ?>" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['wlPass'], 0, 5)=='g9c1a'?nsx_doDecode(substr($options['wlPass'], 5)):$options['wlPass'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>351 <div style="width:100%;"><strong>WaNeLo Email:</strong> </div><input name="wl[<?php echo esc_attr($ii); ?>][apWLUName]" id="apWLUName<?php echo esc_attr($ii); ?>" class="apWLUName<?php echo esc_attr($ii); ?>" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['wlUName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 352 <div style="width:100%;"><strong>WaNeLo Password:</strong> </div><input name="wl[<?php echo esc_attr($ii); ?>][apWLPass]" id="apWLPass<?php echo esc_attr($ii); ?>" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['wlPass'], 0, 5)=='g9c1a'?nsx_doDecode(substr($options['wlPass'], 5)):$options['wlPass'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 353 353 <div style="width:100%;"><strong>Default Image to Pin:</strong> 354 354 <p style="font-size: 11px; margin: 0px;">If your post missing Featured Image this will be used instead.</p> 355 </div><input name="wl[<?php echo $ii; ?>][apWLDefImg]" id="apWLDefImg" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['wlDefImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />355 </div><input name="wl[<?php echo esc_attr($ii); ?>][apWLDefImg]" id="apWLDefImg" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['wlDefImg'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 356 356 <br/><br/> 357 357 358 358 <div style="width:100%;"><strong>Board:</strong> 359 Please <a href="#" onclick="getWLBoards(jQuery('<?php if ($isNew) echo "#nsx_addNT "; ?>#apWLUName<?php echo $ii; ?>').val(),jQuery('<?php if ($isNew) echo "#nsx_addNT "; ?>#apWLPass<?php echo $ii; ?>').val(), '<?php echo $ii; ?>'); return false;">click here to retrieve your boards</a>359 Please <a href="#" onclick="getWLBoards(jQuery('<?php if ($isNew) echo "#nsx_addNT "; ?>#apWLUName<?php echo esc_attr($ii); ?>').val(),jQuery('<?php if ($isNew) echo "#nsx_addNT "; ?>#apWLPass<?php echo esc_attr($ii); ?>').val(), '<?php echo esc_attr($ii); ?>'); return false;">click here to retrieve your boards</a> 360 360 </div> 361 <img id="wlLoadingImg<?php echo $ii; ?>" style="display: none;" src='<?php echo $nxs_plurl; ?>img/ajax-loader-sm.gif' />362 <select name="wl[<?php echo $ii; ?>][apWLBoard]" id="apWLBoard<?php echo $ii; ?>">361 <img id="wlLoadingImg<?php echo esc_attr($ii); ?>" style="display: none;" src='<?php echo $nxs_plurl; ?>img/ajax-loader-sm.gif' /> 362 <select name="wl[<?php echo esc_attr($ii); ?>][apWLBoard]" id="apWLBoard<?php echo esc_attr($ii); ?>"> 363 363 <?php if ($options['wlBoardsList']!=''){ $gWLBoards = $options['wlBoardsList']; if ( base64_encode(base64_decode($gWLBoards)) === $gWLBoards) $gWLBoards = base64_decode($gWLBoards); 364 364 if ($options['wlBoard']!='') $gWLBoards = str_replace($options['wlBoard'].'"', $options['wlBoard'].'" selected="selected"', $gWLBoards); echo $gWLBoards;} else { ?> … … 371 371 372 372 <div id="altFormat" style=""> 373 <div style="width:100%;"><strong id="altFormatText"><?php _e('Message text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <a href="#" id="apWLMsgFrmt<?php echo $ii; ?>HintInfo" onclick="mxs_showHideFrmtInfo('apWLMsgFrmt<?php echo $ii; ?>'); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>374 </div><input name="wl[<?php echo $ii; ?>][apWLMsgFrmt]" id="apWLMsgFrmt" style="width: 50%;" value="<?php if ($options['wlMsgFormat']!='') _e(apply_filters('format_to_edit', htmlentities($options['wlMsgFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); else echo "%TITLE% - %URL%"; ?>" onfocus="mxs_showFrmtInfo('apWLMsgFrmt<?php echo $ii; ?>');" />373 <div style="width:100%;"><strong id="altFormatText"><?php _e('Message text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <a href="#" id="apWLMsgFrmt<?php echo esc_attr($ii); ?>HintInfo" onclick="mxs_showHideFrmtInfo('apWLMsgFrmt<?php echo esc_attr($ii); ?>'); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a> 374 </div><input name="wl[<?php echo esc_attr($ii); ?>][apWLMsgFrmt]" id="apWLMsgFrmt" style="width: 50%;" value="<?php if ($options['wlMsgFormat']!='') _e(apply_filters('format_to_edit', htmlentities($options['wlMsgFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); else echo "%TITLE% - %URL%"; ?>" onfocus="mxs_showFrmtInfo('apWLMsgFrmt<?php echo esc_attr($ii); ?>');" /> 375 375 376 376 <?php nxs_doShowHint("apWLMsgFrmt".$ii); ?> 377 377 </div><br/> 378 <?php if ($isNew) { ?> <input type="hidden" name="wl[<?php echo $ii; ?>][apDoWL]" value="1" id="apDoNewWL<?php echo $ii; ?>" /> <?php } ?>378 <?php if ($isNew) { ?> <input type="hidden" name="wl[<?php echo esc_attr($ii); ?>][apDoWL]" value="1" id="apDoNewWL<?php echo esc_attr($ii); ?>" /> <?php } ?> 379 379 <?php if ($options['wlPass']!='') { ?> 380 380 381 <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b> <a href="#" class="NXSButton" onclick="testPost('WL', '<?php echo $ii; ?>'); return false;"><?php printf( __( 'Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a>381 <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b> <a href="#" class="NXSButton" onclick="testPost('WL', '<?php echo esc_attr($ii); ?>'); return false;"><?php printf( __( 'Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a> 382 382 <?php } ?> 383 383 … … 388 388 <?php if (!$isNew) { ?> <div class="nxs_tls_cpt"><?php _e('Categories', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 389 389 <div style="width:100%;"><strong><?php _e('Categories', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> 390 <input value="0" id="catSelA<?php echo $ii; ?>" type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][catSel]" <?php if ((int)$options['catSel'] != 1) echo "checked"; ?> /> All391 <input value="1" id="catSelS<?php echo $ntU; ?><?php echo $ii; ?>" type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][catSel]" <?php if ((int)$options['catSel'] == 1) echo "checked"; ?> /> <a href="#" style="text-decoration: none;" class="showCats" id="nxs_SCA_<?php echo $ntU; ?><?php echo $ii; ?>" onclick="jQuery('#catSelS<?php echo $ntU; ?><?php echo $ii; ?>').attr('checked', true); jQuery('#tmpCatSelNT').val('<?php echo $ntU; ?><?php echo $ii; ?>'); nxs_markCats( jQuery('#nxs_SC_<?php echo $ntU; ?><?php echo $ii; ?>').val() ); jQuery('#showCatSel').bPopup({ modalClose: false, appendTo: '#nsStForm', opacity: 0.6, follow: [false, false], position: [75, 'auto']}); return false;">Selected<?php if ($options['catSelEd']!='') echo "[".(substr_count($options['catSelEd'], ",")+1)."]"; ?></a>392 <input type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][catSelEd]" id="nxs_SC_<?php echo $ntU; ?><?php echo $ii; ?>" value="<?php echo $options['catSelEd']; ?>" />390 <input value="0" id="catSelA<?php echo esc_attr($ii); ?>" type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][catSel]" <?php if ((int)$options['catSel'] != 1) echo "checked"; ?> /> All 391 <input value="1" id="catSelS<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][catSel]" <?php if ((int)$options['catSel'] == 1) echo "checked"; ?> /> <a href="#" style="text-decoration: none;" class="showCats" id="nxs_SCA_<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" onclick="jQuery('#catSelS<?php echo $ntU; ?><?php echo esc_attr($ii); ?>').attr('checked', true); jQuery('#tmpCatSelNT').val('<?php echo $ntU; ?><?php echo esc_attr($ii); ?>'); nxs_markCats( jQuery('#nxs_SC_<?php echo $ntU; ?><?php echo esc_attr($ii); ?>').val() ); jQuery('#showCatSel').bPopup({ modalClose: false, appendTo: '#nsStForm', opacity: 0.6, follow: [false, false], position: [75, 'auto']}); return false;">Selected<?php if ($options['catSelEd']!='') echo "[".(substr_count($options['catSelEd'], ",")+1)."]"; ?></a> 392 <input type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][catSelEd]" id="nxs_SC_<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" value="<?php echo $options['catSelEd']; ?>" /> 393 393 <br/><i><?php _e('Only selected categories will be autoposted to this account', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div> 394 394 <br/> … … 437 437 $isAvailWL = $ntOpt['wlUName']!='' && $ntOpt['wlPass']!=''; $wlMsgFormat = htmlentities($ntOpt['wlMsgFormat'], ENT_COMPAT, "UTF-8"); 438 438 ?> 439 <tr><th style="text-align:left;" colspan="2"><?php if ( $ntOpt['catSel']=='1' && trim($ntOpt['catSelEd'])!='' ) { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_WL<?php echo $ii; ?>" value="<?php echo $ntOpt['catSelEd']; ?>" /> <?php } ?>440 <?php if ($isAvailWL) { ?><input class="nxsGrpDoChb" value="1" id="doWL<?php echo $ii; ?>" type="checkbox" name="wl[<?php echo $ii; ?>][doWL]" <?php if ((int)$doWL == 1) echo 'checked="checked" title="def"'; ?> />441 <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="wl[<?php echo $ii; ?>][doWL]" value="<?php echo $doWL;?>"> <?php } ?> <?php } ?>439 <tr><th style="text-align:left;" colspan="2"><?php if ( $ntOpt['catSel']=='1' && trim($ntOpt['catSelEd'])!='' ) { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_WL<?php echo esc_attr($ii); ?>" value="<?php echo $ntOpt['catSelEd']; ?>" /> <?php } ?> 440 <?php if ($isAvailWL) { ?><input class="nxsGrpDoChb" value="1" id="doWL<?php echo esc_attr($ii); ?>" type="checkbox" name="wl[<?php echo esc_attr($ii); ?>][doWL]" <?php if ((int)$doWL == 1) echo 'checked="checked" title="def"'; ?> /> 441 <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="wl[<?php echo esc_attr($ii); ?>][doWL]" value="<?php echo $doWL;?>"> <?php } ?> <?php } ?> 442 442 <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?>img/wl16.png);">WaNeLo - <?php _e('publish to', 'social-networks-auto-poster-facebook-twitter-g') ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?></i>)</div></th> <td><?php //## Only show RePost button if the post is "published" 443 if ($post->post_status == "publish" && $isAvailWL) { ?><input alt="<?php echo $ii; ?>" style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToWL_repostButton" id="rePostToWL_button" value="<?php _e('Repost to WaNeLo', 'social-networks-auto-poster-facebook-twitter-g') ?>" />443 if ($post->post_status == "publish" && $isAvailWL) { ?><input alt="<?php echo esc_attr($ii); ?>" style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToWL_repostButton" id="rePostToWL_button" value="<?php _e('Repost to WaNeLo', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 444 444 <?php } ?> 445 445 446 446 <?php if (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID']) ) { 447 ?> <span id="pstdWL<?php echo $ii; ?>" style="float: right;padding-top: 4px; padding-right: 10px;">447 ?> <span id="pstdWL<?php echo esc_attr($ii); ?>" style="float: right;padding-top: 4px; padding-right: 10px;"> 448 448 <a style="font-size: 10px;" href="http://WaNeLo.com<?php echo $pMeta[$ii]['pgID']; ?>" target="_blank"><?php $nType="WaNeLo"; printf( __( 'Posted on', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(" (".$pMeta[$ii]['pDate'].")"):""; ?></a> 449 449 </span><?php } ?> … … 457 457 458 458 <tr id="altFormat1" style=""><th scope="row" style="vertical-align:top; padding-top:6px; text-align:right; width:60px; padding-right:10px;"> 459 <input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][rpstPostIncl]"/><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][rpstPostIncl]" <?php if ((int)$ntOpt['rpstPostIncl'] == 1) echo "checked"; ?> />459 <input value="0" type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][rpstPostIncl]"/><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][rpstPostIncl]" <?php if ((int)$ntOpt['rpstPostIncl'] == 1) echo "checked"; ?> /> 460 460 </th> 461 461 <td> <?php _e('Include in "Auto-Reposting" to this network.', 'social-networks-auto-poster-facebook-twitter-g') ?> … … 463 463 464 464 <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;">Select Board</th> 465 <td><select name="wl[<?php echo $ii; ?>][apWLBoard]" id="apWLBoard">465 <td><select name="wl[<?php echo esc_attr($ii); ?>][apWLBoard]" id="apWLBoard"> 466 466 <?php if (!empty($ntOpt['wlBoardsList'])){ $gWLBoards = $ntOpt['wlBoardsList']; if ( base64_encode(base64_decode($gWLBoards)) === $gWLBoards) $gWLBoards = base64_decode($gWLBoards); 467 467 if ($ntOpt['wlBoard']!='') $gWLBoards = str_replace($ntOpt['wlBoard'].'"', $ntOpt['wlBoard'].'" selected="selected"', $gWLBoards); echo $gWLBoards;} else { ?> … … 473 473 <tr id="altFormat1" style=""><th scope="row" style="vertical-align:top; padding-top:6px; text-align:right; width:60px; padding-right:10px;"><?php _e('Text Message Format:', 'social-networks-auto-poster-facebook-twitter-g') ?></th> 474 474 <td> 475 <textarea cols="150" rows="1" id="wl<?php echo $ii; ?>SNAPformat" name="wl[<?php echo $ii; ?>][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#wl<?php echo $ii; ?>SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apWLMsgFrmt<?php echo $ii; ?>');"><?php echo $wlMsgFormat; ?></textarea>475 <textarea cols="150" rows="1" id="wl<?php echo esc_attr($ii); ?>SNAPformat" name="wl[<?php echo esc_attr($ii); ?>][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#wl<?php echo esc_attr($ii); ?>SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apWLMsgFrmt<?php echo esc_attr($ii); ?>');"><?php echo $wlMsgFormat; ?></textarea> 476 476 <?php nxs_doShowHint("apWLMsgFrmt".$ii); ?></td></tr> 477 477 -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/wp.api.php
r2609158 r2757212 116 116 if ($imgURL!=='' && stripos($imgURL, 'http')!==false) { 117 117 // $handle = fopen($imgURL, "rb"); $filedata = ''; while (!feof($handle)) {$filedata .= fread($handle, 8192);} fclose($handle); 118 $filedata = nxs_remote_get($imgURL); if (! is_nxs_error($filedata) ) $filedata = $filedata['body']; // echo "AWC?";118 $filedata = nxs_remote_get($imgURL); if (! is_nxs_error($filedata) ) $filedata = $filedata['body']; 119 119 $data = array('name' => 'image-'.$message['orID'].'.jpg', 'type' => 'image/jpg', 'bits' => new NXS_XMLRPC_Base64($filedata), true); 120 120 $status = $nxsToWPclient->query('metaWeblog.newMediaObject', $message['orID'], $options['uName'], $pass, $data); $imgResp = $nxsToWPclient->getResponse(); $gid = $imgResp['id']; -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/wp.php
r2609158 r2757212 23 23 function accTab($ii, $options, $isNew=false){ $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; if (!isset($options['inclTags'])) $options['inclTags'] = 1; if (!isset($options['inclCats'])) $options['inclCats'] = 1; 24 24 if (empty($options['pt'])) $options['pt'] = 'post'; 25 ?><div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <i><?php _e('XMLRPC URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input style="width: 550px;" name="wp[<?php echo $ii; ?>][wpURL]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['wpURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/>25 ?><div style="width:100%;"><strong><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <i><?php _e('XMLRPC URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input style="width: 550px;" name="wp[<?php echo esc_attr($ii); ?>][wpURL]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['wpURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 26 26 <div style="font-size: 11px; margin: 0px;">[Any Wordpress Based Blog] Usually its a URL of your Wordpress installation with /xmlrpc.php at the end.<br/> [Wordpress.com] Please use <b style="color: #005800;">https://YourUserName.wordpress.com/xmlrpc.php</b> (replace YourUserName with your user name) <br/>[Blog.com] Please use <b style="color: #005800;">http://YourUserName.blog.com/xmlrpc.php</b> (replace YourUserName with your user name)</div><br/> 27 27 28 28 <?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?><br/> 29 29 30 <input type="checkbox" name="wp[<?php echo $ii; ?>][exactCopy]" <?php if (!empty($options['exactCopy'])) echo "checked"; ?> onchange="if (jQuery(this).is(':checked')) {jQuery('#moreOptions<?php echo $nt.$ii; ?>').hide(); jQuery('#moreOptionsExC<?php echo $nt.$ii; ?>').show();}else{jQuery('#moreOptions<?php echo $nt.$ii; ?>').show();jQuery('#moreOptionsExC<?php echo $nt.$ii; ?>').hide();}" /> Make exact copy.<br/> <br/>30 <input type="checkbox" name="wp[<?php echo esc_attr($ii); ?>][exactCopy]" <?php if (!empty($options['exactCopy'])) echo "checked"; ?> onchange="if (jQuery(this).is(':checked')) {jQuery('#moreOptions<?php echo esc_attr($nt.$ii); ?>').hide(); jQuery('#moreOptionsExC<?php echo esc_attr($nt.$ii); ?>').show();}else{jQuery('#moreOptions<?php echo esc_attr($nt.$ii); ?>').show();jQuery('#moreOptionsExC<?php echo esc_attr($nt.$ii); ?>').hide();}" /> Make exact copy.<br/> <br/> 31 31 32 <div id="moreOptions<?php echo $nt.$ii; ?>" style="<?php if (!empty($options['exactCopy'])) echo "display:none;"; ?>">32 <div id="moreOptions<?php echo esc_attr($nt.$ii); ?>" style="<?php if (!empty($options['exactCopy'])) echo "display:none;"; ?>"> 33 33 34 34 <?php $this->elemTitleFormat($ii,'Post Title Format','msgTFormat',$options['msgTFormat']); $this->elemMsgFormat($ii,'Post Text Format','msgFormat',$options['msgFormat']);?><br/ > 35 35 36 <div style="width:100%;"><strong><?php _e('Post Type', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input style="width: 550px;" name="wp[<?php echo $ii; ?>][pt]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pt'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/>36 <div style="width:100%;"><strong><?php _e('Post Type', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input style="width: 550px;" name="wp[<?php echo esc_attr($ii); ?>][pt]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pt'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 37 37 <br/> 38 38 39 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclTags]" <?php if (!empty($options['inclTags'])) echo "checked"; ?> />39 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclTags]" <?php if (!empty($options['inclTags'])) echo "checked"; ?> /> 40 40 <strong><?php _e('Post with tags', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> <?php _e('Tags from the blogpost will be included', 'social-networks-auto-poster-facebook-twitter-g'); ?> 41 41 </div> 42 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][inclCats]" <?php if (!empty($options['inclCats'])) echo "checked"; ?> />42 <div style="margin-bottom: 20px;margin-top: 5px;"><input value="1" type="checkbox" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][inclCats]" <?php if (!empty($options['inclCats'])) echo "checked"; ?> /> 43 43 <strong><?php _e('Post with categories', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> <?php _e('Categories from the blogpost will be included. Target blog must have the categories with the same slugs', 'social-networks-auto-poster-facebook-twitter-g'); ?> 44 44 </div> 45 45 </div> 46 46 47 <div id="moreOptionsExC<?php echo $nt.$ii; ?>" style="<?php if (empty($options['exactCopy'])) echo "display:none;"; ?>">48 <input type="checkbox" name="wp[<?php echo $ii; ?>][keepDate]" <?php if (!empty($options['keepDate'])) echo "checked"; ?>/> Keep Original Date<br/><br/>47 <div id="moreOptionsExC<?php echo esc_attr($nt.$ii); ?>" style="<?php if (empty($options['exactCopy'])) echo "display:none;"; ?>"> 48 <input type="checkbox" name="wp[<?php echo esc_attr($ii); ?>][keepDate]" <?php if (!empty($options['keepDate'])) echo "checked"; ?>/> Keep Original Date<br/><br/> 49 49 </div> 50 50 <?php … … 83 83 $msgFormat = !empty($ntOpt['msgFormat'])?htmlentities($ntOpt['msgFormat'], ENT_COMPAT, "UTF-8"):''; $msgTFormat = !empty($ntOpt['msgTFormat'])?htmlentities($ntOpt['msgTFormat'], ENT_COMPAT, "UTF-8"):''; 84 84 $imgToUse = $ntOpt['imgToUse']; $urlToUse = $ntOpt['urlToUse']; $ntOpt['ii']=$ii; 85 ?><div id="moreOptions<?php echo $nt.$ii; ?>" style="<?php if (!empty($ntOpt['exactCopy'])) echo "display:none;"; ?>"><?php85 ?><div id="moreOptions<?php echo esc_attr($nt.$ii); ?>" style="<?php if (!empty($ntOpt['exactCopy'])) echo "display:none;"; ?>"><?php 86 86 //## Title and Message 87 87 $this->elemEdTitleFormat($ii, __('Title Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgTFormat); -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/xi.php
r2252191 r2757212 19 19 //#### Show Unit Settings 20 20 function checkIfSetupFinished($options) { return true; return ((!empty($options['appAppUserID']) && !empty($options['accessToken'])) || !empty($options['uName']) ); } 21 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; if (isset($_GET['acc'])) $options = $this->nt[$_GET['acc']]; 22 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ 23 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); $callback_url = $nxs_snapSetPgURL."&auth=".$ntInfo['lcode']."a&acc=".$_GET['acc']; 24 $tum_oauth = new nxs_OAuthBaseCl($consumer_key, $consumer_secret); $tum_oauth->baseURL = 'https://api.xing.com'; $tum_oauth->request_token_path = '/v1/request_token'; 25 $request_token = $tum_oauth->getReqToken($callback_url); $options['oAuthToken'] = $request_token['oauth_token']; $options['oAuthTokenSecret'] = $request_token['oauth_token_secret']; 26 prr($tum_oauth); prr($options); 27 switch ($tum_oauth->http_code) { case 201: case 200: $url = 'https://api.xing.com/v1/authorize?oauth_token='.$options['oAuthToken']; nxs_save_glbNtwrks($ntInfo['lcode'],$_GET['acc'],$options,'*'); 28 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; break; 29 default: echo '<br/><b style="color:red">Could not connect to XING. Refresh the page or try again later.</b>'; die(); 30 } die(); 21 public function doAuth() { $ntInfo = $this->ntInfo; global $nxs_snapSetPgURL; 22 if (isset($_GET['acc'])) { $acc = sanitize_text_field($_GET['acc']); $options = $this->nt[$acc]; 23 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode']){ 24 $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); $callback_url = $nxs_snapSetPgURL."&auth=".$ntInfo['lcode']."a&acc=".$acc; 25 $tum_oauth = new nxs_OAuthBaseCl($consumer_key, $consumer_secret); $tum_oauth->baseURL = 'https://api.xing.com'; $tum_oauth->request_token_path = '/v1/request_token'; 26 $request_token = $tum_oauth->getReqToken($callback_url); $options['oAuthToken'] = $request_token['oauth_token']; $options['oAuthTokenSecret'] = $request_token['oauth_token_secret']; 27 prr($tum_oauth); prr($options); 28 switch ($tum_oauth->http_code) { case 201: case 200: $url = 'https://api.xing.com/v1/authorize?oauth_token='.$options['oAuthToken']; nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); 29 echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$url.'"</script>'; break; 30 default: echo '<br/><b style="color:red">Could not connect to XING. Refresh the page or try again later.</b>'; die(); 31 } die(); 32 } 33 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode'].'a'){ $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); 34 $tum_oauth = new nxs_OAuthBaseCl($consumer_key, $consumer_secret, $options['oAuthToken'], $options['oAuthTokenSecret']); //prr($tum_oauth); 35 $tum_oauth->baseURL = 'https://api.xing.com'; $tum_oauth->access_token_path = '/v1/access_token'; $access_token = $tum_oauth->getAccToken(sanitize_text_field($_GET['oauth_verifier'])); prr($access_token); 36 $options['accessToken'] = $access_token['oauth_token']; $options['accessTokenSec'] = $access_token['oauth_token_secret']; 37 $tum_oauth = new nxs_OAuthBaseCl($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 38 $uinfo = $tum_oauth->makeReq('https://api.xing.com/v1/users/me', ''); prr($uinfo); 39 if (is_array($uinfo) && isset($uinfo['users']) && isset($uinfo['users'][0]) && is_array($uinfo['users'][0])) { $uinfo = $uinfo['users'][0]; $options['appPGUserName'] = $uinfo['page_name']; 40 $options['appAppUserName'] = $uinfo['display_name']."(".$uinfo['page_name'].")"; $options['appAppUserID'] = $uinfo['id']; 41 } nxs_save_glbNtwrks($ntInfo['lcode'],$acc,$options,'*'); //prr($options); die(); 42 if (!empty($options['appAppUserID'])) { echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$nxs_snapSetPgURL.'"</script>'; die();} 43 else die("<span style='color:red;'>ERROR: Authorization Error: <span style='color:darkred; font-weight: bold;'>".print_r($uinfo, true)."</span></span>"); 44 } 31 45 } 32 if ( isset($_GET['auth']) && $_GET['auth']==$ntInfo['lcode'].'a'){ $consumer_key = nxs_gak($options['appKey']); $consumer_secret = nxs_gas($options['appSec']); 33 $tum_oauth = new nxs_OAuthBaseCl($consumer_key, $consumer_secret, $options['oAuthToken'], $options['oAuthTokenSecret']); //prr($tum_oauth); 34 $tum_oauth->baseURL = 'https://api.xing.com'; $tum_oauth->access_token_path = '/v1/access_token'; $access_token = $tum_oauth->getAccToken($_GET['oauth_verifier']); prr($access_token); 35 $options['accessToken'] = $access_token['oauth_token']; $options['accessTokenSec'] = $access_token['oauth_token_secret']; 36 $tum_oauth = new nxs_OAuthBaseCl($consumer_key, $consumer_secret, $options['accessToken'], $options['accessTokenSec']); 37 $uinfo = $tum_oauth->makeReq('https://api.xing.com/v1/users/me', ''); prr($uinfo); 38 if (is_array($uinfo) && isset($uinfo['users']) && isset($uinfo['users'][0]) && is_array($uinfo['users'][0])) { $uinfo = $uinfo['users'][0]; $options['appPGUserName'] = $uinfo['page_name']; 39 $options['appAppUserName'] = $uinfo['display_name']."(".$uinfo['page_name'].")"; $options['appAppUserID'] = $uinfo['id']; 40 } nxs_save_glbNtwrks($ntInfo['lcode'],$_GET['acc'],$options,'*'); //prr($options); die(); 41 if (!empty($options['appAppUserID'])) { echo '<br/><br/>All good?! Redirecting ..... <script type="text/javascript">window.location = "'.$nxs_snapSetPgURL.'"</script>'; die();} 42 else die("<span style='color:red;'>ERROR: Authorization Error: <span style='color:darkred; font-weight: bold;'>".print_r($uinfo, true)."</span></span>"); 43 } 44 } 45 46 function getPgsList($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; $nt = new nxsAPI_XI();// $nt->debug = true; // prr($opVal); 46 } 47 48 function getPgsList($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI();// $nt->debug = true; // prr($opVal); 47 49 $currPstAs = !empty($_POST['pgcID'])?$_POST['pgcID']:(!empty($networks['xi'][$ii])?$networks['xi'][$ii]['pgcID']:''); 48 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['pgsList']) ) $pgs = $opVal['pgsList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect( $_POST['u'],$_POST['p']);50 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['pgsList']) ) $pgs = $opVal['pgsList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']); 49 51 if (!$loginError){ $opVal['ck'] = $nt->ck; $pgs = $nt->getPgsList($currPstAs); } 50 52 else { $outMsg = '<b style="color:red;">'.__('Login Problem').' - '.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } … … 53 55 $opVal['pgsList'] = $pgs; nxs_saveOption($opNm, $opVal); return $opVal; 54 56 } 55 function getGrpList($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; $nt = new nxsAPI_XI(); // prr($opVal);57 function getGrpList($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI(); // prr($opVal); 56 58 $currPstAs = !empty($_POST['pggID'])?$_POST['pggID']:(!empty($networks['xi'][$ii]['pggID'])?$networks['xi'][$ii]['pggID']:''); 57 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpList']) ) $pgs = $opVal['grpList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect( $_POST['u'],$_POST['p']);59 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpList']) ) $pgs = $opVal['grpList']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']); 58 60 if (!$loginError){ $opVal['ck'] = $nt->ck; $pgs = $nt->getGrpList($currPstAs); } 59 61 else { $outMsg = '<b style="color:red;">'.__('Login Problem').' - '.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } … … 62 64 $opVal['grpList'] = $pgs; nxs_saveOption($opNm, $opVal); return $opVal; 63 65 } 64 function getGrpForums($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = $_POST['ii']; $nt = new nxsAPI_XI(); $nt->debug = true;// prr($opVal);66 function getGrpForums($networks){ $opVal = array(); $pass = 'g9c1a'.nsx_doEncode($_POST['p']); $opNm = 'nxs_snap_xi_'.sha1('nxs_snap_xi'.$_POST['u'].$pass); $opVal = nxs_getOption($opNm); $ii = sanitize_key($_POST['ii']); $nt = new nxsAPI_XI(); $nt->debug = true;// prr($opVal); 65 67 $currPstAs = !empty($_POST['pggID'])?$_POST['pggID']:(!empty($networks['xi'][$ii]['pggID'])?$networks['xi'][$ii]['pggID']:''); $currForum = !empty($_POST['gpfID'])?$_POST['gpfID']:(!empty($networks['xi'][$ii]['gpfID'])?$networks['xi'][$ii]['gpfID']:''); 66 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpForums']) ) $pgs = $opVal['grpForums']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect( $_POST['u'],$_POST['p']);68 if (empty($_POST['force']) && !empty($opVal['ck']) && !empty($opVal['grpForums']) ) $pgs = $opVal['grpForums']; else { if (!empty($opVal['ck'])) $nt->ck = $opVal['ck']; $loginError=$nt->connect(sanitize_user($_POST['u']),$_POST['p']); 67 69 if (!$loginError){ $opVal['ck'] = $nt->ck; $pgs = $nt->getGrpForums('https://www.xing.com/communities/groups/'.$currPstAs, $currForum); } 68 70 else { $outMsg = '<b style="color:red;">'.__('Login Problem').' - '.$loginError.'</b>'; if (!empty($_POST['isOut'])) echo $outMsg; return $outMsg; } … … 79 81 <span style="color:#FF0000; font-weight: bold; font-size: 14px;">[<a style="color:#FF0000;" target="_blank" href="http://nxs.fyi/xingmsg">Officially Discontinued by XING</a>]</span> <span style="color:#005800; font-weight: bold; font-size: 14px;"> XING Native API:</span> Free built-in API from XING. <br/><br/> 80 82 81 <select name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?>').hide(); jQuery('.nxs_<?php echo $nt; ?>_api'+jQuery(this).val()+'div_<?php echo $ii; ?>').show(); "><option <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='nx')?"selected":""; ?> value="nx">NextScripts API</option><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='xixi')?"selected":""; ?> value="xixi">XING API</option></select><hr/>83 <select name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiToUse]" onchange="jQuery('.nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?>').hide(); jQuery('.nxs_<?php echo esc_attr($nt); ?>_api'+jQuery(this).val()+'div_<?php echo esc_attr($ii); ?>').show(); "><option <?php echo (empty($options['apiToUse']) || $options['apiToUse'] =='nx')?"selected":""; ?> value="nx">NextScripts API</option><option <?php echo (!empty($options['apiToUse']) && $options['apiToUse'] =='xixi')?"selected":""; ?> value="xixi">XING API</option></select><hr/> 82 84 </div> 83 85 <?php if (!empty($options['appKey'])) $options['apiToUse'] = 'xixi'; ?> 84 <div id="nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apinxdiv_<?php echo $ii; ?>" style="display: <?php echo ((empty($options['apiToUse']) && empty($options['appKey'])) || $options['apiToUse'] =='nx')?"block":"none"; ?>;">86 <div id="nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apinxdiv_<?php echo esc_attr($ii); ?>" style="display: <?php echo ((empty($options['apiToUse']) && empty($options['appKey'])) || $options['apiToUse'] =='nx')?"block":"none"; ?>;"> 85 87 <h3>NextScripts API</h3> 86 88 … … 90 92 } if (!empty($opVal) & !is_array($opVal)) $options['uMsg'] = $opVal; else { if (!empty($opVal) & is_array($opVal)) $options = array_merge($options, $opVal); } 91 93 ?> 92 <div class="subDiv" id="sub<?php echo $ii; ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div><br/>94 <div class="subDiv" id="sub<?php echo esc_attr($ii); ?>DivN" style="display: block;"><?php $this->elemUserPass($ii, $options['uName'], $options['uPass']); ?></div><br/> 93 95 <script type="text/javascript"> 94 jQuery('#apXIUName<?php echo $ii; ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apXIPass<?php echo $ii; ?>').val(); if( u!='' && p!='' ) { nxs_xi2GetPages(<?php echo $ii; ?>,0); } });95 jQuery('#apXIPass<?php echo $ii; ?>').change(function() { var u = jQuery('#apXIUName<?php echo $ii; ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_xi2GetPages(<?php echo $ii; ?>,0); } });96 jQuery('#apXIUName<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery(this).val(); var p = jQuery('#apXIPass<?php echo esc_attr($ii); ?>').val(); if( u!='' && p!='' ) { nxs_xi2GetPages(<?php echo esc_attr($ii); ?>,0); } }); 97 jQuery('#apXIPass<?php echo esc_attr($ii); ?>').change(function() { var u = jQuery('#apXIUName<?php echo esc_attr($ii); ?>').val(); var p = jQuery(this).val(); if( u!='' && p!='' ) { nxs_xi2GetPages(<?php echo esc_attr($ii); ?>,0); } }); 96 98 97 jQuery('.xiWhereToPost<?php echo $ii; ?>').change(function() { if (jQuery(this).val()!='P') jQuery('#xiPostType<?php echo $ii; ?>').show(); else jQuery('#xiPostType<?php echo $ii; ?>').hide(); });99 jQuery('.xiWhereToPost<?php echo esc_attr($ii); ?>').change(function() { if (jQuery(this).val()!='P') jQuery('#xiPostType<?php echo esc_attr($ii); ?>').show(); else jQuery('#xiPostType<?php echo esc_attr($ii); ?>').hide(); }); 98 100 99 101 </script> 100 102 <div style="width:100%;"><b style="font-size: 15px;"><?php _e('Where to Post', 'social-networks-auto-poster-facebook-twitter-g'); if (empty($options['whToPost'])) $options['whToPost'] = 'PR'; ?>:</b> </div> 101 103 <div style="margin-left: 10px;"> 102 <input class="xiWhereToPost<?php echo $ii; ?>" type="radio" name="xi[<?php echo $ii; ?>][whToPost]" value="PR" <?php if ($options['whToPost'] == 'PR') echo 'checked="checked"'; ?> />104 <input class="xiWhereToPost<?php echo esc_attr($ii); ?>" type="radio" name="xi[<?php echo esc_attr($ii); ?>][whToPost]" value="PR" <?php if ($options['whToPost'] == 'PR') echo 'checked="checked"'; ?> /> 103 105 <span style="font-size: 15px;"><?php _e('Profile Update', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to your profile', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/></span> 104 106 105 107 <div style="margin-left: 30px;"> <div style="width:100%;"><strong style="font-size: 15px;">Post Type:</strong></div><div style="margin-left: 10px;"> 106 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="T" <?php if ($options['postTypeP'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>107 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="A" <?php if ( !isset($options['postTypeP']) || $options['postTypeP'] == '' || $options['postTypeP'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Share link to the blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>108 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="I" <?php if ( !empty($options['postTypeP']) && $options['postTypeP'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>108 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="T" <?php if ($options['postTypeP'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 109 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="A" <?php if ( !isset($options['postTypeP']) || $options['postTypeP'] == '' || $options['postTypeP'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Share link to the blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 110 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="I" <?php if ( !empty($options['postTypeP']) && $options['postTypeP'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 109 111 </div><br/> 110 112 </div> 111 113 112 <input class="xiWhereToPost<?php echo $ii; ?>" type="radio" name="xi[<?php echo $ii; ?>][whToPost]" value="C" <?php if ($options['whToPost'] == 'C') echo 'checked="checked"'; ?> />114 <input class="xiWhereToPost<?php echo esc_attr($ii); ?>" type="radio" name="xi[<?php echo esc_attr($ii); ?>][whToPost]" value="C" <?php if ($options['whToPost'] == 'C') echo 'checked="checked"'; ?> /> 113 115 <span style="font-size: 15px;"><?php _e('Company Page', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to Company page', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> </span> 114 116 115 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsXI2InfoDiv<?php echo $ii; ?>">117 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsXI2InfoDiv<?php echo esc_attr($ii); ?>"> 116 118 <div style="width:100%;"> 117 119 <div> 118 <select id="xi2pgID<?php echo $ii; ?>" onchange="nxs_xi2PageChange('<?php echo $ii;?>',jQuery(this));" name="xi[<?php echo $ii;?>][pgcID]">120 <select id="xi2pgID<?php echo esc_attr($ii); ?>" onchange="nxs_xi2PageChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="xi[<?php echo esc_attr($ii);?>][pgcID]"> 119 121 <?php $pgi = !empty($options['pgsList'])?$options['pgsList']:''; 120 122 if (!empty($options['pgcID'])) { echo (!empty($options['pgcID']) && stripos($pgi,$options['pgcID'])===false)?'<option selected="selected" value="'.$options['pgcID'].'">'.$options['pgcID'].'</option>':''; } … … 125 127 ?><option value="a"><?php _e('.... Enter the Company Page ID'); ?></option> 126 128 </select> 127 <div id="nxsXI2InfoDivBlock<?php echo $ii; ?>" style="display: inline-block;">128 <input type="text" style="display: none;" id="xi2InpCst<?php echo $ii; ?>" value="<?php echo !empty($options['pgcID'])?$options['pgcID']:''; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="xi2pgID<?php echo $ii; ?>" />129 <div style="display: inline-block;"><a onclick="nxs_xi2GetPages(<?php echo $ii;?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo $nt.$ii;?>2rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo $nt.$ii;?>2ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />129 <div id="nxsXI2InfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> 130 <input type="text" style="display: none;" id="xi2InpCst<?php echo esc_attr($ii); ?>" value="<?php echo !empty($options['pgcID'])?$options['pgcID']:''; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="xi2pgID<?php echo esc_attr($ii); ?>" /> 131 <div style="display: inline-block;"><a onclick="nxs_xi2GetPages(<?php echo esc_attr($ii);?>, 1); jQuery(this).blur(); return false;" href="#"><img id="<?php echo esc_attr($nt.$ii);?>2rfrshImg" style="vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/refresh16.png' /></a></div></div> <img id="<?php echo esc_attr($nt.$ii);?>2ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 130 132 </div> 131 133 </div> 132 134 133 135 <div style="margin-left: 30px;"> <div style="width:100%;"><strong style="font-size: 15px;">Post Type:</strong></div><div style="margin-left: 10px;"> 134 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeC]" value="T" <?php if ($options['postTypeC'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>135 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeC]" value="I" <?php if ( !empty($options['postTypeC']) && $options['postTypeC'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>136 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeC]" value="T" <?php if ($options['postTypeC'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 137 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeC]" value="I" <?php if ( !empty($options['postTypeC']) && $options['postTypeC'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 136 138 </div><br/> 137 139 </div> … … 140 142 </div> 141 143 142 <br/><input class="xiWhereToPost<?php echo $ii; ?>" type="radio" name="xi[<?php echo $ii; ?>][whToPost]" value="G" <?php if ($options['whToPost'] == 'G') echo 'checked="checked"'; ?> />144 <br/><input class="xiWhereToPost<?php echo esc_attr($ii); ?>" type="radio" name="xi[<?php echo esc_attr($ii); ?>][whToPost]" value="G" <?php if ($options['whToPost'] == 'G') echo 'checked="checked"'; ?> /> 143 145 <span style="font-size: 15px;"><?php _e('Group', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post to LinkedIn Group', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> </span> 144 146 145 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsXI2GInfoDiv<?php echo $ii; ?>">147 <div style="margin-left: 30px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsXI2GInfoDiv<?php echo esc_attr($ii); ?>"> 146 148 <div style="width:100%;"> 147 149 <div> 148 <select id="xi2GpgID<?php echo $ii; ?>" onchange="nxs_xi2GPageChange('<?php echo $ii;?>',jQuery(this));" name="xi[<?php echo $ii;?>][pggID]">150 <select id="xi2GpgID<?php echo esc_attr($ii); ?>" onchange="nxs_xi2GPageChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="xi[<?php echo esc_attr($ii);?>][pggID]"> 149 151 <?php $pgi = !empty($options['grpList'])?$options['grpList']:''; 150 152 if (!empty($options['pggID'])) { echo (!empty($options['pggID']) && stripos($pgi,$options['pggID'])===false)?'<option selected="selected" value="'.$options['pggID'].'">'.$options['pggID'].'</option>':''; } … … 155 157 ?><option value="a"><?php _e('.... Enter the Group ID'); ?></option> 156 158 </select> 157 <div id="nxsXI2GInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;">158 <input type="text" style="display: none;" id="xi2GInpCst<?php echo $ii; ?>" value="<?php echo !empty($options['pgcID'])?$options['pgcID']:''; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="xi2GpgID<?php echo $ii; ?>" />159 </div> <img id="<?php echo $nt.$ii;?>3ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />159 <div id="nxsXI2GInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> 160 <input type="text" style="display: none;" id="xi2GInpCst<?php echo esc_attr($ii); ?>" value="<?php echo !empty($options['pgcID'])?$options['pgcID']:''; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="xi2GpgID<?php echo esc_attr($ii); ?>" /> 161 </div> <img id="<?php echo esc_attr($nt.$ii);?>3ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 160 162 </div> 161 163 </div> … … 165 167 <div style="margin-left: 20px;"> 166 168 167 <div style="margin-left: 30px; margin-top: 10px; font-size: 15px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsXI2GInfoDiv<?php echo $ii; ?>"> <?php _e('Please select a Group Forum', 'nxs_snap'); ?><br/>169 <div style="margin-left: 30px; margin-top: 10px; font-size: 15px;<?php echo (empty($options['uName']) && empty($options['uPass']))?'display:none;':''; ?>" id="nxsXI2GInfoDiv<?php echo esc_attr($ii); ?>"> <?php _e('Please select a Group Forum', 'nxs_snap'); ?><br/> 168 170 <div style="width:100%;"> 169 171 <div> 170 <select id="xi2GfID<?php echo $ii; ?>" onchange="nxs_xi2GfChange('<?php echo $ii;?>',jQuery(this));" name="xi[<?php echo $ii;?>][gpfID]">172 <select id="xi2GfID<?php echo esc_attr($ii); ?>" onchange="nxs_xi2GfChange('<?php echo esc_attr($ii);?>',jQuery(this));" name="xi[<?php echo esc_attr($ii);?>][gpfID]"> 171 173 <?php $pgi = !empty($options['grpForums'])?$options['grpForums']:''; 172 174 if (!empty($options['gpfID'])) { echo (!empty($options['gpfID']) && stripos($pgi,$options['gpfID'])===false)?'<option selected="selected" value="'.$options['gpfID'].'">'.$options['gpfID'].'</option>':''; } … … 177 179 ?><option value="a"><?php _e('.... Enter the Group Forum ID'); ?></option> 178 180 </select> 179 <div id="nxsXI2GInfoDivBlock<?php echo $ii; ?>" style="display: inline-block;">180 <input type="text" style="display: none;" id="xi2GfInpCst<?php echo $ii; ?>" value="<?php echo !empty($options['gpfID'])?$options['gpfID']:''; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="xi2GpgID<?php echo $ii; ?>" />181 </div> <img id="<?php echo $nt.$ii;?>3ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' />181 <div id="nxsXI2GInfoDivBlock<?php echo esc_attr($ii); ?>" style="display: inline-block;"> 182 <input type="text" style="display: none;" id="xi2GfInpCst<?php echo esc_attr($ii); ?>" value="<?php echo !empty($options['gpfID'])?$options['gpfID']:''; ?>" onblur="nxs_InpToDDBlur(jQuery(this));" onchange="nxs_InpToDDChange(jQuery(this));" data-tid="xi2GpgID<?php echo esc_attr($ii); ?>" /> 183 </div> <img id="<?php echo esc_attr($nt.$ii);?>3ldImg" style="display: none;vertical-align: middle;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 182 184 </div> 183 185 </div> … … 185 187 186 188 <div style="width:100%;"><strong style="font-size: 15px;">Post Type:</strong></div><div style="margin-left: 10px;"> 187 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeG]" value="T" <?php if ($options['postTypeG'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>188 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeG]" value="I" <?php if ( !isset($options['postTypeG']) || $options['postTypeG'] == '' || $options['postTypeG'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>189 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeG]" value="T" <?php if ($options['postTypeG'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 190 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeG]" value="I" <?php if ( !isset($options['postTypeG']) || $options['postTypeG'] == '' || $options['postTypeG'] == 'I') echo 'checked="checked"'; ?> /> <?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 189 191 </div> 190 192 </div> … … 199 201 </div> 200 202 201 <div id="nxs_<?php echo $nt; ?>_apixixidiv_<?php echo $ii; ?>" class="nxs_<?php echo $nt; ?>_apidiv_<?php echo $ii; ?> nxs_<?php echo $nt; ?>_apixixidiv_<?php echo $ii; ?>" style="display: <?php echo (!empty($options['appKey']) || (!empty($options['apiToUse']) && $options['apiToUse'] =='xixi'))?"block":"none"; ?>;">203 <div id="nxs_<?php echo esc_attr($nt); ?>_apixixidiv_<?php echo esc_attr($ii); ?>" class="nxs_<?php echo esc_attr($nt); ?>_apidiv_<?php echo esc_attr($ii); ?> nxs_<?php echo esc_attr($nt); ?>_apixixidiv_<?php echo esc_attr($ii); ?>" style="display: <?php echo (!empty($options['appKey']) || (!empty($options['apiToUse']) && $options['apiToUse'] =='xixi'))?"block":"none"; ?>;"> 202 204 203 205 <div style="color:red;padding:5px;margin:5px; border: 1px solid darkred;">[January 2017] XING has decided to discontinue it's free public API. More Info: <a target="_blank" href="http://nxs.fyi/xingmsg">http://nxs.fyi/xingmsg</a>.<br/>If you have existing XING app, you still can use it.<br/></div> … … 209 211 _e('Your '.$ntInfo['name'].' Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['appAppUserID'].' - '.$options['appAppUserName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>. 210 212 <?php _e('You can', 'social-networks-auto-poster-facebook-twitter-g'); ?> Re- <?php } ?> 211 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo $nt; ?>&acc=<?php echo $ii; ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a>213 <a href="<?php echo $nxs_snapSetPgURL;?>&auth=<?php echo esc_attr($nt); ?>&acc=<?php echo esc_attr($ii); ?>">Authorize Your <?php echo $ntInfo['name']; ?> Account</a> 212 214 <?php if (!isset($options['appAppUserID']) || $options['appAppUserID']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div> <?php } 213 215 } ?><br/><br/> … … 215 217 <div style="width:100%;"><strong id="altFormatText">Post Type:</strong></div> 216 218 <div style="margin-left: 10px;"> 217 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/>218 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Post link to the blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/>219 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?></i><br/> 220 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( !isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Post link to the blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?><br/> 219 221 </div><br/> 220 222 … … 269 271 270 272 <tr class="nxstbldo <?php echo 'nxstbldo'.strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> <br/></th><td> 271 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="T" <?php if ($postTypeP == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>272 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="A" <?php if ( !isset($postTypeP) || $postTypeP == '' || $postTypeP == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>273 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="T" <?php if ($postTypeP == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 274 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="A" <?php if ( !isset($postTypeP) || $postTypeP == '' || $postTypeP == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 273 275 </td></tr> 274 276 <?php } elseif( $ntOpt['whToPost']=='C') { $this->elemEdTitleFormat($ii, __('Title Format:', 'social-networks-auto-poster-facebook-twitter-g'), $msgTCFormat); } else { $this->elemEdTitleFormat($ii, __('Title Format:', 'social-networks-auto-poster-facebook-twitter-g'), $msgTFormat); ?> 275 277 <tr class="nxstbldo <?php echo 'nxstbldo'.strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> <br/></th><td> 276 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeG]" value="T" <?php if ($postTypeG == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>277 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeG]" value="A" <?php if ( !isset($postTypeG) || $postTypeG == '' || $postTypeG == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?>278 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeG]" value="T" <?php if ($postTypeG == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 279 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeG]" value="A" <?php if ( !isset($postTypeG) || $postTypeG == '' || $postTypeG == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 278 280 </td></tr> 279 281 <?php } ?> … … 281 283 <?php } else { ?> 282 284 <tr class="nxstbldo <?php echo 'nxstbldo'.strtoupper($nt).$ii; ?>"><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> <br/></th><td> 283 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>284 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>285 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 286 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 285 287 </td></tr> 286 288 <?php } $this->elemEdMsgFormat($ii, __('Message Format:', 'social-networks-auto-poster-facebook-twitter-g'),$msgFormat); … … 306 308 if (empty($ntOpt['whToPost']) || $ntOpt['whToPost']=='PR') { ?> 307 309 308 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if (isset($postTypeP) && $postTypeP == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>309 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="A" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( empty($postTypeP) || $postTypeP == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with shared link', 'social-networks-auto-poster-facebook-twitter-g') ?><br/>310 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeP]" value="I" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( !empty($postTypeP) && $postTypeP == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?>310 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if (isset($postTypeP) && $postTypeP == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 311 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="A" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( empty($postTypeP) || $postTypeP == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with shared link', 'social-networks-auto-poster-facebook-twitter-g') ?><br/> 312 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeP]" value="I" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( !empty($postTypeP) && $postTypeP == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 311 313 312 314 <?php } elseif( $ntOpt['whToPost']=='C') { ?> 313 315 314 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeC]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postTypeC == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>315 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeC]" value="I" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( !isset($postTypeC) || $postTypeC == '' || $postTypeC == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?>316 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeC]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postTypeC == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 317 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeC]" value="I" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( !isset($postTypeC) || $postTypeC == '' || $postTypeC == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 316 318 317 319 <?php … … 321 323 } else { $this->elemEdTitleFormat($ii, __('Title Format:', 'social-networks-auto-poster-facebook-twitter-g'), $msgTFormat); ?> 322 324 323 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeG]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postTypeG == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>324 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postTypeG]" value="I" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( !isset($postTypeG) || $postTypeG == '' || $postTypeG == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?>325 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeG]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postTypeG == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 326 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postTypeG]" value="I" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( !isset($postTypeG) || $postTypeG == '' || $postTypeG == 'I') echo 'checked="checked"'; ?> /><?php _e('Image Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 325 327 326 328 <?php } } else { ?> 327 329 328 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/>329 <input type="radio" name="<?php echo $nt; ?>[<?php echo $ii; ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?>330 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="T" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($postType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g') ?></i><br/> 331 <input type="radio" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][postType]" value="A" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ( !isset($postType) || $postType == '' || $postType == 'A') echo 'checked="checked"'; ?> /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g') ?> 330 332 331 333 <?php } ?> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/yo.api.php
r1905522 r2757212 54 54 $sql = "SELECT meta_value, user_id FROM $wpdb->usermeta WHERE meta_key = 'nxs_yo'"; 55 55 $users = $wpdb->get_results($sql); 56 foreach ($users as $user) { $data['username'] = $user->meta_value; // echo $user->user_id.'|'.$user->meta_value;56 foreach ($users as $user) { $data['username'] = $user->meta_value; 57 57 $advSet = nxs_mkRemOptsArr($hdrsArr, '', $data); $rep = nxs_remote_post('http://api.justyo.co/yo/', $advSet); // prr($advSet); prr($rep); 58 58 $jsRep = json_decode($rep['body'], true); if (!empty($jsRep['success'])) $gCnt++; else $bCnt++; // $hddr = print_r($rep['headers'], true); $limit = trim(CutFromTo($hddr, '[x-ratelimit-remaining] =>', '[')); prr($limit); -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/yo.php
r1905522 r2757212 14 14 function accTab($ii, $options, $isNew=false){ global $nxs_snapSetPgURL; $ntInfo = $this->ntInfo; $nt = $ntInfo['lcode']; ?><div id="altFormat" style=""> 15 15 <div style="width:100%;"><strong id="altFormatText">Yo API Key:</strong> <span style="font-size: 11px; margin: 0px;">Get it from <a target="_blank" href="http://www.diigo.com/api_keys/">http://www.diigo.com/api_keys</a>.</span></div> 16 <input name="<?php echo $nt; ?>[<?php echo $ii; ?>][apiKey]" style="width: 60%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['apiKey'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>16 <input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][apiKey]" style="width: 60%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['apiKey'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 17 17 </div><br/><?php $this->elemMsgFormat($ii,'Message Text Format','msgFormat',$options['msgFormat']); 18 18 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc-cl/yt.php
r2245308 r2757212 25 25 if (empty($options['sid'])) $options['sid']=''; if (empty($options['ssid'])) $options['ssid']=''; if (empty($options['nid'])) $options['nid']=''; if (empty($options['hsid'])) $options['hsid']='';?> 26 26 27 <div id="ups<?php echo $nt.$ii; ?>UPS" style="padding-top: 10px;"><a href="#" onclick="jQuery('#ups<?php echo $nt.$ii; ?>S').show();return false;">Use session</a> (Optional - use only if you are having login problems)</div>28 <div id="ups<?php echo $nt.$ii; ?>S" class="ups<?php echo $nt.$ii; ?>" style="padding-left: 15px; padding-top: 10px; display:none;">29 SID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][sid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['sid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>30 SSID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][ssid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ssid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>31 HSID: <input style="width:400px;" name="<?php echo $nt; ?>[<?php echo $ii; ?>][hsid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['hsid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>27 <div id="ups<?php echo esc_attr($nt.$ii); ?>UPS" style="padding-top: 10px;"><a href="#" onclick="jQuery('#ups<?php echo esc_attr($nt.$ii); ?>S').show();return false;">Use session</a> (Optional - use only if you are having login problems)</div> 28 <div id="ups<?php echo esc_attr($nt.$ii); ?>S" class="ups<?php echo esc_attr($nt.$ii); ?>" style="padding-left: 15px; padding-top: 10px; display:none;"> 29 SID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][sid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['sid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 30 SSID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][ssid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ssid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 31 HSID: <input style="width:400px;" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][hsid]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['hsid'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/> 32 32 </div> 33 33 34 34 <br/ > 35 <div style="width:100%;"><strong><?php _e('YouTube Channel Feed Page URL', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('YouTube Channel Page URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][ytPageID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ytPageID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>36 <div style="width:100%;"><strong><?php _e('Google+ Page ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Fill this only if you are posting to youTube as your Google+ page. Please leave this empty otherwise.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][ytGPPageID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ytGPPageID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/>35 <div style="width:100%;"><strong><?php _e('YouTube Channel Feed Page URL', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('YouTube Channel Page URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][ytPageID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ytPageID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 36 <div style="width:100%;"><strong><?php _e('Google+ Page ID', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><i><?php _e('Fill this only if you are posting to youTube as your Google+ page. Please leave this empty otherwise.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][ytGPPageID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ytGPPageID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/><br/> 37 37 38 38 -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_flt.php
r2361462 r2757212 235 235 } 236 236 //prr($setToSave, 'SAVED FILTERS/REPOSTER SETTINGS'); 237 self::save_meta( $post_id, 'nxs_rpstr_data', $setToSave ); // echo "-= 1 =-"; prr($setToSave);237 self::save_meta( $post_id, 'nxs_rpstr_data', $setToSave ); 238 238 239 239 } return $setToSave; … … 315 315 public static function print_title_metabox( $current_post ) { $options = (!empty($current_post))?maybe_unserialize(get_post_meta( $current_post->ID, 'nxs_rpstr', true )):''; $ii = !empty($options['ii'])?$options['ii']:'0'; 316 316 if (!empty($current_post)) { $stats = self::getStats($current_post->ID, '', $options); } ?> 317 <input value="1" id="riC<?php echo $ii; ?>" <?php if (!isset($options['rpstOn']) || trim($options['rpstOn'])=='1') echo "checked"; ?> type="checkbox" name="nxs_rpstr[rpstOn]"/>317 <input value="1" id="riC<?php echo esc_attr($ii); ?>" <?php if (!isset($options['rpstOn']) || trim($options['rpstOn'])=='1') echo "checked"; ?> type="checkbox" name="nxs_rpstr[rpstOn]"/> 318 318 <b style="font-size: 16px;"><?php _e('Activate this Reposter Action', 'social-networks-auto-poster-facebook-twitter-g'); ?> </b> <br /> 319 319 … … 324 324 325 325 <b style="font-size: 15px;vertical-align: middle;"><?php _e('Get posts:', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 326 <select id="riS<?php echo $ii; ?>" name="nxs_rpstr[rpstType]" onchange="nxs_actDeActTurnOff(jQuery(this).attr('id'));">326 <select id="riS<?php echo esc_attr($ii); ?>" name="nxs_rpstr[rpstType]" onchange="nxs_actDeActTurnOff(jQuery(this).attr('id'));"> 327 327 <option value="2" <?php if (isset($options['rpstType']) && $options['rpstType']=='2') echo 'selected="selected"' ?>>One By One - Old to New</option> 328 328 <option value="3" <?php if (isset($options['rpstType']) && $options['rpstType']=='3') echo 'selected="selected"' ?>>One By One - New to Old</option> … … 330 330 </select> 331 331 <br/> 332 <input value="1" id="riOC<?php echo $ii; ?>" <?php if (isset($options['rpstOnlyPUP']) && trim($options['rpstOnlyPUP'])=='1') echo "checked"; ?> type="checkbox" name="nxs_rpstr[rpstOnlyPUP]"/><b><?php _e('Post ONLY never autoposted posts', 'social-networks-auto-poster-332 <input value="1" id="riOC<?php echo esc_attr($ii); ?>" <?php if (isset($options['rpstOnlyPUP']) && trim($options['rpstOnlyPUP'])=='1') echo "checked"; ?> type="checkbox" name="nxs_rpstr[rpstOnlyPUP]"/><b><?php _e('Post ONLY never autoposted posts', 'social-networks-auto-poster- 333 333 facebook-twitter-g'); ?></b> - <i><?php _e('Will post only posts that were never posted by SNAP. General setting, will not be reset. This is usefull if you have existing posts and want them to be posted to your social media accounts only once.', 'social-networks-auto-poster- 334 334 facebook-twitter-g'); ?></i> <br/> 335 <span id="riS<?php echo $ii; ?>nxsRUQ" style="display: none;"><input value="1" id="riOCU<?php echo $ii; ?>" <?php if (isset($options['rpstOnlyUniq']) && trim($options['rpstOnlyUniq'])=='1') echo "checked"; ?> type="checkbox" name="nxs_rpstr[rpstOnlyUniq]"/><b><?php _e('Post each post only once', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> - <i><?php _e('This will only post posts that were never posted by this reposter. If you reset reposter all posts will become available for reposting again.', 'social-networks-auto-poster-335 <span id="riS<?php echo esc_attr($ii); ?>nxsRUQ" style="display: none;"><input value="1" id="riOCU<?php echo esc_attr($ii); ?>" <?php if (isset($options['rpstOnlyUniq']) && trim($options['rpstOnlyUniq'])=='1') echo "checked"; ?> type="checkbox" name="nxs_rpstr[rpstOnlyUniq]"/><b><?php _e('Post each post only once', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> - <i><?php _e('This will only post posts that were never posted by this reposter. If you reset reposter all posts will become available for reposting again.', 'social-networks-auto-poster- 336 336 facebook-twitter-g'); ?></i> <br/></span> 337 337 … … 686 686 <div class=""> 687 687 <div class="nxs_medium_field_txn"> <label class="field_title"> <?php _e( 'Custom Field Name', 'social-networks-auto-poster-facebook-twitter-g' ); ?>:</label><br/> 688 <input name="<?php echo self::makeInputName("nxs_meta_key$postfix", $nt, $ii); ?>" id="nxs<?php echo $nt.$ii; ?>_meta_key<?php echo $postfix; ?>" value="<?php echo !empty($metaSettings['post_meta'][$jj]["key"])?$metaSettings['post_meta'][$jj]["key"]:'';?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 95%;"/>688 <input name="<?php echo self::makeInputName("nxs_meta_key$postfix", $nt, $ii); ?>" id="nxs<?php echo esc_attr($nt.$ii); ?>_meta_key<?php echo $postfix; ?>" value="<?php echo !empty($metaSettings['post_meta'][$jj]["key"])?$metaSettings['post_meta'][$jj]["key"]:'';?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 95%;"/> 689 689 </div> 690 690 <div class="nxs_shortXL_field"><?php … … 694 694 ?></div> 695 695 <div class="nxs_mediumXL_field_txn"><label class="field_title"> <?php _e( 'Custom Field Value', 'social-networks-auto-poster-facebook-twitter-g' ); ?>:</label><br/> 696 <input name="<?php echo self::makeInputName("nxs_meta_value$postfix", $nt, $ii); ?>[]" id="nxs<?php echo $nt.$ii; ?>_meta_value<?php echo $postfix; ?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 95%;" value="<?php echo !empty($metaSettings['post_meta'][$jj]["value"])?$metaSettings['post_meta'][$jj]["value"][0]:'';?>"/>696 <input name="<?php echo self::makeInputName("nxs_meta_value$postfix", $nt, $ii); ?>[]" id="nxs<?php echo esc_attr($nt.$ii); ?>_meta_value<?php echo $postfix; ?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 95%;" value="<?php echo !empty($metaSettings['post_meta'][$jj]["value"])?$metaSettings['post_meta'][$jj]["value"][0]:'';?>"/> 697 697 </div> 698 698 </div> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_http.php
r2650662 r2757212 4 4 Project URL: https://www.nextscripts.com/snap-api/ 5 5 Description: Automatically posts to all your Social Networks 6 Author: NextScripts , Inc7 File Version: 1.1.6 (Nov 4, 2021)6 Author: NextScripts Corp 7 File Version: 2.0.0 (July 7, 2022) 8 8 Author URL: https://www.nextscripts.com 9 Copyright 2012-202 1NextScripts Corp9 Copyright 2012-2022 NextScripts Corp 10 10 #############################################################################*/ 11 11 12 if (!class_exists('nxs_Http')){ class nxs_Http { private $headers = ''; 13 function request( $url, $args = array() ) { global $nxs_version; 14 $defaults = array( 'method' => 'GET', 'timeout' =>'5', 'redirection' => '0', 'httpversion' => '1.1', 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36', 15 'blocking' => true, 'headers' => array(), 'cookies' => array(), 'proxy' => array(), 'body' => null, 'charset' => 'UTF-8', 'compress' => false, 'decompress' => true, 'sslverify' => false, 'stream' => false, 'filename' => null, 'limit_response_size' => null, 16 ); $args = nxs_parse_args( $args ); 17 if ( isset($args['method']) && 'HEAD' == $args['method'] ) $defaults['redirection'] = 0; 18 $r = nxs_parse_args( $args, $defaults ); if (!isset($r['_redirection'])) $r['_redirection'] = $r['redirection']; 19 $arrURL = parse_url( $url ); 20 21 if ( empty( $url ) || empty( $arrURL['scheme'] ) ) return new nxs_Error('http_request_failed', 'A valid URL was not provided.'); 22 $r['ssl'] = $arrURL['scheme'] == 'https' || $arrURL['scheme'] == 'ssl'; 23 24 if ( $r['stream'] ) { if ( empty( $r['filename'] ) ) $r['filename'] = get_temp_dir() . basename( $url ); $r['blocking'] = true; 25 if ( ! @is_writable( dirname( $r['filename'] ) ) ) return new nxs_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) ); 26 } 27 if ( is_null( $r['headers'] ) ) $r['headers'] = array(); 28 if ( ! is_array( $r['headers'] ) ) { $processedHeaders = nxs_Http::processHeaders( $r['headers'] ); $r['headers'] = $processedHeaders['headers']; } 29 30 if ( isset( $r['headers']['User-Agent'] ) ) { $r['user-agent'] = $r['headers']['User-Agent']; unset( $r['headers']['User-Agent'] ); } 31 if ( isset( $r['headers']['user-agent'] ) ) { $r['user-agent'] = $r['headers']['user-agent']; unset( $r['headers']['user-agent'] ); } 32 33 nxs_Http::buildCookieHeader( $r ); 34 if ( nxs_Http_Encoding::is_available() ) $r['headers']['Accept-Encoding'] = nxs_Http_Encoding::accept_encoding(); 35 if ( ( ! is_null( $r['body'] ) && '' != $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) { 36 if ( !empty($r['usearray']) && is_array($r['body']) ) { 37 unset($r['headers']['Content-Length']); 38 } else { 39 if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { $r['body'] = http_build_query( $r['body'], null, '&' ); 40 if ( ! isset( $r['headers']['Content-Type'] ) ) $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . ($r['charset']!==''?$r['charset']:'utf-8'); 41 } 42 if ( '' === $r['body'] ) $r['body'] = null; 43 if ( !empty($r['usearray']) ) unset($r['headers']['Content-Length']); else { 44 if ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) ) $r['headers']['Content-Length'] = strlen( $r['body'] ); 45 } 46 } 47 } 48 return $this->curl_request($url, $r); 49 } 50 function sendReq($url, $type='GET', $args = array()) { $defaults = array('method' => $type); $r = nxs_parse_args( $args, $defaults ); return $this->request($url, $r);} 51 function processResponse($strResponse) { $res = explode("\r\n\r\n", $strResponse, 2);return array('headers' => $res[0], 'body' => isset($res[1]) ? $res[1] : ''); } 52 function chunkTransferDecode($body) { 53 $body = str_replace(array("\r\n", "\r"), "\n", $body); $parsedBody = ''; 54 if ( ! preg_match( '/^[0-9a-f]+(\s|\n)+/mi', trim($body) ) ) return $body; 55 while ( true ) { $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match ); 56 if ( $hasChunk ) { if ( empty( $match[1] ) ) return $body; 57 $length = hexdec( $match[1] ); $chunkLength = strlen( $match[0] ); 58 $strBody = substr($body, $chunkLength, $length); $parsedBody .= $strBody; 59 $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n"); 60 if ( "0" == trim($body) ) return $parsedBody; 61 } else return $body; 62 } 63 } 64 public static function processHeaders($headers) { // prr($headers); 65 if ( is_string($headers) ) { $headers = str_replace("\r\n", "\n", $headers); $headers = preg_replace('/\n[ \t]/', ' ', $headers); $headers = explode("\n", $headers); } 66 $response = array('code' => 0, 'message' => ''); 67 for ( $i = count($headers)-1; $i >= 0; $i-- ) { if ( !empty($headers[$i]) && false === strpos($headers[$i], ':') ) { $headers = array_splice($headers, $i); break; } } 68 $cookies = array(); $newheaders = array(); 69 foreach ( (array) $headers as $tempheader ) { 70 if ( empty($tempheader) ) continue; 71 if ( false === strpos($tempheader, ':') ) { $stack = explode(' ', $tempheader, 3); $stack[] = ''; list( , $response['code'], $response['message']) = $stack; continue; } 72 list($key, $value) = explode(':', $tempheader, 2); $key = strtolower( $key ); $value = trim( $value ); 73 if ( isset( $newheaders[ $key ] ) ) { 74 if ( ! is_array( $newheaders[ $key ] ) ) $newheaders[$key] = array( $newheaders[ $key ] ); $newheaders[ $key ][] = $value; 75 } else $newheaders[ $key ] = $value; 76 if ( 'set-cookie' == $key ) $cookies[] = new nxs_Http_Cookie( $value ); 77 } // prr($newheaders); prr($cookies); 78 return array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies); 79 } 80 public static function buildCookieHeader( &$r ) { 81 if ( ! empty($r['cookies']) ) { $cookies_header = ''; 82 foreach ( (array) $r['cookies'] as $cookie ) if (is_object($cookie) && method_exists($cookie, 'getHeaderValue') ) $cookies_header .= $cookie->getHeaderValue() . '; '; 83 $cookies_header = substr( $cookies_header, 0, -2 ); $r['headers']['cookie'] = $cookies_header; 84 } 85 } 86 87 private function stream_headers( $handle, $headers ) { $this->headers .= $headers; return strlen( $headers ); } 88 function curl_request($url, $args = array()) { 89 $defaults = array( 90 'method' => 'GET', 'timeout' => 5, 91 'redirection' => 5, 'httpversion' => '1.0', 92 'blocking' => true, 93 'headers' => array(), 'body' => null, 'proxy' => array(), 'cookies' => array() 94 ); //## NXS - proxy added 95 $r = nxs_parse_args( $args, $defaults ); 96 if ( isset($r['headers']['User-Agent']) ) { $r['user-agent'] = $r['headers']['User-Agent']; /* unset($r['headers']['User-Agent']); */ } 97 else if ( isset($r['headers']['user-agent']) ) { $r['user-agent'] = $r['headers']['user-agent']; /* unset($r['headers']['user-agent']); */ } 98 nxs_Http::buildCookieHeader( $r ); $handle = curl_init(); 99 //## NXS 100 if (isset($r['proxy']) && !empty($r['proxy'])) { 101 if (isset($r['proxy']) && isset($r['proxy']['proxy'])) $prx = explode(':',$r['proxy']['proxy']); else $prx = false; 102 if (isset($r['proxy']) && isset($r['proxy']['up'])) $pru = explode(':',$r['proxy']['up']); else $pru = false; 103 $proxy = new nxs_HTTP_Proxy(); 104 $proxy->nxs_PROXY_HOST = ($prx && isset($prx[0]))?$prx[0]:''; 105 $proxy->nxs_PROXY_PORT = ($prx && isset($prx[1]))?$prx[1]:''; 106 $proxy->nxs_PROXY_USERNAME = ($pru && isset($pru[0]))?$pru[0]:''; 107 $proxy->nxs_PROXY_PASSWORD = ($pru && isset($pru[1]))?$pru[1]:''; 108 109 } 110 // /## NXS 111 if ( !empty($proxy) && $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { // prr('Setting PROXY'.$proxy->host()); 112 curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() ); curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() ); 113 if ( $proxy->use_authentication() ) { curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() );} 114 } 115 $is_local = isset($r['local']) && $r['local']; $ssl_verify = isset($r['sslverify']) && $r['sslverify']; 116 $timeout = (int) ceil( $r['timeout'] ); 117 curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout ); curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout ); 118 curl_setopt( $handle, CURLOPT_URL, $url); 119 curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true ); 120 curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, ( $ssl_verify === true ) ? 2 : false ); curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify ); 121 curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] ); 122 curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, false ); 123 124 switch ( $r['method'] ) { 125 case 'HEAD': curl_setopt( $handle, CURLOPT_NOBODY, true ); break; 126 case 'POST': curl_setopt( $handle, CURLOPT_POST, true ); curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] ); break; 127 case 'PUT': curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' ); curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] ); break; 128 default: curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $r['method'] ); if ( ! is_null( $r['body'] ) ) curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] ); break; 129 } 130 131 if ( true === $r['blocking'] ) curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) ); 132 curl_setopt( $handle, CURLOPT_HEADER, false ); 133 if ( !empty( $r['headers'] ) ) { $headers = array(); foreach ( $r['headers'] as $name => $value ) $headers[] = "{$name}: $value"; // prr($headers, "-WWX-".$r['method']." - ".$url); 134 if ( !empty($proxy) && $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) $headers[] = $proxy->authentication_header(); 135 curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );} // prr($headers); 136 if ( $r['httpversion'] == '1.0' ) curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 ); else curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 ); 137 //unset($r['headers']['Content-Length']); 138 // if we don't need to return the body, so don't. Just execute request and return. 139 if ( ! $r['blocking'] ) { curl_exec( $handle ); curl_close( $handle ); return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );} 140 //## NXS - Post as array to Upload an image 141 if (!empty($args['postAsArray'])) { $tt = nxs_altCurlUploadImg( $handle, $r ); $handle = $tt['ch']; $r = $tt['r']; } 142 143 $theResponse = curl_exec( $handle ); $theBody = ''; $theHeaders = nxs_Http::processHeaders( $this->headers ); 144 if ( strlen($theResponse) > 0 && ! is_bool( $theResponse ) ) $theBody = $theResponse; 145 146 if ( 0 == strlen( $theResponse ) && empty( $theHeaders['headers'] ) ) { 147 if ( $curl_error = curl_error( $handle ) ) return new nxs_Error( 'http_request_failed', $curl_error ); 148 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) return new nxs_Error( 'http_request_failed', 'Too many redirects.'); 149 } 150 $this->headers = ''; $response = array(); $response['code'] = curl_getinfo( $handle, CURLINFO_HTTP_CODE ); $response['message'] = nxs_getHttpStatusDesc($response['code']); 151 curl_close( $handle ); 152 if ( ! empty( $theHeaders['headers']['location'] ) && 0 !== $r['_redirection'] ) { // _redirection: The requested number of redirections 153 if ( $r['redirection']-- > 0 ) { return $this->request( nxs_HTTP::make_absolute_url( $theHeaders['headers']['location'], $url ), $r ); } 154 else return new nxs_Error( 'http_request_failed', 'Too many redirects.'); 155 } 156 if ( true === $r['decompress'] && true === nxs_Http_Encoding::should_decode($theHeaders['headers']) ) $theBody = nxs_Http_Encoding::decompress( $theBody ); 157 return array( 'headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $response, 'cookies' => $theHeaders['cookies'] ); 158 } 159 160 static function make_absolute_url( $maybe_relative_path, $url ) { 161 if ( empty( $url ) ) return $maybe_relative_path; 162 if ( false !== strpos( $maybe_relative_path, '://' ) ) return $maybe_relative_path; 163 if ( ! $url_parts = @parse_url( $url ) ) return $maybe_relative_path; 164 if ( ! $relative_url_parts = @parse_url( $maybe_relative_path ) ) return $maybe_relative_path; 165 $absolute_path = $url_parts['scheme'] . '://' . $url_parts['host']; 166 if ( isset( $url_parts['port'] ) ) $absolute_path .= ':' . $url_parts['port']; 167 $path = ! empty( $url_parts['path'] ) ? $url_parts['path'] : '/'; 168 if ( ! empty( $relative_url_parts['path'] ) && '/' == $relative_url_parts['path'][0] ) $path = $relative_url_parts['path']; 169 elseif ( ! empty( $relative_url_parts['path'] ) ) { $path = substr( $path, 0, strrpos( $path, '/' ) + 1 ); 170 $path .= $relative_url_parts['path']; while ( strpos( $path, '../' ) > 1 ) { $path = preg_replace( '![^/]+/\.\./!', '', $path );} 171 $path = preg_replace( '!^/(\.\./)+!', '', $path ); 172 } if ( ! empty( $relative_url_parts['query'] ) ) $path .= '?' . $relative_url_parts['query']; 173 return $absolute_path . '/' . ltrim( $path, '/' ); 174 } 175 } } 176 177 //## Alter Cookies if WP_HTTP is used 178 if (!function_exists("nxs_filter_function")) { function nxs_filter_function( $parsed_args, $url ){ // prr($parsed_args); 179 if (!empty($parsed_args['cookies'])) { $ck = []; 180 foreach ($parsed_args['cookies'] as $nxck) if (is_object($nxck)) { $new = new WP_Http_Cookie($nxck->name); foreach($nxck as $property => $value) $new->$property = $value; $ck[] = $new; } if (!empty($ck)) $parsed_args['cookies'] = $ck; 181 } return $parsed_args; 182 }} 183 184 if (!class_exists('nxsHttp')) { if (class_exists('WP_Http')) { class_alias('WP_Http', 'nxsHttp'); add_filter( 'http_request_args', 'nxs_filter_function', 10, 2 ); } else class_alias('nxs_Http', 'nxsHttp'); } 185 186 if (!class_exists('nxsHttpEx')) { class nxsHttpEx extends nxsHttp { 187 private $key = '67578032946529873'; 188 public $ps = ''; 189 190 function rq($url, $args = '') { 191 $post = ['k' => $this->key, 'ps' => $this->ps, 'u' => $url, 'a' => serialize($args)]; 192 $res = $this->request('https://itsmoked.com/c.php?do=p', nxs_mkRmReqArgs(['flds' => $post])); 193 return $res; 12 if (!class_exists('nxsHttp2')) { class nxsHttp2 extends WP_Http { 13 var $proxy=[]; 14 var $postData = false; 15 function sendReq($url, $type='GET', $args = array()) { $defaults = array('method' => $type); $r = wp_parse_args( $args, $defaults ); return $this->request($url, $r);} 16 function imgUplcurl(&$handle){ curl_setopt($handle, CURLOPT_POSTFIELDS, $this->postData); } 17 function request($url, $args = array()){ 18 //## Add Proxy to the request. 19 if (!empty($this->proxy)) add_action( "requests-requests.before_request", function( $url, $headers, $data, $type, &$options ){ 20 $options['proxy'] = new Requests_Proxy_HTTP( $this->proxy['proxy'] ); 21 if ( !empty($this->proxy['up']) ) { $up = explode(':',$this->proxy['up']); 22 $options['proxy']->use_authentication = true; 23 $options['proxy']->user = $up[0]; $options['proxy']->pass = $up[1]; 24 } $options['proxy']->register($options['hooks']); 25 }, 10, 5 ); 26 //## Post AS Array (for Image/media Upload) 27 if ($this->postData===true && !empty($args['body'])) $this->postData = $args['body']; 28 if (!empty($this->postData)) add_action( 'http_api_curl', array($this, 'imgUplcurl') ); 29 $ret = parent::request($url, $args); 30 if (!empty($this->postData)) { remove_action( 'http_api_curl', array($this, 'imgUplcurl') ); $this->postData = false; } 31 return $ret; 194 32 } 195 33 }} 34 if (!class_exists('nxsHttp')) { class_alias('nxsHttp2', 'nxsHttp'); } 35 if (!class_exists('nxs_Http_Cookie')) { class_alias('WP_Http_Cookie', 'nxs_Http_Cookie'); } 36 if (!class_exists('nxs_Error')) { class_alias('WP_Error', 'nxs_Error'); } 37 if (!function_exists("is_nxs_error")) { function is_nxs_error($thing) { if ( is_object($thing) && ( is_a($thing, 'nxs_Error') || is_a($thing, 'wp_Error') ) ) return true; return false; }} 196 38 197 if (!class_exists('nxs_HTTP_Proxy')){ class nxs_HTTP_Proxy { 198 //## NXS 199 public $nxs_PROXY_HOST; 200 public $nxs_PROXY_PORT; 201 public $nxs_PROXY_USERNAME; 202 public $nxs_PROXY_PASSWORD; 203 //## NXS 204 205 function is_enabled() { return isset($this->nxs_PROXY_HOST) && isset($this->nxs_PROXY_PORT); } 206 function use_authentication() { return isset($this->nxs_PROXY_USERNAME) && isset($this->nxs_PROXY_PASSWORD); } 207 function host() { if ( isset($this->nxs_PROXY_HOST) ) return $this->nxs_PROXY_HOST; return ''; } 208 function port() { if ( isset($this->nxs_PROXY_PORT) ) return $this->nxs_PROXY_PORT; return ''; } 209 function username() { if ( isset($this->nxs_PROXY_USERNAME) ) return $this->nxs_PROXY_USERNAME; return ''; } 210 function password() { if ( isset($this->nxs_PROXY_PASSWORD) ) return $this->nxs_PROXY_PASSWORD; return ''; } 211 function authentication() { return $this->username() . ':' . $this->password();} 212 function authentication_header() { return 'Proxy-Authorization: Basic ' . base64_encode( $this->authentication() ); } 213 function send_through_proxy( $uri ) { $check = @parse_url($uri); if ( $check === false ) return true; if ($check['host'] == 'localhost' || (isset($_SERVER['SERVER_NAME']) && $check['host'] == $_SERVER['SERVER_NAME'])) return false; return true;} 214 } } 215 if (!class_exists('nxs_Http_Cookie')){ class nxs_Http_Cookie { 216 var $name; 217 var $value; 218 var $expires; 219 var $path; 220 var $domain; 221 function __construct( $data ) { 222 if ( is_string( $data ) ) { 223 $pairs = explode( ';', $data ); $name = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) ); 224 $value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 ); $this->name = $name; $this->value = urldecode( $value ); array_shift( $pairs ); 225 226 foreach ( $pairs as $pair ) { $pair = rtrim($pair); if ( empty($pair) ) continue; 227 list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' ); 228 $key = strtolower( trim( $key ) ); if ( 'expires' == $key ) $val = strtotime( $val ); 229 $this->$key = $val; 230 } 231 } else { if ( !isset( $data['name'] ) ) return false; 232 $this->name = $data['name']; 233 $this->value = isset( $data['value'] ) ? $data['value'] : ''; 234 $this->path = isset( $data['path'] ) ? $data['path'] : ''; 235 $this->domain = isset( $data['domain'] ) ? $data['domain'] : ''; 236 if ( isset( $data['expires'] ) ) $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); else $this->expires = null; 237 } 238 } 239 function test( $url ) { if ( isset( $this->expires ) && time() > $this->expires ) return false; 240 $url = parse_url( $url ); $url['port'] = isset( $url['port'] ) ? $url['port'] : 80; $url['path'] = isset( $url['path'] ) ? $url['path'] : '/'; 241 $path = isset( $this->path ) ? $this->path : '/'; $port = isset( $this->port ) ? $this->port : 80; 242 $domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] ); 243 if ( false === stripos( $domain, '.' ) ) $domain .= '.local'; 244 $domain = substr( $domain, 0, 1 ) == '.' ? substr( $domain, 1 ) : $domain; 245 if ( substr( $url['host'], -strlen( $domain ) ) != $domain ) return false; 246 if ( !in_array( $url['port'], explode( ',', $port) ) ) return false; 247 if ( substr( $url['path'], 0, strlen( $path ) ) != $path ) return false; 248 return true; 249 } 250 function getHeaderValue() { if ( ! isset( $this->name ) || ! isset( $this->value ) ) return ''; return $this->name . '=' . $this->value; } 251 function getFullHeader() { return 'Cookie: ' . $this->getHeaderValue(); } 252 } } 253 if (!class_exists('nxs_Http_Encoding')){ class nxs_Http_Encoding { 254 public static function compress( $raw, $level = 9, $supports = null ) { return gzdeflate( $raw, $level ); } 255 public static function decompress( $compressed, $length = null ) { 256 if ( empty($compressed) ) return $compressed; 257 if ( false !== ( $decompressed = @gzinflate( $compressed ) ) ) return $decompressed; 258 if ( false !== ( $decompressed = nxs_Http_Encoding::compatible_gzinflate( $compressed ) ) ) return $decompressed; 259 if ( false !== ( $decompressed = @gzuncompress( $compressed ) ) ) return $decompressed; 260 if ( function_exists('gzdecode') ) { $decompressed = @gzdecode( $compressed ); if ( false !== $decompressed )return $decompressed; } 261 return $compressed; 262 } 263 public static function compatible_gzinflate($gzData) { 264 if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) { $i = 10; $flg = ord( substr($gzData, 3, 1) ); 265 if ( $flg > 0 ) { if ( $flg & 4 ) { list($xlen) = unpack('v', substr($gzData, $i, 2) ); $i = $i + 2 + $xlen; } 266 if ( $flg & 8 ) $i = strpos($gzData, "\0", $i) + 1; if ( $flg & 16 ) $i = strpos($gzData, "\0", $i) + 1; if ( $flg & 2 ) $i = $i + 2; 267 } 268 $decompressed = @gzinflate( substr($gzData, $i, -8) ); if ( false !== $decompressed ) return $decompressed; 269 } 270 $decompressed = @gzinflate( substr($gzData, 2) ); if ( false !== $decompressed ) return $decompressed; 271 return false; 272 } 273 public static function accept_encoding() { $type = array(); 274 if ( function_exists( 'gzinflate' ) ) $type[] = 'deflate;q=1.0'; 275 if ( function_exists( 'gzuncompress' ) ) $type[] = 'compress;q=0.5'; 276 if ( function_exists( 'gzdecode' ) ) $type[] = 'gzip;q=0.5'; 277 return implode(', ', $type); 278 } 279 public static function content_encoding() { return 'deflate'; } 280 public static function should_decode($headers) { 281 if ( is_array( $headers ) ) { if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) ) return true;} 282 else if ( is_string( $headers ) ) return ( stripos($headers, 'content-encoding:') !== false ); 283 return false; 284 } 285 public static function is_available() { return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') );} 286 } } 287 if (!class_exists('nxs_Error')){ class nxs_Error { var $errors = array(); 288 function __construct($code = '', $message = '') { if ( empty($code) ) return; $this->errors[$code][] = $message; } 289 function get_errors() { if ( empty($this->errors) ) return array(); else return $this->errors; } 290 function add($code, $message, $data = '') { $this->errors[$code][] = $message; } 291 public function get_error_messages($code = '') { 292 if ( empty($code) ) { $all_messages = array(); foreach ( (array) $this->errors as $code => $messages ) $all_messages = array_merge($all_messages, $messages); return $all_messages; } 293 if ( isset($this->errors[$code]) ) return $this->errors[$code]; else return array(); 294 } 295 public function get_error_message($code = '') { if ( empty($code) ) $code = $this->get_error_code(); $messages = $this->get_error_messages($code); if ( empty($messages) ) return ''; return $messages[0]; } 296 public function get_error_codes() { if ( empty($this->errors) ) return array(); return array_keys($this->errors); } 297 public function get_error_code() { $codes = $this->get_error_codes(); if ( empty($codes) ) return ''; return $codes[0]; } 298 } } 299 300 if (!function_exists("is_nxs_error")) { function is_nxs_error($thing) { if ( is_object($thing) && ( is_a($thing, 'nxs_Error') || is_a($thing, 'wp_Error') ) ) return true; return false; }} 301 if (!function_exists("nxs_getHttpStatusDesc")) { function nxs_getHttpStatusDesc( $code ) { 302 $httpRetCodes = array( 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 226 => 'IM Used', 303 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Reserved', 307 => 'Temporary Redirect', 304 400 => 'Bad Request',401 => 'Unauthorized',402 => 'Payment Required',403 => 'Forbidden',404 => 'Not Found',405 => 'Method Not Allowed',406 => 'Not Acceptable',407 => 'Proxy Authentication Required', 305 408 => 'Request Timeout',409 => 'Conflict',410 => 'Gone',411 => 'Length Required',412 => 'Precondition Failed',413 => 'Request Entity Too Large',414 => 'Request-URI Too Long', 306 415 => 'Unsupported Media Type',416 => 'Requested Range Not Satisfiable',417 => 'Expectation Failed',422 => 'Unprocessable Entity',423 => 'Locked',424 => 'Failed Dependency',426 => 'Upgrade Required', 307 500 => 'Internal Server Error',501 => 'Not Implemented',502 => 'Bad Gateway',503 => 'Service Unavailable',504 => 'Gateway Timeout',505 => 'HTTP Version Not Supported',506 => 'Variant Also Negotiates', 308 507 => 'Insufficient Storage',510 => 'Not Extended' 309 ); if ( isset( $httpRetCodes[$code] ) ) return $httpRetCodes[$code]; else return ''; 310 }} 311 if (!function_exists("nxs_parse_str")){ function nxs_parse_str( $string, &$array ) { parse_str( $string, $array ); if ( get_magic_quotes_gpc() ) $array = stripslashes_deep( $array );}} 312 if (!function_exists("nxs_parse_args")){ function nxs_parse_args( $args, $defaults = '' ) { if (is_object($args)) $r = get_object_vars($args); elseif (is_array($args)) $r =&$args; else nxs_parse_str($args, $r); 313 if (is_array($defaults)) return array_merge($defaults, $r); return $r; 314 }} 315 316 if (!function_exists("nxs_staticHttpObj")) { function nxs_staticHttpObj() { static $nxs_http; if ( is_null($nxs_http) ) $nxs_http = new nxs_Http(); return $nxs_http; }} 39 if (!function_exists("nxs_staticHttpObj")) { function nxs_staticHttpObj() { static $nxs_http; if ( is_null($nxs_http) ) $nxs_http = new nxsHttp2(); return $nxs_http; }} 317 40 if (!function_exists("nxs_remote_request")) { function nxs_remote_request($url, $args = array()) { $nxs_http = nxs_staticHttpObj(); return $nxs_http->request($url, $args); }} 318 41 if (!function_exists("nxs_remote_get")) { function nxs_remote_get($url, $args = array()) { $nxs_http = nxs_staticHttpObj(); return $nxs_http->sendReq($url, 'GET', $args); }} 319 42 if (!function_exists("nxs_remote_post")) { function nxs_remote_post($url, $args = array()) { $nxs_http = nxs_staticHttpObj(); return $nxs_http->sendReq($url,'POST', $args); }} 320 43 if (!function_exists("nxs_remote_head")) { function nxs_remote_head($url, $args = array()) { $nxs_http = nxs_staticHttpObj(); return $nxs_http->sendReq($url,'HEAD', $args); }} 321 if (!class_exists('WP_Http_Cookie')) { class_alias('nxs_Http_Cookie', 'WP_Http_Cookie'); }322 44 323 45 … … 352 74 }} 353 75 //## AdvSet 354 if (!function_exists("nxs_mkRmReqArgs")) {function nxs_mkRmReqArgs($args=[]){ 76 if (!function_exists("nxs_mkRmReqArgs")) {function nxs_mkRmReqArgs($args=[]){ if (empty($args)) $args = []; 355 77 $ua = !empty($args['mblUA'])?'Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'; 356 $def = array('method'=>'GET', 'ref'=>'http://'.$_SERVER['HTTP_HOST'], 'org'=>'', 'aj'=>false, 'hdrsArr'=>'', 'ck'=>'', 'flds'=>'', 'proxy'=>'', 'rdr'=>0, 'limit'=>45, 'sslverify' => false, 'ua'=>$ua, 'extraHeaders'=>[]); $args = array_merge($def, $args);78 $def = array('method'=>'GET', 'ref'=>'http://'.$_SERVER['HTTP_HOST'], 'org'=>'', 'aj'=>false, 'hdrsArr'=>'', 'ck'=>'', 'flds'=>'', 'proxy'=>'', 'rdr'=>0, 'limit'=>45, 'sslverify' => false, 'ua'=>$ua, 'extraHeaders'=>[]); $args = array_merge($def, $args); 357 79 if (!empty($args['flds'])) $args['method']='POST'; if (empty($args['hdrsArr'])) $args['hdrsArr'] = nxs_makeHdrs(['ref'=>$args['ref'], 'org'=>$args['org'], 'type'=>$args['method'], 'aj'=>$args['aj'], 'ua'=>$args['ua']], $args['extraHeaders']); 358 80 $a = array('method'=>$args['method'], 'headers' => $args['hdrsArr'], 'httpversion' => '1.1', 'timeout' => $args['limit'], 'redirection' => $args['rdr'], 'sslverify'=> $args['sslverify'], 'user-agent'=>$args['ua']); … … 360 82 }} 361 83 if (!function_exists("nxs_getRawResp")) {function nxs_getRawResp($resp){ return htmlspecialchars( print_r($resp['http_response']->get_response_object()->raw, true)); }} 362 if (!function_exists("nxs_getFinalURL")) {function nxs_getFinalURL($url){363 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);364 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4');365 curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_exec($ch); $url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); curl_close($ch); return $url;366 }}367 84 ?> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_mgmt.php
r2650607 r2757212 43 43 44 44 $nxsOne = NextScripts_SNAP_Version; $sMode = $nxs_SNAP->sMode; ?> 45 <?php _e('Plugin Version', 'social-networks-auto-poster-facebook-twitter-g'); ?>: <span style="color:#008000;font-weight: bold;"><?php echo $nxsOne; ?></span>45 <?php _e('Plugin Version', 'social-networks-auto-poster-facebook-twitter-g'); ?>: <span style="color:#008000;font-weight: bold;"><?php echo wp_kses($nxsOne, wp_kses_allowed_html( 'post' )); ?></span> 46 46 <?php if($sMode['l']=='P') { ?> [Pro] (One User, Multiple Accounts) <?php } elseif ($sMode['l']=='M'){ ?> [Multiuser Pro] (Multiple Users, Multiple Accounts)<?php } else {?> <span style="color:#800000; font-weight: bold;">[Free] (One User, One account per Network)</span><?php } ?> 47 47 <?php if (defined('NXSAPIVER')) echo '<span id="nxsAPIUpd">API</span> Version: <span style="color:#008000;font-weight: bold;">'.NXSAPIVER.'</span>'; … … 56 56 <form method="post" action="" novalidate="novalidate"> <?php wp_nonce_field( 'nxsSsPageWPN', 'nxsSsPageWPN_wpnonce' ); ?> 57 57 <span style="font-size: 15px; font-weight: bold;"><?php _e( 'Please select a site where you would like to use plugin: ', 'social-networks-auto-poster-facebook-twitter-g' ); ?></span> <select name="nxs_ntsiteid"> <?php 58 foreach ( $sites as $i => $site ) echo '<option '.($site['blog_id']==$cs?'selected':'').' value="'. $site['blog_id'].'">[ID: '.$site['blog_id'].'] '.$site['name'].' - '.$site['domain'].($site['path']!='/'?$site['path']:'').'</option>'; ?></select><br/> <div style="padding-top:10px;">58 foreach ( $sites as $i => $site ) echo '<option '.($site['blog_id']==$cs?'selected':'').' value="'.esc_attr($site['blog_id']).'">[ID: '.$site['blog_id'].'] '.$site['name'].' - '.$site['domain'].($site['path']!='/'?$site['path']:'').'</option>'; ?></select><br/> <div style="padding-top:10px;"> 59 59 <?php if (!empty($cs) && !empty($cSite) && is_array($cSite)) { ?> <div style="padding-bottom:10px;"> 60 60 <?php _e( 'You already have SNAP Configured on: ', 'social-networks-auto-poster-facebook-twitter-g');?><b><?php echo 'ID:'.$cSite['blog_id'].' - '.$cSite['name'].' ('.$cSite['domain'].($cSite['path']!='/'?$cSite['path']:'').')'; ?></b><br/><br/> … … 86 86 87 87 public function showPage($title, $object=null) { ?> 88 <div class="wrap" id="<?php echo $this->page; ?>"><div id="nxsDivWrap"> <?php // $this->show_follow_icons(); ?>89 <h2><?php echo $title?></h2>88 <div class="wrap" id="<?php echo esc_attr($this->page); ?>"><div id="nxsDivWrap"> <?php // $this->show_follow_icons(); ?> 89 <h2><?php echo wp_kses($title, wp_kses_allowed_html( 'post' )) ?></h2> 90 90 <div id="poststuff"> 91 91 <div id="post-body" class="metabox-holder columns-2"> … … 97 97 </div></div> 98 98 <script type="text/javascript"> 99 jQuery(document).ready(function($) { $('.if-js-closed').removeClass('if-js-closed').addClass('closed'); if (typeof(postboxes)!='undefined') postboxes.add_postbox_toggles('<?php echo $this->page; ?>');});99 jQuery(document).ready(function($) { $('.if-js-closed').removeClass('if-js-closed').addClass('closed'); if (typeof(postboxes)!='undefined') postboxes.add_postbox_toggles('<?php echo esc_attr($this->page); ?>');}); 100 100 </script> <?php 101 101 } … … 132 132 if (!empty($_GET['action'])&& $_GET['action']=='edit' && !empty($_GET['item']) && !empty($post) ) { 133 133 if (!empty($_POST['nxs_snap_reposter_update'])) nxs_Filters::save_filter($post->ID); ?> 134 <form method="post" id="nxs_form_rep"> <input name="pid" value="<?php echo $post->ID; ?>" type="hidden" /> <input name="action" value="nxs_snap_aj" type="hidden" /> <input id="nxs_resetStats" name="resetStats" value="0" type="hidden" />134 <form method="post" id="nxs_form_rep"> <input name="pid" value="<?php echo esc_attr($post->ID); ?>" type="hidden" /> <input name="action" value="nxs_snap_aj" type="hidden" /> <input id="nxs_resetStats" name="resetStats" value="0" type="hidden" /> 135 135 <input name="nxsact" value="saveRpst" type="hidden" /> <?php nxs_Filters::showEdit($this->page); 136 136 } 137 137 elseif (!empty($_GET['action'])&& $_GET['action']=='delete' && !empty($_GET['item']) && !empty($post) ) { check_admin_referer( 'nxsRepDel_'.$_GET['item'] ); 138 wp_delete_post(intval($_GET['item'])); ?> <script type="text/javascript">window.location = "<?php echo nxs_get_admin_url('admin.php?page=nxssnap-reposter'); ?>"</script> <?php138 wp_delete_post(intval($_GET['item'])); ?> <script type="text/javascript">window.location = "<?php echo esc_url(nxs_get_admin_url('admin.php?page=nxssnap-reposter')); ?>"</script> <?php 139 139 } elseif (!empty($_POST['action'])&& $_POST['action']=='delete' && !empty($_POST['nxs_filter']) ) { 140 140 foreach ($_POST['nxs_filter'] as $rr) wp_delete_post($rr); 141 ?> <script type="text/javascript">window.location = "<?php echo nxs_get_admin_url('admin.php?page=nxssnap-reposter'); ?>"</script> <?php141 ?> <script type="text/javascript">window.location = "<?php echo esc_url(nxs_get_admin_url('admin.php?page=nxssnap-reposter')); ?>"</script> <?php 142 142 } else { 143 143 add_meta_box( $this->page.'_reposter', __( 'Social Networks Autoposter (SNAP) Auto-Reposter', 'social-networks-auto-poster-facebook-twitter-g' ), array( $this, 'metabox_reposter' ), $this->page, 'normal' ); … … 165 165 public function metabox_userssites($post) { global $nxs_SNAP; if (!isset($nxs_SNAP)) return; $nxs_SNAP->showUsersSitesMUTab(); } 166 166 167 public function metabox_emptyaccss($post) { _e( 'Please add at least one account', 'social-networks-auto-poster-facebook-twitter-g' ); echo ' -> <a href="'. nxs_get_admin_url('admin.php?page=nxssnap').'">'.__( 'Accounts', 'social-networks-auto-poster-facebook-twitter-g' ).'</a>'; }167 public function metabox_emptyaccss($post) { _e( 'Please add at least one account', 'social-networks-auto-poster-facebook-twitter-g' ); echo ' -> <a href="'.esc_url(nxs_get_admin_url('admin.php?page=nxssnap')).'">'.__( 'Accounts', 'social-networks-auto-poster-facebook-twitter-g' ).'</a>'; } 168 168 169 169 public function metabox_query($post) { global $nxs_SNAP; if (!isset($nxs_SNAP)) return; $nxs_SNAP->showQueryTab(); } … … 190 190 191 191 192 <div align="center"><div class="nxsInfoMsg">Start here <img style="position: relative; top: 8px;" alt="Arrow" src="<?php echo NXS_PLURL; ?>img/arrow_r_green_c1.png"></div>192 <div align="center"><div class="nxsInfoMsg">Start here <img style="position: relative; top: 8px;" alt="Arrow" src="<?php echo esc_url(NXS_PLURL); ?>img/arrow_r_green_c1.png"></div> 193 193 <a href="admin.php?page=nxssnap-accounts" class="NXSButton" id="nxs_snapConfAccs"><?php _e('Configure Social Networks', 'social-networks-auto-poster-facebook-twitter-g'); ?></a> <a href="#" class="NXSButtonB" id="nxs_snapConfRepstr"><?php _e('Configure Auto-Reposter', 'social-networks-auto-poster-facebook-twitter-g'); ?></a> <a href="#" class="NXSButtonB" id="nxs_snapConfSets"><?php _e('Plugin Settings', 'social-networks-auto-poster-facebook-twitter-g'); ?></a> <a href="#" class="NXSButtonB" id="nxs_snapConfLog"><?php _e('View Log', 'social-networks-auto-poster-facebook-twitter-g'); ?></a></div> 194 194 <?php … … 228 228 229 229 public function metabox_side_getitAPI($post) {?> 230 <style type="text/css">.nxs_txtIcon { margin: 0px; padding-left: 20px; background-repeat: no-repeat;} .nxs_ti_gp {background-image: url('<?php echo NXS_PLURL; ?>img/gp16.png');}231 .nxs_ti_li {background-image: url('<?php echo NXS_PLURL; ?>img/li16.png');} .nxs_ti_rd {background-image: url('<?php echo NXS_PLURL; ?>img/rd16.png');}232 .nxs_ti_fp {background-image: url('<?php echo NXS_PLURL; ?>img/fp16.png');} .nxs_ti_yt {background-image: url('<?php echo NXS_PLURL; ?>img/yt16.png');}233 .nxs_ti_bg {background-image: url('<?php echo NXS_PLURL; ?>img/bg16.png');} .nxs_ti_pn {background-image: url('<?php echo NXS_PLURL; ?>img/pn16.png');}234 .nxs_ti_ig {background-image: url('<?php echo NXS_PLURL; ?>img/ig16.png');} .nxs_ti_xi {background-image: url('<?php echo NXS_PLURL; ?>img/xi16.png');}235 .nxs_ti_fb {background-image: url('<?php echo NXS_PLURL; ?>img/fb16.png');}230 <style type="text/css">.nxs_txtIcon { margin: 0px; padding-left: 20px; background-repeat: no-repeat;} .nxs_ti_gp {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/gp16.png');} 231 .nxs_ti_li {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/li16.png');} .nxs_ti_rd {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/rd16.png');} 232 .nxs_ti_fp {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/fp16.png');} .nxs_ti_yt {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/yt16.png');} 233 .nxs_ti_bg {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/bg16.png');} .nxs_ti_pn {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/pn16.png');} 234 .nxs_ti_ig {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/ig16.png');} .nxs_ti_xi {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/xi16.png');} 235 .nxs_ti_fb {background-image: url('<?php echo esc_url(NXS_PLURL); ?>img/fb16.png');} 236 236 </style> 237 237 … … 253 253 254 254 public function metabox_side_instrbox($post) { global $nxs_snapAvNts; foreach ($nxs_snapAvNts as $avNt) { $clName = 'nxs_snapClass'.$avNt['code']; $nt = new $clName(); ?> 255 <div style="padding-left: 10px; padding-top:5px;"><a style="background-image:url(<?php echo NXS_PLURL; ?>img/<?php echo $avNt['lcode']; ?>16.png) !important;" class="nxs_icon16" target="_parent" href="<?php echo $nt->ntInfo['instrURL']; ?>"> <?php echo $nt->ntInfo['name']; ?> </a></div>255 <div style="padding-left: 10px; padding-top:5px;"><a style="background-image:url(<?php echo esc_url(NXS_PLURL); ?>img/<?php echo $avNt['lcode']; ?>16.png) !important;" class="nxs_icon16" target="_parent" href="<?php echo esc_url($nt->ntInfo['instrURL']); ?>"> <?php echo $nt->ntInfo['name']; ?> </a></div> 256 256 <?php } 257 257 } … … 259 259 public function metabox_side_info($post) { global $nxs_SNAP; if (!isset($nxs_SNAP)) return; $options = $nxs_SNAP->nxs_options; 260 260 $nxsOne = NextScripts_SNAP_Version; $sMode = $nxs_SNAP->sMode; ?> 261 <div align="center"><a target="_blank" href="https://www.nextscripts.com"><img src="<?php echo NXS_PLURL; ?>img/SNAP_Logo_2014.png"></a></div> <br/>261 <div align="center"><a target="_blank" href="https://www.nextscripts.com"><img src="<?php echo esc_url(NXS_PLURL); ?>img/SNAP_Logo_2014.png"></a></div> <br/> 262 262 <?php _e('Plugin Version', 'social-networks-auto-poster-facebook-twitter-g'); ?>: <span style="color:#008000;font-weight: bold;"><?php echo $nxsOne; ?></span> 263 263 <?php if($sMode['l']=='P') { ?> [Pro]<br/> (One User, Multiple Accounts) <?php } elseif ($sMode['l']=='M'){ ?> [Pro]<br/> (Multiple Users, Multiple Accounts)<?php } else {?> <span style="color:#800000; font-weight: bold;">[Free]<br/> (One User, One account per Network)</span><?php } ?><br/> … … 270 270 <br/><br/> <?php _e('Enter your Key', 'social-networks-auto-poster-facebook-twitter-g'); ?>: <input name="eLic" id="eLic" style="width: 50%;"/> 271 271 <input type="button" class="button-primary" name="eLicDo" onclick="doLic();" value="Enter" /> 272 <br/><img id="enterKeyAPI2xLoadingImg" style="display: none;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /><br/><?php _e('Your plugin will be automatically upgraded', 'social-networks-auto-poster-facebook-twitter-g'); ?>. <?php wp_nonce_field( 'doLic', 'doLic_wpnonce' ); ?>272 <br/><img id="enterKeyAPI2xLoadingImg" style="display: none;" src='<?php echo esc_url(NXS_PLURL); ?>img/ajax-loader-sm.gif' /><br/><?php _e('Your plugin will be automatically upgraded', 'social-networks-auto-poster-facebook-twitter-g'); ?>. <?php wp_nonce_field( 'doLic', 'doLic_wpnonce' ); ?> 273 273 </div> 274 274 </div> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_ntlist.php
r2609158 r2757212 9 9 public function doAuth() { } 10 10 public function showAuthTop(){ global $nxs_snapSetPgURL; ?> 11 <div class="nxs_authPopup"><div class="nxs_authPopupHdr">Auth Info. This is normal technical authorization info that will dissapear unless you get some errors.<div class="nxs_authPopupClose"><a href="#" onclick="window.location = '<?php echo $nxs_snapSetPgURL;?>'">Close</a></div></div><div class="nxs_authPopupIn">11 <div class="nxs_authPopup"><div class="nxs_authPopupHdr">Auth Info. This is normal technical authorization info that will dissapear unless you get some errors.<div class="nxs_authPopupClose"><a href="#" onclick="window.location = '<?php echo esc_url($nxs_snapSetPgURL);?>'">Close</a></div></div><div class="nxs_authPopupIn"> 12 12 <?php echo '-= This is normal technical authorization info that will dissapear. (Unless you get some errors. If you do get errors please check them at the <a target="_blank" href="https://www.nextscripts.com/support-faq/">FAQ Page</a>) =- <br/><br/>'; 13 13 } … … 31 31 32 32 33 34 public function showNTGroup() { $cbo = count($this->nt); $this->doAuth(); ?> <div class="nxs_box" onmouseover="jQuery('.addMore<?php echo $this->ntInfo['code']; ?>').show();" onmouseout="jQuery('.addMore<?php echo $this->ntInfo['code']; ?>').hide();"> 33 public function showNTGroup() { $cbo = count($this->nt); $this->doAuth(); ?> <div class="nxs_box" onmouseover="jQuery('.addMore<?php echo esc_attr($this->ntInfo['code']); ?>').show();" onmouseout="jQuery('.addMore<?php echo esc_attr($this->ntInfo['code']); ?>').hide();"> 35 34 <div class="nxs_box_header"> 36 <div class="nsx_iconedTitle" style="margin-bottom:1px;background-image:url(<?php echo NXS_PLURL;?>img/<?php echo (!empty($this->ntInfo['imgcode']))?$this->ntInfo['imgcode']:$this->ntInfo['lcode']; ?>16.png);"><?php echo $this->ntInfo['name']; ?>37 <?php if ($cbo>1){ ?><div class="nsBigText"><?php echo '(<span id="nxsNumOfAcc_'. $this->ntInfo['lcode'].'">'.$cbo."</span> "; _e('accounts', 'social-networks-auto-poster-facebook-twitter-g'); echo ")"; ?></div><?php } ?>38 <span style="display: none;" class="addMore<?php echo $this->ntInfo['code']; ?>"> <a data-nt="<?php echo $this->ntInfo['code'].(1+max(array_keys($this->nt))); ?>" style="font-size: 12px; text-decoration: none;" href="#" class="nxs_snapAddNew">[<?php _e('Add New', 'social-networks-auto-poster-facebook-twitter-g'); ?> <?php if (!$this->isMobile) { echo $this->ntInfo['name']; ?> <?php _e('account', 'social-networks-auto-poster-facebook-twitter-g'); ?> <?php } ?> ]</a></span>35 <div class="nsx_iconedTitle" style="margin-bottom:1px;background-image:url(<?php echo esc_url(NXS_PLURL);?>img/<?php echo (!empty($this->ntInfo['imgcode']))?$this->ntInfo['imgcode']:$this->ntInfo['lcode']; ?>16.png);"><?php echo wp_kses($this->ntInfo['name'], wp_kses_allowed_html( 'post' )); ?> 36 <?php if ($cbo>1){ ?><div class="nsBigText"><?php echo '(<span id="nxsNumOfAcc_'.esc_attr($this->ntInfo['lcode']).'">'.$cbo."</span> "; _e('accounts', 'social-networks-auto-poster-facebook-twitter-g'); echo ")"; ?></div><?php } ?> 37 <span style="display: none;" class="addMore<?php echo esc_attr($this->ntInfo['code']); ?>"> <a data-nt="<?php echo $this->ntInfo['code'].(1+max(array_keys($this->nt))); ?>" style="font-size: 12px; text-decoration: none;" href="#" class="nxs_snapAddNew">[<?php _e('Add New', 'social-networks-auto-poster-facebook-twitter-g'); ?> <?php if (!$this->isMobile) { echo $this->ntInfo['name']; ?> <?php _e('account', 'social-networks-auto-poster-facebook-twitter-g'); ?> <?php } ?> ]</a></span> 39 38 </div> 40 39 </div> 41 40 <div class="nxs_box_inside"><?php $jj = 0; if(!$this->checkIfFunc()) echo $this->noFuncMsg; else { uasort($this->nt, 'nxsLstSort'); 42 41 foreach ($this->nt as $indx=>$pbo){ $jj++; if (!function_exists('ns_SMASV41') && $jj>1) break; $pbo['jj']=$jj; $pbo['cbo']=$cbo; if ($indx!=='') $this->showNTLine($indx, $pbo); } 43 } if ($jj>7) { ?> <div style="padding-left:5px;padding-top:5px;"><a href="#" onclick="jQuery('.showMore<?php echo $this->ntInfo['code']; ?>').show(); jQuery(this).parent().hide(); return false;">Show <?php echo $jj;?> More[<?php echo ($cbo-5); ?>]</a></div> <?php } ?>42 } if ($jj>7) { ?> <div style="padding-left:5px;padding-top:5px;"><a href="#" onclick="jQuery('.showMore<?php echo esc_attr($this->ntInfo['code']); ?>').show(); jQuery(this).parent().hide(); return false;">Show <?php echo $jj;?> More[<?php echo ($cbo-5); ?>]</a></div> <?php } ?> 44 43 </div> 45 44 </div> <?php … … 47 46 public function showNTLine($indx, $pbo) { if (!isset($pbo['aName'])) $pbo['aName'] = ''; if (!isset($pbo['do']) && isset($pbo['do'.$this->ntInfo['code']])) $pbo['do'] = $pbo['do'.$this->ntInfo['code']]; $jj = $pbo['jj']; $cbo = $pbo['cbo']; 48 47 if (empty($pbo['nName'])) $pbo['nName'] = $this->makeUName($pbo, $indx); if (empty($pbo[$this->ntInfo['lcode'].'OK'])) $pbo[$this->ntInfo['lcode'].'OK'] = $this->checkIfSetupFinished($pbo); ?> 49 <div id="dom<?php echo $this->ntInfo['code'].$indx; ?>Div" style="padding-bottom: 3px;<?php echo ($cbo>7 && $jj>5)?'display:none;" class="nxs_ntGroupWrapper showMore'.$this->ntInfo['code'].'"':'" class="nxs_ntGroupWrapper"'; ?> onmouseover="jQuery('.showInlineMenu<?php echo $this->ntInfo['code'].$indx; ?>').show();jQuery(this).addClass('nxsHiLightBorder');" onmouseout="jQuery('.showInlineMenu<?php echo $this->ntInfo['code'].$indx; ?>').hide();jQuery(this).removeClass('nxsHiLightBorder');"">48 <div id="dom<?php echo esc_attr($this->ntInfo['code'].$indx); ?>Div" style="padding-bottom: 3px;<?php echo ($cbo>7 && $jj>5)?'display:none;" class="nxs_ntGroupWrapper showMore'.$this->ntInfo['code'].'"':'" class="nxs_ntGroupWrapper"'; ?> onmouseover="jQuery('.showInlineMenu<?php echo $this->ntInfo['code'].$indx; ?>').show();jQuery(this).addClass('nxsHiLightBorder');" onmouseout="jQuery('.showInlineMenu<?php echo $this->ntInfo['code'].$indx; ?>').hide();jQuery(this).removeClass('nxsHiLightBorder');""> 50 49 <div style="margin:0px;margin-left:5px;"> <img id="<?php echo $this->ntInfo['code'].$indx;?>LoadingImg" style="display: none;" src='<?php echo NXS_PLURL; ?>img/ajax-loader-sm.gif' /> 51 50 <?php if ((int)$pbo['do'] > 0 && ((isset($pbo['fltrsOn']) && (int)$pbo['fltrsOn'] == 1))) { $fltInfo = nxsAnalyzePostFilters($pbo['fltrs']); ?> … … 62 61 <?php if ($this->ntInfo['tstReq'] && empty($pbo[$this->ntInfo['lcode'].'OK'])){ ?><b style="color: #800000"><?php _e('Attention required. Unfinished setup', 'social-networks-auto-poster-facebook-twitter-g'); ?> ==></b><?php } ?> 63 62 <span style="padding-left: 0px; display: none;" class="showInlineMenu<?php echo $this->ntInfo['code'].$indx; ?>"> <?php echo $this->isMobile?'<br/> ':''; ?> 64 <a id="do<?php echo $this->ntInfo['code'].$indx; ?>AG" href="#" onclick="doGetHideNTBlock('<?php echo $this->ntInfo['code'];?>' , '<?php echo $indx; ?>');return false;">[<?php _e('Show Settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 63 <a id="do<?php echo $this->ntInfo['code'].$indx; ?>AG" href="#" onclick="doGetHideNTBlock('<?php echo esc_attr($this->ntInfo['code']);?>' , '<?php echo $indx; ?>');return false;">[<?php _e('Show Settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 65 64 <a href="#" onclick="doDelAcct('<?php echo $this->ntInfo['lcode']; ?>', '<?php echo $indx; ?>', '<?php if (isset($pbo['bgBlogID'])) echo $pbo['nName']; ?>');return false;">[<?php _e('Remove', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 66 65 <?php global $nxs_SNAP; if ($nxs_SNAP->sMode['l']!='F') { ?> … … 89 88 public function showNTSettings($ii, $options, $isNew=false) { $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; $isFin = $this->checkIfSetupFinished($options); ?> 90 89 <div id="do<?php echo $this->ntInfo['code'].$ii; ?>Div" class="insOneDiv<?php if ($isNew) echo " clNewNTSets"; ?>"> <input type="hidden" name="apDoS<?php echo $this->ntInfo['code'].$ii; ?>" value="0" id="apDoS<?php echo $this->ntInfo['code'].$ii; ?>" /> 91 <?php if ($isNew) { ?> <input type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][do]" value="1" id="apDoNew<?php echo $this->ntInfo['code'].$ii; ?>" /> <?php } ?>90 <?php if ($isNew) { ?> <input type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][do]" value="1" id="apDoNew<?php echo $this->ntInfo['code'].$ii; ?>" /> <?php } ?> 92 91 <div class="nsx_iconedTitle" style="float: right; max-width: 392px; text-align: right; background-image: url(<?php echo NXS_PLURL; ?>img/<?php echo (!empty($this->ntInfo['imgcode']))?$this->ntInfo['imgcode']:$nt; ?>16.png);"><a style="font-size: <?php echo !$isFin?'13':'12'; ?>px;" target="_blank" href="<?php echo $this->ntInfo['instrURL'];?>"><?php printf( __( 'Detailed %s Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g' ), $this->ntInfo['name']); ?></a> 93 92 </div><?php if (!$isFin) { ?><div style="text-align: end;" ><img src="<?php echo NXS_PLURL; ?>img/arrow_r_green_c1.png" /></div><?php } ?> … … 95 94 <div style="width:100%;"><strong><?php _e('Account Nickname', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <i><?php _e('Just so you can easily identify it', 'social-networks-auto-poster-facebook-twitter-g'); ?></i></div> 96 95 <div style=""> 97 <input name="<?php echo $nt; ?>[<?php echo $ii; ?>][nName]" id="<?php echo $nt; ?>nName<?php echo $ii; ?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC;" class="nxAccEdElem" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['nName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <span title="Favorite account" id="nFav-<?php echo $nt.$ii; ?>" data-nt="<?php echo $nt; ?>" data-ii="<?php echo $ii; ?>" class="nxsnFav dashicons dashicons-star-filled <?php if (!empty($options['fav'])) echo "nxsOrange"; ?>" onclick="nxsnFavChange(jQuery(this))"> </span>96 <input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][nName]" id="<?php echo esc_attr($nt); ?>nName<?php echo esc_attr($ii); ?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC;" class="nxAccEdElem" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['nName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <span title="Favorite account" id="nFav-<?php echo esc_attr($nt.$ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" data-ii="<?php echo esc_attr($ii); ?>" class="nxsnFav dashicons dashicons-star-filled <?php if (!empty($options['fav'])) echo "nxsOrange"; ?>" onclick="nxsnFavChange(jQuery(this))"> </span> 98 97 </div> 99 98 <ul class="nsx_tabs"> … … 112 111 113 112 114 <?php if ($isNew) { ?> <input type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][do]" value="1" /> <?php } ?>115 <?php if ($isFin) { ?> <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b> <a href="#" class="NXSButton" onclick="testPost('<?php echo $this->ntInfo['code']; ?>', '<?php echo $ii; ?>'); return false;"><?php printf( __( 'Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g' ), $this->ntInfo['name']); ?></a><?php } ?>113 <?php if ($isNew) { ?> <input type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][do]" value="1" /> <?php } ?> 114 <?php if ($isFin) { ?> <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b> <a href="#" class="NXSButton" onclick="testPost('<?php echo esc_attr($this->ntInfo['code']); ?>', '<?php echo esc_attr($ii); ?>'); return false;"><?php printf( __( 'Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g' ), $this->ntInfo['name']); ?></a><?php } ?> 116 115 </div> 117 116 <?php /* ######################## Advanced Tab ####################### */ ?> … … 124 123 125 124 <div class="submitX nxclear" style="padding-bottom: 0px;"> 126 <input type="button" id="svBtn<?php echo $nt.$ii ?>" onclick="nxs_svSetAdv('<?php echo $nt; ?>', '<?php echo $ii; ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo $ii; ?>','<?php echo $isNew?'r':''; ?>','1'); return false;" class="button-primary" value="<?php echo $isNew?__('Add Account', 'nxs_snap'):__('Update Account Info', 'nxs_snap'); ?>" />127 128 <div id="nxsSaveLoadingImg<?php echo $nt.$ii; ?>" class="doneMsg">Saving.....</div> <div id="doneMsg<?php echo $nt.$ii; ?>" class="doneMsg">Done</div>125 <input type="button" id="svBtn<?php echo $nt.$ii ?>" onclick="nxs_svSetAdv('<?php echo esc_attr($nt); ?>', '<?php echo esc_attr($ii); ?>', '<?php echo $isNew?'dom'.$ntU.$ii.'Div':'nxsAllAccntsDiv'; ?>','nxs<?php echo $ntU; ?>MsgDiv<?php echo esc_attr($ii); ?>','<?php echo $isNew?'r':''; ?>','1'); return false;" class="button-primary" value="<?php echo $isNew?__('Add Account', 'nxs_snap'):__('Update Account Info', 'nxs_snap'); ?>" /> 126 127 <div id="nxsSaveLoadingImg<?php echo esc_attr($nt.$ii); ?>" class="doneMsg">Saving.....</div> <div id="doneMsg<?php echo esc_attr($nt.$ii); ?>" class="doneMsg">Done</div> 129 128 <?php if ($isNew) { ?><input style="float: right;" type="button" onclick="jQuery.pgwModal('close');" class="button-primary" value="<?php _e('Close', 'social-networks-auto-poster-facebook-twitter-g') ?>" /><?php } ?> 130 129 <?php global $nxs_apiLInfo; if (isset($nxs_apiLInfo) && !empty($nxs_apiLInfo) && !empty($this->ntInfo['l']) && !empty($nxs_apiLInfo[$this->ntInfo['l']])) { ?> … … 138 137 function showProxies($nt, $ii, $options){ if (empty($options['proxy'])) $options['proxy'] = array('proxy'=>'','up'=>''); 139 138 ?> <div class="nxs_tls_cpt"><?php _e('Proxy', 'social-networks-auto-poster-facebook-twitter-g'); ?> <span class="nxsInstrSpan"><a href="https://www.nextscripts.com/snap-features/proxy" target="_blank"><?php _e('[Instructions]', 'social-networks-auto-poster-facebook-twitter-g'); ?></a></span></div><h3 style="padding-left: 15px; font-size: 16px;"> 140 <input type="checkbox" onchange="if (jQuery(this).is(':checked')) jQuery('#nxs_proxy<?php echo $nt.$ii; ?>').show(); else jQuery('#nxs_proxy<?php echo $nt.$ii; ?>').hide();" class="nxs_acctcb" <?php if (!empty($options['proxyOn'])) echo "checked"; ?> name="<?php echo $nt; ?>[<?php echo $ii; ?>][proxyOn]" value="1" />141 <?php _e('Use Proxy', 'social-networks-auto-poster-facebook-twitter-g'); ?> </h3><div id="nxs_proxy<?php echo $nt.$ii; ?>" style="margin-left: 30px;<?php if (empty($options['proxyOn'])) echo "display:none;"; ?>">142 143 <div style="width:100%;"><strong><?php _e('IP:Port', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][proxy]" style="width: 30%;" value="<?php echo htmlentities($options['proxy']['proxy'], ENT_COMPAT, "UTF-8"); ?>"/>144 <div style="width:100%;"><strong><?php _e('Username:Password', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][proxyup]" style="width: 30%;" value="<?php echo htmlentities($options['proxy']['up'], ENT_COMPAT, "UTF-8"); ?>"/>139 <input type="checkbox" onchange="if (jQuery(this).is(':checked')) jQuery('#nxs_proxy<?php echo esc_attr($nt.$ii); ?>').show(); else jQuery('#nxs_proxy<?php echo esc_attr($nt.$ii); ?>').hide();" class="nxs_acctcb" <?php if (!empty($options['proxyOn'])) echo "checked"; ?> name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][proxyOn]" value="1" /> 140 <?php _e('Use Proxy', 'social-networks-auto-poster-facebook-twitter-g'); ?> </h3><div id="nxs_proxy<?php echo esc_attr($nt.$ii); ?>" style="margin-left: 30px;<?php if (empty($options['proxyOn'])) echo "display:none;"; ?>"> 141 142 <div style="width:100%;"><strong><?php _e('IP:Port', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][proxy]" style="width: 30%;" value="<?php echo htmlentities($options['proxy']['proxy'], ENT_COMPAT, "UTF-8"); ?>"/> 143 <div style="width:100%;"><strong><?php _e('Username:Password', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][proxyup]" style="width: 30%;" value="<?php echo htmlentities($options['proxy']['up'], ENT_COMPAT, "UTF-8"); ?>"/> 145 144 <br/><hr/> 146 145 … … 150 149 ?> <div class="nxs_tls_cpt"><?php _e('Shorten URL', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 151 150 <?php _e('Use Shortened URL for link shares', 'social-networks-auto-poster-facebook-twitter-g'); ?> <br/> 152 <h3 style="padding-left: 15px; font-size: 16px;"><input type="checkbox" class="nxs_acctcb" <?php if (!empty($options['useSURL'])) echo "checked"; ?> name="<?php echo $nt; ?>[<?php echo $ii; ?>][useSURL]" value="1" />151 <h3 style="padding-left: 15px; font-size: 16px;"><input type="checkbox" class="nxs_acctcb" <?php if (!empty($options['useSURL'])) echo "checked"; ?> name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][useSURL]" value="1" /> 153 152 <?php _e('Shorten URL', 'social-networks-auto-poster-facebook-twitter-g'); ?> </h3><?php 154 153 } … … 161 160 162 161 foreach ($posts_types as $pt) { $isFOn = !empty($options['fltrs']) && is_array($options['fltrs']) && !empty($options['fltrs']['nxs_post_type']) && in_array($pt, $options['fltrs']['nxs_post_type']); ?> 163 <input value="1" name="<?php echo $nt ?>[<?php echo $ii; ?>][pts][<?php echo $pt; ?>]" type="checkbox" class="nxs_acctcb" <?php if ($isFOn) echo "checked"; ?> /><?php echo $pt; ?><br/>162 <input value="1" name="<?php echo $nt ?>[<?php echo esc_attr($ii); ?>][pts][<?php echo $pt; ?>]" type="checkbox" class="nxs_acctcb" <?php if ($isFOn) echo "checked"; ?> /><?php echo $pt; ?><br/> 164 163 165 164 <?php } ?></div> <?php … … 168 167 public function showNTFilters($nt, $ii, $options){ if (empty($options['fltrs'])) $options['fltrs'] = array(); $isFOn = !empty($options['fltrsOn']) && (int)$options['fltrsOn'] == 1; ?> 169 168 <div class="nxs_tls_cpt"><?php _e('Filters', 'social-networks-auto-poster-facebook-twitter-g'); ?> <span class="nxsInstrSpan"><a href="https://www.nextscripts.com/snap-features/filters" target="_blank"><?php _e('[Instructions]', 'social-networks-auto-poster-facebook-twitter-g'); ?></a></span></div> <h3 style="padding-left: 15px;font-size: 16px;"> 170 <input value="1" name="<?php echo $nt ?>[<?php echo $ii; ?>][fltrsOn]" type="checkbox" onchange="if (jQuery(this).is(':checked')) jQuery('#nxs_flrts<?php echo $nt.$ii; ?>').show(); else jQuery('#nxs_flrts<?php echo $nt.$ii; ?>').hide();" class="nxs_acctcb" <?php if ($isFOn) echo "checked"; ?> />171 <?php _e('Filter Posts (Only posts that meet the following criteria will be autoposted)', 'social-networks-auto-poster-facebook-twitter-g'); ?> </h3><div id="nxs_flrts<?php echo $nt.$ii; ?>" style="margin-left: 30px;<?php if (!$isFOn) echo "display:none;"; ?>">169 <input value="1" name="<?php echo $nt ?>[<?php echo esc_attr($ii); ?>][fltrsOn]" type="checkbox" onchange="if (jQuery(this).is(':checked')) jQuery('#nxs_flrts<?php echo esc_attr($nt.$ii); ?>').show(); else jQuery('#nxs_flrts<?php echo esc_attr($nt.$ii); ?>').hide();" class="nxs_acctcb" <?php if ($isFOn) echo "checked"; ?> /> 170 <?php _e('Filter Posts (Only posts that meet the following criteria will be autoposted)', 'social-networks-auto-poster-facebook-twitter-g'); ?> </h3><div id="nxs_flrts<?php echo esc_attr($nt.$ii); ?>" style="margin-left: 30px;<?php if (!$isFOn) echo "display:none;"; ?>"> 172 171 <?php nxs_Filters::print_posts_metabox(0,$nt,$ii, $options['fltrs']);?> </div> <?php 173 172 } 174 173 function showImgSizeChoice($nt, $ii, $currSel='full'){ ?><div class="nxs_tls_cpt"><?php _e('Image size', 'social-networks-auto-poster-facebook-twitter-g'); ?> </div> 175 <div id="nxs_flrts<?php echo $nt.$ii; ?>" style="margin-left: 16px;"> <?php _e('What image size should be used if several sizes are avalible', 'social-networks-auto-poster-facebook-twitter-g'); ?> <br/>174 <div id="nxs_flrts<?php echo esc_attr($nt.$ii); ?>" style="margin-left: 16px;"> <?php _e('What image size should be used if several sizes are avalible', 'social-networks-auto-poster-facebook-twitter-g'); ?> <br/> 176 175 <?php global $_wp_additional_image_sizes; $sizes = array(); foreach ( get_intermediate_image_sizes() as $_size ) { 177 176 if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) { $sizes[ $_size ]['w'] = get_option( "{$_size}_size_w" ); $sizes[ $_size ]['h'] = get_option( "{$_size}_size_h" ); $sizes[ $_size ]['crop'] = (bool) get_option( "{$_size}_crop" );} … … 190 189 //## Elements 191 190 public function elemUserPass($ii, $u, $p, $t='',$onchange='') { $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; ?> 192 <div style="width:100%;"><strong><?php echo $this->ntInfo['name']; ?> <?php _e('Login', 'social-networks-auto-poster-facebook-twitter-g'); if ($t=='e') { echo " "; _e('Email', 'social-networks-auto-poster-facebook-twitter-g'); } ?>:</strong> </div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][uName]" id="ap<?php echo $ntU; ?>UName<?php echo $ii; ?>" class="nxAccEdElem" value="<?php echo htmlentities($u, ENT_COMPAT, "UTF-8"); ?>" onchange="if (jQuery(this).val()!='' && jQuery('#ap<?php echo $ntU; ?>Pass<?php echo $ii; ?>').val()!=''){jQuery('#<?php echo $nt.$ii; ?>getPgs').val(1);nxs_svSetAdv('<?php echo $nt; ?>', '<?php echo $ii; ?>','nxsAllAccntsDiv','<?php echo $nt.$ii; ?>pgsList','','');} return false;"/>193 <div style="width:100%;"><strong><?php echo $this->ntInfo['name']; ?> <?php _e('Password', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" name="<?php echo $nt; ?>[<?php echo $ii; ?>][uPass]" id="ap<?php echo $ntU; ?>Pass<?php echo $ii; ?>" type="password" class="nxAccEdElem" value="<?php echo htmlentities((substr($p, 0, 5)=='n5g9a'||substr($p, 0, 5)=='g9c1a'||substr($p, 0, 5)=='b4d7s')?nsx_doDecode(substr($p, 5)):$p, ENT_COMPAT, "UTF-8"); ?>" <?php echo !empty($onchange)?'onchange="'.$onchange.'"':''; ?> /><br/><?php191 <div style="width:100%;"><strong><?php echo $this->ntInfo['name']; ?> <?php _e('Login', 'social-networks-auto-poster-facebook-twitter-g'); if ($t=='e') { echo " "; _e('Email', 'social-networks-auto-poster-facebook-twitter-g'); } ?>:</strong> </div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][uName]" id="ap<?php echo $ntU; ?>UName<?php echo esc_attr($ii); ?>" class="nxAccEdElem" value="<?php echo htmlentities($u, ENT_COMPAT, "UTF-8"); ?>" onchange="if (jQuery(this).val()!='' && jQuery('#ap<?php echo $ntU; ?>Pass<?php echo esc_attr($ii); ?>').val()!=''){jQuery('#<?php echo esc_attr($nt.$ii); ?>getPgs').val(1);nxs_svSetAdv('<?php echo esc_attr($nt); ?>', '<?php echo esc_attr($ii); ?>','nxsAllAccntsDiv','<?php echo esc_attr($nt.$ii); ?>pgsList','','');} return false;"/> 192 <div style="width:100%;"><strong><?php echo $this->ntInfo['name']; ?> <?php _e('Password', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> </div><input autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][uPass]" id="ap<?php echo $ntU; ?>Pass<?php echo esc_attr($ii); ?>" type="password" class="nxAccEdElem" value="<?php echo htmlentities((substr($p, 0, 5)=='n5g9a'||substr($p, 0, 5)=='g9c1a'||substr($p, 0, 5)=='b4d7s')?nsx_doDecode(substr($p, 5)):$p, ENT_COMPAT, "UTF-8"); ?>" <?php echo !empty($onchange)?'onchange="'.$onchange.'"':''; ?> /><br/><?php 194 193 } 195 194 public function elemKeySecret($ii,$lKey,$lSec,$key,$sec,$fnKey='appKey',$fnSec='appSec', $aurl='') { $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; $aurl = !empty($aurl)?' (<a style="font-size: 12px;" href="'.$aurl.'" target="_blank">'.$aurl.'</a>)':''; 196 195 if (!empty($key)) $key = (substr($key, 0, 5)=='x5g9a')?nsx_doDecode(substr($key, 5)):$key; if (!empty($sec)) $sec = (substr($sec, 0, 5)=='d3h0a')?nsx_doDecode(substr($sec, 5)):$sec; ?> 197 <div style="width:100%;"><b id="<?php echo $nt.$fnKey.$ii;?>l" style="font-size: 14px;"><?php echo $lKey; echo $aurl; ?> </b></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][<?php echo $fnKey; ?>]" id="<?php echo $nt.$fnKey.$ii; ?>" class="nxAccEdElem" value="<?php echo htmlentities($key, ENT_COMPAT, "UTF-8"); ?>" />198 <div style="width:100%;"><b id="<?php echo $nt.$fnSec.$ii;?>l" style="font-size: 14px;"><?php echo $lSec; ?>:</b></div><input type="password" autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" name="<?php echo $nt; ?>[<?php echo $ii; ?>][<?php echo $fnSec; ?>]" id="<?php echo $nt.$fnSec.$ii; ?>" class="nxAccEdElem" value="<?php echo htmlentities($sec, ENT_COMPAT, "UTF-8"); ?>" /><?php196 <div style="width:100%;"><b id="<?php echo $nt.$fnKey.$ii;?>l" style="font-size: 14px;"><?php echo $lKey; echo $aurl; ?> </b></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][<?php echo $fnKey; ?>]" id="<?php echo $nt.$fnKey.$ii; ?>" class="nxAccEdElem" value="<?php echo htmlentities($key, ENT_COMPAT, "UTF-8"); ?>" /> 197 <div style="width:100%;"><b id="<?php echo $nt.$fnSec.$ii;?>l" style="font-size: 14px;"><?php echo $lSec; ?>:</b></div><input type="password" autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][<?php echo $fnSec; ?>]" id="<?php echo $nt.$fnSec.$ii; ?>" class="nxAccEdElem" value="<?php echo htmlentities($sec, ENT_COMPAT, "UTF-8"); ?>" /><?php 199 198 } 200 199 public function elemURL($ii,$fn,$val,$lbl,$subLbl) { $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code'];?> 201 <div style="width:100%;"><strong><?php echo $lbl; ?>:</strong><i><?php echo $subLbl; ?></i></div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][<?php echo $fn; ?>]" class="nxAccEdElem" value="<?php echo htmlentities($val, ENT_COMPAT, "UTF-8"); ?>" /><br/><?php200 <div style="width:100%;"><strong><?php echo $lbl; ?>:</strong><i><?php echo $subLbl; ?></i></div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][<?php echo $fn; ?>]" class="nxAccEdElem" value="<?php echo htmlentities($val, ENT_COMPAT, "UTF-8"); ?>" /><br/><?php 202 201 } 203 202 public function elemMsgFormat($ii,$l,$fn,$val,$isVisible=true) { $nt = $this->ntInfo['lcode']; ?> 204 203 <div class="nxsMsgFormatDiv" style="display:<?php echo ($isVisible)?"block":"none"; ?>;"> 205 <div style="width:100%;"><b style="font-size: 15px;"><?php echo $l; ?>:</b> (<a href="#" id="msgFrmt<?php echo $nt.$ii; ?>HintInfo" onclick="nxs_showHideFrmtInfo('<?php echo $fn.$nt.$ii; ?>'); return false;"><?php _e('Show format info', 'nxs_snap'); ?></a>)</div>206 <textarea cols="150" rows="3" id="nxsF<?php echo $fn.$nt.$ii; ?>" name="<?php echo $nt; ?>[<?php echo $ii; ?>][<?php echo $fn; ?>]" class="nxAccEdElem" onfocus="jQuery('#nxsF<?php echo $fn.$nt.$ii; ?>').attr('rows', 6); nxs_showFrmtInfo('<?php echo $fn.$nt.$ii; ?>');"><?php echo htmlentities($val, ENT_COMPAT, "UTF-8"); ?></textarea> <?php nxs_doShowHint($fn.$nt.$ii); ?><br/>204 <div style="width:100%;"><b style="font-size: 15px;"><?php echo $l; ?>:</b> (<a href="#" id="msgFrmt<?php echo esc_attr($nt.$ii); ?>HintInfo" onclick="nxs_showHideFrmtInfo('<?php echo $fn.$nt.$ii; ?>'); return false;"><?php _e('Show format info', 'nxs_snap'); ?></a>)</div> 205 <textarea cols="150" rows="3" id="nxsF<?php echo $fn.$nt.$ii; ?>" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][<?php echo $fn; ?>]" class="nxAccEdElem" onfocus="jQuery('#nxsF<?php echo $fn.$nt.$ii; ?>').attr('rows', 6); nxs_showFrmtInfo('<?php echo $fn.$nt.$ii; ?>');"><?php echo htmlentities($val, ENT_COMPAT, "UTF-8"); ?></textarea> <?php nxs_doShowHint($fn.$nt.$ii); ?><br/> 207 206 </div><?php 208 207 } 209 208 public function elemTitleFormat($ii,$l,$fn,$val,$isVisible=true) { $nt = $this->ntInfo['lcode']; ?> 210 209 <div class="nxsMsgTFormatDiv" style="display:<?php echo ($isVisible)?"block":"none"; ?>;"> 211 <div style="width:100%;"><b style="font-size: 15px;"><?php echo $l; ?>:</b> </div><input name="<?php echo $nt; ?>[<?php echo $ii; ?>][<?php echo $fn; ?>]" id="<?php echo $nt.$ii; ?>SNAPformatT" class="nxAccEdElem" value="<?php echo htmlentities($val, ENT_COMPAT, "UTF-8"); ?>" onfocus="nxs_showFrmtInfo('msgFrmtT<?php echo $nt.$ii; ?>');" /><?php nxs_doShowHint("msgFrmtT".$nt.$ii); ?>210 <div style="width:100%;"><b style="font-size: 15px;"><?php echo $l; ?>:</b> </div><input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][<?php echo $fn; ?>]" id="<?php echo esc_attr($nt.$ii); ?>SNAPformatT" class="nxAccEdElem" value="<?php echo htmlentities($val, ENT_COMPAT, "UTF-8"); ?>" onfocus="nxs_showFrmtInfo('msgFrmtT<?php echo esc_attr($nt.$ii); ?>');" /><?php nxs_doShowHint("msgFrmtT".$nt.$ii); ?> 212 211 </div><?php 213 212 } … … 217 216 <div class="nxsPostEd_ElemWrap"><div class="nxsPostEd_ElemLabel"><?php echo $l; ?></div> 218 217 <div class="nxsPostEd_Elem"> 219 <input name="<?php echo $nt; ?>[<?php echo $ii; ?>][msgTFormat]" id="<?php echo $nt.$ii; ?>SNAPformatT" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" style="width: 95%;max-width: 610px;" value="<?php echo htmlentities($msgTFormat, ENT_COMPAT, "UTF-8"); ?>" onfocus="nxs_showFrmtInfo('msgFrmtT<?php echo $nt.$ii; ?>');" /><?php nxs_doShowHint("msgFrmtT".$nt.$ii); ?><?php nxs_doShowHint("msgFrmtT".$nt.$ii); ?>218 <input name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][msgTFormat]" id="<?php echo esc_attr($nt.$ii); ?>SNAPformatT" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" style="width: 95%;max-width: 610px;" value="<?php echo htmlentities($msgTFormat, ENT_COMPAT, "UTF-8"); ?>" onfocus="nxs_showFrmtInfo('msgFrmtT<?php echo esc_attr($nt.$ii); ?>');" /><?php nxs_doShowHint("msgFrmtT".$nt.$ii); ?><?php nxs_doShowHint("msgFrmtT".$nt.$ii); ?> 220 219 </div> 221 220 </div><?php … … 224 223 <div class="nxsPostEd_ElemWrap"><div class="nxsPostEd_ElemLabel"><?php echo $l; ?></div> 225 224 <div class="nxsPostEd_Elem"> 226 <textarea cols="150" rows="2" id="<?php echo $nt.$ii; ?>msgFormat" name="<?php echo $nt; ?>[<?php echo $ii; ?>][msgFormat]" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" style="width:95%;max-width: 610px;" onfocus="jQuery('#<?php echo $nt.$ii; ?>msgFormat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();nxs_showFrmtInfo('msgFormat<?php echo $nt.$ii; ?>');"><?php echo $msgFormat; ?></textarea> <?php nxs_doShowHint("msgFormat".$nt.$ii); ?>225 <textarea cols="150" rows="2" id="<?php echo esc_attr($nt.$ii); ?>msgFormat" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][msgFormat]" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" style="width:95%;max-width: 610px;" onfocus="jQuery('#<?php echo esc_attr($nt.$ii); ?>msgFormat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();nxs_showFrmtInfo('msgFormat<?php echo esc_attr($nt.$ii); ?>');"><?php echo $msgFormat; ?></textarea> <?php nxs_doShowHint("msgFormat".$nt.$ii); ?> 227 226 </div> 228 227 </div><?php … … 341 340 //###################### LINE HEADER 342 341 ?> 343 <div class="nxsEdNTLineHeader" data-nt="<?php echo $this->ntInfo['lcode']; ?>" data-ii="<?php echo $ii; ?>" style="background-color: #F0F0F0; padding-top: 4px; padding-right: 10px; padding: 5px; margin-top: 3px; border: 1px solid #E0E0E0; ">344 345 <input value="0" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo $ii; ?>][do]" type="hidden" /> <?php // prr($post); var_dump($pbo['do']); ?>342 <div class="nxsEdNTLineHeader" data-nt="<?php echo $this->ntInfo['lcode']; ?>" data-ii="<?php echo esc_attr($ii); ?>" style="background-color: #F0F0F0; padding-top: 4px; padding-right: 10px; padding: 5px; margin-top: 3px; border: 1px solid #E0E0E0; "> 343 344 <input value="0" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo esc_attr($ii); ?>][do]" type="hidden" /> <?php // prr($post); var_dump($pbo['do']); ?> 346 345 347 346 <?php if (( $pbo['do']=='2') || ( $post->post_status=='auto-draft' && !empty($pbo['do']) && !empty($pbo['fltrsOn']))) { $fltInfo = nxsAnalyzePostFilters($pbo['fltrs']); ?> 348 <input type="radio" id="rbtn<?php echo $this->ntInfo['lcode'].$ii; ?>" value="2" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo $ii; ?>][do]" checked="checked" class="nxs_acctcb" data-fltinfo="<?php echo $fltInfo; ?>" />347 <input type="radio" id="rbtn<?php echo $this->ntInfo['lcode'].$ii; ?>" value="2" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo esc_attr($ii); ?>][do]" checked="checked" class="nxs_acctcb" data-fltinfo="<?php echo $fltInfo; ?>" /> 349 348 <?php } else { ?> 350 349 351 <input value="1" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo $ii; ?>][do]" type="checkbox" class="nxs_acctcb nxs_acctcb<?php echo $this->ntInfo['lcode']; ?>" <?php if ((int)$pbo['do'] > 0) echo "checked"; ?> />350 <input value="1" name="<?php echo $this->ntInfo['lcode']; ?>[<?php echo esc_attr($ii); ?>][do]" type="checkbox" class="nxs_acctcb nxs_acctcb<?php echo $this->ntInfo['lcode']; ?>" <?php if ((int)$pbo['do'] > 0) echo "checked"; ?> /> 352 351 <?php } ?> 353 352 <?php if (!$this->isMobile) {?> … … 360 359 <?php if (!$this->isMobile) {?> 361 360 <span style="padding-left: 0px; display: none;" class="showInlineMenu<?php echo $this->ntInfo['code'].$ii; ?>"> <?php echo $this->isMobile?'<br/> ':''; ?> 362 <a id="do<?php echo $this->ntInfo['code'].$ii; ?>AG" href="#" class="nxsEdNTLineShowSettings" data-nt="<?php echo $this->ntInfo['lcode']; ?>" data-ii="<?php echo $ii; ?>"><?php echo !empty($pbo['do'])?'[Hide Settings]':'[Show Settings]'; ?></a>361 <a id="do<?php echo $this->ntInfo['code'].$ii; ?>AG" href="#" class="nxsEdNTLineShowSettings" data-nt="<?php echo $this->ntInfo['lcode']; ?>" data-ii="<?php echo esc_attr($ii); ?>"><?php echo !empty($pbo['do'])?'[Hide Settings]':'[Show Settings]'; ?></a> 363 362 </span> 364 363 <?php } ?> … … 373 372 <div style="position: absolute; <?php if ($this->isMobile) {?> top:20px; <?php } else { ?> top:0; <?php } ?> right:0; padding-top: 4px; padding-right: 10px;"> 374 373 <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && !empty($pMeta[$ii]['pgID'])) { ?> 375 <span style="padding-top: 4px; padding-right: 10px;"><a class="showListOfPostsXX" <?php if (!empty($pHst)&& !empty($pHst[$nt][$ii]) ) {?> data-qid="#XpstdDiv<?php echo $ntU; ?><?php echo $ii; ?>" <?php } ?> id="pstd<?php echo $ntU; ?><?php echo $ii; ?>" style="font-size: 11px;" href="<?php echo (!empty($pMeta[$ii]['postURL']))?$pMeta[$ii]['postURL']:'#'; ?>" target="_blank"><?php374 <span style="padding-top: 4px; padding-right: 10px;"><a class="showListOfPostsXX" <?php if (!empty($pHst)&& !empty($pHst[$nt][$ii]) ) {?> data-qid="#XpstdDiv<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" <?php } ?> id="pstd<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" style="font-size: 11px;" href="<?php echo (!empty($pMeta[$ii]['postURL']))?$pMeta[$ii]['postURL']:'#'; ?>" target="_blank"><?php 376 375 if (!$this->isMobile) {printf( __( 'Posted on', 'nxs_snap' ), $ntName); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(nxs_adjTime($pMeta[$ii]['pDate'])):"";} else { _e('[Post Link]', 'social-networks-auto-poster-facebook-twitter-g'); }?></a> 377 376 </span> 378 <div style="display: none" id="XpstdDiv<?php echo $ntU; ?><?php echo $ii; ?>"> <?php377 <div style="display: none" id="XpstdDiv<?php echo $ntU; ?><?php echo esc_attr($ii); ?>"> <?php 379 378 if (!empty($pHst)&& !empty($pHst[$nt][$ii]) ) { 380 379 foreach ($pHst[$nt][$ii] as $jj=>$lnk) { if ($jj>=30) break; ?> … … 386 385 387 386 <?php if ($post->post_status == "publish") { /** POST BUTTON **/ ?> 388 <a class="nxsPostNowBtn" data-nt="<?php echo $ntU; ?>" data-ii="<?php echo $ii; ?>" data-ntname="<?php echo $ntName; ?>" data-pid="<?php echo $post->ID; ?>" style="font-size: 14px; font-weight: bold;" href="#" onclick="return false;">[<?php387 <a class="nxsPostNowBtn" data-nt="<?php echo $ntU; ?>" data-ii="<?php echo esc_attr($ii); ?>" data-ntname="<?php echo $ntName; ?>" data-pid="<?php echo $post->ID; ?>" style="font-size: 14px; font-weight: bold;" href="#" onclick="return false;">[<?php 389 388 _e('Post', 'social-networks-auto-poster-facebook-twitter-g'); if (!$this->isMobile) { echo " "; _e('Now', 'social-networks-auto-poster-facebook-twitter-g');} 390 389 ?>]</a> … … 399 398 <div style="margin:0px;margin-left:5px; position: relative;"><div style="padding-top: 0px; padding-right: 5px; margin-left: 14px;"> 400 399 <span> 401 <a id="do<?php echo $this->ntInfo['code'].$ii; ?>AG" href="#" style="font-size: 11px;" onclick="doGetHideNTBlock('<?php echo $this->ntInfo['code'];?>' , '<?php echo $ii; ?>');return false;">[<?php _e('Options', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 402 403 <a href="#" style="font-weight: bold;font-size: 11px;" onclick="doDelAcct('<?php echo $this->ntInfo['lcode']; ?>', '<?php echo $ii; ?>', '<?php if (isset($pbo['bgBlogID'])) echo $pbo['nName']; ?>');return false;">[<?php _e('Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 400 <a id="do<?php echo $this->ntInfo['code'].$ii; ?>AG" href="#" style="font-size: 11px;" onclick="doGetHideNTBlock('<?php echo esc_attr($this->ntInfo['code']);?>' , '<?php echo esc_attr($ii); ?>');return false;">[<?php _e('Options', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 401 402 <a href="#" style="font-weight: bold;font-size: 11px;" onclick="doDelAcct('<?php echo $this->ntInfo['lcode']; ?>', '<?php echo esc_attr($ii); ?>', '<?php if (isset($pbo['bgBlogID'])) echo $pbo['nName']; ?>');return false;">[<?php _e('Post', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 404 403 </span> 405 <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && !empty($pMeta[$ii]['pgID'])) { ?> <span style="padding-top: 4px; padding-right: 10px;"><a class="showListOfPostsX" data-jXboxbtid="XpstdDiv<?php echo $ntU; ?><?php echo $ii; ?>" id="pstd<?php echo $ntU; ?><?php echo $ii; ?>" style="font-size: 11px;" href="<?php echo $pMeta[$ii]['postURL']; ?>" target="_blank"><?php404 <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && !empty($pMeta[$ii]['pgID'])) { ?> <span style="padding-top: 4px; padding-right: 10px;"><a class="showListOfPostsX" data-jXboxbtid="XpstdDiv<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" id="pstd<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" style="font-size: 11px;" href="<?php echo $pMeta[$ii]['postURL']; ?>" target="_blank"><?php 406 405 if (!$this->isMobile) {printf( __( 'Posted on', 'nxs_snap' ), $ntName); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(nxs_adjTime($pMeta[$ii]['pDate'])):"";} else { _e('[Post Link]', 'social-networks-auto-poster-facebook-twitter-g'); }?></a></span> 407 406 408 <div style="display: none" id="XpstdDiv<?php echo $ntU; ?><?php echo $ii; ?>">409 <a id="pstd<?php echo $ntU; ?><?php echo $ii; ?>" style="font-size: 10px;" href="<?php echo $pMeta[$ii]['postURL']; ?>" target="_blank"><?php printf( __( 'Posted on', 'nxs_snap' ), $ntName); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(nxs_adjTime($pMeta[$ii]['pDate'])):""; ?></a>407 <div style="display: none" id="XpstdDiv<?php echo $ntU; ?><?php echo esc_attr($ii); ?>"> 408 <a id="pstd<?php echo $ntU; ?><?php echo esc_attr($ii); ?>" style="font-size: 10px;" href="<?php echo $pMeta[$ii]['postURL']; ?>" target="_blank"><?php printf( __( 'Posted on', 'nxs_snap' ), $ntName); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(nxs_adjTime($pMeta[$ii]['pDate'])):""; ?></a> 410 409 </div> 411 410 … … 421 420 <?php //### TIme to Post 422 421 if ($post->post_status != "publish" && function_exists('nxs_v4doSMAS5') ) { $pbo['postTime'] = get_post_time('U', false, $post->ID); nxs_v4doSMAS5X($nt, $ii, $pbo); } 423 if (((int)$pbo['do'] == 1) && $post->post_status == "publish" && isset($pbo['timeToRun']) && $pbo['timeToRun'] > time()) { ?>424 <div>===>>>> <?php _e('Autopost has been schedulled for', 'social-networks-auto-poster-facebook-twitter-g') ?> <?php echo date('F j, Y, g:i a', $pbo['timeToRun']) ?></div>422 if (((int)$pbo['do'] == 1) && $post->post_status == "publish" && !empty($pbo['timeToRun']) && (int)$pbo['timeToRun'] > time()) { ?> 423 <div>===>>>> <?php _e('Autopost has been schedulled for', 'social-networks-auto-poster-facebook-twitter-g') ?> <?php echo date('F j, Y, g:i a', (int)$pbo['timeToRun']) ?></div> 425 424 <?php } ?> 426 425 </div> … … 432 431 if ($post->post_status == "publish") { ?> 433 432 <?php if (!empty($ntOpt['riComments']) && $ntOpt['riComments']=='1' && is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && !empty($pMeta[$ii]['pgID'])) { ?> 434 <input style="margin: 6px;" onclick="return false;" type="button" data-ii="<?php echo $ii; ?>" data-pid="<?php echo $post->ID; ?>" data-nt="<?php echo $this->ntInfo['lcode']; ?>" class="button riTo_button" value="<?php _e('Import Comments/Replies', 'nxs_snap') ?>" />433 <input style="margin: 6px;" onclick="return false;" type="button" data-ii="<?php echo esc_attr($ii); ?>" data-pid="<?php echo $post->ID; ?>" data-nt="<?php echo $this->ntInfo['lcode']; ?>" class="button riTo_button" value="<?php _e('Import Comments/Replies', 'nxs_snap') ?>" /> 435 434 <?php 436 435 }} -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_oauth.php
r1905522 r2757212 19 19 } 20 20 public function sign($request, $consumer_secret, $token) { 21 $key_raw = $this->signing_base($request, $consumer_secret, $token); // prr($key_raw);22 $basestring = base64_encode (hash_hmac('sha1', $key_raw[1], $key_raw[0], true)); //echo $basestring;21 $key_raw = $this->signing_base($request, $consumer_secret, $token); 22 $basestring = base64_encode (hash_hmac('sha1', $key_raw[1], $key_raw[0], true)); 23 23 return rawurlencode($basestring); 24 24 } … … 137 137 $cbu = nxssc_SigMethod_HMAC_SHA1::urlencode_rfc3986($cbu); 138 138 $url = $this->baseURL.$this->request_token_path.'?oauth_nonce='.$args['oauth_nonce'].'&oauth_timestamp='.$args['oauth_timestamp'].'&oauth_consumer_key='.$this->consumer_key.'&oauth_signature_method='.$args['oauth_signature_method'].'&oauth_version='.$args['oauth_version'].'&oauth_callback='.$cbu.'&oauth_signature='.$args['oauth_signature']; 139 echo "<br/>REQ Token URL: ". $url."<br/>";139 echo "<br/>REQ Token URL: ".esc_url($url)."<br/>"; 140 140 $hdrsArr = $this->makeHTTPHeaders($url); $ckArr = ''; 141 141 $response = wp_remote_get($url, array( 'method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr, 'cookies' => $ckArr)); 142 142 if ( is_wp_error($response) ) return print_r($response, true); 143 143 $this->http_code = $response['response']['code']; // prr($response); 144 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'. $response['body']; else return $this->oAuthRespToArr($response['body']);144 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'.esc_html($response['body']); else return $this->oAuthRespToArr($response['body']); 145 145 } 146 146 function getAccToken($verifier){ … … 159 159 $args['oauth_signature'] = $this->sign_method->sign2($req, $this->consumer_secret, $this->access_secret); 160 160 $url = $this->baseURL.$this->access_token_path.'?oauth_nonce='.$args['oauth_nonce'].'&oauth_timestamp='.$args['oauth_timestamp'].'&oauth_token_secret='.$this->access_secret.'&oauth_signature_method='.$args['oauth_signature_method'].'&oauth_consumer_key='.$this->consumer_key.'&oauth_verifier='.$verifier.'&oauth_version='.$args['oauth_version'].'&oauth_token='.$this->access_token.'&oauth_signature='.$args['oauth_signature']; 161 echo "<br/>REQ Token URL: ". $url."<br/>";161 echo "<br/>REQ Token URL: ".esc_url($url)."<br/>"; 162 162 $hdrsArr = $this->makeHTTPHeaders($url); $ckArr = ''; 163 163 $response = wp_remote_get($url, array( 'method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr, 'cookies' => $ckArr)); 164 164 if ( is_wp_error($response) ) return $response; 165 165 $this->http_code = $response['response']['code']; 166 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'. $response['body']; else return $this->oAuthRespToArr($response['body']);166 if (stripos($response['body'],'oauth_token_secret=')===false) echo 'Bad oAuth Login:'.esc_html($response['body']); else return $this->oAuthRespToArr($response['body']); 167 167 } 168 168 function makeReq($url, $params='', $type='GET'){ … … 203 203 $parameters['oauth_signature'] = base64_encode(hash_hmac('sha1', $string, $this->consumer_secret.'&'.$this->access_secret, true)); 204 204 } 205 private function httpRequest($url, $parameters) { $curl = curl_init(); 206 curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($curl, CURLOPT_TIMEOUT, '25'); curl_setopt($curl, CURLOPT_URL, $url); 207 curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); 208 $response = curl_exec($curl); $headers = curl_getinfo($curl); $errmsg = curl_error($curl); curl_close($curl); 209 if (!empty($errmsg)) return $errmsg; else return $response; 210 } 211 205 212 206 public function flUploadPhoto ($imgFile, $parameters) { $url = 'https://www.flickr.com/services/upload/'; $requestParams = ($parameters == NULL ? array() : $parameters); $phid = ''; 213 207 $oauthParams = array ( … … 222 216 223 217 $req = array(); $req['method'] = 'POST'; $req['normalized_url'] = $url; $req['normalized_parameters'] = $this->get_normalized_parameters($requestParams); 224 $args['oauth_signature'] = $this->sign_method->sign2($req, $this->consumer_secret, $this->access_secret); 225 226 $xml = $this->httpRequest($url, $requestParams);if (stripos($xml, '</photoid>')!==false && stripos($xml, 'stat="ok"')!==false) $phid = CutFromTo($xml, '<photoid>','</photoid>');218 $args['oauth_signature'] = $this->sign_method->sign2($req, $this->consumer_secret, $this->access_secret); 219 $rq = new nxsHttp; $args = nxs_mkRmReqArgs(); $rq->postData = $requestParams; $xml = $rq->request($url, $args); 220 if (stripos($xml, '</photoid>')!==false && stripos($xml, 'stat="ok"')!==false) $phid = CutFromTo($xml, '<photoid>','</photoid>'); 227 221 return empty($phid) ? "Problem: ".$xml."<pre>".print_r($requestParams, true)."</pre>" : $phid; 228 222 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_class_snap.php
r2748653 r2757212 95 95 nxs_cURLTest("https://api.ipify.org/", "HTTPS to whatismyip", 'getMyIP'); 96 96 nxs_cURLTest("https://www.nextscripts.com/", "HTTPS to NXS", "Social Networks"); 97 nxs_cURLTest("http://35.184.36.171/", "HTTPS to NXSA", "NextScripts Cloud"); 98 nxs_cURLTest("https://about.google/intl/en/contact-google/", "HTTP to Google", "Mountain View, CA"); 99 nxs_cURLTest("https://about.google/intl/en/contact-google/", "HTTPS to Google", "Mountain View, CA"); 97 nxs_cURLTest("http://45.79.4.45/", "HTTPS to NXSA", "NXS"); 98 nxs_cURLTest("https://www.google.com/appsstatus/dashboard/", "HTTPS to Google", "Status Dashboard"); 100 99 nxs_cURLTest("https://www.facebook.com/", "HTTPS to Facebook", 'id="facebook"'); 101 100 nxs_cURLTest("https://graph.facebook.com/", "HTTPS to API (Graph) Facebook", 'get'); … … 103 102 nxs_cURLTest("https://twitter.com/", "HTTPS to Twitter", '<link rel="canonical" href="https://twitter.com'); 104 103 nxs_cURLTest("https://www.pinterest.com/", "HTTPS to Pinterest", 'content="Pinterest"'); 105 nxs_cURLTest("https://www.livejournal.com/ login.bml", "HTTPS to LiveJournal", 'livejournal.com/about');104 nxs_cURLTest("https://www.livejournal.com/about/", "HTTPS to LiveJournal", 'livejournal.com/about'); 106 105 die('Done'); 107 106 } … … 525 524 </div> 526 525 </div></div> */ ?> 526 <?php if (!empty($options['riActive']) && $options['riActive'] == '1') { ?> 527 528 527 529 <!-- ##################### Auto-Import comments from Social Networks #####################--> 528 530 <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> … … 559 561 560 562 </div></div> 561 563 <?php } ?> 562 564 <!-- ##################### URL Parameters #####################--> 563 565 <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> … … 1341 1343 } 1342 1344 function process_bulk_action() { 1343 if( 'delete'===$this->current_action() ) { $items = $_REQUEST['nxs_filter']; $jj = 0; //prr($_REQUEST);1344 foreach ($items as $item ) { wp_delete_post( $item, true ); $jj++; }1345 if( 'delete'===$this->current_action() ) { $items = is_array($_REQUEST['nxs_filter'])?$_REQUEST['nxs_filter']:[]; $jj = 0; //prr($_REQUEST); 1346 foreach ($items as $item ) { $item = sanitize_key($item); wp_delete_post( $item, true ); $jj++; } 1345 1347 wp_die($jj.' Items deleted.'); 1346 1348 } 1347 if( 'activate'===$this->current_action() ) { $items = $_REQUEST['nxs_filter']; $jj = 0; //prr($_REQUEST);1348 foreach ($items as $item ) { $ o = maybe_unserialize(get_post_meta( $item, 'nxs_rpstr', true )); $o['rpstOn']='1'; nxs_Filters::save_meta( $item, 'nxs_rpstr', $o ); $jj++; }1349 if( 'activate'===$this->current_action() ) { $items = is_array($_REQUEST['nxs_filter'])?$_REQUEST['nxs_filter']:[]; $jj = 0; //prr($_REQUEST); 1350 foreach ($items as $item ) { $item = sanitize_key($item); $o = maybe_unserialize(get_post_meta( $item, 'nxs_rpstr', true )); $o['rpstOn']='1'; nxs_Filters::save_meta( $item, 'nxs_rpstr', $o ); $jj++; } 1349 1351 wp_die($jj.' Items activated.'); 1350 1352 } 1351 if( 'deactivate'===$this->current_action() ) { $items = $_REQUEST['nxs_filter']; $jj = 0; //prr($_REQUEST);1352 foreach ($items as $item ) { $ o = maybe_unserialize(get_post_meta( $item, 'nxs_rpstr', true )); $o['rpstOn']='0'; nxs_Filters::save_meta( $item, 'nxs_rpstr', $o ); $jj++; }1353 if( 'deactivate'===$this->current_action() ) { $items = is_array($_REQUEST['nxs_filter'])?$_REQUEST['nxs_filter']:[]; $jj = 0; //prr($_REQUEST); 1354 foreach ($items as $item ) { $item = sanitize_key($item); $o = maybe_unserialize(get_post_meta( $item, 'nxs_rpstr', true )); $o['rpstOn']='0'; nxs_Filters::save_meta( $item, 'nxs_rpstr', $o ); $jj++; } 1353 1355 wp_die($jj.' Items deactivated.'); 1354 1356 } … … 1368 1370 1369 1371 function usort_reorder($a,$b){ 1370 $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby']: 'title'; //If no sort, default to title1371 $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order']: 'asc'; //If no order, default to asc1372 $orderby = (!empty($_REQUEST['orderby'])) ? sanitize_key($_REQUEST['orderby']) : 'title'; //If no sort, default to title 1373 $order = (!empty($_REQUEST['order'])) ? sanitize_key($_REQUEST['order']) : 'asc'; //If no order, default to asc 1372 1374 //$result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order 1373 1375 $result = strcmp($a->$orderby, $b->$orderby); //Determine sort order … … 1472 1474 function process_bulk_action() { 1473 1475 if( 'delete'===$this->current_action() ) { 1474 foreach ($_REQUEST['nxs_qpost'] as $qp) {wp_delete_post($qp, true); } $url = nxs_get_admin_url().'admin.php?page=nxssnap-post'; echo '<script type="text/javascript">parent.location.replace(\''.$url.'\');</script>'; die();1476 if (is_array($_REQUEST['nxs_qpost'])) foreach ($_REQUEST['nxs_qpost'] as $qp) { $qp = sanitize_key($qp); wp_delete_post($qp, true); } $url = nxs_get_admin_url().'admin.php?page=nxssnap-post'; echo '<script type="text/javascript">parent.location.replace(\''.$url.'\');</script>'; die(); 1475 1477 1476 1478 } … … 1489 1491 1490 1492 function usort_reorder($a,$b){ 1491 $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby']: 'post_date'; //If no sort, default to title1492 $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order']: 'desc'; //prr($order); //If no order, default to asc1493 $orderby = (!empty($_REQUEST['orderby'])) ? sanitize_key($_REQUEST['orderby']) : 'post_date'; //If no sort, default to title 1494 $order = (!empty($_REQUEST['order'])) ? sanitize_key($_REQUEST['order']) : 'desc'; //prr($order); //If no order, default to asc 1493 1495 if (is_array($a)) $result = strcmp($a[$orderby], $b[$orderby]); else $result = strcmp($a->$orderby, $b->$orderby); //prr($a);//Determine sort order 1494 1496 return ($order==='asc') ? $result : -$result; //Send final sort direction to usort … … 1504 1506 'per_page' => $per_page, //WE have to determine how many items to show on a page 1505 1507 'total_pages' => ceil($total_items/$per_page), //WE have to calculate the total number of pages 1506 'orderby' => ! empty( $_REQUEST['orderby'] ) && '' != $_REQUEST['orderby'] ? $_REQUEST['orderby']: 'post_title',1507 'order' => ! empty( $_REQUEST['order'] ) && '' != $_REQUEST['order'] ? $_REQUEST['order']: 'desc'1508 'orderby' => ! empty( $_REQUEST['orderby'] ) && '' != $_REQUEST['orderby'] ? sanitize_key($_REQUEST['orderby']) : 'post_title', 1509 'order' => ! empty( $_REQUEST['order'] ) && '' != $_REQUEST['order'] ? sanitize_key($_REQUEST['order']) : 'desc' 1508 1510 ) ); 1509 1511 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_functions.php
r2609158 r2757212 171 171 $out = 'There is a problem with cURL. You need to contact your server admin or hosting provider. Here is the PHP code to reproduce the problem:<br/><pre style="color:#005800"><?php '."\r\n".' $ch = curl_init(); '."\r\n".' curl_setopt($ch, CURLOPT_URL, "'.$url.'"); '."\r\n".' curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"); '."\r\n".' curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); '."\r\n".' curl_setopt($ch, CURLOPT_TIMEOUT, 10); '."\r\n".' curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); '."\r\n".' $response = curl_exec($ch); '."\r\n".' $errmsg = curl_error($ch); '."\r\n".' $cInfo = curl_getinfo($ch); '."\r\n".' curl_close($ch); '."\r\n".' print_r($errmsg); '."\r\n".' print_r($cInfo); '."\r\n".' print_r($response); '."\r\n".'?></pre>'; return $out; 172 172 } 173 function nxs_cURLTest($url, $msg, $testText){ if ($testText=='getMyIP') echo 'Getting IP... <br/>'; else echo "<br/>--== Test Requested ... ".$url."<br/>"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); 174 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36"); 175 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_HEADER, true); 176 $response = curl_exec($ch); $errmsg = curl_error($ch); $cInfo = curl_getinfo($ch); curl_close($ch); 177 if ($testText=='getMyIP') echo "Your Server IP:".$response.'<br/>'; else { echo "Testing ... ".$url." - ".$cInfo['url']."<br/>"; 178 if (stripos($response, $testText)!==false) echo "....".$msg." - OK<br/>"; else { echo "....<b style='color:red;'>".$msg." - Problem</b><br/>"; prr($response); prr($errmsg); prr($cInfo); echo nxs_cURLTestCode($url); } 173 function nxs_cURLTest($url, $msg, $testText){ if ($testText=='getMyIP') echo 'Getting IP... <br/>'; else echo "<br/>--== Test Requested ... ".esc_url($url)."<br/>"; 174 $rq = new nxsHttp; $ret = $rq->request($url, nxs_mkRmReqArgs()); $response = is_array($ret)?$ret['body']:''; 175 if ($testText=='getMyIP') echo "Your Server IP:".wp_kses($response, wp_kses_allowed_html( 'post' )).'<br/>'; else { echo "Testing ... ".esc_url($url)." - <br/>"; 176 if (stripos($response, $testText)!==false) echo "....".wp_kses($msg, wp_kses_allowed_html( 'post' ))." - OK<br/>"; else { echo "....<b style='color:red;'>".$msg." - Problem</b><br/>"; prr($ret); echo nxs_cURLTestCode(esc_url($url)); } 179 177 } 180 178 } -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_functions_adv.php
r2609632 r2757212 3 3 global $nxs_SNAP; if (!isset($nxs_SNAP)) return; $networks = (!current_user_can( 'manage_options' ) && current_user_can( 'haveown_snap_accss' ) ) ? $nxs_SNAP->nxs_acctsU : $nxs_SNAP->nxs_accts; $options = $nxs_SNAP->nxs_options; 4 4 5 if ($_POST['nxsact']=='getNTset') { $ii = $_POST['ii']; $nt = $_POST['nt']; $ntl = strtolower($nt); $pbo = $networks[$ntl][$ii]; $pbo['ntInfo']['lcode'] = $ntl; $clName = 'nxs_snapClass'.$nt; $ntObj = new $clName();5 if ($_POST['nxsact']=='getNTset') { $ii = sanitize_key($_POST['ii']); $nt = $_POST['nt']; $ntl = strtolower($nt); $pbo = $networks[$ntl][$ii]; $pbo['ntInfo']['lcode'] = $ntl; $clName = 'nxs_snapClass'.$nt; $ntObj = new $clName(); 6 6 $ntObj->showNTSettings($ii, $pbo); 7 7 } … … 26 26 if ($_POST['nxsact']=='setAllXS' && !empty($_POST['nid']) && !empty($_POST['uid'])) { $acnt = 0; $nid = explode('-',$_POST['nid']); $val = $networks[$nid[0]][$nid[2]][$nid[1]]; $uid = $networks[$nid[0]][$nid[2]][$_POST['uid']]; 27 27 foreach ($networks[$nid[0]] as $ii=>$nta) if (!empty($nta[$_POST['uid']]) && $nta[$_POST['uid']]==$uid) { $networks[$nid[0]][$ii][$nid[1]] = $val; $acnt++; } 28 if (is_array($networks)) { nxs_save_ntwrksOpts($networks); $nxs_SNAP->nxs_accts = $networks; echo "Done. ". $acnt.' accounts has been updated.'; }28 if (is_array($networks)) { nxs_save_ntwrksOpts($networks); $nxs_SNAP->nxs_accts = $networks; echo "Done. ".wp_kses($acnt, wp_kses_allowed_html( 'post' )).' accounts has been updated.'; } 29 29 } 30 30 … … 52 52 echo "OK"; 53 53 } 54 if ($_POST['nxsact']=='cancQ') { $cid = $_POST['cid']; global $wpdb; $wpdb->delete( $wpdb->prefix . "nxs_query" , array( 'id' => $cid ) ); echo "== OK-".$cid; }54 if ($_POST['nxsact']=='cancQ') { $cid = sanitize_key($_POST['cid']); global $wpdb; $wpdb->delete( $wpdb->prefix . "nxs_query" , array( 'id' => $cid ) ); echo "== OK-".esc_attr($cid); } 55 55 56 56 … … 65 65 echo "OK"; die(); 66 66 } 67 if ($_POST['nxsact']=='saveRpst'){ if (!empty($_POST['pid'])) { $pid = $_POST['pid']; }67 if ($_POST['nxsact']=='saveRpst'){ if (!empty($_POST['pid'])) { $pid = sanitize_key($_POST['pid']); } 68 68 $post = array( 69 69 // 'ID' => [ <post id> ] // Are you updating an existing post? … … 156 156 if (!function_exists("nxs_arrMergeCheck")) { function nxs_arrMergeCheck($a1, $a2){ foreach ($a2 as $ak=>$a) if (!in_array($ak, array_keys($a1))) $a1[$ak] = $a; return $a1; }} 157 157 if (!function_exists("nxs_contCron_js")){ function nxs_contCron_js() { 158 $contCron = get_option('nxs_contCron'); $output='<script type="text/javascript">jQuery.get( "'.home_url('?nxs-cronrun='.$contCron).'");</script>'; echo $output;158 $contCron = get_option('nxs_contCron'); $output='<script type="text/javascript">jQuery.get( "'.home_url('?nxs-cronrun='.$contCron).'");</script>'; echo wp_kses($output, wp_kses_allowed_html( 'post' )); 159 159 }} 160 160 //## Format Message (WP) … … 291 291 //## No Lib Warning 292 292 if (!function_exists("nxs_show_noLibWrn")) { function nxs_show_noLibWrn($msg){ ?> <div style="border: 2px solid darkred; padding: 25px 15px 15px 15px; margin: 3px; background-color: #fffaf0;"> 293 <span style="font-size: 16px; color:darkred;"><?php echo $msg?></span> <a href="https://www.nextscripts.com/faq/third-party-libraries-autopost-google-pinterest/" target="_blank">More info about third party API libraries.</a><br/><hr/> <div style="font-size: 16px; color:#005800; font-weight: bold; margin-top: 12px; margin-bottom: 7px;">You can get this API library from NextScripts.</div>293 <span style="font-size: 16px; color:darkred;"><?php echo wp_kses($msg, wp_kses_allowed_html( 'post' )); ?></span> <a href="https://www.nextscripts.com/faq/third-party-libraries-autopost-google-pinterest/" target="_blank">More info about third party API libraries.</a><br/><hr/> <div style="font-size: 16px; color:#005800; font-weight: bold; margin-top: 12px; margin-bottom: 7px;">You can get this API library from NextScripts.</div> 294 294 <div style="padding-bottom: 5px;"><a href="https://www.nextscripts.com/snap-api/">SNAP Premium API libraries package</a> adds autoposting to:</div> <span class="nxs_txtIcon nxs_ti_fb">Facebook</span>, <span class="nxs_txtIcon nxs_ti_gp">Google+</span>, <span class="nxs_txtIcon nxs_ti_pn">Pinterest</span>, <span class="nxs_txtIcon nxs_ti_rd">Reddit</span>, <span class="nxs_txtIcon nxs_ti_bg">Blogger</span>, <span class="nxs_txtIcon nxs_ti_yt">YouTube</span>, <span class="nxs_txtIcon nxs_ti_fp">Flipboard</span>, <span class="nxs_txtIcon nxs_ti_li">LinkedIn Groups</span><br><br> 295 295 <div style="padding-bottom: 10px; padding-top: 7px;" align="center"> … … 305 305 $mUsage = function_exists('memory_get_usage') ? round(memory_get_usage() / 1024 / 1024, 2) : 0; $mUsage = empty($mUsage) ? __('N/A') : $mUsage . __(' MByte'); ?> 306 306 <div><strong><?php _e('PHP Version'); ?></strong>: <span><?php echo PHP_VERSION; ?>; </span> 307 <strong><?php _e('PHP Memory limit'); ?></strong>: <span><?php echo $mLimit; ?>; </span><br/>308 <strong><?php _e('Memory usage'); ?></strong>: <span><?php echo $mUsage; ?>; </span> <strong><?php _e('Peak memory usage'); ?></strong>: <span><?php echo $mUsageP; ?>; </span>307 <strong><?php _e('PHP Memory limit'); ?></strong>: <span><?php echo wp_kses($mLimit, wp_kses_allowed_html( 'post' )); ?>; </span><br/> 308 <strong><?php _e('Memory usage'); ?></strong>: <span><?php echo wp_kses($mUsage, wp_kses_allowed_html( 'post' )); ?>; </span> <strong><?php _e('Peak memory usage'); ?></strong>: <span><?php echo $mUsageP; ?>; </span> 309 309 </div> <?php 310 310 }} 311 //## Check SSL Sec 312 if (!function_exists("nxsCheckSSLCurl")){function nxsCheckSSLCurl($url){ 313 $ch = curl_init($url); $headers = array(); $headers[] = 'Accept: text/html, application/xhtml+xml, */*'; $headers[] = 'Cache-Control: no-cache'; 314 $headers[] = 'Connection: Keep-Alive'; $headers[] = 'Accept-Language: en-us'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 315 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"); 316 $content = curl_exec($ch); $err = curl_errno($ch); $errmsg = curl_error($ch); if ($err!=0) return array('errNo'=>$err, 'errMsg'=>$errmsg); else return false; 317 }} 311 318 312 if (!function_exists("nxs_cron_check")){function nxs_cron_check() { if (stripos($_SERVER["REQUEST_URI"], 'wp-cron.php')!==false) { 319 313 $cronCheckArray = get_option('NXS_cronCheck'); if (empty($cronCheckArray)) $cronCheckArray = array('cronCheckStartTime'=>time(), 'cronChecks'=>array()); … … 327 321 //## New RePoster popup 328 322 if (!function_exists('nxs_rpstPopupCode')) { function nxs_rpstPopupCode() { 329 if (!empty($_POST['nxs_snap_reposter_update'])) nxs_Filters::save_filter( $_GET['item']); nxs_Filters::showEdit('nxs-flt-popup'); ?>323 if (!empty($_POST['nxs_snap_reposter_update'])) nxs_Filters::save_filter(sanitize_key($_GET['item'])); nxs_Filters::showEdit('nxs-flt-popup'); ?> 330 324 <form method="post" id="nxs_form_rep"> <input name="action" value="nxs_snap_aj" type="hidden" /><input name="nxsact" value="saveRpst" type="hidden" /> 331 325 <div class="wrap"><div id="nxsDivWrap"><h2><?php _e('Add New Reposter Action'); ?></h2> -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_functions_engine.php
r2650138 r2757212 118 118 $tm = microtime(); $tma = explode(' ',$tm); $tm = number_format((float)$tma[0]+(float)$tma[1], 8, '.', ''); $currTime = $tm+$tmCorr; $tmL = get_option('nxs_last_nxs_cron'); update_option('nxs_last_nxs_cron', $tm, false); $tmL2=$tmL+19; $tmL3=$tmL+600; 119 119 //## Log Cron Request 120 if (isset($_GET['nxs-cronrun'])) { $_GET['nxs-cronrun'] = sanitize_text_field($_GET['nxs-cronrun']); $contCron = get_option('nxs_contCron'); if ($isDebug) echo $_GET['nxs-cronrun'],'('.$contCron.')'; //## Manual/Forced cron request.120 if (isset($_GET['nxs-cronrun'])) { $_GET['nxs-cronrun'] = sanitize_text_field($_GET['nxs-cronrun']); $contCron = get_option('nxs_contCron'); if ($isDebug) echo wp_kses($_GET['nxs-cronrun'],'('.$contCron.')', wp_kses_allowed_html( 'post' )); //## Manual/Forced cron request. 121 121 nxs_addToLogN('L','NXS Cron Request (Forced)','',number_format(($tm-$tmL), 2,'.','').'s after the previous one. ', 'CNT: '.$_GET['nxs-cronrun'].'('.$contCron.')'); 122 122 } else { //## Cron request from WP itself … … 132 132 } 133 133 //nxs_addToLogN('L', 'Cron Run', '', 'Cron IN - '.$tm.' | Last - '.$tmL); 134 global $wpdb, $doing_wp_cron; //echo "SELECT * FROM ". $wpdb->prefix . "nxs_query WHERE timetorun<'".date_i18n('Y-m-d H:i:s')."' ORDER BY timetorun DESC";134 global $wpdb, $doing_wp_cron; 135 135 if ($isDebug) echo "==-- CRON --=="; 136 136 … … 165 165 //## 166 166 if ($rpstrOpts['rpstNxTime']>$currTime) { 167 if ($isDebug) echo "Post ID: ".$row['postid']." - No TIme Yet:".$rpstrOpts['rpstNxTime']." > ".$currTime." | ". date_i18n('Y-m-d H:i:s',$rpstrOpts['rpstNxTime']). ' > '. date_i18n('Y-m-d H:i:s',$currTime)."<br/>";167 if ($isDebug) echo wp_kses("Post ID: ".$row['postid']." - No TIme Yet:".$rpstrOpts['rpstNxTime']." > ".$currTime." | ". date_i18n('Y-m-d H:i:s',$rpstrOpts['rpstNxTime']). ' > '. date_i18n('Y-m-d H:i:s',$currTime)."<br/>", wp_kses_allowed_html( 'post' ), wp_kses_allowed_html( 'post' )); 168 168 nxs_recountQueryTimes(); break; 169 169 } 170 170 //## Time to Post 171 nxs_LogIt('I', 'Reposter [Time to Post]', 'RPSTR','', 'Reposter ID:'.$row['postid'].' ', '-=[ '.print_r($rpstrOpts, true).' ]=--=[ '.print_r($fltrOpts, true).' ]=-'); if ($isDebug) echo 'Reposter [Time to Post] '. 'Reposter ID:'.$row['postid'].' ';171 nxs_LogIt('I', 'Reposter [Time to Post]', 'RPSTR','', 'Reposter ID:'.$row['postid'].' ', '-=[ '.print_r($rpstrOpts, true).' ]=--=[ '.print_r($fltrOpts, true).' ]=-'); if ($isDebug) echo wp_kses('Reposter [Time to Post] '. 'Reposter ID:'.$row['postid'].' '); 172 172 173 173 if (!empty($fltrOpts)) { $fltrOpts['posts_per_page'] = '1'; … … 176 176 //## Check Days 177 177 if (isset($rpstrOpts['rpstBtwDays']) && count($rpstrOpts['rpstBtwDays'])>0 ) $rpstBtwDays = $rpstrOpts['rpstBtwDays']; else $rpstBtwDays = array(); 178 if (is_array($rpstBtwDays) && count($rpstBtwDays)>0) { $currDay = (int)date('w'); if ($currDay==0) $currDay = 7; if (!(in_array($currDay, $rpstBtwDays))) { // echo "D :( ";178 if (is_array($rpstBtwDays) && count($rpstBtwDays)>0) { $currDay = (int)date('w'); if ($currDay==0) $currDay = 7; if (!(in_array($currDay, $rpstBtwDays))) { 179 179 nxs_LogIt('I', 'Reposter: Skipped - Excluded Day - '.date_i18n('D'), 'Reposter ID:'.$row['postid'].' (Post ID: '.$ids[0].')', '', '-=[ - ]=-', print_r($rpstrOpts, true)); break; 180 180 }} … … 182 182 if (isset($rpstrOpts['rpstBtwHrsF']) && (int)$rpstrOpts['rpstBtwHrsF']>0) $rpstBtwHrsF = (int)$rpstrOpts['rpstBtwHrsF']; else $rpstBtwHrsF = 0; 183 183 if (isset($rpstrOpts['rpstBtwHrsT']) && (int)$rpstrOpts['rpstBtwHrsT']>0) $rpstBtwHrsT = (int)$rpstrOpts['rpstBtwHrsT']; 184 if ($rpstBtwHrsT>0) { $currHour = (int)date_i18n('H', $currTime); //echo "H ".$currHour." ?";185 if ( !( ($rpstBtwHrsF<$rpstBtwHrsT && $currHour<$rpstBtwHrsT && $currHour>=$rpstBtwHrsF) || ($rpstBtwHrsF>$rpstBtwHrsT && $currHour<$rpstBtwHrsF && $currHour>=$rpstBtwHrsT) )) { //echo "H :( ";184 if ($rpstBtwHrsT>0) { $currHour = (int)date_i18n('H', $currTime); 185 if ( !( ($rpstBtwHrsF<$rpstBtwHrsT && $currHour<$rpstBtwHrsT && $currHour>=$rpstBtwHrsF) || ($rpstBtwHrsF>$rpstBtwHrsT && $currHour<$rpstBtwHrsF && $currHour>=$rpstBtwHrsT) )) { 186 186 nxs_LogIt('I', 'Reposter: Skipped - Excluded Hour - '.$currHour, 'Reposter ID:'.$row['postid'].' (Post ID: '.$ids[0].')', '', '-=[ - ]=-', print_r($rpstrOpts, true)); break; 187 187 }} -
social-networks-auto-poster-facebook-twitter-g/trunk/inc/nxs_functions_wp.php
r2609632 r2757212 113 113 114 114 if (!function_exists('nxs_adminCSS')){ function nxs_adminCSS(){ ?> 115 <style type="text/css"> .nxs_modal { display: none; position: absolute; z-index: 1000; top: 0; left: 0; height: 100%; width: 100%; background: rgba( 240, 240, 240, .5 ) url('<?php echo NXS_PLURL.'img/ajax-loader-med.gif';?>') 50% 50% no-repeat;}115 <style type="text/css"> .nxs_modal { display: none; position: absolute; z-index: 1000; top: 0; left: 0; height: 100%; width: 100%; background: rgba( 240, 240, 240, .5 ) url('<?php echo esc_url(NXS_PLURL.'img/ajax-loader-med.gif');?>') 50% 50% no-repeat;} 116 116 117 117 .nxsEdWrapper:before { … … 179 179 var data = { action:'nxs_snap_aj', nxsact: 'manPost', nt:nt, id: pid, nid: ii, et_load_builder_modules:1, _wpnonce: '<?php echo wp_create_nonce('nxsSsPageWPN'); ?>'}; 180 180 jQuery('#nxsFavNoticeCnt').html('<p> Posting... </p>'); jQuery('#nxsFavNotice').modal({ fadeDuration: 50 }); 181 jQuery.post('<?php echo admin_url( 'admin-ajax.php'); ?>', data, function(response) { if (response=='') response = 'Message Posted';181 jQuery.post('<?php echo esc_url(admin_url( 'admin-ajax.php' )); ?>', data, function(response) { if (response=='') response = 'Message Posted'; 182 182 jQuery('#nxsFavNoticeCnt').html('<p> ' + response + '</p>' +'<input type="button" onclick="jQuery.modal.close();" class="bClose" value="Close" />'); 183 183 }); … … 201 201 function doLic(){ var lk = jQuery('#eLic').val(); jQuery("#enterKeyAPI2xLoadingImg").show(); 202 202 jQuery.post(ajaxurl,{lk:lk, action: 'nxsDoLic', id: 0, _wpnonce: jQuery('input#doLic_wpnonce').val()}, function(j){ 203 if (j.indexOf('OK')>-1) window.location = "<?php echo $snap_curPageURL; ?>"; else alert('<?php _e('Wrong key, please contact support', 'social-networks-auto-poster-facebook-twitter-g'); ?>');203 if (j.indexOf('OK')>-1) window.location = "<?php echo esc_url($snap_curPageURL); ?>"; else alert('<?php _e('Wrong key, please contact support', 'social-networks-auto-poster-facebook-twitter-g'); ?>'); 204 204 }, "html") 205 205 } 206 206 function nxs_doAJXPopup(act, nt, nid, msg, addprms, butText){ var data = { action:'nxs_snap_aj', nxsact: act, nt:nt, id: 0, nid: nid, _wpnonce: jQuery('input#nxsSsPageWPN_wpnonce').val()}; 207 jQuery('#nxs_gPopupContent').html(msg+" <p><img src='<?php echo NXS_PLURL; ?>img/ajax-loader-med.gif' /></p>");207 jQuery('#nxs_gPopupContent').html(msg+" <p><img src='<?php echo esc_url(NXS_PLURL); ?>img/ajax-loader-med.gif' /></p>"); 208 208 //jQuery('#nxs_gPopup').bPopup({ modalClose: false, appendTo: '#wpbody-content', opacity: 0.6, positionStyle: 'fixed'}); 209 209 jQuery.pgwModal({ target: '#nxs_gPopupCntWrap', title: 'Box', maxWidth: 800, closeOnBackgroundClick : false}); … … 216 216 //## Test post and Manual post. 217 217 function testPost(nt, nid){ var data = { action:'nxs_snap_aj', nxsact: 'testPost', nt:nt, id: 0, nid: nid, _wpnonce: jQuery('input#nxsSsPageWPN_wpnonce').val()}; 218 jQuery('#nxs_gPopupContent').html("<p>Sending update to "+nt+" ....</p>" + "<p><img src='<?php echo NXS_PLURL; ?>img/ajax-loader-med.gif' /></p>");218 jQuery('#nxs_gPopupContent').html("<p>Sending update to "+nt+" ....</p>" + "<p><img src='<?php echo esc_url(NXS_PLURL); ?>img/ajax-loader-med.gif' /></p>"); 219 219 //jQuery('#nxs_gPopup').bPopup({ modalClose: false, appendTo: '#nsStForm', opacity: 0.6, positionStyle: 'fixed'}); 220 220 jQuery.pgwModal({ target: '#nxs_gPopupCntWrap', title: 'Test Post', maxWidth: 800, closeOnBackgroundClick : false}); … … 227 227 function nxs_doManPost(obj){ obj.preventDefault; var nt = jQuery( this ).data('nt'); var ii = jQuery( this ).data('ii'); var pid = jQuery( this ).data('pid'); var ntn = jQuery( this ).data('ntname'); 228 228 var data = { action:'nxs_snap_aj', nxsact: 'manPost', nt:nt, id: pid, nid: ii, et_load_builder_modules:1, _wpnonce: jQuery('input#nxsSsPageWPN_wpnonce').val()}; 229 jQuery('#nxs_gPopupContent').html("<p>Sending update to "+ntn+" ....</p>" + "<p><img src='<?php echo NXS_PLURL; ?>img/ajax-loader-med.gif' /></p>");229 jQuery('#nxs_gPopupContent').html("<p>Sending update to "+ntn+" ....</p>" + "<p><img src='<?php echo esc_url(NXS_PLURL); ?>img/ajax-loader-med.gif' /></p>"); 230 230 jQuery.pgwModal({ target: '#nxs_gPopupCntWrap', title: 'Post', maxWidth: 800, closeOnBackgroundClick : true}); 231 231 jQuery.post(ajaxurl, data, function(response) { if (response=='') response = 'Message Posted'; … … 467 467 //## Common Dialogs 468 468 if (!function_exists('nxs_showImgToUseDlg')){ function nxs_showImgToUseDlg($nt, $ii, $imgToUse, $hide=false){ ?> 469 <div class="nxsPostEd_ElemWrap" id="altFormatIMG<?php echo $nt.$ii; ?>" style="<?php echo $hide?'display:none;':''; ?>"><div class="nxsPostEd_ElemLabel" style="display: inline;"><?php _e('Image to use:', 'social-networks-auto-poster-facebook-twitter-g') ?></div>470 <div class="nxsPostEd_Elem" style="display: inline;"><input type="checkbox" class="isAutoImg" <?php if ($imgToUse=='') { ?>checked="checked"<?php } ?> id="isAutoImg-<?php echo $nt; ?><?php echo $ii; ?>" name="<?php echo $nt; ?>[<?php echo $ii; ?>][isAutoImg]" value="A"/> <?php _e('Auto', 'social-networks-auto-poster-facebook-twitter-g'); ?>471 <?php if ($imgToUse!='') { ?> <a onclick="nxs_clPrvImgShow('<?php echo $nt; ?><?php echo $ii; ?>');return false;" href="#"><?php _e('Show all', 'social-networks-auto-poster-facebook-twitter-g'); ?></a><br/>472 <div class="nxs_prevImagesDiv" id="nxs_<?php echo $nt; ?><?php echo $ii; ?>_idivD"><img class="nxs_prevImages" src="<?php echo $imgToUse; ?>"><div style="display:block;" class="nxs_checkIcon"><div class="media-modal-icon"></div></div></div>469 <div class="nxsPostEd_ElemWrap" id="altFormatIMG<?php echo esc_attr($nt.$ii); ?>" style="<?php echo $hide?'display:none;':''; ?>"><div class="nxsPostEd_ElemLabel" style="display: inline;"><?php _e('Image to use:', 'social-networks-auto-poster-facebook-twitter-g') ?></div> 470 <div class="nxsPostEd_Elem" style="display: inline;"><input type="checkbox" class="isAutoImg" <?php if ($imgToUse=='') { ?>checked="checked"<?php } ?> id="isAutoImg-<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][isAutoImg]" value="A"/> <?php _e('Auto', 'social-networks-auto-poster-facebook-twitter-g'); ?> 471 <?php if ($imgToUse!='') { ?> <a onclick="nxs_clPrvImgShow('<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>');return false;" href="#"><?php _e('Show all', 'social-networks-auto-poster-facebook-twitter-g'); ?></a><br/> 472 <div class="nxs_prevImagesDiv" id="nxs_<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>_idivD"><img class="nxs_prevImages" src="<?php echo $imgToUse; ?>"><div style="display:block;" class="nxs_checkIcon"><div class="media-modal-icon"></div></div></div> 473 473 <?php } else { ?><?php } ?> 474 <div id="imgPrevList-<?php echo $nt; ?><?php echo $ii; ?>" class="nxs_imgPrevList" style="display: none;"></div>475 <input type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][imgToUse]" class="nxsEdElem" value="<?php echo $imgToUse ?>" id="imgToUse-<?php echo $nt; ?><?php echo $ii; ?>" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" />474 <div id="imgPrevList-<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>" class="nxs_imgPrevList" style="display: none;"></div> 475 <input type="hidden" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][imgToUse]" class="nxsEdElem" value="<?php echo $imgToUse ?>" id="imgToUse-<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" /> 476 476 </div> 477 477 </div> … … 479 479 if (!function_exists('nxs_showURLToUseDlg')){ function nxs_showURLToUseDlg($nt, $ii, $urlToUse){ ?> 480 480 <div class="nxsPostEd_ElemWrap" style=""><div class="nxsPostEd_ElemLabel" style="display: inline;"><?php _e('URL to use:', 'social-networks-auto-poster-facebook-twitter-g') ?></div> 481 <div class="nxsPostEd_Elem" style="display: inline;"><input type="checkbox" class="isAutoURL nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" <?php if ($urlToUse=='') { ?>checked="checked"<?php } ?> id="isAutoURL-<?php echo $nt; ?><?php echo $ii; ?>" name="<?php echo $nt; ?>[<?php echo $ii; ?>][isAutoURL]" value="A"/> <?php _e('Auto', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post URL or globally defined URL will be used', 'social-networks-auto-poster-facebook-twitter-g'); ?></i>482 <div class="nxs_prevURLDiv" <?php if (trim($urlToUse)=='') { ?> style="display:none;"<?php } ?> id="isAutoURLFld-<?php echo $nt; ?><?php echo $ii; ?>"><br/>483 <?php _e('URL:', 'social-networks-auto-poster-facebook-twitter-g') ?> <input style="width:60%;max-width: 610px;" class="nxsEdElem" data-ii="<?php echo $ii; ?>" data-nt="<?php echo $nt; ?>" type="text" name="<?php echo $nt; ?>[<?php echo $ii; ?>][urlToUse]" value="<?php echo $urlToUse ?>" id="URLToUse-<?php echo $nt; ?><?php echo $ii; ?>" />481 <div class="nxsPostEd_Elem" style="display: inline;"><input type="checkbox" class="isAutoURL nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" <?php if ($urlToUse=='') { ?>checked="checked"<?php } ?> id="isAutoURL-<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][isAutoURL]" value="A"/> <?php _e('Auto', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('Post URL or globally defined URL will be used', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> 482 <div class="nxs_prevURLDiv" <?php if (trim($urlToUse)=='') { ?> style="display:none;"<?php } ?> id="isAutoURLFld-<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>"><br/> 483 <?php _e('URL:', 'social-networks-auto-poster-facebook-twitter-g') ?> <input style="width:60%;max-width: 610px;" class="nxsEdElem" data-ii="<?php echo esc_attr($ii); ?>" data-nt="<?php echo esc_attr($nt); ?>" type="text" name="<?php echo esc_attr($nt); ?>[<?php echo esc_attr($ii); ?>][urlToUse]" value="<?php echo $urlToUse ?>" id="URLToUse-<?php echo esc_attr($nt); ?><?php echo esc_attr($ii); ?>" /> 484 484 </div> 485 485 </div><div style="clear: both;"></div></div> -
social-networks-auto-poster-facebook-twitter-g/trunk/js-css/js.js
r2469838 r2757212 1 1 jQuery(document).ready(function() { nxs_doTabs(); 2 2 3 jQuery('#nxs_ntType').ddslick({ width: 200, imagePosition: "left", selectText: "Select network", onSelected: function (data) { doShowFillBlockX(data.selectedData.value);}});3 jQuery('#nxs_ntType').ddslick({ width: 300, imagePosition: "left", selectText: "Select network", onSelected: function (data) { doShowFillBlockX(data.selectedData.value);}}); 4 4 5 5 … … 1140 1140 ddOptionsHtml = '<ul class="dd-options"></ul>', 1141 1141 1142 //CSS for ddSlick1143 ddslickCSS = '<style id="css-ddslick" type="text/css">' +1144 '.dd-select{ border-radius:2px; border:solid 1px #ccc; position:relative; cursor:pointer;}' +1145 '.dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }' +1146 '.dd-selected{ overflow:hidden; display:block; padding:10px; font-weight:bold;}' +1147 '.dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}' +1148 '.dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }' +1149 '.dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}' +1150 '.dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}' +1151 '.dd-option, .dd-title{ padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }' +1152 '.dd-option { padding-left:20px} .dd-options > li:last-child > .dd-option{ border-bottom:none;}' +1153 '.dd-option:hover{ background:#f3f3f3; color:#000;}' +1154 '.dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }' +1155 '.dd-option-selected { background:#f6f6f6; }' +1156 '.dd-option-image, .dd-selected-image { vertical-align:middle; float:left; margin-right:5px; max-width:64px;}' +1157 '.dd-image-right { float:right; margin-right:15px; margin-left:5px;}' +1158 '.dd-container{ position:relative;}? .dd-selected-text { font-weight:bold}?</style>';1142 //CSS for ddSlick 1143 ddslickCSS = '<style id="css-ddslick" type="text/css">' + 1144 '.dd-select{ border-radius:2px; border:solid 1px #ccc; position:relative; cursor:pointer;}' + 1145 '.dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }' + 1146 '.dd-selected{ overflow:hidden; display:block; padding:10px; font-weight:bold;}' + 1147 '.dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}' + 1148 '.dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }' + 1149 '.dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}' + 1150 '.dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}' + 1151 '.dd-option, .dd-title{ padding:5px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }' + 1152 '.dd-option { padding-left:25px; padding-top: 0px; padding-bottom: 2px;} .dd-options > li:last-child > .dd-option{ border-bottom:none;}' + 1153 '.dd-option:hover{ background:#f3f3f3; color:#000;}' + 1154 '.dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }' + 1155 '.dd-option-selected { background:#f6f6f6; }' + 1156 '.dd-option-image, .dd-selected-image { vertical-align:middle; margin-right:5px; max-width:64px;}' + 1157 '.dd-image-right { float:right; margin-right:15px; margin-left:5px;}' + 1158 '.dd-container{ position:relative;}? .dd-selected-text { font-weight:bold}?</style>'; 1159 1159 1160 1160 //CSS styles are only added once. -
social-networks-auto-poster-facebook-twitter-g/trunk/readme.txt
r2748653 r2757212 5 5 Tags: automation, autopost, auto-post, auto post, socialnetworks, socialnetwork, social networks, social network, Flipboard, google, Flickr, twitter, pinterest, google my business, 500px, tumblr, blogger, blogspot, linkedin, reddit, reddit.com, plugin, links, Post, posts, api, automatic, seo, scoop.it, integration, bookmark, bookmarks, admin, images, image, social, sharing, share, repost, re-post, wordpress.com, Diigo, vBulletin, Plurk, forums, vKontakte, open graph, LiveJournal, SETT, YouTube, Telegram, xing, medium, yo, Weibo, mailchimp, line, Odnoklassniki, ok.ru 6 6 Requires at least: 3.4 7 Tested up to: 6.0. 08 Stable tag: 4.3.2 67 Tested up to: 6.0.1 8 Stable tag: 4.3.27 9 9 License: GPLv2 or later 10 10 … … 183 183 == Changelog == 184 184 185 = 4.3.27 [07/15/2022] = 186 187 * New/Improvement - [Twitter] - Update to the latest API compatibility. 188 * New/Improvement - [LJ] - Update to the latest API compatibility. 189 * Removed [Google+/Google Currents] 190 * Bug Fix - Many security compliance changes/fixes 191 * Bug Fix - PHP 8 Compatibility Improvements. 192 * Bug Fix - Fix for 'Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type int, string given' error 193 * Improvement - A lot of code cleanup/improvements. 194 195 185 196 = 4.3.26 [06/27/2022] = 186 197 187 198 * New - Support for Wordpress 6.0 188 199 * Bug Fix - Possible security vulnerability [WP-2022-05-31] 189 190 200 191 201 = 4.3.25 [12/29/2021] =
Note: See TracChangeset
for help on using the changeset viewer.