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

PHP nsTrnc函数代码示例

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

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



在下文中一共展示了nsTrnc函数的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['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


示例2: nxs_doPublishToTW

 function nxs_doPublishToTW($postID, $options)
 {
     $ntCd = 'TW';
     $ntCdL = 'tw';
     $ntNm = 'Twitter';
     $imgData = '';
     $imgURL = '';
     global $plgn_NS_SNAutoPoster, $nxs_urlLen;
     $nxs_urlLen = 0;
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     //$backtrace = debug_backtrace(); nxs_addToLogN('W', 'Error', $logNT, 'I am here - '.$ntCd."|".print_r($backtrace, true), '');
     //if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToTW',  array($postID, $options));
     $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
     if (!empty($gOptions['nxsHTSpace'])) {
         $htS = $gOptions['nxsHTSpace'];
     } else {
         $htS = '';
     }
     $addParams = nxs_makeURLParams(array('NTNAME' => $ntNm, 'NTCODE' => $ntCd, 'POSTID' => $postID, 'ACCNAME' => $options['nName']));
     $ii = $options['ii'];
     if (!isset($options['pType'])) {
         $options['pType'] = 'im';
     }
     if ($options['pType'] == 'sh') {
         sleep(rand(1, 10));
     }
     $logNT = '<span style="color:#00FFFF">Twitter</span> - ' . $options['nName'];
     $snap_ap = get_post_meta($postID, 'snap' . $ntCd, true);
     $snap_ap = maybe_unserialize($snap_ap);
     if ($options['pType'] != 'aj' && is_array($snap_ap) && (nxs_chArrVar($snap_ap[$ii], 'isPosted', '1') || nxs_chArrVar($snap_ap[$ii], 'isPrePosted', '1'))) {
         $snap_isAutoPosted = get_post_meta($postID, 'snap_isAutoPosted', true);
         if ($snap_isAutoPosted != '2') {
             nxs_addToLogN('W', 'Notice', $logNT, '-=Duplicate=- Post ID:' . $postID, 'Already posted. No reason for posting duplicate' . ' |' . $options['pType']);
             return;
         }
     }
     $blogTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
     if ($blogTitle == '') {
         $blogTitle = home_url();
     }
     $uln = 0;
     $extInfo = ' | PostID: ' . $postID;
     if ($options['attchImg'] == '1') {
         if (!empty($options['imgToUse'])) {
             $imgURL = $options['imgToUse'];
         } else {
             $imgURL = nxs_getPostImage($postID);
         }
         if (preg_match("/noImg.\\.png/i", $imgURL)) {
             $imgURL = '';
         }
         if (trim($imgURL) == '') {
             $options['attchImg'] = 0;
         } else {
             $imgURL = str_replace(' ', '%20', $imgURL);
             $hdrsArr['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0';
             $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'sslverify' => false);
             $imgData = wp_remote_get($imgURL, $advSet);
             if (is_wp_error($imgData) || empty($imgData['body']) || !empty($imgData['headers']['content-length']) && (int) $imgData['headers']['content-length'] < 200) {
                 $options['attchImg'] = 0;
                 nxs_addToLogN('E', 'Error', $logNT, 'Could not get image (' . $imgURL . '), will post without it - Error:' . print_r($imgData, true), $extInfo);
             } else {
                 $imgData = $imgData['body'];
             }
         }
     }
     if ($options['attchImg'] == '1' && $imgData != '') {
         $twLim = 117;
     } else {
         $twLim = 140;
     }
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $msg = 'Test Post from ' . nsTrnc($blogTitle, $twLim - 24) . " - " . rand(1, 155);
         $uln = nxs_strLen($msg);
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $twMsgFormat = $options['twMsgFormat'];
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $extInfo = ' | PostID: ' . $postID . " - " . $post->post_title . ' |' . $options['pType'];
         if (stripos($twMsgFormat, '%URL%') !== false || stripos($twMsgFormat, '%SURL%') !== false) {
             $twLim = $twLim - 22;
         }
         if (stripos($twMsgFormat, '%AUTHORNAME%') !== false) {
             $aun = $post->post_author;
             $aun = get_the_author_meta('display_name', $aun);
             $twLim = $twLim - nxs_strLen($aun);
         }
         $noRepl = str_ireplace("%TITLE%", "", $twMsgFormat);
         $noRepl = str_ireplace("%SITENAME%", "", $noRepl);
         $noRepl = str_ireplace("%URL%", "", $noRepl);
         $noRepl = str_ireplace("%RAWEXCERPT%", "", $noRepl);
         $noRepl = str_ireplace("%SURL%", "", $noRepl);
         $noRepl = str_ireplace("%TEXT%", "", $noRepl);
         $noRepl = str_ireplace("%FULLTEXT%", "", $noRepl);
//.........这里部分代码省略.........
开发者ID:jguzmanf88,项目名称:social-networks-auto-poster-facebook-twitter-g,代码行数:101,代码来源:tw.php


示例3: nxs_doPublishToPK

 function nxs_doPublishToPK($postID, $options)
 {
     $ntCd = 'PK';
     $ntCdL = 'pk';
     $ntNm = 'Plurk';
     //if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToPK',  array($postID, $options));
     $blogTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
     if ($blogTitle == '') {
         $blogTitle = home_url();
     }
     $ii = $options['ii'];
     if (!isset($options['pType'])) {
         $options['pType'] = 'im';
     }
     if ($options['pType'] == 'sh') {
         sleep(rand(1, 10));
     }
     $logNT = '<span style="color:#014A76">Plurk</span> - ' . $options['nName'];
     $snap_ap = get_post_meta($postID, 'snap' . $ntCd, true);
     $snap_ap = maybe_unserialize($snap_ap);
     if ($options['pType'] != 'aj' && is_array($snap_ap) && (nxs_chArrVar($snap_ap[$ii], 'isPosted', '1') || nxs_chArrVar($snap_ap[$ii], 'isPrePosted', '1'))) {
         $snap_isAutoPosted = get_post_meta($postID, 'snap_isAutoPosted', true);
         if ($snap_isAutoPosted != '2') {
             sleep(5);
             nxs_addToLogN('W', 'Notice', $logNT, '-=Duplicate=- Post ID:' . $postID, 'Already posted. No reason for posting duplicate' . ' |' . $uqID);
             return;
         }
     }
     //## Format
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $msg = 'Test Post from ' . $blogTitle;
         $msgT = 'Test Post from ' . $blogTitle;
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $twMsgFormat = $options['pkMsgFormat'];
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $twLim = 180;
         $extInfo = ' | PostID: ' . $postID . " - " . $post->post_title;
         if (stripos($twMsgFormat, '%URL%') !== false || stripos($twMsgFormat, '%SURL%') !== false) {
             $twLim = $twLim - 5;
         }
         if (stripos($twMsgFormat, '%AUTHORNAME%') !== false) {
             $aun = $post->post_author;
             $aun = get_the_author_meta('display_name', $aun);
             $twLim = $twLim - strlen($aun);
         }
         $noRepl = str_ireplace("%TITLE%", "", $twMsgFormat);
         $noRepl = str_ireplace("%SITENAME%", "", $noRepl);
         $noRepl = str_ireplace("%URL%", "", $noRepl);
         $noRepl = str_ireplace("%RAWEXCERPT%", "", $noRepl);
         $noRepl = str_ireplace("%SURL%", "", $noRepl);
         $noRepl = str_ireplace("%TEXT%", "", $noRepl);
         $noRepl = str_ireplace("%FULLTEXT%", "", $noRepl);
         $noRepl = str_ireplace("%EXCERPT%", "", $noRepl);
         $noRepl = str_ireplace("%ANNOUNCE%", "", $noRepl);
         $noRepl = str_ireplace("%AUTHORNAME%", "", $noRepl);
         $twLim = $twLim - strlen($noRepl);
         $pTitle = $title = $post->post_title;
         if ($post->post_excerpt != "") {
             $pText = apply_filters('the_content', $post->post_excerpt);
         } else {
             $pText = apply_filters('the_content', $post->post_content);
         }
         $pFullText = apply_filters('the_content', $post->post_content);
         $pRawText = $post->post_content;
         if (stripos($twMsgFormat, '%TITLE%') !== false) {
             $pTitle = nsTrnc($pTitle, $twLim);
             $twMsgFormat = str_ireplace("%TITLE%", $pTitle, $twMsgFormat);
             $twLim = $twLim - strlen($pTitle);
         }
         if (stripos($twMsgFormat, '%SITENAME%') !== false) {
             $siteTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
             $siteTitle = nsTrnc($siteTitle, $twLim);
             $twMsgFormat = str_ireplace("%SITENAME%", $siteTitle, $twMsgFormat);
             $twLim = $twLim - strlen($siteTitle);
         }
         if (stripos($twMsgFormat, '%EXCERPT%') !== false) {
             $pText = nsTrnc(strip_tags(strip_shortcodes($pText)), 300, " ", "...");
             $pText = nsTrnc($pText, $twLim);
             $twMsgFormat = str_ireplace("%EXCERPT%", $pText, $twMsgFormat);
             $twLim = $twLim - strlen($pText);
         }
         if (stripos($twMsgFormat, '%FULLTEXT%') !== false) {
             $pFullText = nsTrnc(strip_tags($pFullText), $twLim);
             $twMsgFormat = str_ireplace("%FULLTEXT%", $pFullText, $twMsgFormat);
             $twLim = $twLim - strlen($pFullText);
         }
         if (stripos($twMsgFormat, '%RAWTEXT%') !== false) {
             $pRawText = nsTrnc(strip_tags($pRawText), $twLim);
             $twMsgFormat = str_ireplace("%FULLTEXT%", $pRawText, $twMsgFormat);
             $twLim = $twLim - strlen($pRawText);
         }
         $msg = nsFormatMessage($twMsgFormat, $postID);
     }
     //## Post
     require_once 'apis/plurkOAuth.php';
//.........这里部分代码省略.........
开发者ID:JalpMi,项目名称:v2contact,代码行数:101,代码来源:pk.php


示例4: nxs_doPublishToLI

 function nxs_doPublishToLI($postID, $options)
 {
     global $nxs_gCookiesArr;
     $ntCd = 'LI';
     $ntCdL = 'li';
     $ntNm = 'LinkedIn';
     $urlDescr = '';
     $myurl = '';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     //if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToLI',  array($postID, $options));
     $addParams = nxs_makeURLParams(array('NTNAME' => $ntNm, 'NTCODE' => $ntCd, 'POSTID' => $postID, 'ACCNAME' => $options['nName']));
     if (empty($options['imgToUse'])) {
         $options['imgToUse'] = '';
     }
     if (empty($options['imgSize'])) {
         $options['imgSize'] = '';
     }
     $ii = $options['ii'];
     if (!isset($options['pType'])) {
         $options['pType'] = 'im';
     }
     if ($options['pType'] == 'sh') {
         sleep(rand(1, 10));
     }
     $logNT = '<span style="color:#000058">LinkedIn</span> - ' . $options['nName'];
     $snap_ap = get_post_meta($postID, 'snap' . $ntCd, true);
     $snap_ap = maybe_unserialize($snap_ap);
     if ($options['pType'] != 'aj' && is_array($snap_ap) && (nxs_chArrVar($snap_ap[$ii], 'isPosted', '1') || nxs_chArrVar($snap_ap[$ii], 'isPrePosted', '1'))) {
         $snap_isAutoPosted = get_post_meta($postID, 'snap_isAutoPosted', true);
         if ($snap_isAutoPosted != '2') {
             sleep(5);
             nxs_addToLogN('W', 'Notice', $logNT, '-=Duplicate=- Post ID:' . $postID, 'Already posted. No reason for posting duplicate' . ' |' . $uqID);
             return;
         }
     }
     $blogTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
     if ($blogTitle == '') {
         $blogTitle = home_url();
     }
     $imgURL = '';
     // prr($options);
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $options['liMsgFormatT'] = 'Test Post from ' . $blogTitle;
         $urlToGo = home_url();
         $options['liMsgFormat'] = 'Test Post from ' . $blogTitle . " " . $urlToGo;
         $title = $blogTitle;
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $options['liMsgFormat'] = nsFormatMessage($options['liMsgFormat'], $postID, $addParams);
         $options['liMsgFormatT'] = nsTrnc(nsFormatMessage($options['liMsgFormatT'], $postID, $addParams), 200);
         //## MyURL - URLToGo code
         $options = nxs_getURL($options, $postID, $addParams);
         $urlToGo = $options['urlToUse'];
         $title = nsTrnc($post->post_title, 200);
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         if (empty($options['postType'])) {
             if ((int) $options['liAttch'] == 1 || $isNew) {
                 $options['postType'] = 'A';
             }
         }
         if ($options['postType'] == 'A' || $options['postType'] == 'I') {
             if (trim($options['liMsgAFrmt']) != '') {
                 $urlDescr = nsFormatMessage($options['liMsgAFrmt'], $postID, $addParams);
             } else {
                 $urlDescr = trim(apply_filters('the_content', $post->post_excerpt));
                 if ($urlDescr == '') {
                     $urlDescr = apply_filters('the_content', $post->post_content);
                 }
             }
             if (trim($options['imgToUse']) != '') {
                 $imgURL = $options['imgToUse'];
             } else {
                 $imgURL = nxs_getPostImage($postID, 'full');
             }
             if (preg_match("/noImg.\\.png/i", $imgURL)) {
                 $imgURL = '';
             }
             $urlDescr = strip_tags($urlDescr);
             $urlDescr = nxs_decodeEntitiesFull($urlDescr);
             $urlDescr = nxs_html_to_utf8($urlDescr);
             $urlDescr = nsTrnc($urlDescr, 300);
         }
     }
     $extInfo = ' | PostID: ' . $postID . " - " . (isset($post) && is_object($post) ? $post->post_title : '');
     //$images = array(nxs_getPostImage($postID, 'thumb'), nxs_getPostImage($postID, 'medium'), nxs_getPostImage($postID, 'full'), nxs_getPostImage($postID, 'original'));
     $message = array('url' => $urlToGo, 'surl' => $urlToGo, 'urlDescr' => $urlDescr, 'urlTitle' => $title, 'title' => $title, 'imageURL' => $imgURL, 'videoCode' => '', 'videoURL' => '', 'siteName' => $blogTitle, 'cats' => '', 'authorName' => '');
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_LI();
     $ret = $ntToPost->doPostToNT($options, $message);
     //## Process Results
     if (!is_array($ret) || $ret['isPosted'] != '1') {
         //## Error
         if ($postID == '0') {
             prr($ret);
//.........这里部分代码省略.........
开发者ID:Florian-Eschenbacher,项目名称:schneeeule,代码行数:101,代码来源:li.php


示例5: 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


示例6: nxs_doPublishToVK


//.........这里部分代码省略.........
         $imgURL = $imgVURL;
     }
     if ($options['postType'] == 'A') {
         if (trim($options['msgAFormat']) != '') {
             $dsc = nsFormatMessage($options['msgAFormat'], $postID, $addParams);
         } else {
             if (function_exists('aioseop_mrt_fix_meta') && $dsc == '') {
                 $dsc = trim(get_post_meta($postID, '_aioseop_description', true));
             }
             if (function_exists('wpseo_admin_init') && $dsc == '') {
                 $dsc = trim(get_post_meta($postID, '_yoast_wpseo_opengraph-description', true));
             }
             if (function_exists('wpseo_admin_init') && $dsc == '') {
                 $dsc = trim(get_post_meta($postID, '_yoast_wpseo_metadesc', true));
             }
             if (is_object($post) && $dsc == '') {
                 $dsc = trim(apply_filters('the_content', nxs_doQTrans($post->post_excerpt, $lng)));
             }
             if ($dsc == '') {
                 $dsc = trim(nxs_doQTrans($post->post_excerpt, $lng));
             }
             if (is_object($post) && $dsc == '') {
                 $dsc = trim(apply_filters('the_content', nxs_doQTrans($post->post_content, $lng)));
             }
             if ($dsc == '') {
                 $dsc = trim(nxs_doQTrans($post->post_content, $lng));
             }
             if (is_object($post) && $dsc == '') {
                 $dsc = get_bloginfo('description');
             }
         }
         $dsc = strip_tags($dsc);
         $dsc = nxs_decodeEntitiesFull($dsc);
         $dsc = nsTrnc($dsc, 900, ' ');
     } else {
         $dsc = '';
     }
     $message = array('siteName' => $blogTitle, 'url' => $urlToGo, 'imageURL' => $imgURL, 'videoURL' => $vidURL, 'urlTitle' => nxs_decodeEntitiesFull(nxs_doQTrans($post->post_title, $lng)), 'urlDescr' => $dsc);
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_VK();
     $ret = $ntToPost->doPostToNT($options, $message);
     //## Check Phone Req Return
     if (is_string($ret) && stripos($ret, 'Phone verification required:') !== false) {
         global $plgn_NS_SNAutoPoster;
         $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
         $phtext = str_ireplace('Phone verification required: ', '', $ret);
         $ret .= ". Please refresh/reload the SNAP settings page and enter your phone.";
         $gOptions['vk'][$ii]['vkPhReq'] = $phtext;
         update_option('NS_SNAutoPoster', $gOptions);
         if ($postID == '0') {
             prr($ret);
         }
         nxs_addToLogN('E', 'Error', $logNT, '-=ERROR=- ' . print_r($ret, true) . " - BAD USER/PASS", $extInfo);
         return " -= BAD USER/PASS - Phone verification required =- ";
     }
     //## Save Session
     if (empty($options['vkSvC']) || serialize($nxs_vkCkArray) != $options['vkSvC']) {
         global $plgn_NS_SNAutoPoster;
         $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
         if (isset($options['ii']) && $options['ii'] !== '') {
             $gOptions['vk'][$options['ii']]['vkSvC'] = serialize($nxs_vkCkArray);
             update_option('NS_SNAutoPoster', $gOptions);
         } else {
             foreach ($gOptions['vk'] as $ii => $gpn) {
                 $result = array_diff($options, $gpn);
                 if (!is_array($result) || count($result) < 1) {
开发者ID:brettex,项目名称:pspark,代码行数:67,代码来源:vk.php


示例7: nxs_doPublishToTW

 function nxs_doPublishToTW($postID, $options)
 {
     $ntCd = 'TW';
     $ntCdL = 'tw';
     $ntNm = 'Twitter';
     $img = '';
     $imgURL = '';
     global $nxs_urlLen;
     $nxs_urlLen = 0;
     //$backtrace = debug_backtrace(); nxs_addToLogN('W', 'Error', $logNT, 'I am here - '.$ntCd."|".print_r($backtrace, true), '');
     //if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToTW',  array($postID, $options));
     $ii = $options['ii'];
     if (!isset($options['pType'])) {
         $options['pType'] = 'im';
     }
     if ($options['pType'] == 'sh') {
         sleep(rand(1, 10));
     }
     $logNT = '<span style="color:#00FFFF">Twitter</span> - ' . $options['nName'];
     $snap_ap = get_post_meta($postID, 'snap' . $ntCd, true);
     $snap_ap = maybe_unserialize($snap_ap);
     if ($options['pType'] != 'aj' && is_array($snap_ap) && (nxs_chArrVar($snap_ap[$ii], 'isPosted', '1') || nxs_chArrVar($snap_ap[$ii], 'isPrePosted', '1'))) {
         $snap_isAutoPosted = get_post_meta($postID, 'snap_isAutoPosted', true);
         if ($snap_isAutoPosted != '2') {
             nxs_addToLogN('W', 'Notice', $logNT, '-=Duplicate=- Post ID:' . $postID, 'Already posted. No reason for posting duplicate' . ' |' . $options['pType']);
             return;
         }
     }
     $blogTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
     if ($blogTitle == '') {
         $blogTitle = home_url();
     }
     $uln = 0;
     if ($options['attchImg'] == '1') {
         $imgURL = nxs_getPostImage($postID);
         if (trim($imgURL) == '') {
             $options['attchImg'] = 0;
         } else {
             if (ini_get('allow_url_fopen')) {
                 if (@getimagesize($imgURL) !== false) {
                     $img = wp_remote_get($imgURL);
                     if ($img['headers']['content-length'] < 200) {
                         $options['attchImg'] = 0;
                     } else {
                         if (is_wp_error($img)) {
                             $options['attchImg'] = 0;
                         } else {
                             $img = $img['body'];
                         }
                     }
                 } else {
                     $options['attchImg'] = 0;
                 }
             } else {
                 $img = wp_remote_get($imgURL);
                 if (is_wp_error($img)) {
                     $options['attchImg'] = 0;
                 } elseif (isset($img['body']) && trim($img['body']) != '') {
                     $img = $img['body'];
                 } else {
                     $options['attchImg'] = 0;
                 }
             }
         }
         if ($options['attchImg'] == 0) {
             nxs_addToLogN('E', 'Error', $logNT, 'Could not get image, will post without it', $extInfo);
         }
     }
     if ($options['attchImg'] == '1' && $img != '') {
         $twLim = 118;
     } else {
         $twLim = 140;
     }
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $msg = 'Test Post from ' . nsTrnc($blogTitle, $twLim - 24) . " - " . rand(1, 155);
         $uln = nxs_strLen($msg);
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $twMsgFormat = $options['twMsgFormat'];
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         if (stripos($twMsgFormat, '%URL%') !== false || stripos($twMsgFormat, '%SURL%') !== false) {
             $twLim = $twLim - 22;
         }
         if (stripos($twMsgFormat, '%AUTHORNAME%') !== false) {
             $aun = $post->post_author;
             $aun = get_the_author_meta('display_name', $aun);
             $twLim = $twLim - nxs_strLen($aun);
         }
         $noRepl = str_ireplace("%TITLE%", "", $twMsgFormat);
         $noRepl = str_ireplace("%SITENAME%", "", $noRepl);
         $noRepl = str_ireplace("%URL%", "", $noRepl);
         $noRepl = str_ireplace("%RAWEXCERPT%", "", $noRepl);
         $noRepl = str_ireplace("%SURL%", "", $noRepl);
         $noRepl = str_ireplace("%TEXT%", "", $noRepl);
         $noRepl = str_ireplace("%FULLTEXT%", "", $noRepl);
         $noRepl = str_ireplace("%EXCERPT%", "", $noRepl);
//.........这里部分代码省略.........
开发者ID:JalpMi,项目名称:v2contact,代码行数:101,代码来源:tw.php


示例8: nxs_doPublishToBG

 function nxs_doPublishToBG($postID, $options)
 {
     $ntCd = 'BG';
     $ntCdL = 'bg';
     $ntNm = 'Blogger';
     //  $uqID = uniqid('BG_');
     //$backtrace = debug_backtrace(); nxs_addToLogN('W', 'Enter', $ntCd, 'I am here - '.$ntCd."|".print_r($backtrace, true), '');
     // if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToBG',  array($postID, $options));
     $blogTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
     if ($blogTitle == '') {
         $blogTitle = home_url();
     }
     $addParams = nxs_makeURLParams(array('NTNAME' => $ntNm, 'NTCODE' => $ntCd, 'ACCNAME' => $options['nName'], 'POSTID' => $postID));
     $ii = $options['ii'];
     if (!isset($options['pType'])) {
         $options['pType'] = 'im';
     }
     if ($options['pType'] == 'sh') {
         sleep(rand(1, 10));
     }
     $logNT = '<span style="color:#F87907">' . $ntNm . '</span> - ' . $options['nName'];
     $snap_ap = get_post_meta($postID, 'snap' . $ntCd, true);
     $snap_ap = maybe_unserialize($snap_ap);
     if ($options['pType'] != 'aj' && is_array($snap_ap) && (nxs_chArrVar($snap_ap[$ii], 'isPosted', '1') || nxs_chArrVar($snap_ap[$ii], 'isPrePosted', '1'))) {
         $snap_isAutoPosted = get_post_meta($postID, 'snap_isAutoPosted', true);
         if ($snap_isAutoPosted != '2') {
             nxs_addToLogN('W', 'Notice', $logNT, '-=Duplicate=- Post ID:' . $postID, 'Already posted. No reason for posting duplicate');
             return;
         }
     }
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $msgT = 'Test Post from ' . htmlentities($blogTitle);
         $link = home_url();
         $msg = 'Test Post from ' . $blogTitle . " " . $link;
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $msgFormat = $options['bgMsgFormat'];
         $msg = nsFormatMessage($msgFormat, $postID, $addParams);
         $link = get_permalink($postID);
         $msgTFormat = $options['bgMsgTFormat'];
         $msgT = nsFormatMessage($msgTFormat, $postID, $addParams);
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
     }
     $extInfo = ' | PostID: ' . $postID . " - " . nxs_doQTrans($post->post_title, $lng);
     //## Actual POST Code
     $email = $options['bgUName'];
     $pass = substr($options['bgPass'], 0, 5) == 'b4d7s' ? nsx_doDecode(substr($options['bgPass'], 5)) : $options['bgPass'];
     $blogID = $options['bgBlogID'];
     //echo "###".$auth."|".$blogID."|".$msgT."|".$msg;
     if ($options['bgInclTags'] == '1') {
         $t = wp_get_post_tags($postID);
         $tggs = array();
         foreach ($t as $tagA) {
             $tggs[] = $tagA->name;
         }
         $tags = implode('","', $tggs);
         $tags = nsTrnc($tags, 195, ',', '');
     }
     if (substr($tags, -1) == '"') {
         $tags = substr($tags, 0, -1);
     }
     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_once 'apis/htmlNumTable.php';
         if (is_array($HTML401NamedToNumeric)) {
             $msg = strtr($msg, $HTML401NamedToNumeric);
             $msgT = strtr($msgT, $HTML401NamedToNumeric);
         }
     }
     //  prr($text);
     // prr($msg); echo " =HT= ";
     $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);
     //  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 = nsBloggerGetAuth($email, $pass);
//.........这里部分代码省略.........
开发者ID:JalpMi,项目名称:v2contact,代码行数:101,代码来源:bg.php


示例9: doPostToNT

 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']) || empty($options['bgPass'])) && empty($options['AccessToken'])) {
         $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 (class_exists('nxsAPI_GP') && !empty($options['bgUName']) && empty($options['APIKey'])) {
         $nt = new nxsAPI_GP();
         if (!empty($options['ck'])) {
             $nt->ck = $options['ck'];
         }
         $nt->debug = false;
         $loginError = $nt->connect($email, $pass, 'BG');
         if (!$loginError) {
             $result = $nt->postBG($blogID, $msgT, $msg, $tags);
             // prr($result);
         } else {
             $badOut['Error'] = "Login/Connection Error: " . print_r($loginError, true);
             return $badOut;
         }
         if (is_array($result) && $result['isPosted'] == '1') {
             nxs_save_glbNtwrks('bg', $options['ii'], $nt->ck, 'ck');
         }
         return $result;
     } else {
         //## Refresh token
         if (function_exists('get_option')) {
             $currTime = time() + get_option('gmt_offset') * HOUR_IN_SECONDS;
         } else {
             $currTime = time();
         }
         if ($options['AccessTokenExp'] < $currTime) {
             $tknURL = 'https://www.googleapis.com/oauth2/v3/token?refresh_token=' . $options['RefreshToken'] . '&client_id=' . $options['APIKey'] . '&client_secret=' . $options['APISec'] . '&grant_type=refresh_token';
             $response = wp_remote_post($tknURL);
             $resp = json_decode($response['body'], true);
             $options['AccessToken'] = $resp['access_token'];
             $options['AccessTokenExp'] = $currTime + $resp['expires_in'];
             nxs_save_glbNtwrks('bg', $options['ii'], $resp['access_token'], 'AccessTokenExp');
             nxs_save_glbNtwrks('bg', $options['ii'], $options['AccessTokenExp'], 'AccessTokenExp');
             //nxs_addToLogN('S', 'Test', $logNT, 'Token Refreshed '.date('Y-m-d H:i:s',$options['AccessTokenExp'])."|".$tknURL.$options['AccessToken'].print_r($response, true));
         }
         //## Post
         $post = array("kind" => "blogger#post", "blog" => array("id" => $blogID), "title" => $msgT, "content" => $msg);
         $post = json_encode($post);
         // prr($post);
         $hdrsArr = array('Content-Type' => 'application/json');
//.........这里部分代码省略.........
开发者ID:digideskio,项目名称:stammtisch,代码行数:101,代码来源:bg.api.php


示例10: doPostToNT


//.........这里部分代码省略.........
     } else {
         $options['imgUpl'] = 'A';
     }
     if (stripos($options['fbURL'], '/groups/') != false) {
         $options['destType'] == 'gr';
     }
     if (!empty($options['destType']) && $options['destType'] == 'pr') {
         $page_id = $options['fbAppAuthUser'];
     } else {
         $page_id = $options['pgID'];
     }
     $msg = strip_tags($msg);
     $msg = str_ireplace('&lt;(")', '<(")', $msg);
     //## FB Smiles FIX 3
     if (substr($msg, 0, 1) == '@') {
         $msg = ' ' . $msg;
     }
     // ERROR] couldn't open file fix
     //## Own App Post
     if (!empty($options['fbAppPageAuthToken'])) {
         if (empty($options['appsecret_proof'])) {
             $options['appsecret_proof'] = hash_hmac('sha256', $options['fbAppPageAuthToken'], $options['fbAppSec']);
         }
         $mssg = array('access_token' => $options['fbAppPageAuthToken'], 'appsecret_proof' => $options['appsecret_proof'], 'method' => 'post', 'message' => $msg);
         if ($fbPostType == 'I' && trim($imgURL) == '') {
             $fbPostType = 'T';
         }
         if ($fbPostType == 'A' && !preg_match("/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i", $message['url'])) {
             $badOut['Warning'] = 'Unvalid URL: ' . $message['url'] . '| Will be posting as text message';
             $fbPostType = 'T';
         }
         if ($fbPostType == 'A' || $fbPostType == '') {
             if ($attachType == 'A' || $attachType == 'S') {
                 $message['urlTitle'] = nsTrnc($message['urlTitle'], 250, " ", "...");
                 $attArr = array('name' => $message['urlTitle'], 'caption' => $message['siteName'], 'link' => $message['url'], 'description' => $message['urlDescr']);
                 $mssg = array_merge($mssg, $attArr);
             }
             if ($attachType == 'A') {
                 $mssg['actions'] = json_encode(array('name' => $message['siteName'], 'link' => $message['url']));
             }
             if (trim($imgURL) != '') {
                 $mssg['picture'] = $imgURL;
             }
             //if (trim($message['videoURL'])!='') $mssg['source'] = $message['videoURL'];
         } elseif ($fbPostType == 'I') {
             /* $facebook->setFileUploadSupport(true); */
             $fbWhere = 'photos';
             $mssg['url'] = $imgURL;
             if ($options['imgUpl'] == 'T') {
                 //## Try to Post to TImeline
                 $aacct = array('access_token' => $options['fbAppPageAuthToken'], 'appsecret_proof' => $options['appsecret_proof'], 'method' => 'get');
                 $res = wp_remote_get("https://graph.facebook.com/{$page_id}/albums?" . http_build_query($aacct, null, '&'), $wprg);
                 if (is_wp_error($res) || empty($res['body'])) {
                     $badOut['Error'] = ' [ERROR(Albums)] ' . print_r($res, true);
                 } else {
                     $albums = json_decode($res['body'], true);
                     if (empty($albums)) {
                         $badOut['Error'] .= "JSON ERROR (Albums): " . print_r($res, true);
                     } else {
                         if (is_array($albums) && is_array($albums["data"])) {
                             foreach ($albums["data"] as $album) {
                                 if ($album["type"] == "wall") {
                                     $chosen_album = $album;
                                     break;
                                 }
                             }
开发者ID:Florian-Eschenbacher,项目名称:schneeeule,代码行数:67,代码来源:fb.api.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['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


示例12: nxs_doPublishToDI

 function nxs_doPublishToDI($postID, $options)
 {
     global $nxs_diCkArray;
     $ntCd = 'DI';
     $ntCdL = 'di';
     $ntNm = 'Diigo';
     //  if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToDI',  array($postID, $options));
     $ii = $options['ii'];
     if (!isset($options['pType'])) {
         $options['pType'] = 'im';
     }
     if ($options['pType'] == 'sh') {
         sleep(rand(1, 10));
     }
     $logNT = '<span style="color:#000080">Diigo</span> - ' . $options['nName'];
     $snap_ap = get_post_meta($postID, 'snap' . $ntCd, true);
     $snap_ap = maybe_unserialize($snap_ap);
     if ($options['pType'] != 'aj' && is_array($snap_ap) && (nxs_chArrVar($snap_ap[$ii], 'isPosted', '1') || nxs_chArrVar($snap_ap[$ii], 'isPrePosted', '1'))) {
         $snap_isAutoPosted = get_post_meta($postID, 'snap_isAutoPosted', true);
         if ($snap_isAutoPosted != '2') {
             sleep(5);
             nxs_addToLogN('W', 'Notice', $logNT, '-=Duplicate=- Post ID:' . $postID, 'Already posted. No reason for posting duplicate');
             return;
         }
     }
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $link = home_url();
         $msg = 'Test Message from ' . $link;
         $msgT = 'Test Link from ' . $link;
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $link = get_permalink($postID);
         $msgFormat = $options['diMsgFormat'];
         $diCat = $options['diCat'];
         $msg = nsFormatMessage($msgFormat, $postID);
         $msgFormatT = $options['diMsgTFormat'];
         $msgT = nsFormatMessage($msgFormatT, $postID);
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1' 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP nsx_doDecode函数代码示例发布时间:2022-05-15
下一篇:
PHP nsFormatMessage函数代码示例发布时间: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