• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP nsx_doDecode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中nsx_doDecode函数的典型用法代码示例。如果您正苦于以下问题:PHP nsx_doDecode函数的具体用法?PHP nsx_doDecode怎么用?PHP nsx_doDecode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了nsx_doDecode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: doPostToNT

 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;
 }
开发者ID:acruxray,项目名称:social-networks-auto-poster-facebook-twitter-g,代码行数:35,代码来源:yt.api.php


示例2: doPostToNT

 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;
 }
开发者ID:digideskio,项目名称:stammtisch,代码行数:60,代码来源:lj.api.php


示例3: doPostToNT

 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;
 }
开发者ID:JalpMi,项目名称:v2contact,代码行数:60,代码来源:gp.api.php


示例4: doPostToNT

 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;
 }
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:59,代码来源:ff.api.php


示例5: doPostToNT

 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;
 }
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:59,代码来源:ip.api.php


示例6: doPostToNT

 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'));
 }
开发者ID:digideskio,项目名称:stammtisch,代码行数:57,代码来源:dl.api.php


示例7: doPostToNT

 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;
     }
 }
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:43,代码来源:di.api.php


示例8: doPostToNT

 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;
 }
开发者ID:digideskio,项目名称:stammtisch,代码行数:37,代码来源:yt.api.php


示例9: doPostToNT

 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;
 }
开发者ID:digideskio,项目名称:stammtisch,代码行数:88,代码来源:rd.api.php


示例10: showNTSettings


//.........这里部分代码省略.........
            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;
开发者ID:digideskio,项目名称:stammtisch,代码行数:67,代码来源:kt.php


示例11: doPostToNT

 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 {
//.........这里部分代码省略.........
开发者ID:digideskio,项目名称:stammtisch,代码行数:101,代码来源:wp.api.php


示例12: doPostToNT

 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;
 }
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:50,代码来源:su.api.php


示例13: showNTSettings


//.........这里部分代码省略.........
            ?>
_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="">
开发者ID:jguzmanf88,项目名称:social-networks-auto-poster-facebook-twitter-g,代码行数:67,代码来源:vb.php


示例14: doPostToNT

 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);
     }
 }
开发者ID:digideskio,项目名称:stammtisch,代码行数:57,代码来源:st.api.php


示例15: showNTSettings


//.........这里部分代码省略.........
                ?>
<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 
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:67,代码来源:fb.php


示例16: getAPOptions

 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_OptionsPa 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nsx_doEncode函数代码示例发布时间:2022-05-15
下一篇:
PHP nsTrnc函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap