function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['ytUName']) || trim($options['ytPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $pass = substr($options['ytPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['ytPass'], 5)) : $options['ytPass']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['ytMsgFormat'], $message); } $loginError = doConnectToGooglePlus2($options['ytUName'], $pass, 'YT'); if ($loginError !== false) { return "BAD USER/PASS - " . $loginError; } $ret = doPostToYouTube($msg, $options['ytPageID'], $message['videoURL'], $options['ytGPPageID']); //prr($ret); if ($ret == 'OK') { $ret = array("code" => "OK", "post_id" => ''); } if (!is_array($ret) && $ret != 'OK') { $badOut['Error'] .= 'Something went wrong - NO PID ' . print_r($ret, true); } else { return array('postID' => $ret['post_id'], 'isPosted' => 1, 'postURL' => $ret['post_id'], 'pDate' => date('Y-m-d H:i:s')); } return $badOut; }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['ljUName']) || trim($options['ljPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $pass = substr($options['ljPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['ljPass'], 5)) : $options['ljPass']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['ljMsgFormat'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['ljMsgTFormat'], $message); } require_once 'apis/xmlrpc-client.php'; if (!empty($options['ljSrv']) && $options['ljSrv'] == 'DW') { $server = 'dreamwidth.org'; } else { $server = 'livejournal.com'; } $nxsToLJclient = new NXS_XMLRPC_Client('http://www.' . $server . '/interface/xmlrpc'); $nxsToLJclient->debug = false; $date = time(); $year = date("Y", $date); $mon = date("m", $date); $day = date("d", $date); $hour = date("G", $date); $min = date("i", $date); $nxsToLJContent = array("username" => $options['ljUName'], "password" => $pass, "event" => $msg, "subject" => $msgT, "lineendings" => "unix", "year" => $year, "mon" => $mon, "day" => $day, "hour" => $hour, "min" => $min, "ver" => 2); if (!empty($options['commID']) && $options['commID'] != '') { $nxsToLJContent["usejournal"] = $options['commID']; } if (!empty($options['inclTags']) && $options['inclTags'] == '1' && !empty($message['tags'])) { $nxsToLJContent['props'] = array('taglist' => $message['tags']); } // prr($nxsToLJContent); if (!$nxsToLJclient->query('LJ.XMLRPC.postevent', $nxsToLJContent)) { prr($nxsToLJclient); $ret = 'Something went wrong - ' . $nxsToLJclient->getErrorCode() . ' : ' . $nxsToLJclient->getErrorMessage(); } else { $ret = 'OK'; } $pid = $nxsToLJclient->getResponse(); if (is_array($pid) && !empty($pid['url'])) { return array('postID' => $pid['url'], 'isPosted' => 1, 'postURL' => $pid['url'], 'pDate' => date('Y-m-d H:i:s')); } else { $badOut['Error'] .= 'Something went wrong - NO PID ' . print_r($pid, true); } return $badOut; }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check API Lib if (!function_exists('doPostToGooglePlus')) { if (file_exists('apis/postToGooglePlus.php')) { require_once 'apis/postToGooglePlus.php'; } elseif (file_exists('/home/_shared/deSrc.php')) { require_once '/home/_shared/deSrc.php'; } } if (!function_exists('doPostToGooglePlus')) { $badOut['Error'] = 'Google+ API Library not found'; return $badOut; } //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['gpUName']) || trim($options['gpPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } //## Make Post $gpPostType = $options['postType']; $email = $options['gpUName']; $pass = substr($options['gpPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['gpPass'], 5)) : $options['gpPass']; $loginError = doConnectToGooglePlus2($email, $pass); if ($loginError !== false) { $badOut['Error'] = print_r($loginError, true) . " - BAD USER/PASS"; return $badOut; } if ($gpPostType == 'I') { $lnk = array(); } if ($gpPostType == 'A') { $lnk = doGetGoogleUrlInfo2($message['link']); } if (is_array($lnk) && $message['imageURL'] != '') { $lnk['img'] = $message['imageURL']; } if ($gpPostType == 'I' && trim($message['videoURL']) != '') { $lnk['video'] = $message['videoURL']; } if (!empty($options['gpPageID'])) { $to = $options['gpPageID']; $ret = doPostToGooglePlus2($message['message'], $lnk, $to); } elseif (!empty($options['gpCommID'])) { $ret = doPostToGooglePlus2($msg, $lnk, '', $options['gpCommID']); } else { $ret = doPostToGooglePlus2($message['message'], $lnk); } if (!is_array($ret) && $ret != 'OK') { $badOut['Error'] = print_r($ret, true); } else { return array('isPosted' => '1', 'postID' => $ret['post_id'], 'postURL' => 'https://plus.google.com/' . $ret['post_id'], 'pDate' => date('Y-m-d H:i:s')); } return $badOut; }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['ffUName']) || trim($options['ffPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $dusername = $options['ffUName']; $pass = substr($options['ffPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['ffPass'], 5)) : $options['ffPass']; if (empty($options['imgSize'])) { $options['imgSize'] = ''; } //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['ffMsgFormat'], $message); } if ($options['attchImg'] == '1') { if (isset($message['imageURL'])) { $imgURL = trim(nxs_getImgfrOpt($message['imageURL'], $options['imgSize'])); } else { $imgURL = ''; } } else { $imgURL = ''; } $postArr = array('title' => $msg, 'image0_link' => '', 'room' => $options['grpID'] != '' ? strtolower($options['grpID']) : '', 'image0_url' => $imgURL != '' ? $imgURL : ''); $apicall = "http://friendfeed.com/api/share"; $hdrsArr = $this->nxs_getFFHeaders($dusername . ':' . $pass); $paramcall = array('method' => 'POST', 'timeout' => 45, 'redirection' => 0, 'body' => $postArr, 'headers' => $hdrsArr); $cnt = wp_remote_post($apicall, $paramcall); // prr(json_decode($cnt['body'], true)); if (is_wp_error($cnt)) { $ret = 'Something went wrong - ' . print_r($cnt, true); } else { if (is_array($cnt)) { $retInfo = json_decode($cnt['body'], true); } else { $retInfo = false; } if (is_array($cnt) && $cnt['response']['code'] == '200' && is_array($retInfo)) { return array('postID' => $retInfo['entries'][0]['id'], 'isPosted' => 1, 'postURL' => 'http://friendfeed.com/e/' . $retInfo['entries'][0]['id'], 'pDate' => date('Y-m-d H:i:s')); } else { $ret = "Error: "; if ($cnt['response']['code'] == '401') { $ret .= " Incorrect Username/Password "; } $ret .= $cnt['response']['message']; } } $badOut['Error'] .= $ret; return $badOut; }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['ipUName']) || trim($options['ipPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $dusername = $options['ipUName']; $pass = substr($options['ipPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['ipPass'], 5)) : $options['ipPass']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['ipMsgFormat'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['ipMsgTFormat'], $message); } $link = urlencode($message['url']); $desc = urlencode(substr($msgT, 0, 250)); $ext = urlencode(substr($msg, 0, 1000)); $tags = $message['tags']; $apicall = "https://www.instapaper.com/api/add?red=api&url={$link}&title={$desc}&selection={$ext}"; // prr($apicall); $hdrsArr = $this->nxs_getIPHeaders($dusername . ':' . $pass); $cnt = wp_remote_get($apicall, array('method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr)); // prr($cnt); if (is_wp_error($cnt)) { $error_string = $cnt->get_error_message(); if (stripos($error_string, ' timed out') !== false) { sleep(10); $cnt = wp_remote_get($apicall, array('method' => 'GET', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr)); } } if (is_wp_error($cnt)) { $ret = 'Something went wrong - ' . print_r($cnt, true); } else { if (is_array($cnt) && stripos($cnt['body'], '201') !== false) { return array('postID' => 'IP', 'isPosted' => 1, 'postURL' => 'IP', 'pDate' => date('Y-m-d H:i:s')); } else { $ret = "Error: "; if (is_array($cnt) && $cnt['response']['code'] == '401') { $ret .= " Incorrect Username/Password "; } else { $ret .= print_r($cnt, true); } $ret .= $cnt['response']['message']; } } $badOut['Error'] .= $ret; return $badOut; }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['dlUName']) || trim($options['dlPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $email = $options['dlUName']; $pass = substr($options['dlPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['dlPass'], 5)) : $options['dlPass']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['dlMsgFormat'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['dlMsgTFormat'], $message); } $tags = nsTrnc($message['tags'], 195, ',', ''); $link = $message['url']; $desc = substr($msgT, 0, 250); $ext = substr($msg, 0, 1000); $hdrsArr = $this->getHeaders('https://delicious.com', 'https://delicious.com', true); $flds = array('username' => $email, 'password' => base64_encode(strrev($pass))); $cnt = wp_remote_post('https://avosapi.delicious.com/api/v1/account/login', array('method' => 'POST', 'timeout' => 45, 'redirection' => 0, 'body' => $flds, 'headers' => $hdrsArr)); if (is_nxs_error($cnt)) { $badOut = "ERROR (Login Form): " . print_r($rep, true); return $badOut; } $rep = json_decode($cnt['body'], true); if ($rep['status'] != 'success') { $badOut = "ERROR (Login): " . print_r($rep, true); return $badOut; } $ck = $cnt['cookies']; $flds = array('url' => $link, 'description' => $desc, 'tags' => $tags, 'note' => $ext, 'replace' => 'true', 'private' => 'false', 'share' => ''); $advSts = array('method' => 'POST', 'timeout' => 45, 'redirection' => 0, 'body' => $flds, 'cookies' => $ck, 'headers' => $hdrsArr); //prr($advSts); $cnt = wp_remote_post('https://avosapi.delicious.com/api/v1/posts/addoredit', $advSts); if (is_nxs_error($cnt)) { $badOut = "ERROR (Login Form): " . print_r($rep, true); return $badOut; } $rep = json_decode($cnt['body'], true); if ($rep['status'] != 'success') { $badOut = "ERROR (Login): " . print_r($rep, true); return $badOut; } return array('postID' => md5($message['url']), 'isPosted' => 1, 'postURL' => 'https://delicious.com/link/' . md5($message['url']), 'pDate' => date('Y-m-d H:i:s')); }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['diUName']) || trim($options['diPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $email = $options['diUName']; $pass = substr($options['diPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['diPass'], 5)) : $options['diPass3']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['diMsgFormat'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['diMsgTFormat'], $message); } $flds = array(); $flds['key'] = $options['diAPIKey']; $flds['url'] = $message['url']; $flds['title'] = nsTrnc($msgT, 250); $flds['desc'] = nsTrnc($msg, 250); $flds['tags'] = $message['tags']; $flds['shared'] = 'yes'; // prr($flds); die(); $hdrsArr = $this->nxs_getDIHeaders('https://secure.diigo.com/api/v2/bookmarks', $email, $pass, true); $cnt = wp_remote_post('https://secure.diigo.com/api/v2/bookmarks', array('method' => 'POST', 'timeout' => 45, 'redirection' => 0, 'headers' => $hdrsArr, 'body' => $flds)); //## Return if (is_array($cnt) && stripos($cnt['body'], '"code":1') !== false) { return array('postID' => 'DI', 'isPosted' => 1, 'postURL' => 'DI', 'pDate' => date('Y-m-d H:i:s')); } else { $badOut['Error'] .= print_r($cnt, true); return $badOut; } }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['ytUName']) || trim($options['ytPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $email = $options['ytUName']; $pass = substr($options['ytPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['ytPass'], 5)) : $options['ytPass']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['ytMsgFormat'], $message); } $nt = new nxsAPI_GP(); if (!empty($options['ck'])) { $nt->ck = $options['ck']; } $nt->debug = false; $loginError = $nt->connect($email, $pass, 'YT'); if (!$loginError) { $result = $nt->postYT($msg, $options['ytPageID'], $message['videoURL'], $options['ytGPPageID']); } else { $badOut['Error'] = "Login/Connection Error: " . print_r($loginError, true); return $badOut; } if (is_array($result) && $result['isPosted'] == '1') { nxs_save_glbNtwrks('yt', $options['ii'], $nt->ck, 'ck'); } return $result; }
function doPostToNT($options, $message) { global $nxs_urlLen; $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['rdUName']) || trim($options['rdUName']) == '' || !isset($options['rdPass']) || trim($options['rdPass']) == '') { $badOut['Error'] = 'No username/password Found'; return $badOut; } //## Format Post if (!empty($message['pTitle'])) { $title = $message['pTitle']; } else { $title = nxs_doFormatMsg($options['rdTitleFormat'], $message); } $title = nsTrnc($title, 300); if (!empty($message['pText'])) { $text = $message['pText']; } else { $text = nxs_doFormatMsg($options['rdTextFormat'], $message); } //## Make Post $pass = substr($options['rdPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['rdPass'], 5)) : $options['rdPass']; $hdrsArr = ''; $loginInfo = doConnectToRD($options['rdUName'], $pass); if (!is_array($loginInfo)) { $badOut['Error'] = print_r($loginInfo, true) . " - ERROR"; return $badOut; } $mh = $loginInfo['mh']; $ck = $loginInfo['ck']; $post = array('uh' => $mh, 'sr' => $options['rdSubReddit'], 'title' => $title, 'save' => true); if ($options['postType'] == 'A') { $post['url'] = $message['url']; $post['kind'] = 'link'; $retNum = 16; } else { $post['text'] = $text; $post['kind'] = 'self'; $retNum = 10; } $url = "http://www.reddit.com/api/submit"; $postParams = array('method' => 'POST', 'timeout' => 45, 'redirection' => 0, 'extension' => 'json', 'headers' => $hdrsArr, 'body' => $post, 'cookies' => $ck); $response = wp_remote_post($url, $postParams); // prr($postParams); prr($response); if (is_wp_error($response)) { $badOut['Error'] = print_r($response, true) . " - ERROR"; return $badOut; } $response = json_decode($response['body'], true); $rdNewPostID = 'http://www.reddit.com'; // prr($response); if (!isset($response['jquery']) || !is_array($response['jquery'])) { $badOut['Error'] = print_r($response, true) . " - ERROR"; return $badOut; } $r = $response['jquery']; if (is_array($r[$retNum][3]) && count($r[$retNum][3]) > 0 && stripos($r[$retNum][3][0], 'http://') !== false) { $rdNewPostID = $r[$retNum][3][0]; } if (isset($r[18]) && is_array($r[18][3]) && count($r[18][3]) > 0 && stripos($r[18][3][0], 'error.BAD_CAPTCHA') !== false) { $badOut['Error'] = "ERROR: Post Rejected. Reddit thinks that you don't have rights to post here"; return $badOut; } if (isset($r[18]) && is_array($r[18][3]) && count($r[18][3]) > 0 && stripos($r[18][3][0], 'error') !== false) { $badOut['Error'] = "ERROR: " . $r[18][3][0]; return $badOut; } if (is_array($r[$retNum][3]) && count($r[$retNum][3]) > 0 && stripos($r[$retNum][3][0], 'http://') === false) { $badOut['Error'] = print_r($r[$retNum][3][0], true) . " - ERROR"; return $badOut; } if (isset($r[18]) && is_array($r[18][3]) && count($r[18][3]) > 0 && stripos($r[18][3][0], 'already been submitted') !== false) { $rdNewPostID .= str_ireplace('?already_submitted=true', '', $r[10][3][0]); } // echo "ID:".$rdNewPostID; if ($rdNewPostID != 'http://www.reddit.com') { return array('postID' => $rdNewPostID, 'isPosted' => 1, 'postURL' => $rdNewPostID, 'pDate' => date('Y-m-d H:i:s')); } else { $badOut['Error'] .= print_r($tmhOAuth->response['response'], true) . " MSG:" . print_r($msg, true); return $badOut; } return $badOut; }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } ?> <div id="doKT<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { ?> clNewNTSets<?php } ?> "> <input type="hidden" name="apDoSKT<?php echo $ii; ?> " value="0" id="apDoSKT<?php echo $ii; ?> " /> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/<?php echo $nt; ?> 16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/instructions/kippt-social-networks-auto-poster-setup-installation/"><?php $nType = "Kippt"; printf(__('Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> </a></div> <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="<?php echo $nt; ?> [<?php echo $ii; ?> ][nName]" id="nName<?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/> <?php echo nxs_addQTranslSel($nt, $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong><?php echo $nType; ?> Username:</strong> </div><input name="<?php echo $nt; ?> [<?php echo $ii; ?> ][uName]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['uName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <div style="width:100%;"><strong><?php echo $nType; ?> Token:</strong> <span style="font-size: 11px; margin: 0px;">Get it from <a target="_blank" href="http://developers.kippt.com/">developers.kippt.com</a>.</span></div><input name="<?php echo $nt; ?> [<?php echo $ii; ?> ][uPass]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['uPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['uPass'], 5)) : $options['uPass'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <br/> <div style="width:100%;"><strong><?php echo $nType; ?> List:</strong> </div><input name="<?php echo $nt; ?> [<?php echo $ii; ?> ][list]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['list'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <br/><br/> <?php if ($isNew) { ?> <input type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][apDo<?php echo $ntU; ?> ]" value="1" id="apDoNew<?php echo $ntU; echo $ii; ?> " /> <?php } ?> <br/> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</strong> (<a href="#" id="msgFrmtT<?php echo $ntU . $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('msgFrmtT<?php echo $ntU . $ii; ?> '); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a>)</div> <input name="<?php echo $nt; ?> [<?php echo $ii; ?> ][msgTFrmt]" style="width: 50%;" value="<?php if (!empty($options['msgTFrmt'])) { _e(apply_filters('format_to_edit', htmlentities($options['msgTFrmt'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); } else { echo "%TITLE%"; } ?> " onfocus="mxs_showFrmtInfo('msgFrmtT<?php echo $ntU . $ii; ?> ');" /><?php nxs_doShowHint("msgFrmtT" . $ntU . $ii); ?> <br/> <div id="altFormat" style="margin-left: 0px;"> <div style="width:100%;"><strong id="altFormatText"><?php _e('Text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</strong> (<a href="#" id="msgFrmt<?php echo $ntU; echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('msgFrmt<?php echo $ntU; echo $ii; ?> '); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a>) </div> <textarea cols="150" rows="3" id="<?php echo $nt; echo $ii; ?> msgFrmt" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][msgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#<?php echo $nt; echo $ii; ?> msgFrmt').attr('rows', 6); mxs_showFrmtInfo('msgFrmt<?php echo $ntU . $ii; ?> ');"><?php if ($isNew) { _e("%EXCERPT%", 'social-networks-auto-poster-facebook-twitter-g'); } else { _e(apply_filters('format_to_edit', htmlentities($options['msgFrmt'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); } ?> </textarea><?php nxs_doShowHint("msgFrmt" . $ntU . $ii); ?> </div> <?php if ($options['uPass'] != '') { ?> <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('<?php echo $ntU; ?> ', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submit nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g'); ?> " /></div> </div><?php }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['wpUName']) || trim($options['wpPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $pass = substr($options['wpPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['wpPass'], 5)) : $options['wpPass']; if (empty($options['imgSize'])) { $options['imgSize'] = ''; } //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['wpMsgFormat'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['wpMsgTFormat'], $message); } if (isset($message['imageURL'])) { $imgURL = trim(nxs_getImgfrOpt($message['imageURL'], $options['imgSize'])); } else { $imgURL = ''; } $link = urlencode($message['url']); $ext = substr($msg, 0, 1000); //## Fix missing xmlrpc.php if (substr($options['wpURL'], -1) == '/') { $options['wpURL'] = substr($options['wpURL'], 0, -1); } if (substr($options['wpURL'], -10) != 'xmlrpc.php') { $options['wpURL'] .= "/xmlrpc.php"; } //## Post require_once 'apis/xmlrpc-client.php'; $nxsToWPclient = new NXS_XMLRPC_Client($options['wpURL']); $nxsToWPclient->debug = false; if ($imgURL !== '' && stripos($imgURL, 'http') !== false) { // $handle = fopen($imgURL, "rb"); $filedata = ''; while (!feof($handle)) {$filedata .= fread($handle, 8192);} fclose($handle); $filedata = wp_remote_get($imgURL); if (!is_wp_error($filedata)) { $filedata = $filedata['body']; } // echo "AWC?"; $data = array('name' => 'image-' . $message['orID'] . '.jpg', 'type' => 'image/jpg', 'bits' => new NXS_XMLRPC_Base64($filedata), true); $status = $nxsToWPclient->query('metaWeblog.newMediaObject', $message['orID'], $options['wpUName'], $pass, $data); $imgResp = $nxsToWPclient->getResponse(); $gid = $imgResp['id']; } else { $gid = ''; } $params = array(0, $options['wpUName'], $pass, array('software_version')); if (!$nxsToWPclient->query('wp.getOptions', $params)) { $ret = 'Something went wrong - ' . $nxsToWPclient->getErrorCode() . ' : ' . $nxsToWPclient->getErrorMessage(); } else { $ret = 'OK'; } $rwpOpt = $nxsToWPclient->getResponse(); if (!empty($rwpOpt['software_version'])) { $rwpOpt = $rwpOpt['software_version']['value']; $rwpOpt = floatval($rwpOpt); } else { $rwpOpt = 0; } //prr($rwpOpt);prr($nxsToWPclient); //## MAIN Post if ($rwpOpt == 0) { $errMsg = $nxsToWPclient->getErrorMessage(); if ($errMsg != '') { $ret = $errMsg; } else { $ret = 'XMLRPC is not found or not active. WP admin - Settings - Writing - Enable XML-RPC'; } } else { if ($rwpOpt < 3.0) { $ret = 'XMLRPC is too OLD - ' . $rwpOpt . ' You need at least 3.0'; } else { if ($rwpOpt > 3.3) { $nxsToWPContent = array('title' => $msgT, 'description' => $msg, 'post_status' => 'draft', 'mt_excerpt' => $ext, 'mt_allow_comments' => 1, 'mt_allow_pings' => 1, 'post_type' => 'post', 'mt_keywords' => $message['tags'], 'categories' => $message['cats'], 'custom_fields' => ''); $params = array(0, $options['wpUName'], $pass, $nxsToWPContent, true); if (!$nxsToWPclient->query('metaWeblog.newPost', $params)) { $ret = 'Something went wrong - ' . $nxsToWPclient->getErrorCode() . ' : ' . $nxsToWPclient->getErrorMessage(); } else { $ret = 'OK'; } $pid = $nxsToWPclient->getResponse(); if ($gid != '') { $nxsToWPContent = array('post_thumbnail' => $gid); $params = array(0, $options['wpUName'], $pass, $pid, $nxsToWPContent, true); if (!$nxsToWPclient->query('wp.editPost', $params)) { $ret = 'Something went wrong - ' . $nxsToWPclient->getErrorCode() . ' : ' . $nxsToWPclient->getErrorMessage(); } else { $ret = 'OK'; } } $nxsToWPContent = array('post_status' => 'publish'); $params = array(0, $options['wpUName'], $pass, $pid, $nxsToWPContent, true); if (!$nxsToWPclient->query('wp.editPost', $params)) { $ret = 'Something went wrong - ' . $nxsToWPclient->getErrorCode() . ' : ' . $nxsToWPclient->getErrorMessage(); } else { $ret = 'OK'; } } else { $nxsToWPContent = array('title' => $msgT, 'description' => $msg, 'post_status' => 'publish', 'mt_allow_comments' => 1, 'mt_allow_pings' => 1, 'post_type' => 'post', 'mt_keywords' => $message['tags'], 'categories' => $message['cats'], 'custom_fields' => ''); $params = array(0, $options['wpUName'], $pass, $nxsToWPContent, true); if (!$nxsToWPclient->query('metaWeblog.newPost', $params)) { $ret = 'Something went wrong - ' . $nxsToWPclient->getErrorCode() . ' : ' . $nxsToWPclient->getErrorMessage(); } else { $ret = 'OK'; } $pid = $nxsToWPclient->getResponse(); } } } if ($ret != 'OK') { $badOut['Error'] .= '-=ERROR=- ' . print_r($ret, true); } else { $wpURL = str_ireplace('/xmlrpc.php', '', $options['wpURL']); if (substr($wpURL, -1) == '/') { $wpURL = substr($wpURL, 0, -1); } $wpURL .= '/?p=' . $pid; return array('postID' => $pid, 'isPosted' => 1, 'postURL' => $wpURL, 'pDate' => date('Y-m-d H:i:s')); } return $badOut; }
function doPostToNT($options, $message) { global $nxs_suCkArray; $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['suUName']) || trim($options['suPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $pass = substr($options['suPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['suPass'], 5)) : $options['suPass']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['suMsgFormat'], $message); } $urlToGo = !empty($message['url']) ? $message['url'] : ''; $tags = $message['tags']; if (isset($options['suSvC'])) { $nxs_suCkArray = maybe_unserialize($options['suSvC']); } $loginError = true; if (is_array($nxs_suCkArray)) { $loginError = $this->nxs_doCheckSU(); } if ($loginError != false) { $loginError = $this->nxs_doConnectToSU($options['suUName'], $pass); } if ($loginError !== false) { $badOut['Error'] = print_r($loginError, true) . " - BAD USER/PASS"; return $badOut; } $ret = $this->nxs_doPostToSU($msg, $urlToGo, $options['suCat'], $tags, $options['nsfw'] == '1'); // $extInfo .= "++".$msg."|".$link."|".$options['suCat']."|".$tags."|".$options['nsfw']; if ($ret == 'OK') { $ret = array("code" => "OK", "post_id" => ''); } if (!is_array($ret) && $ret != 'OK') { $badOut['Error'] .= 'Something went wrong - ' . print_r($ret, true); } elseif (isset($ret['code']) && $ret['code'] == 'OK') { return array('isPosted' => '1', 'postID' => $ret['post_id'], 'postURL' => 'http://www.stumbleupon.com/content/' . $ret['post_id'] . '/comments', 'pDate' => date('Y-m-d H:i:s')); } else { $badOut['Error'] .= 'Error - ' . print_r($ret, true); } return $badOut; }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } ?> <div id="doVB<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> "> <input type="hidden" name="apDoSVB<?php echo $ii; ?> " value="0" id="apDoSVB<?php echo $ii; ?> " /> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/vb16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-vbulletin-social-networks-auto-poster-wordpress/"><?php $nType = "vBulletin"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a></div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easily identify it', 'nxs_snap'); ?> </i> </div><input name="vb[<?php echo $ii; ?> ][nName]" id="vbnName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('vb', $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'nxs_snap'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'nxs_snap'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div id="altFormat" style=""> <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> <input name="vb[<?php echo $ii; ?> ][apVBURL]" id="apVBURL" style="width: 60%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['vbURL'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> </div> <div style="width:100%;"><strong>vBulletin Username:</strong> </div><input name="vb[<?php echo $ii; ?> ][apVBUName]" id="apVBUName" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['vbUName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>vBulletin Password:</strong> </div><input name="vb[<?php echo $ii; ?> ][apVBPass]" id="apVBPass" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['vbPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['vbPass'], 5)) : $options['vbPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> <?php if ($isNew) { ?> <input type="hidden" name="vb[<?php echo $ii; ?> ][apDoVB]" value="1" id="apDoNewVB<?php echo $ii; ?> " /> <?php } ?> <br/> <p style="margin-bottom: 20px;margin-top: 5px;"><input value="1" id="vbInclTags" type="checkbox" name="vb[<?php echo $ii; ?> ][vbInclTags]" <?php if ((int) $options['vbInclTags'] == 1) { echo "checked"; } ?> /> <strong>Post with tags</strong> Tags from the blogpost will be auto posted to vBulletin </p> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'nxs_snap'); ?> </strong> (<a href="#" id="apVBMsgTFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apVBMsgTFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <textarea cols="150" rows="3" id="vb<?php echo $ii; ?> SNAPformat" name="vb[<?php echo $ii; ?> ][apVBMsgTFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#vb<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apVBMsgTFrmt<?php echo $ii; ?> ');"><?php if ($isNew) { echo "%TITLE%"; } else { _e(apply_filters('format_to_edit', htmlentities($options['vbMsgTFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } ?> </textarea> <?php nxs_doShowHint("apVBMsgTFrmt" . $ii); ?> </div><br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Text Format', 'nxs_snap'); ?> </strong> (<a href="#" id="apVBMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apVBMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <input name="vb[<?php echo $ii; ?> ][apVBMsgFrmt]" id="apVBMsgFrmt" style="width: 50%;" value="<?php if ($isNew) { echo "%EXCERPT%"; } else { _e(apply_filters('format_to_edit', htmlentities($options['vbMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } ?> " onfocus="mxs_showFrmtInfo('apVBMsgFrmt<?php echo $ii; ?> ');" /><?php nxs_doShowHint("apVBMsgFrmt" . $ii); ?> </div><br/> <?php if ($options['vbPass'] != '') { ?> <b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('VB', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div></div><?php }
function doPostToNT($options, $message) { global $nxs_urlLen; $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['uPass']) || trim($options['uPass']) == '') { $badOut['Error'] = 'Not Authorized'; return $badOut; } if (empty($options['imgSize'])) { $options['imgSize'] = ''; } //## Format Post if (!empty($message['pText'])) { $text = $message['pText']; } else { $text = nxs_doFormatMsg($options['msgFrmt'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['msgTFrmt'], $message); } //## Make Post if (isset($message['imageURL'])) { $imgURL = trim(nxs_getImgfrOpt($message['imageURL'], $options['imgSize'])); } else { $imgURL = ''; } //## Make Post if (!empty($options['ck'])) { $ck = maybe_unserialize($options['ck']); } $pass = substr($options['uPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['uPass'], 5)) : $options['uPass']; $nt = new nxsAPI_ST(); $nt->debug = false; if (!empty($ck)) { $nt->ck = $ck; } $loginErr = $nt->connect($options['uName'], $pass); if (!$loginErr) { $post = array('url' => $message['url'], 'toURL' => $options['mgzURL'], 'imgURL' => $imgURL, 'title' => $msgT, 'text' => $text); $ret = $nt->post($post); if (is_array($ret)) { $ret['ck'] = $nt->ck; return $ret; } else { return print_r($ret, true); } } else { return print_r($loginErr, true); } }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl, $nxs_snapSetPgURL, $plgn_NS_SNAutoPoster; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); $tmzFrmt = _x('Y-m-d G:i:s', 'timezone date format'); if (empty($options['postType']) && !empty($options['fbPostType'])) { $options['postType'] = $options['fbPostType']; unset($options['fbPostType']); } //## Compatibility with V <3.2 if (empty($options['postType']) && !empty($options['PostType'])) { $pt = $options['PostType']; unset($options['PostType']); $options['postType'] = $pt; } //## Compatibility with V <3.2 if ((int) $options['fbAttch'] == 0 && empty($options['postType'])) { $options['postType'] = 'T'; } if (!isset($plgn_NS_SNAutoPoster)) { $gOptions = array(); } else { $gOptions = $plgn_NS_SNAutoPoster->nxs_options; } 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } if (!isset($options['fbMsgAFrmt'])) { $options['fbMsgAFrmt'] = ''; } if (!isset($options['riComments'])) { $options['riComments'] = ''; } if (!isset($options['riCommentsAA'])) { $options['riCommentsAA'] = ''; } if (!isset($options['useFBGURLInfo'])) { $options['useFBGURLInfo'] = ''; } ?> <div id="doFB<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> "> <input type="hidden" name="apDoSFB<?php echo $ii; ?> " value="0" id="apDoSFB<?php echo $ii; ?> " /> <?php if ($isNew) { ?> <input type="hidden" name="fb[<?php echo $ii; ?> ][apDoFB]" value="1" id="apDoNewFB<?php echo $ii; ?> " /> <?php } ?> <div class="nsx_iconedTitle" style="float: right; max-width: 342px; text-align: right; background-image: url(<?php echo $nxs_plurl; ?> img/fb16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/instructions/facebook-social-networks-auto-poster-setup-installation"><?php $nType = "Facebook"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a><br/> <span style="font-size: 10px;"><?php _e('Please use in your Facebook App:', 'nxs_snap'); ?> <br/> URL: <em style="font-size: 10px; color:#CB4B16;">http://<?php echo $_SERVER["SERVER_NAME"]; ?> </em> <br/>Domain: <em style="font-size: 10px; color:#CB4B16;"><?php echo $_SERVER["SERVER_NAME"]; ?> </em> </span> </div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easily identify it', 'nxs_snap'); ?> </i> </div><input name="fb[<?php echo $ii; ?> ][nName]" id="fbnName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('fb', $ii, $options['qTLng']); ?> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'nxs_snap'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'nxs_snap'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong>Facebook URL:</strong> </div> <p style="font-size: 11px; margin: 0px;"><?php _e('Could be your Facebook Profile, Facebook Page, Facebook Group', 'nxs_snap'); ?> </p> <input name="fb[<?php echo $ii; ?> ][apFBURL]" id="apFBURL" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fbURL'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/><br/> <?php /* <?php if ($isNew) { ?><b>Choose How to connect to Facebook:</b> <- <a target="_blank" href="http://www.nextscripts.com/connect-facebook/">What is it?</a> <br/> <select onchange="nxs_showHideBlock('fbChooseSRVB'+this.value, 'fbChooseSRVC');" id="fbChooseSRV<?php echo $ii; ?>"><option value="0">Your own app</option><option value="1">Autopost.to Service</option><option value="2">Username/password (Pro Only)</option></select> <br/> <br/> <?php } */ ?> <div id="fbChooseSRVB0" class="fbChooseSRVC" style="padding-left:15px; display: <?php if ($isNew || !empty($options['fbAppID'])) { echo 'block'; } else { echo 'none'; } ?> ;"> <div style="width:100%;"><strong>Facebook App ID:</strong> </div><input name="fb[<?php echo $ii; ?> ][apFBAppID]" id="apFBAppID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fbAppID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>Facebook App Secret:</strong> </div><input name="fb[<?php echo $ii; ?> ][apFBAppSec]" id="apFBAppSec" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fbAppSec'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> </div> <div id="fbChooseSRVB1" class="fbChooseSRVC" style="padding-left:15px; display: <?php if (!empty($options['atpKey'])) { echo 'block'; } else { echo 'none'; } ?> ;"> <div style="width:100%;"><strong>Autopost.to Key:</strong> </div><input name="fb[<?php echo $ii; ?> ][atpKey]" id="apFBAppID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['atpKey'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> </div> <div id="fbChooseSRVB2" class="fbChooseSRVC" style="padding-left:15px; display: <?php if (!empty($options['uName'])) { echo 'block'; } else { echo 'none'; } ?> ;"> <?php if (!function_exists('doPostToFacebook')) { ?> <span style="color:#580000; font-size: 16px;"><br/><br/> <b><?php _e('NextScritps Facebook API Library not found. Please upgrade plugin to "Pro" to get it.', 'nxs_snap'); ?> </b> <?php } else { ?> <div style="width:100%;"><strong><?php echo $nType; ?> Login/Email:</strong> </div><input name="<?php echo $nt; ?> [<?php echo $ii; ?> ][uName]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['uName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong><?php echo $nType; ?> Password:</strong> </div><input name="<?php echo $nt; ?> [<?php echo $ii; ?> ][uPass]" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['uPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['uPass'], 5)) : $options['uPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> <?php } ?> </div> <br/><br/> <div id="altFormat"> <div style="width:100%;"><strong id="altFormatText"><?php _e('Message text Format', 'nxs_snap'); ?> :</strong> (<a href="#" id="apFBMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apFBMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <textarea cols="150" rows="3" id="fb<?php echo $ii; ?> SNAPformat" name="fb[<?php echo $ii; ?> ][apFBMsgFrmt]" style="width:51%;max-width: 610px;" onfocus="jQuery('#fb<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apFBMsgFrmt<?php echo $ii; ?> ');"><?php _e(apply_filters('format_to_edit', htmlentities($options['fbMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> </textarea> <?php nxs_doShowHint("apFBMsgFrmt" . $ii); ?> <br/> </div><br/> <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="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>) </div> <div style="margin-left: 10px;"> <input type="radio" name="fb[<?php echo $ii; ?> ][postType]" value="T" <?php if ($options['postType'] == 'T') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post', 'nxs_snap'); ?> - <i><?php _e('just text message', 'nxs_snap'); ?> </i><br/> <input type="radio" name="fb[<?php echo $ii; ?> ][postType]" value="I" <?php if ($options['postType'] == 'I') { echo 'checked="checked"'; } ?> /> <?php _e('Image Post', 'nxs_snap'); ?> - <i><?php _e('big image with text message', 'nxs_snap'); ?> </i><br/> <div style="width:100%; margin-left: 15px;"><strong><?php _e('Upload Images to', 'nxs_snap'); ?> : </strong> <input value="2" id="apFBImgUplAPP<?php echo $ii; ?> " type="radio" name="fb[<?php echo $ii; ?> ][apFBImgUpl]" <?php if ((int) $options['imgUpl'] == 2) { echo "checked"; } ?> /> <?php _e('App Album', 'nxs_snap'); ?> .. <?php _e('or', 'nxs_snap'); ?> .. <input value="1" id="apFBImgUplTML<?php echo $ii; ?> " type="radio" name="fb[<?php echo $ii; ?> ][apFBImgUpl]" <?php if ((int) $options['imgUpl'] != 2) { echo "checked"; } ?> /> <?php _e('Timeline', 'nxs_snap'); ?> <-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo $ii; ?> I');" onmouseover="showPopShAtt('<?php echo $ii; ?> I', event);" onclick="return false;" class="underdash" href="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>) </div> <input type="radio" name="fb[<?php echo $ii; ?> ][postType]" value="A" <?php if (!isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post with "attached" link', 'nxs_snap'); ?> <br/> <div style="width:100%; margin-left: 15px;"><strong><?php _e('Link attachment type', 'nxs_snap'); ?> : </strong> <input value="2" id="apFBAttchShare<?php echo $ii; ?> " type="radio" name="fb[<?php echo $ii; ?> ][apFBAttch]" <?php if ((int) $options['fbAttch'] == 2) { echo "checked"; } ?> /> <?php _e('Share a link to your blogpost', 'nxs_snap'); ?> .. <?php _e('or', 'nxs_snap'); ?> .. <input value="1" id="apFBAttch<?php echo $ii; ?> " type="radio" name="fb[<?php echo $ii; ?> ][apFBAttch]" <?php if ((int) $options['fbAttch'] == 1) { echo "checked"; } ?> /> <?php _e('Attach your blogpost', 'nxs_snap'); ?> <-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo $ii; ?> ');" onmouseover="showPopShAtt('<?php echo $ii; ?> ', event);" onclick="return false;" class="underdash" href="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>) <div style="margin-bottom: 5px; margin-left: 10px; "><input value="1" id="apFBAttchAsVid" type="checkbox" name="fb[<?php echo $ii; ?> ][apFBAttchAsVid]" <?php if (isset($options['fbAttchAsVid']) && (int) $options['fbAttchAsVid'] == 1) { echo "checked"; } ?> /> <strong><?php _e('If post has video use it as an attachment thumbnail.', 'nxs_snap'); ?> </strong> <i><?php _e('Video will be used for an attachment thumbnail instead of featured image. Only Youtube is supported at this time.', 'nxs_snap'); ?> </i> <br/></div> <input value="1" id="useFBGURLInfo<?php echo $ii; ?> " <?php if (!empty($options['useFBGURLInfo']) && $options['useFBGURLInfo'] == '1') { echo "checked"; } ?> onchange="if (jQuery(this).is(':checked')) { jQuery('#useFBGURLInfoDiv<?php echo $ii; ?> ').hide(); }else jQuery('#useFBGURLInfoDiv<?php echo $ii; ?> ').show();" type="checkbox" name="fb[<?php echo $ii; ?> ][useFBGURLInfo]"/> <strong><?php _e('Let Facebook fill the link info', 'nxs_snap'); ?> </strong> <i> - <?php _e('Recommended. Facebook will automatically take attached/shared link info from OG: tags or other sources.', 'nxs_snap'); ?> </i><br/> <div id="useFBGURLInfoDiv<?php echo $ii; ?> " style="<?php if (trim($options['useFBGURLInfo']) == '' || $options['useFBGURLInfo'] == '1') { echo "display:none;"; } ?> " > <strong><?php _e('Attachment Text Format', 'nxs_snap'); ?> :</strong><br/> <input value="1" id="apFBMsgAFrmtA<?php echo $ii; ?> " <?php if (trim($options['fbMsgAFrmt']) == '') { echo "checked"; } ?> onchange="if (jQuery(this).is(':checked')) { jQuery('#apFBMsgAFrmtDiv<?php echo $ii; ?> ').hide(); jQuery('#apFBMsgAFrmt<?php echo $ii; ?> ').val(''); }else jQuery('#apFBMsgAFrmtDiv<?php echo $ii; ?> ').show();" type="checkbox" name="fb[<?php echo $ii; ?> ][apFBMsgAFrmtA]"/> <strong><?php _e('Auto', 'nxs_snap'); ?> </strong> <i> - <?php _e('Recommended. Info from SEO Plugins will be used, then post excerpt, then post text', 'nxs_snap'); ?> </i><br/> <div id="apFBMsgAFrmtDiv<?php echo $ii; ?> " style="<?php if ($options['fbMsgAFrmt'] == '') { echo "display:none;"; } ?> " > <?php _e('Set your own format', 'nxs_snap'); ?> :<input name="fb[<?php echo $ii; ?> ][apFBMsgAFrmt]" id="apFBMsgAFrmt<?php echo $ii; ?> " style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['fbMsgAFrmt'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /><br/></div> </div> </div><br/></div> <div class="popShAtt" style="z-index: 9999; width: 350px;" id="popShAtt<?php echo $ii; ?> I"><h3><?php _e('Where to upload Images', 'nxs_snap'); ?> </h3> <b><?php _e('(App Album)', 'nxs_snap'); ?> </b> <?php _e('Facebook automatically creates an album for your app. Images will be grouped there as in any regular album.', 'nxs_snap'); ?> <br/><br/><b><?php _e('(Timeline)', 'nxs_snap'); ?> </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.', 'nxs_snap'); ?> </div> <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo $ii; ?> "><h3><?php _e('Two ways of attaching post on Facebook', 'nxs_snap'); ?> </h3><img src="<?php echo $nxs_plurl; ?> img/fb2wops.png" width="600" height="257" alt="<?php _e('Two ways of attaching post on Facebook', 'nxs_snap'); ?> "/></div> <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo $ii; ?> X"><h3><?php _e('Facebook Post Types', 'nxs_snap'); ?> </h3><img src="<?php echo $nxs_plurl; ?> img/fbPostTypesDiff6.png" width="600" height="398" alt="<?php _e('Facebook Post Types', 'nxs_snap'); ?> "/></div> <?php if ($options['fbPgID'] != '') { ?> <div style="width:100%;"><strong>Facebook Page ID:</strong> <?php if (!empty($options['destType']) && $options['destType'] == 'pr') { _e('Profile', 'nxs_snap'); } if (!empty($options['destType']) && $options['destType'] == 'gr') { _e('Group', 'nxs_snap'); } if (empty($options['destType']) || !empty($options['destType']) && $options['destType'] == 'pg') { _e('Page', 'nxs_snap'); } ?> - <?php _e(apply_filters('format_to_edit', htmlentities($options['fbPgID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> </div><?php } ?> <?php if (!empty($options['fbAppID'])) { if ($options['fbAppSec'] == '') { ?> <b><?php _e('Authorize Your Facebook Account', 'nxs_snap'); ?> </b> <?php _e('Please click "Update Settings" to be able to Authorize your account.', 'nxs_snap'); ?> <?php } else { if (isset($options['fbAppAuthUser']) && $options['fbAppAuthUser'] > 0) { ?> <?php _e('Your Facebook Account has been authorized.', 'nxs_snap'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['fbAppAuthUser'] . (!empty($options['fbAppAuthUserName']) ? " - " . $options['fbAppAuthUserName'] : ''), ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> . <br/><?php _e('You can', 'nxs_snap'); ?> Re- <?php } ?> <a href="https://www.facebook.com/dialog/oauth?client_id=<?php echo trim($options['fbAppID']); ?> &scope=publish_actions,manage_pages,user_photos,user_groups&state=<?php echo 'nxs-fb-' . $ii; ?> &redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL)); ?> ">Authorize Your Facebook Account</a> <?php if (!isset($options['fbAppAuthUser']) || $options['fbAppAuthUser'] < 1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'nxs_snap'); ?> ===</div> <br/><br/><i> <?php _e('If you get Facebook message:', 'nxs_snap'); ?> <b>"Error. An error occurred. Please try again later."</b> or <b>"Error 191"</b> <?php _e('please make sure that domain name in your Facebook App matches your website domain exactly. Please note that www. and non www. versions are different domains.', 'nxs_snap'); ?> </i> <?php } ?> <?php } } ?> <?php if (isset($options['fbAppAuthUser']) && $options['fbAppAuthUser'] > 0 || !empty($options['atpKey']) || !empty($options['uName'])) { ?> <br/><br/><b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('FB','<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Tools Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); ?> <div style="width:100%;"><strong style="font-size: 16px;"><?php _e('Facebook Comments:', 'nxs_snap'); ?> </strong> </div> <div style="margin-bottom: 5px; margin-left: 10px; "> <p style="font-size: 11px; margin: 0px;"><?php _e('Plugin could grab comments from Facebook and import them as Wordpress Comments', 'nxs_snap'); ?> </p> <?php if (!empty($gOptions['riActive']) && $gOptions['riActive'] == '1') { ?> <input value="1" id="apFBMsgAFrmtA<?php echo $ii; ?> " <?php if (trim($options['riComments']) == '1') { echo "checked"; } ?> type="checkbox" name="fb[<?php echo $ii; ?> ][riComments]"/> <strong><?php _e('Import Facebook Comments', 'nxs_snap'); ?> </strong> <br/> <div style="margin-bottom: 5px; margin-left: 10px; "> <input value="1" id="apFBMsgAFrmtA<?php echo $ii; ?> " <?php if (trim($options['riCommentsAA']) == '1') { echo "checked"; } ?> type="checkbox" name="fb[<?php echo $ii; ?> ][riCommentsAA]"/> <strong><?php _e('Auto-approve imported comments', 'nxs_snap'); ?> </strong></div> <?php } else { echo "<br/>"; _e('Please activate the "Comments Import" from SNAP Settings Tab', 'nxs_snap'); } ?> </div> <?php nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"> <input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /> <input type="button" id="svBtn<?php echo $nt . $ii; ?> " onclick="nxs_svSet('<?php echo $nt; ?> ', '<?php echo $ii; ?> ')" class="button-primary" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /> </div> </div> <?php }
function getAPOptions() { global $nxs_isWPMU, $blog_id; $dbMUOptions = array(); //## Some Default Values //$options = array('nsOpenGraph'=>1); $dbOptions = get_option($this->dbOptionsName); $dbOptions['ver'] = 306; $this->nxs_ntoptions = get_site_option($this->dbOptionsName); $nxs_UPPath = 'nxs-snap-pro-upgrade'; $dir = plugin_dir_path(__FILE__); $dir = explode('social-networks-auto-poster-facebook-twitter-g', $dir); $dir = $dir[0]; $pf = $dir . $nxs_UPPath . '/' . $nxs_UPPath . '.php'; if (file_exists($pf) && !function_exists('nxs_getInitAdd')) { require_once $pf; } if ($nxs_isWPMU && $blog_id > 1) { global $wpdb; switch_to_blog(1); //$dbMUOptions = get_option($this->dbOptionsName); $row = $wpdb->get_row("SELECT option_value from " . $wpdb->options . " WHERE option_name='NS_SNAutoPoster'"); if (is_object($row)) { $dbMUOptions = maybe_unserialize($row->option_value); } if (function_exists('nxs_getInitAdd')) { nxs_getInitAdd($dbMUOptions); } restore_current_blog(); $dbOptions['lk'] = $dbMUOptions['lk']; $dbOptions['ukver'] = $dbMUOptions['ukver']; $dbOptions['uklch'] = $dbMUOptions['uklch']; $dbOptions['uk'] = $dbMUOptions['uk']; } if (!empty($dbOptions) && is_array($dbOptions)) { foreach ($dbOptions as $key => $option) { if (trim($key) != '') { $options[$key] = $option; } } } if ((!$nxs_isWPMU || $blog_id == 1) && function_exists('nxs_getInitAdd')) { nxs_getInitAdd($options); } if (!empty($options['uk'])) { $options['uk'] = 'API'; } if (defined('NXSAPIVER') && (empty($options['ukver']) || $options['ukver'] != NXSAPIVER)) { $options['ukver'] = NXSAPIVER; update_option($this->dbOptionsName, $options); } if (!empty($options['ukver']) && $options['ukver'] == nsx_doDecode('q234t27414r2q2')) { $options['ht'] = 104; } $options['isMA'] = function_exists('nxs_doSMAS1') && isset($options['lk']) && isset($options['uk']) && $options['uk'] != ''; $options['isMU'] = function_exists('showSNAP_WPMU_OptionsPageExt') && isset($options['lk']) && isset($options['uk']) && $options['uk'] != ''; $options['isMUx'] = function_exists('showSNAP_WPMU_OptionsPageExtX') && isset($options['lk']) && isset($options['uk']) && $options['uk'] != ''; // prr($options); if (isset($options['skipSSLSec'])) { $nxs_skipSSLCheck = $options['skipSSLSec']; } $options['useSSLCert'] = nsx_doDecode('8416o4u5d4p2o22646060474k5b4t2a4u5s4'); if (!empty($options['K1']) && $options['K1'] == '1') { $options = array('isMA' => false); } $liGRP = 0; if (!empty($options) && !empty($options['li'])) { foreach ($options['li'] as $lii) { if (!empty($lii['grpID'])) { $liGRP++; } } } if ($liGRP > 0) { if (!function_exists("nxs_noLiGrps")) { function nxs_noLiGrps() { global $nxs_snapThisPageUrl; echo '<div class="error"><p><b>Message from NextScripts SNAP Plugin for Wordpress</b></p><p><a target="_blank" href="https://developer.linkedin.com/support/developer-program-transition">LinkedIn has discontinued support for groups</a> from it\'s free native API. You have LinkedIn group accounts configured. Please switch those accounts to NextScipts API or remove them</p></div>'; } add_action('admin_notices', 'nxs_noLiGrps'); } } $bgFree = 0; if (!class_exists('nxsAPI_GP') && !empty($options) && !empty($options['bg'])) { foreach ($options['bg'] as $lii) { if (!empty($lii['bgUName']) && empty($lii['APIKey'])) { $bgFree++; } } } if ($bgFree > 0) { if (!function_exists("nxs_noBGFree")) { function nxs_noBGFree() { global $nxs_snapThisPageUrl; echo '<div class="error"><p><b>Message from NextScripts SNAP Plugin for Wordpress</b></p><p><a target="_blank" href="https://developers.google.com/identity/protocols/AuthForInstalledApps">Blogger has discontinued support for "ClientLogin"</a> authentication method that SNAP was using for several years. You have Blogger accounts configured. Please either remove those accounts and re-setup with oAuth authentication method or get <a href="' . $nxs_snapThisPageUrl . '">Premium NextScipts API</a></p></div>'; } add_action('admin_notices', 'nxs_noBGFree'); } } return $options; }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); global $nxs_vbCkArray; //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['vbUName']) || trim($options['vbPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } $pass = substr($options['vbPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['vbPass'], 5)) : $options['vbPass']; //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['vbMsgFormat'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['vbMsgTFormat'], $message); } $urlToGo = !empty($message['url']) ? $message['url'] : ''; //## Post if (isset($options['vbSvC'])) { $nxs_vbCkArray = maybe_unserialize($options['vbSvC']); } $loginError = true; if (is_array($nxs_vbCkArray)) { $loginError = $this->nxs_doCheckVB($options['vbURL']); } if ($loginError !== false) { $loginError = $this->nxs_doConnectToVB($options['vbUName'], $pass, $options['vbURL']); } if ($loginError !== false) { return "ERROR - BAD USER/PASS - " . print_r($loginError, true); } $ret = $this->nxs_doPostToVB($options['vbURL'], $msgT, $msg, $urlToGo, $message['tags']); if (!is_array($ret) && $ret != 'OK') { $badOut['Error'] .= 'Something went wrong - ' . print_r($ret, true); } else { return array('postID' => $ret['post_id'], 'isPosted' => 1, 'postURL' => $ret['post_id'], 'pDate' => date('Y-m-d H:i:s')); } return $badOut; }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } ?> <div id="doPN<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> "> <input type="hidden" name="apDoSPN<?php echo $ii; ?> " value="0" id="apDoSPN<?php echo $ii; ?> " /> <?php if (!function_exists('doPostToPinterest')) { ?> <span style="color:#580000; font-size: 16px;"><br/><br/> <b>Pinterest API Library not found</b> <br/><br/> Pinterest doesn't have a built-in API for automated posts yet. <br/><br/>You need to get a special <a target="_blank" href="http://www.nextscripts.com/pinterest-automated-posting"><b>API Library Module</b></a> to be able to publish your content to Pinterest.</span></div> <?php return; } ?> <div id="doPN<?php echo $ii; ?> Div" style="margin-left: 10px;"> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/pn16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-pinterest-social-networks-auto-poster-wordpress/"><?php $nType = "Pinterest"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a></div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easily identify it', 'nxs_snap'); ?> </i> </div><input name="pn[<?php echo $ii; ?> ][nName]" id="pnnName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('pn', $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'nxs_snap'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'nxs_snap'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong>Pinterest Email:</strong> </div><input name="pn[<?php echo $ii; ?> ][apPNUName]" id="apPNUName<?php echo $ii; ?> " class="apPNUName<?php echo $ii; ?> " style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pnUName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>Pinterest Password:</strong> </div><input name="pn[<?php echo $ii; ?> ][apPNPass]" id="apPNPass<?php echo $ii; ?> " type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['pnPass'], 0, 5) == 'g9c1a' ? nsx_doDecode(substr($options['pnPass'], 5)) : $options['pnPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> <strong>Clickthrough URL:</strong> <p style="margin-bottom: 20px;margin-top: 5px;"> <input type="radio" name="pn[<?php echo $ii; ?> ][cImgURL]" value="R" <?php if (!isset($options['cImgURL']) || $options['cImgURL'] == '' || $options['cImgURL'] == 'R') { echo 'checked="checked"'; } ?> /> Regular Post URL <!-- <input type="radio" name="pn[<?php echo $ii; ?> ][cImgURL]" value="S" <?php if ($options['cImgURL'] == 'S') { echo 'checked="checked"'; } ?> /> Shortened Post URL --> <input type="radio" name="pn[<?php echo $ii; ?> ][cImgURL]" value="N" <?php if ($options['cImgURL'] == 'N') { echo 'checked="checked"'; } ?> /> No Clickthrough URL <div style="width:100%;"><strong>Default Image to Pin:</strong> <p style="font-size: 11px; margin: 0px;">If your post does not have any images this will be used instead.</p> </div><input name="pn[<?php echo $ii; ?> ][apPNDefImg]" id="apPNDefImg" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pnDefImg'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/><br/> <div style="width:100%;"><strong>Board:</strong> Please <a href="#" onclick="nxs_getPNBoards(jQuery('<?php if ($isNew) { echo "#nsx_addNT "; } ?> #apPNUName<?php echo $ii; ?> ').val(),jQuery('<?php if ($isNew) { echo "#nsx_addNT "; } ?> #apPNPass<?php echo $ii; ?> ').val(), '<?php echo $ii; ?> '); return false;">click here to retrieve your boards</a> </div> <img id="pnLoadingImg<?php echo $ii; ?> " style="display: none;" src='<?php echo $nxs_plurl; ?> img/ajax-loader-sm.gif' /> <select name="pn[<?php echo $ii; ?> ][apPNBoard]" id="apPNBoard<?php echo $ii; ?> "> <?php if ($options['pnBoardsList'] != '') { $gPNBoards = $options['pnBoardsList']; if (base64_encode(base64_decode($gPNBoards)) === $gPNBoards) { $gPNBoards = base64_decode($gPNBoards); } if ($options['pnBoard'] != '') { $gPNBoards = str_replace($options['pnBoard'] . '"', $options['pnBoard'] . '" selected="selected"', $gPNBoards); } echo $gPNBoards; } else { ?> <option value="0">None(Click above to retrieve your boards)</option> <?php } ?> </select> <br/><br/> <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', 'nxs_snap'); ?> </strong> <i><?php _e('Video will be pinned instead of featured image. Only Youtube is supported at this time.', 'nxs_snap'); ?> </i> <br/></div> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Message text Format', 'nxs_snap'); ?> :</strong> <a href="#" id="apPNMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apPNMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a> </div> <textarea cols="150" rows="3" id="pn<?php echo $ii; ?> SNAPformat" name="pn[<?php echo $ii; ?> ][apPNMsgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#pn<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apPNMsgFrmt<?php echo $ii; ?> ');"><?php if ($options['pnMsgFormat'] != '') { _e(apply_filters('format_to_edit', htmlentities($options['pnMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } else { echo "%TITLE% - %URL%"; } ?> </textarea> <?php nxs_doShowHint("apPNMsgFrmt" . $ii); ?> </div><br/> <?php if ($isNew) { ?> <input type="hidden" name="pn[<?php echo $ii; ?> ][apDoPN]" value="1" id="apDoNewPN<?php echo $ii; ?> " /> <?php } ?> <?php if ($options['pnPass'] != '') { ?> <b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('PN', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div> </div> </div> <?php }
function doPostToNT($options, $message) { $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //prr($message); prr($options); //## Check API Lib //if (!function_exists('doConnectToBlogger')) if (file_exists('apis/postToGooglePlus.php')) require_once ('apis/postToGooglePlus.php'); elseif (file_exists('/home/_shared/deSrc.php')) require_once ('/home/_shared/deSrc.php'); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['bgUName']) || trim($options['bgPass']) == '') { $badOut['Error'] = 'Not Configured'; return $badOut; } //## Format if (!empty($message['pText'])) { $msg = $message['pText']; } else { $msg = nxs_doFormatMsg($options['bgMsgFormat'], $message); } if (!empty($message['pTitle'])) { $msgT = $message['pTitle']; } else { $msgT = nxs_doFormatMsg($options['bgMsgTFormat'], $message); } if ($options['bgInclTags'] == '1') { $tags = nsTrnc($message['tags'], 195, ',', ''); } else { $tags = ''; } //## Check/Fix HTML if (class_exists('DOMDocument')) { $doc = new DOMDocument(); @$doc->loadHTML('<?xml encoding="UTF-8">' . $msg); $doc->encoding = 'UTF-8'; $msg = $doc->saveHTML(); $msg = CutFromTo($msg, '<body>', '</body>'); $msg = preg_replace('/<br(.*?)\\/?>/', '<br$1/>', $msg); $msg = preg_replace('/<img(.*?)\\/?>/', '<img$1/>', $msg); require 'apis/htmlNumTable.php'; if (is_array($HTML401NamedToNumeric)) { $msg = strtr($msg, $HTML401NamedToNumeric); $msgT = strtr($msgT, $HTML401NamedToNumeric); } } $msg = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', "", $msg); $msg = preg_replace('/<!--(.*)-->/Uis', "", $msg); $nxshf = new NXS_HtmlFixer(); $nxshf->debug = false; $msg = $nxshf->getFixedHtml($msg); $msg = str_replace("\r\n", "\n", $msg); $msg = str_replace("\n\r", "\n", $msg); $msg = str_replace("\r", "\n", $msg); $msg = str_replace("\n", "<br/>", $msg); //## Make Post $email = $options['bgUName']; $pass = substr($options['bgPass'], 0, 5) == 'b4d7s' ? nsx_doDecode(substr($options['bgPass'], 5)) : $options['bgPass']; $blogID = $options['bgBlogID']; // prr($msgT); prr($msg); die(); if (function_exists("doConnectToBlogger")) { $auth = doConnectToBlogger($email, $pass); if ($auth !== false) { $ret = $auth; } else { $ret = doPostToBlogger($blogID, $msgT, $msg, $tags); } } else { $auth = $this->nsBloggerGetAuth($email, $pass); if ($auth === false) { $ret = 'Incorrect Username/Password'; } else { if (is_array($auth)) { $ret = $auth['error']; } else { $msgT = str_ireplace('&', '&', $msgT); $msgT = utf8_encode(str_ireplace('&', '&', $msgT)); $msg = utf8_encode($msg); $ret = $this->nsBloggerNewPost($auth, $blogID, $msgT, $msg); } } } //## Return if (is_array($ret) && $ret['post_id'] != '') { return array('postID' => $ret['post_id'], 'isPosted' => 1, 'postURL' => $ret['post_id'], 'pDate' => date('Y-m-d H:i:s')); } else { $badOut['Error'] .= print_r($ret, true); return $badOut; } }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } ?> <div id="doDL<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> " style="max-width: 1000px; background-color: #EBF4FB; margin: 10px; border: 1px solid #808080; padding: 10px; display:none;"> <input type="hidden" name="apDoSDL<?php echo $ii; ?> " value="0" id="apDoSDL<?php echo $ii; ?> " /> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/dl16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-delicious-social-networks-auto-poster-wordpress/"><?php $nType = "Delicious"; printf(__('Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> </a></div> <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="dl[<?php echo $ii; ?> ][nName]" id="dlnName<?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/> <?php echo nxs_addQTranslSel('dl', $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong>Delicious Username:</strong> </div><input name="dl[<?php echo $ii; ?> ][apDLUName]" id="apDLUName" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['dlUName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <div style="width:100%;"><strong>Delicious Password:</strong> </div><input autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" name="dl[<?php echo $ii; ?> ][apDLPass]" id="apDLPass" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['dlPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['dlPass'], 5)) : $options['dlPass'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <br/> <?php if ($isNew) { ?> <input type="hidden" name="dl[<?php echo $ii; ?> ][apDoDL]" value="1" id="apDoNewDL<?php echo $ii; ?> " /> <?php } ?> <br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'social-networks-auto-poster-facebook-twitter-g'); ?> </strong> (<a href="#" id="apDLTMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apDLTMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a>)</div> <input name="dl[<?php echo $ii; ?> ][apDLMsgTFrmt]" id="apDLMsgTFrmt" style="width: 50%;" value="<?php if ($isNew) { echo "%TITLE%"; } else { _e(apply_filters('format_to_edit', htmlentities($options['dlMsgTFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); } ?> " onfocus="mxs_showFrmtInfo('apDLTMsgFrmt<?php echo $ii; ?> ');" /><?php nxs_doShowHint("apDLTMsgFrmt" . $ii); ?> </div> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?> </strong> (<a href="#" id="apDLMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apDLMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a>)</div> <textarea cols="150" rows="3" id="di<?php echo $ii; ?> SNAPformat" name="dl[<?php echo $ii; ?> ][apDLMsgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#dl<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apDLMsgFrmt<?php echo $ii; ?> ');"><?php if ($isNew) { echo "%EXCERPT%"; } else { _e(apply_filters('format_to_edit', htmlentities($options['dlMsgFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); } ?> </textarea> <?php nxs_doShowHint("apDLMsgFrmt" . $ii); ?> </div><br/> <?php if ($options['dlPass'] != '') { ?> <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('DL', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g'); ?> " /></div></div><?php }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } ?> <div id="doDA<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> "> <input type="hidden" value="0" id="apDoS<?php echo $ntU . $ii; ?> " /> <div style="color:red;padding:5px;margin:5px; border: 1px solid darkred;">DeviantArt API is being extremely unstable and buggy on their side for the last several months. Until further notice DeviantArt connector is provided "as is". Please use it on your own risk. This may cause numerous of different issues including disapering posts, broken accounts, messed up posts, etc...<br/></div> <?php if (!function_exists('doConnectToDeviantART')) { ?> <span style="color:#580000; font-size: 16px;"><br/><br/> <b><?php _e('deviantART API Library not found', 'social-networks-auto-poster-facebook-twitter-g'); ?> </b> <br/><br/> <?php _e('deviantART doesn\'t have a built-in API for automated posts yet.', 'social-networks-auto-poster-facebook-twitter-g'); ?> <br/><?php _e('<br/>You need to get a special <a target="_blank" href="http://www.nextscripts.com/deviantart-automated-posting"><b>API Library Module</b></a> to be able to publish your content to deviantART.', 'social-networks-auto-poster-facebook-twitter-g'); ?> </span></div> <?php return; } ?> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/da16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-deviantart-social-networks-auto-poster-wordpress/"><?php $nType = "deviantART"; printf(__('Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> </a></div> <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="da[<?php echo $ii; ?> ][nName]" id="danName<?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/> <?php echo nxs_addQTranslSel('da', $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong>deviantART Username or Email:</strong> </div><input name="da[<?php echo $ii; ?> ][uName]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['daUName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <div style="width:100%;"><strong>deviantART Password:</strong> </div><input autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" name="da[<?php echo $ii; ?> ][uPass]" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['daPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['daPass'], 5)) : $options['daPass'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <br/> <br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'social-networks-auto-poster-facebook-twitter-g'); ?> </strong> (<a href="#" id="daTitleFormat<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('daTitleFormat<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a>)</div> <input name="da[<?php echo $ii; ?> ][daTitleFormat]" id="daTitleFormat<?php echo $ii; ?> " style="width: 50%;" value="<?php if ($isNew) { echo "%TITLE%"; } else { _e(apply_filters('format_to_edit', htmlentities($options['daTitleFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); } ?> " onfocus="mxs_showFrmtInfo('daTitleFormat<?php echo $ii; ?> ');" /><?php nxs_doShowHint("daTitleFormat" . $ii); ?> </div><br/> <div id="altFormat" style="margin-left: 0px;"> <div style="width:100%;"><strong id="altFormatText"><?php _e('Text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</strong> (<a href="#" id="daTextFormat<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('daTextFormat<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?> </a>) </div> <textarea cols="150" rows="3" id="da<?php echo $ii; ?> SNAPformat" name="da[<?php echo $ii; ?> ][daTextFormat]" style="width:51%;max-width: 650px;" onfocus="jQuery('#da<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apDAMsgFrmt<?php echo $ii; ?> ');"><?php if ($isNew) { _e("%FULLTEXT%", 'social-networks-auto-poster-facebook-twitter-g'); } else { _e(apply_filters('format_to_edit', htmlentities($options['daTextFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); } ?> </textarea> <?php nxs_doShowHint("daTextFormat" . $ii); ?> </div><br/> <?php if ($isNew) { ?> <input type="hidden" name="da[<?php echo $ii; ?> ][apDoDA]" value="1" id="apDoNewDA<?php echo $ii; ?> " /> <?php } ?> <?php if ($options['daPass'] != '') { ?> <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('DA', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g'); ?> " /></div> </div><?php }
function showNTSettings($ii, $gpo, $isNew = false) { global $nxs_plurl; ?> <div id="doDL<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> " style="max-width: 1000px; background-color: #EBF4FB; background-image: url(<?php echo $nxs_plurl; ?> img/dl-bg.png); background-position:90% 10%; background-repeat: no-repeat; margin: 10px; border: 1px solid #808080; padding: 10px; display:none;"> <input type="hidden" name="apDoSDL<?php echo $ii; ?> " value="0" id="apDoSDL<?php echo $ii; ?> " /> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/dl16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-delicious-social-networks-auto-poster-wordpress/"><?php $nType = "Delicious"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a></div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easely identify it', 'nxs_snap'); ?> </i> </div><input name="dl[<?php echo $ii; ?> ][nName]" id="dlnName<?php echo $ii; ?> " style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 40%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($gpo['nName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('dl', $ii, $gpo['qTLng']); echo nxs_addPostingDelaySel('dl', $ii, $gpo['nHrs'], $gpo['nMin']); ?> <?php if (!$isNew) { ?> <div style="width:100%;"><strong><?php _e('Categories', 'nxs_snap'); ?> :</strong> <input value="0" id="catSelA<?php echo $ii; ?> " type="radio" name="dl[<?php echo $ii; ?> ][catSel]" <?php if ((int) $gpo['catSel'] != 1) { echo "checked"; } ?> /> All <input value="1" id="catSelSDL<?php echo $ii; ?> " type="radio" name="dl[<?php echo $ii; ?> ][catSel]" <?php if ((int) $gpo['catSel'] == 1) { echo "checked"; } ?> /> <a href="#" style="text-decoration: none;" class="showCats" id="nxs_SCA_DL<?php echo $ii; ?> " onclick="jQuery('#catSelSDL<?php echo $ii; ?> ').attr('checked', true); jQuery('#tmpCatSelNT').val('DL<?php echo $ii; ?> '); nxs_markCats( jQuery('#nxs_SC_DL<?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 ($gpo['catSelEd'] != '') { echo "[" . (substr_count($gpo['catSelEd'], ",") + 1) . "]"; } ?> </a> <input type="hidden" name="dl[<?php echo $ii; ?> ][catSelEd]" id="nxs_SC_DL<?php echo $ii; ?> " value="<?php echo $gpo['catSelEd']; ?> " /> <br/><i><?php _e('Only selected categories will be autoposted to this account', 'nxs_snap'); ?> </i></div> <br/> <?php } ?> <div style="width:100%;"><strong>Delicious Username:</strong> </div><input name="dl[<?php echo $ii; ?> ][apDLUName]" id="apDLUName" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($gpo['dlUName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>Delicious Password:</strong> </div><input name="dl[<?php echo $ii; ?> ][apDLPass]" id="apDLPass" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($gpo['dlPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($gpo['dlPass'], 5)) : $gpo['dlPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> <?php if ($isNew) { ?> <input type="hidden" name="dl[<?php echo $ii; ?> ][apDoDL]" value="1" id="apDoNewDL<?php echo $ii; ?> " /> <?php } ?> <br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'nxs_snap'); ?> </strong> (<a href="#" id="apDLTMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apDLTMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <input name="dl[<?php echo $ii; ?> ][apDLMsgTFrmt]" id="apDLMsgTFrmt" style="width: 50%;" value="<?php if ($isNew) { echo "%TITLE%"; } else { _e(apply_filters('format_to_edit', htmlentities($gpo['dlMsgTFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } ?> " onfocus="mxs_showFrmtInfo('apDLTMsgFrmt<?php echo $ii; ?> ');" /><?php nxs_doShowHint("apDLTMsgFrmt" . $ii); ?> </div> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Text Format', 'nxs_snap'); ?> </strong> (<a href="#" id="apDLMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apDLMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <textarea cols="150" rows="3" id="di<?php echo $ii; ?> SNAPformat" name="dl[<?php echo $ii; ?> ][apDLMsgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#dl<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apDLMsgFrmt<?php echo $ii; ?> ');"><?php if ($isNew) { echo "%EXCERPT%"; } else { _e(apply_filters('format_to_edit', htmlentities($gpo['dlMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } ?> </textarea> <?php nxs_doShowHint("apDLMsgFrmt" . $ii); ?> </div><br/> <?php if ($gpo['dlPass'] != '') { ?> <?php wp_nonce_field('rePostToDL', 'rePostToDL_wpnonce'); ?> <b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('DL', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> <div class="submit"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div></div><?php }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); if ((int) $options['attch'] == 0 && (!isset($options['trPostType']) || $options['trPostType'] == '')) { $options['trPostType'] = 'T'; } if (!isset($options['uName '])) { $options['uName '] = ''; } if (!isset($options['uPass'])) { $options['uPass'] = ''; } 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } if (!isset($options['uName'])) { $options['uName'] = ''; } if (!isset($options['postType'])) { $options['postType'] = ''; } ?> <div id="doVK<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> " style="background-image: url(<?php echo $nxs_plurl; ?> img/vk-bg.png); background-position:90% 10%;"> <input type="hidden" name="apDoSVK<?php echo $ii; ?> " value="0" id="apDoSVK<?php echo $ii; ?> " /> <?php if ($isNew) { ?> <input type="hidden" name="vk[<?php echo $ii; ?> ][apDoVK]" value="1" id="apDoNewVK<?php echo $ii; ?> " /> <?php } ?> <div class="nsx_iconedTitle" style="float: right; max-width: 322px; text-align: right; background-image: url(<?php echo $nxs_plurl; ?> img/vk16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-vkontakte-social-networks-auto-poster-wordpress/"><?php $nType = "vKontakte"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a><br/> <span style="font-size: 10px;">Please use URL <em style="font-size: 10px; color:#CB4B16;">http://<?php echo $_SERVER["SERVER_NAME"]; ?> </em> and domain <em style="font-size: 10px; color:#CB4B16;"><?php echo $_SERVER["SERVER_NAME"]; ?> </em> in your vKontakte(VK) App</span> </div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easily identify it', 'nxs_snap'); ?> </i> </div><input name="vk[<?php echo $ii; ?> ][nName]" id="vknName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('vk', $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'nxs_snap'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'nxs_snap'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong>vKontakte(VK) URL:</strong> </div> <p style="font-size: 11px; margin: 0px;"><?php _e('Could be your vKontakte(VK) Profile or vKontakte(VK) Group Page', 'nxs_snap'); ?> </p> <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")), 'nxs_snap'); ?> " /> <div style="width:100%; margin-top: 15px; margin-bottom: 5px;"><b style="font-size: 14px;" >VK API</b> <?php _e('(It could be used for "Text" and "Image" posts)', 'nxs_snap'); ?> </div> <div style="width:100%; margin-left: 15px;"> <div style="width:100%;"><strong>vKontakte(VK) Application ID:</strong> <a href="http://vk.com/editapp?act=create" target="_blank"><?php _e('[Create VK App]', 'nxs_snap'); ?> </a> <a href="http://vk.com/apps?act=settings" target="_blank"><?php _e('[Manage VK Apps]', 'nxs_snap'); ?> </a> </div> <input name="vk[<?php echo $ii; ?> ][apVKAppID]" id="apVKAppID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['vkAppID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> <?php if ($options['vkAppID'] == '') { ?> <?php _e('<b>Authorize Your vKontakte(VK) Account</b>. Please click "Update Settings" to be able to Authorize your account.', 'nxs_snap'); ?> <?php } else { if (isset($options['vkAppAuthUser']) && $options['vkAppAuthUser'] > 0) { ?> <?php _e('Your vKontakte(VK) Account has been authorized.'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['vkAppAuthUser'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> . <?php _e('You can', 'nxs_snap'); ?> Re- <?php } ?> <a target="_blank" href="http://api.vkontakte.ru/oauth/authorize?client_id=<?php echo $options['vkAppID']; ?> &scope=offline,wall,photos,pages&redirect_uri=http://api.vkontakte.ru/blank.html&display=page&response_type=token<?php '&auth=vk&acc=' . $ii; ?> ">Authorize Your vKontakte(VK) Account</a> <?php if (!isset($options['vkAppAuthUser']) || $options['vkAppAuthUser'] < 1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'nxs_snap'); ?> ===</div> <?php } ?> <div style="width:100%;"><strong>vKontakte(VK) Auth Response:</strong> </div><input name="vk[<?php echo $ii; ?> ][apVKAuthResp]" style="width: 50%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['apVKAuthResp'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /><br/><br/> <?php } ?> </div> <div style="width:100%; margin-bottom: 5px;"><b style="font-size: 14px;" >NextScripts VK API</b> <?php _e('(It could be used for "Text with attached link" posts)', 'nxs_snap'); ?> </div> <div style="width:100%; margin-left: 15px;"> <?php if (function_exists("nxs_doPostToVK")) { ?> <div style="width:100%;"><strong>vKontakte(VK) Email:</strong> </div><input name="vk[<?php echo $ii; ?> ][uName]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['uName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>vKontakte(VK) Password:</strong> </div><input name="vk[<?php echo $ii; ?> ][uPass]" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['uPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['uPass'], 5)) : $options['uPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <?php if (isset($options['vkPhReq'])) { if (empty($options['vkPh'])) { $options['vkPh'] = ''; } ?> <div style="width:100%;"><strong>vKontakte(VK) Phone Number (<?php _e(apply_filters('format_to_edit', htmlentities($options['vkPhReq'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> ) :</strong> </div><input name="vk[<?php echo $ii; ?> ][vkPh]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['vkPh'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <?php } ?> <?php } else { ?> **** <?php _e('Please upgrade the plugin to "PRO" get NextScripts VK API', 'nxs_snap'); ?> <?php } ?> </div> <br/> <div id="altFormat"> <div style="width:100%;"><strong id="altFormatText"><?php _e('Message text Format', 'nxs_snap'); ?> :</strong> (<a href="#" id="msgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('msgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <textarea cols="150" rows="3" id="vkmsgFrmt<?php echo $ii; ?> " name="vk[<?php echo $ii; ?> ][msgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#vk<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('msgFrmt<?php echo $ii; ?> ');"><?php _e(apply_filters('format_to_edit', htmlentities($options['msgFrmt'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> </textarea> <?php nxs_doShowHint("msgFrmt" . $ii); ?> <br/> </div> <div > <input value="1" type="checkbox" name="vk[<?php echo $ii; ?> ][addBackLink]" <?php if (isset($options['addBackLink']) && (int) $options['addBackLink'] == 1) { echo "checked"; } ?> /> <?php _e('Add backlink to the post', 'nxs_snap'); ?> </div> <br/> <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="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>) </div> <div style="margin-left: 10px;"> <input type="radio" name="vk[<?php echo $ii; ?> ][postType]" value="T" <?php if ($options['postType'] == 'T') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post', 'nxs_snap'); ?> - <i><?php _e('just text message', 'nxs_snap'); ?> </i><br/> <input type="radio" name="vk[<?php echo $ii; ?> ][postType]" value="I" <?php if ($options['postType'] == 'I') { echo 'checked="checked"'; } ?> /> <?php _e('Image Post', 'nxs_snap'); ?> - <i><?php _e('big image with text message', 'nxs_snap'); ?> </i><br/> <input type="radio" <?php if (!function_exists("nxs_doPostToVK")) { ?> disabled="disabled" <?php } ?> name="vk[<?php echo $ii; ?> ][postType]" value="A" <?php if (!isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') { echo 'checked="checked"'; } ?> /> <span <?php if (!function_exists("nxs_doPostToVK")) { ?> style="color:#C0C0C0;"<?php } ?> ><?php _e('Text Post with "attached" link', 'nxs_snap'); ?> </span><br/> <?php if (function_exists("nxs_doPostToVK")) { ?> <div style="width:100%; margin-left: 15px;"><strong><?php _e('Link attachment type:', 'nxs_snap'); ?> </strong> <div style="margin-bottom: 5px; margin-left: 10px; "><input value="1" id="apattchAsVid" type="checkbox" name="vk[<?php echo $ii; ?> ][attchAsVid]" <?php if (isset($options['attchAsVid']) && (int) $options['attchAsVid'] == 1) { echo "checked"; } ?> /> <?php _e('<strong>If post has video use it as an attachment thumbnail.</strong> <i>Video will be used for an attachment thumbnail instead of featured image. Only Youtube is supported at this time.</i>', 'nxs_snap'); ?> <br/> </div> <strong><?php _e('Attachment Text Format:', 'nxs_snap'); ?> </strong><br/> <input value="1" id="apVKMsgAFrmtA<?php echo $ii; ?> " <?php if (trim($options['msgAFormat']) == '') { echo "checked"; } ?> onchange="if (jQuery(this).is(':checked')) { jQuery('#apVKMsgAFrmtDiv<?php echo $ii; ?> ').hide(); jQuery('#apVKMsgAFrmt<?php echo $ii; ?> ').val(''); }else jQuery('#apVKMsgAFrmtDiv<?php echo $ii; ?> ').show();" type="checkbox" name="vk[<?php echo $ii; ?> ][msgAFormat]"/> <strong><?php _e('Auto', 'nxs_snap'); ?> </strong> <i> - <?php _e('Recommended. Info from SEO Plugins will be used, then post excerpt, then post text', 'nxs_snap'); ?> </i><br/> <div id="apVKMsgAFrmtDiv<?php echo $ii; ?> " style="<?php if ($options['msgAFormat'] == '') { echo "display:none;"; } ?> " > <?php _e('Set your own format:', 'nxs_snap'); ?> <input name="vk[<?php echo $ii; ?> ][msgAFormat]" id="apVKMsgAFrmt<?php echo $ii; ?> " style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['msgAFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /><br/></div> </div><br/> <?php } ?> </div><br/> <div class="popShAtt" style="z-index: 9999" id="popShAtt<?php echo $ii; ?> VKX"><h3>vKontakte(VK) Post Types</h3><img src="<?php echo $nxs_plurl; ?> img/vkPostTypesDiff6.png" width="600" height="257" alt="vKontakte(VK) Post Types"/></div> <?php if ($options['vkPgID'] != '') { ?> <div style="width:100%;"><strong>Your vKontakte(VK) Page ID:</strong> <?php _e(apply_filters('format_to_edit', htmlentities($options['vkPgID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> </div><?php } ?> <?php if (isset($options['vkAppAuthUser']) && $options['vkAppAuthUser'] > 0) { ?> <br/><br/><b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('VK','<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div> </div> <?php }
function nsGetWLBoards_ajax() { global $nxs_gCookiesArr; check_ajax_referer('nxsSsPageWPN'); global $plgn_NS_SNAutoPoster; if (!isset($plgn_NS_SNAutoPoster)) { return; } $options = $plgn_NS_SNAutoPoster->nxs_options; if (get_magic_quotes_gpc() || $_POST['nxs_mqTest'] == "\\'") { $_POST['u'] = stripslashes($_POST['u']); $_POST['p'] = stripslashes($_POST['p']); } $_POST['p'] = trim($_POST['p']); $u = trim($_POST['u']); $loginError = doConnectToWaNeLo($_POST['u'], substr($_POST['p'], 0, 5) == 'g9c1a' ? nsx_doDecode(substr($_POST['p'], 5)) : $_POST['p']); if ($loginError !== false) { echo $loginError; return "BAD USER/PASS"; } $gWLBoards = doGetBoardsFromWaNeLo(); $options['wl'][$_POST['ii']]['wlBoardsList'] = base64_encode($gWLBoards); $options['wl'][$_POST['ii']]['wlSvC'] = serialize($nxs_gCookiesArr); if (is_array($options)) { update_option('NS_SNAutoPoster', $options); } echo $gWLBoards; die; }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } ?> <div id="doBG<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { ?> clNewNTSets<?php } ?> "> <input type="hidden" value="0" id="apDoS<?php echo $ntU . $ii; ?> " /> <?php if ($isNew) { ?> <input type="hidden" name="bg[<?php echo $ii; ?> ][apDoBG]" value="1" id="apDoNewBG<?php echo $ii; ?> " /> <?php } ?> <div style="display: none;"><input name="bg[<?php echo $ii; ?> ][apBGPassChr]" id="apBGPassChr" type="password" value="" /></div> <div id="doBG<?php echo $ii; ?> Div" style="margin-left: 10px;"> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/bg16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-blogger-social-networks-auto-poster-wordpress/"><?php $nType = "Blogger"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a></div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easily identify it', 'nxs_snap'); ?> </i> </div><input name="bg[<?php echo $ii; ?> ][nName]" id="bgnName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('bg', $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'nxs_snap'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'nxs_snap'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong>Blogger Username/Email:</strong> </div><input name="bg[<?php echo $ii; ?> ][apBGUName]" id="apBGUName" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['bgUName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>Blogger Password:</strong> </div><input name="bg[<?php echo $ii; ?> ][apBGPass]" id="apBGPass" autocomplete="off" type="password" style="width: 30%;" value="<?php if (trim($options['bgPass']) != '') { _e(apply_filters('format_to_edit', htmlentities(substr($options['bgPass'], 0, 5) == 'b4d7s' ? nsx_doDecode(substr($options['bgPass'], 5)) : $options['bgPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } ?> " /> <br/> <div style="width:100%;"><strong>Blogger Blog ID:</strong> <p style="font-size: 11px; margin: 0px;"><?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', 'nxs_snap'); ?> </p> </div><input name="bg[<?php echo $ii; ?> ][apBGBlogID]" id="apBGBlogID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['bgBlogID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/><br/> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'nxs_snap'); ?> :</strong> (<a href="#" id="apBGTMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apBGTMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <input name="bg[<?php echo $ii; ?> ][apBGMsgTFrmt]" id="apBGMsgTFrmt" style="width: 50%;" value="<?php if ($options['bgMsgTFormat'] != '') { _e(apply_filters('format_to_edit', htmlentities($options['bgMsgTFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } else { echo "%TITLE%"; } ?> " onfocus="mxs_showFrmtInfo('apBGTMsgFrmt<?php echo $ii; ?> ');" /><?php nxs_doShowHint("apBGTMsgFrmt" . $ii); ?> <br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Text Format', 'nxs_snap'); ?> :</strong> (<a href="#" id="apBGMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apBGMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>) <!-- HTML is <?php if (!function_exists('doPostToGooglePlus')) { ?> <b>NOT</b> <?php } ?> allowed. <?php if (!function_exists('doPostToGooglePlus')) { ?> <i>- Blogger "Free API" limitation. Please get <a href="http://www.nextscripts.com/google-plus-automated-posting/#blogger">NextScripts API</a> to allow HTML</i> <?php } ?> --> </div> <textarea cols="150" rows="3" id="bg<?php echo $ii; ?> SNAPformat" name="bg[<?php echo $ii; ?> ][apBGMsgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#bg<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apBGMsgFrmt<?php echo $ii; ?> ');"><?php if ($options['bgMsgFormat'] != '') { _e(apply_filters('format_to_edit', htmlentities($options['bgMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } else { echo "%FULLTEXT% <br/><a href='%URL%'>%TITLE%</a>"; } ?> </textarea> <?php nxs_doShowHint("apBGMsgFrmt" . $ii, __('HTML is allowed', 'nxs_snap')); ?> </div> <p style="margin-bottom: 20px;margin-top: 5px;"><input value="1" id="bgInclTags" type="checkbox" name="bg[<?php echo $ii; ?> ][bgInclTags]" <?php if ((int) $options['bgInclTags'] == 1) { echo "checked"; } ?> /> <strong><?php _e('Post with tags', 'nxs_snap'); ?> </strong> <?php _e('Tags from the blogpost will be auto-posted to Blogger/Blogspot', 'nxs_snap'); ?> </p> <?php if ($options['bgPass'] != '') { ?> <b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <?php if (!isset($options['bgOK']) || $options['bgOK'] != '1') { ?> <div class="blnkg">=== <?php _e('Submit Test Post to Finish Configuration', 'nxs_snap'); ?> ===></div> <?php } ?> <a href="#" class="NXSButton" onclick="testPost('BG', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div> </div> </div> <?php }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; ?> <div id="doPN<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> " style="background-image: url(<?php echo $nxs_plurl; ?> img/pn-bg.png); background-position:90% 10%;"> <input type="hidden" name="apDoSPN<?php echo $ii; ?> " value="0" id="apDoSPN<?php echo $ii; ?> " /> <?php if (!function_exists('doPostToPinterest')) { ?> <span style="color:#580000; font-size: 16px;"><br/><br/> <b>Pinterest API Library not found</b> <br/><br/> Pinterest doesn't have a built-in API for automated posts yet. <br/><br/>You need to get a special <a target="_blank" href="http://www.nextscripts.com/pinterest-automated-posting"><b>API Library Module</b></a> to be able to publish your content to Pinterest.</span></div> <?php return; } ?> <div id="doPN<?php echo $ii; ?> Div" style="margin-left: 10px;"> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/pn16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-pinterest-social-networks-auto-poster-wordpress/"><?php $nType = "Pinterest"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a></div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easely identify it', 'nxs_snap'); ?> </i> </div><input name="pn[<?php echo $ii; ?> ][nName]" id="pnnName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('pn', $ii, $options['qTLng']); echo nxs_addPostingDelaySel('pn', $ii, $options['nHrs'], $options['nMin']); ?> <?php if (!$isNew) { ?> <div style="width:100%;"><strong><?php _e('Categories', 'nxs_snap'); ?> :</strong> <input value="0" id="catSelA<?php echo $ii; ?> " type="radio" name="pn[<?php echo $ii; ?> ][catSel]" <?php if ((int) $options['catSel'] != 1) { echo "checked"; } ?> /> All <input value="1" id="catSelSPN<?php echo $ii; ?> " type="radio" name="pn[<?php echo $ii; ?> ][catSel]" <?php if ((int) $options['catSel'] == 1) { echo "checked"; } ?> /> <a href="#" style="text-decoration: none;" class="showCats" id="nxs_SCA_PN<?php echo $ii; ?> " onclick="jQuery('#catSelSPN<?php echo $ii; ?> ').attr('checked', true); jQuery('#tmpCatSelNT').val('PN<?php echo $ii; ?> '); nxs_markCats( jQuery('#nxs_SC_PN<?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> <input type="hidden" name="pn[<?php echo $ii; ?> ][catSelEd]" id="nxs_SC_PN<?php echo $ii; ?> " value="<?php echo $options['catSelEd']; ?> " /> <br/><i><?php _e('Only selected categories will be autoposted to this account', 'nxs_snap'); ?> </i></div> <br/> <?php } ?> <div style="width:100%;"><strong>Pinterest Email:</strong> </div><input name="pn[<?php echo $ii; ?> ][apPNUName]" id="apPNUName<?php echo $ii; ?> " class="apPNUName<?php echo $ii; ?> " style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pnUName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>Pinterest Password:</strong> </div><input name="pn[<?php echo $ii; ?> ][apPNPass]" id="apPNPass<?php echo $ii; ?> " type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['pnPass'], 0, 5) == 'g9c1a' ? nsx_doDecode(substr($options['pnPass'], 5)) : $options['pnPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> <div style="width:100%;"><strong>Default Image to Pin:</strong> <p style="font-size: 11px; margin: 0px;">If your post missing Featured Image this will be used instead.</p> </div><input name="pn[<?php echo $ii; ?> ][apPNDefImg]" id="apPNDefImg" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['pnDefImg'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/><br/> <div style="width:100%;"><strong>Board:</strong> Please <a href="#" onclick="getBoards(jQuery('<?php if ($isNew) { echo "#nsx_addNT "; } ?> #apPNUName<?php echo $ii; ?> ').val(),jQuery('<?php if ($isNew) { echo "#nsx_addNT "; } ?> #apPNPass<?php echo $ii; ?> ').val(), '<?php echo $ii; ?> '); return false;">click here to retrieve your boards</a> </div> <?php wp_nonce_field('getBoards', 'getBoards_wpnonce'); ?> <img id="pnLoadingImg<?php echo $ii; ?> " style="display: none;" src='<?php echo $nxs_plurl; ?> img/ajax-loader-sm.gif' /> <select name="pn[<?php echo $ii; ?> ][apPNBoard]" id="apPNBoard<?php echo $ii; ?> "> <?php if ($options['pnBoardsList'] != '') { $gPNBoards = $options['pnBoardsList']; if (base64_encode(base64_decode($gPNBoards)) === $gPNBoards) { $gPNBoards = base64_decode($gPNBoards); } if ($options['pnBoard'] != '') { $gPNBoards = str_replace($options['pnBoard'] . '"', $options['pnBoard'] . '" selected="selected"', $gPNBoards); } echo $gPNBoards; } else { ?> <option value="0">None(Click above to retrieve your boards)</option> <?php } ?> </select> <br/><br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Message text Format', 'nxs_snap'); ?> :</strong> <a href="#" id="apPNMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apPNMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a> </div> <textarea cols="150" rows="3" id="pn<?php echo $ii; ?> SNAPformat" name="pn[<?php echo $ii; ?> ][apPNMsgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#pn<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apPNMsgFrmt<?php echo $ii; ?> ');"><?php if ($options['pnMsgFormat'] != '') { _e(apply_filters('format_to_edit', htmlentities($options['pnMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } else { echo "%TITLE% - %URL%"; } ?> </textarea> <?php nxs_doShowHint("apPNMsgFrmt" . $ii); ?> </div><br/> <?php if ($isNew) { ?> <input type="hidden" name="pn[<?php echo $ii; ?> ][apDoPN]" value="1" id="apDoNewPN<?php echo $ii; ?> " /> <?php } ?> <?php if ($options['pnPass'] != '') { ?> <?php wp_nonce_field('rePostToPN', 'rePostToPN_wpnonce'); ?> <b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('PN', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> <div class="submit"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div> </div> </div> <?php }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); 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'] = ''; } if (!isset($options['nDays'])) { $options['nDays'] = 0; } if (!isset($options['qTLng'])) { $options['qTLng'] = ''; } if (!isset($options['ytGPPageID'])) { $options['ytGPPageID'] = ''; } ?> <div id="doYT<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { echo " clNewNTSets"; } ?> "> <input type="hidden" name="apDoSYT<?php echo $ii; ?> " value="0" id="apDoSYT<?php echo $ii; ?> " /> <?php if (!function_exists('doPostToGooglePlus')) { ?> <span style="color:#580000; font-size: 16px;"><br/><br/> <b><?php _e('YouTube API Library not found', 'nxs_snap'); ?> </b> <br/><br/> <?php _e('YouTube doesn\'t have a built-in API for automated posts yet.', 'nxs_snap'); ?> <br/><?php _e('The current <a target="_blank" href="http://developers.google.com/+/api/">YouTube API</a> is "Read Only" and can\'t be used for posting. <br/><br/>You need to get a special <a target="_blank" href="http://www.nextscripts.com/google-plus-automated-posting"><b>API Library Module</b></a> to be able to publish your content to YouTube.', 'nxs_snap'); ?> </span></div> <?php return; } ?> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/yt16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/instructions/youtube-social-networks-auto-poster-wordpress-setup-installation/"><?php $nType = "YouTube"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a></div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easily identify it', 'nxs_snap'); ?> </i> </div><input name="yt[<?php echo $ii; ?> ][nName]" id="ytnName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('yt', $ii, $options['qTLng']); ?> <br/> <ul class="nsx_tabs"> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab1"><?php _e('Account Info', 'nxs_snap'); ?> </a></li> <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt . $ii; ?> _tab2"><?php _e('Advanced', 'nxs_snap'); ?> </a></li> <?php } ?> </ul> <div class="nsx_tab_container"><?php /* ######################## Account Tab ####################### */ ?> <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%;"> <div style="width:100%;"><strong>YouTube(Google) Username:</strong> </div><input name="yt[<?php echo $ii; ?> ][apYTUName]" id="apYTUName" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ytUName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>YouTube(Google) Password:</strong> </div><input name="yt[<?php echo $ii; ?> ][apYTPass]" id="apYTPass" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['ytPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['ytPass'], 5)) : $options['ytPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/> <p><div style="width:100%;"><strong>YouTube Channel Page URL:</strong> </div><input name="yt[<?php echo $ii; ?> ][apYTPage]" id="apYTPage" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ytPageID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/><br/> <p><div style="width:100%;"><i style="color: gray;"><strong >Google+ Page ID:</strong> Fill this only if you are posting to youTube as your Google+ page. Please leave this empty otherwise.</i> </div><input name="yt[<?php echo $ii; ?> ][ytGPPageID]" id="ytGPPageID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['ytGPPageID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/><br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Message text Format', 'nxs_snap'); ?> :</strong> (<a href="#" id="apYTMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apYTMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>) </div> <textarea cols="150" rows="3" id="yt<?php echo $ii; ?> SNAPformat" name="yt[<?php echo $ii; ?> ][apYTMsgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#yt<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apYTMsgFrmt<?php echo $ii; ?> ');"><?php if ($isNew) { _e("New post: %TITLE% - %URL%", 'nxs_snap'); } else { _e(apply_filters('format_to_edit', htmlentities($options['ytMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } ?> </textarea> <?php nxs_doShowHint("apYTMsgFrmt" . $ii); ?> </div><br/> <?php if ($isNew) { ?> <input type="hidden" name="yt[<?php echo $ii; ?> ][apDoYT]" value="1" id="apDoNewYT<?php echo $ii; ?> " /> <?php } ?> <?php if ($options['ytPass'] != '') { ?> <b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <a href="#" class="NXSButton" onclick="testPost('YT', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> </div> <?php /* ######################## Advanced Tab ####################### */ ?> <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt . $ii; ?> _tab2" class="nsx_tab_content"> <?php nxs_showCatTagsCTFilters($nt, $ii, $options); nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); nxs_showRepostSettings($nt, $ii, $options); ?> </div> <?php } ?> <?php /* #### End of Tab #### */ ?> </div><br/> <?php /* #### End of Tabs #### */ ?> <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div></div><?php }
function showNTSettings($ii, $options, $isNew = false) { global $nxs_plurl; ?> <div id="doBG<?php echo $ii; ?> Div" class="insOneDiv<?php if ($isNew) { ?> clNewNTSets<?php } ?> " style="background-image: url(<?php echo $nxs_plurl; ?> img/bg-bg.png);background-position:90% 10%;"> <input type="hidden" name="apDoSBG<?php echo $ii; ?> " value="0" id="apDoSBG<?php echo $ii; ?> " /> <?php if ($isNew) { ?> <input type="hidden" name="bg[<?php echo $ii; ?> ][apDoBG]" value="1" id="apDoNewBG<?php echo $ii; ?> " /> <?php } ?> <div style="display: none;"><input name="bg[<?php echo $ii; ?> ][apBGPassChr]" id="apBGPassChr" type="password" value="" /></div> <div id="doBG<?php echo $ii; ?> Div" style="margin-left: 10px;"> <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?> img/bg16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-blogger-social-networks-auto-poster-wordpress/"><?php $nType = "Blogger"; printf(__('Detailed %s Installation/Configuration Instructions', 'nxs_snap'), $nType); ?> </a></div> <div style="width:100%;"><strong><?php _e('Account Nickname', 'nxs_snap'); ?> :</strong> <i><?php _e('Just so you can easely identify it', 'nxs_snap'); ?> </i> </div><input name="bg[<?php echo $ii; ?> ][nName]" id="bgnName<?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")), 'nxs_snap'); ?> " /><br/> <?php echo nxs_addQTranslSel('bg', $ii, $options['qTLng']); ?> <?php echo nxs_addPostingDelaySel('bg', $ii, $options['nHrs'], $options['nMin']); ?> <?php if (!$isNew) { ?> <div style="width:100%;"><strong><?php _e('Categories', 'nxs_snap'); ?> :</strong> <input value="0" id="catSelA<?php echo $ii; ?> " type="radio" name="bg[<?php echo $ii; ?> ][catSel]" <?php if ((int) $options['catSel'] != 1) { echo "checked"; } ?> /> All <input value="1" id="catSelSBG<?php echo $ii; ?> " type="radio" name="bg[<?php echo $ii; ?> ][catSel]" <?php if ((int) $options['catSel'] == 1) { echo "checked"; } ?> /> <a href="#" style="text-decoration: none;" class="showCats" id="nxs_SCA_BG<?php echo $ii; ?> " onclick="jQuery('#catSelSBG<?php echo $ii; ?> ').attr('checked', true); jQuery('#tmpCatSelNT').val('BG<?php echo $ii; ?> '); nxs_markCats( jQuery('#nxs_SC_BG<?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> <input type="hidden" name="bg[<?php echo $ii; ?> ][catSelEd]" id="nxs_SC_BG<?php echo $ii; ?> " value="<?php echo $options['catSelEd']; ?> " /> <br/><i><?php _e('Only selected categories will be autoposted to this account', 'nxs_snap'); ?> </i> </div> <br/> <?php } ?> <div style="width:100%;"><strong>Blogger Username/Email:</strong> </div><input name="bg[<?php echo $ii; ?> ][apBGUName]" id="apBGUName" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['bgUName'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <div style="width:100%;"><strong>Blogger Password:</strong> </div><input name="bg[<?php echo $ii; ?> ][apBGPass]" id="apBGPass" autocomplete="off" type="password" style="width: 30%;" value="<?php if (trim($options['bgPass']) != '') { _e(apply_filters('format_to_edit', htmlentities(substr($options['bgPass'], 0, 5) == 'b4d7s' ? nsx_doDecode(substr($options['bgPass'], 5)) : $options['bgPass'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } ?> " /> <br/> <div style="width:100%;"><strong>Blogger Blog ID:</strong> <p style="font-size: 11px; margin: 0px;"><?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', 'nxs_snap'); ?> </p> </div><input name="bg[<?php echo $ii; ?> ][apBGBlogID]" id="apBGBlogID" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['bgBlogID'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); ?> " /> <br/><br/> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'nxs_snap'); ?> :</strong> (<a href="#" id="apBGTMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apBGTMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>)</div> <input name="bg[<?php echo $ii; ?> ][apBGMsgTFrmt]" id="apBGMsgTFrmt" style="width: 50%;" value="<?php if ($options['bgMsgTFormat'] != '') { _e(apply_filters('format_to_edit', htmlentities($options['bgMsgTFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } else { echo "%TITLE%"; } ?> " onfocus="mxs_showFrmtInfo('apBGTMsgFrmt<?php echo $ii; ?> ');" /><?php nxs_doShowHint("apBGTMsgFrmt" . $ii); ?> <br/> <div id="altFormat" style=""> <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Text Format', 'nxs_snap'); ?> :</strong> (<a href="#" id="apBGMsgFrmt<?php echo $ii; ?> HintInfo" onclick="mxs_showHideFrmtInfo('apBGMsgFrmt<?php echo $ii; ?> '); return false;"><?php _e('Show format info', 'nxs_snap'); ?> </a>) <!-- HTML is <?php if (!function_exists('doPostToGooglePlus')) { ?> <b>NOT</b> <?php } ?> allowed. <?php if (!function_exists('doPostToGooglePlus')) { ?> <i>- Blogger "Free API" limitation. Please get <a href="http://www.nextscripts.com/google-plus-automated-posting/#blogger">NextScripts API</a> to allow HTML</i> <?php } ?> --> </div> <textarea cols="150" rows="3" id="bg<?php echo $ii; ?> SNAPformat" name="bg[<?php echo $ii; ?> ][apBGMsgFrmt]" style="width:51%;max-width: 650px;" onfocus="jQuery('#bg<?php echo $ii; ?> SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apBGMsgFrmt<?php echo $ii; ?> ');"><?php if ($options['bgMsgFormat'] != '') { _e(apply_filters('format_to_edit', htmlentities($options['bgMsgFormat'], ENT_COMPAT, "UTF-8")), 'nxs_snap'); } else { echo "%FULLTEXT% <br/><a href='%URL%'>%TITLE%</a>"; } ?> </textarea> <?php nxs_doShowHint("apBGMsgFrmt" . $ii, __('HTML is allowed', 'nxs_snap')); ?> </div> <p style="margin-bottom: 20px;margin-top: 5px;"><input value="1" id="bgInclTags" type="checkbox" name="bg[<?php echo $ii; ?> ][bgInclTags]" <?php if ((int) $options['bgInclTags'] == 1) { echo "checked"; } ?> /> <strong><?php _e('Post with tags', 'nxs_snap'); ?> </strong> <?php _e('Tags from the blogpost will be auto-posted to Blogger/Blogspot', 'nxs_snap'); ?> </p> <?php if ($options['bgPass'] != '') { ?> <?php wp_nonce_field('rePostToBG', 'rePostToBG_wpnonce'); ?> <b><?php _e('Test your settings', 'nxs_snap'); ?> :</b> <?php if (!isset($options['bgOK']) || $options['bgOK'] != '1') { ?> <div class="blnkg">=== <?php _e('Submit Test Post to Finish Configuration', 'nxs_snap'); ?> ===></div> <?php } ?> <a href="#" class="NXSButton" onclick="testPost('BG', '<?php echo $ii; ?> '); return false;"><?php printf(__('Submit Test Post to %s', 'nxs_snap'), $nType); ?> </a> <?php } ?> <div class="submit"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'nxs_snap'); ?> " /></div> </div> </div> <?php }
function doPostToNT($options, $message) { global $nxs_urlLen; $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (!isset($options['uPass']) || trim($options['uPass']) == '') { $badOut['Error'] = 'Not Authorized'; return $badOut; } if (empty($options['imgSize'])) { $options['imgSize'] = ''; } //## Format Post if (!empty($message['pText'])) { $text = $message['pText']; } else { $text = nxs_doFormatMsg($options['msgFrmt'], $message); } //## Make Post if (isset($message['imageURL'])) { $imgURL = trim(nxs_getImgfrOpt($message['imageURL'], $options['imgSize'])); } else { $imgURL = ''; } //## Make Post if (!empty($options['ck'])) { $ck = maybe_unserialize($options['ck']); $loginError = doCheckFlipboard($ck); } if (empty($ck) || $loginError !== false) { $pass = substr($options['uPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['uPass'], 5)) : $options['uPass']; $loginInfo = doConnectToFlipboard($options['uName'], $pass); if (!is_array($loginInfo)) { $badOut['Error'] = print_r($loginInfo, true) . " - ERROR"; return $badOut; } $ck = $loginInfo['ck']; } $post = array('url' => $message['url'], 'mgzURL' => $options['mgzURL'], 'imgURL' => $imgURL, 'text' => $text); return doPostToFlipboard($ck, $post); }
function doPostToNT($options, $message) { global $nxs_urlLen; $badOut = array('pgID' => '', 'isPosted' => 0, 'pDate' => date('Y-m-d H:i:s'), 'Error' => ''); //## Check settings if (!is_array($options)) { $badOut = 'No Options'; return $badOut; } if (!isset($options['daUName']) || trim($options['daUName']) == '' || !isset($options['daPass']) || trim($options['daPass']) == '') { $badOut = 'No username/password Found'; return $badOut; } //## Format Post if (!empty($message['pTitle'])) { $title = $message['pTitle']; } else { $title = nxs_doFormatMsg($options['daTitleFormat'], $message); } $title = nsTrnc($title, 300); if (!empty($message['pText'])) { $text = $message['pText']; } else { $text = nxs_doFormatMsg($options['daTextFormat'], $message); } //## Make Post if (!empty($options['ck'])) { $ck = maybe_unserialize($options['ck']); } if (!empty($options['mh'])) { $mh = maybe_unserialize($options['mh']); } $pass = substr($options['daPass'], 0, 5) == 'n5g9a' ? nsx_doDecode(substr($options['daPass'], 5)) : $options['uPass']; $nt = new nxsAPI_DA(); $nt->debug = false; if (!empty($ck)) { $nt->ck = $ck; } if (!empty($mh)) { $nt->mh = $mh; } $loginErr = $nt->connect($options['daUName'], $pass); if (!$loginErr) { $post = array('title' => $title, 'text' => $text); $ret = $nt->post($post); if (is_array($ret)) { $ret['ck'] = $nt->ck; $ret['mh'] = $nt->mh; return $ret; } else { return print_r($ret, true); } } else { return print_r($loginErr, true); } }