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

PHP nxs_makeURLParams函数代码示例

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

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



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

示例1: nxs_doPublishToDA

 function nxs_doPublishToDA($postID, $options)
 {
     $ntCd = 'DA';
     $ntCdL = 'da';
     $ntNm = 'deviantART';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     $addParams = nxs_makeURLParams(array('NTNAME' => $ntNm, 'NTCODE' => $ntCd, 'POSTID' => $postID, 'ACCNAME' => $options['nName']));
     $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:#800000">deviantART</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' . ' |' . $uqID);
             return;
         }
     }
     $message = array('message' => '', 'link' => '', 'imageURL' => '', 'videoURL' => '');
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $message['description'] = 'Test Post, Description';
         $message['title'] = 'Test Post - Title';
         $message['url'] = home_url();
     } else {
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $options['daTitleFormat'] = nsFormatMessage($options['daTitleFormat'], $postID, $addParams);
         $options['daTextFormat'] = nsFormatMessage($options['daTextFormat'], $postID, $addParams);
         // prr($options['daTextFormat']); echo $postID;
         $extInfo = ' | PostID: ' . $postID . " - " . (isset($post) && is_object($post) ? $post->post_title : '');
     }
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_DA();
     $ret = $ntToPost->doPostToNT($options, $message);
     // echo "~~~"; prr($ret); echo "+++";
     //## Save Session
     if (empty($options['ck'])) {
         $options['ck'] = '';
     }
     if (!empty($ret) && is_array($ret) && !empty($ret['ck']) && !empty($ret['ck']) && serialize($ret['ck']) != $options['ck']) {
         $options['ck'] = serialize($ret['ck']);
         $options['mh'] = serialize($ret['mh']);
         if (function_exists('get_option')) {
             $nxs_gOptions = get_option('NS_SNAutoPoster');
         }
         if (!empty($nxs_gOptions)) {
             $nxs_gOptions['da'][$ii] = $options;
             nxs_settings_save($nxs_gOptions);
         }
     }
     //## Process Results
     if (!is_array($ret) || $ret['isPosted'] != '1') {
         //## Error
         if ($postID == '0') {
             prr($ret);
         }
         nxs_addToLogN('E', 'Error', $logNT, '-=ERROR=- ' . print_r($ret, true), $extInfo);
     } else {
         // ## All Good - log it.
         if ($postID == '0') {
             nxs_addToLogN('S', 'Test', $logNT, 'OK - TEST Message Posted ');
             echo _e('OK - Message Posted, please see your ' . $logNT . ' Page. ', 'social-networks-auto-poster-facebook-twitter-g');
         } else {
             nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPosted' => '1', 'pgID' => $ret['postID'], 'postURL' => $ret['postURL'], 'pDate' => date('Y-m-d H:i:s')));
             nxs_addToLogN('S', 'Posted', $logNT, 'OK - Message Posted ', $extInfo);
         }
     }
     //## Return Result
     if ($ret['isPosted'] == '1') {
         return 200;
     } else {
         return print_r($ret, true);
     }
 }
开发者ID:Florian-Eschenbacher,项目名称:schneeeule,代码行数:90,代码来源:da.php


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


示例3: nxs_doPublishToVB

 function nxs_doPublishToVB($postID, $options)
 {
     global $nxs_vbCkArray, $plgn_NS_SNAutoPoster;
     $ntCd = 'VB';
     $ntCdL = 'vb';
     $ntNm = 'vBulletin';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     //if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToVB',  array($postID, $options));
     $blogTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
     if ($blogTitle == '') {
         $blogTitle = home_url();
     }
     $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:#000080">vBulletin</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;
         }
     }
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $urlToGo = home_url();
         $options['vbMsgFormat'] = 'Test Message from ' . $urlToGo;
         $options['vbMsgTFormat'] = 'Test Link from ' . $urlToGo;
     } else {
         $post = get_post($postID);
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $options['vbMsgFormat'] = nsFormatMessage($options['vbMsgFormat'], $postID, $addParams);
         $options['vbMsgTFormat'] = nsFormatMessage($options['vbMsgTFormat'], $postID, $addParams);
         //## MyURL - URLToGo code
         if (!isset($options['urlToUse']) || trim($options['urlToUse']) == '') {
             $myurl = trim(get_post_meta($postID, 'snap_MYURL', true));
         }
         if ($myurl != '') {
             $options['urlToUse'] = $myurl;
         }
         if (isset($options['urlToUse']) && trim($options['urlToUse']) != '') {
             $urlToGo = $options['urlToUse'];
             $options['useFBGURLInfo'] = true;
         } else {
             $urlToGo = get_permalink($postID);
         }
         $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
         $addURLParams = trim($gOptions['addURLParams']);
         if ($addURLParams != '') {
             $urlToGo .= (strpos($urlToGo, '?') !== false ? '&' : '?') . $addURLParams;
         }
     }
     $dusername = $options['vbUName'];
     //$link = urlencode($link); $desc = urlencode(substr($msg, 0, 500));
     $extInfo = ' | PostID: ' . $postID . " - " . (!empty($post) && is_object($post) ? $post->post_title : '');
     //## Message & Format
     if ($options['vbInclTags'] == '1') {
         $t = wp_get_post_tags($postID);
         $tggs = array();
         foreach ($t as $tagA) {
             $tggs[] = $tagA->name;
         }
         $tags = implode(', ', $tggs);
         /* $tags = str_replace(' ','+',$tags); */
     } else {
         $tags = '';
     }
     $message = array('siteName' => $blogTitle, 'tags' => $tags);
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_VB();
     $ret = $ntToPost->doPostToNT($options, $message);
     //## Save Session
     if (empty($options['vkSvC']) || serialize($nxs_vbCkArray) != $options['vbSvC']) {
         global $plgn_NS_SNAutoPoster;
         $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
         if (isset($options['ii']) && $options['ii'] !== '') {
             $gOptions['vb'][$options['ii']]['vbSvC'] = serialize($nxs_vbCkArray);
             update_option('NS_SNAutoPoster', $gOptions);
         } else {
             foreach ($gOptions['vb'] as $ii => $gpn) {
                 $result = array_diff($options, $gpn);
                 if (!is_array($result) || count($result) < 1) {
                     $gOptions['vb'][$ii]['vbSvC'] = serialize($nxs_vbCkArray);
                     update_option('NS_SNAutoPoster', $gOptions);
                     break;
                 }
             }
         }
     }
     //## Process Results
//.........这里部分代码省略.........
开发者ID:jguzmanf88,项目名称:social-networks-auto-poster-facebook-twitter-g,代码行数:101,代码来源:vb.php


示例4: nxs_doPublishToSU

 function nxs_doPublishToSU($postID, $options)
 {
     global $nxs_suCkArray;
     $ntCd = 'SU';
     $ntCdL = 'su';
     $ntNm = 'StumbleUpon';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     //$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_doPublishToSU',  array($postID, $options));
     $addParams = nxs_makeURLParams(array('NTNAME' => $ntNm, 'NTCODE' => $ntCd, 'POSTID' => $postID, 'ACCNAME' => $options['nName']));
     $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:#000080">StumbleUpon</span> - ' . $options['nName'];
     $snap_ap = get_post_meta($postID, 'snap' . $ntCd, true);
     $snap_ap = maybe_unserialize($snap_ap);
     /* Check is still nessesary or redo
        if ($options['reset'] != '1' && $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;
            }
        }
        */
     $suCat = $options['suCat'];
     // if (function_exists("get_post_thumbnail_id") ){ $src = wp_get_attachment_image_src(get_post_thumbnail_id($postID), 'thumbnail'); $src = $src[0];}
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $urlToGo = home_url();
         $options['suMsgFormat'] = 'Test Link from ' . $urlToGo;
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $options['suMsgFormat'] = nsFormatMessage($options['suMsgFormat'], $postID, $addParams);
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         //## MyURL - URLToGo code
         $options = nxs_getURL($options, $postID, $addParams);
         $urlToGo = $options['urlToUse'];
     }
     $dusername = $options['suUName'];
     //$link = urlencode($link); $desc = urlencode(substr($msg, 0, 500));
     if ($options['suInclTags'] == '1') {
         $t = wp_get_post_tags($postID);
         $tggs = array();
         foreach ($t as $tagA) {
             $tggs[] = $tagA->name;
         }
         $tags = urlencode(implode(',', $tggs));
         $tags = str_replace(' ', '+', $tags);
     } else {
         $tags = '';
     }
     $extInfo = ' | PostID: ' . $postID . " - " . (isset($post) && is_object($post) ? $post->post_title : '');
     //## Post
     $message = array('siteName' => $blogTitle, 'tags' => $tags, 'url' => $urlToGo);
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_SU();
     $ret = $ntToPost->doPostToNT($options, $message);
     //## Save Session
     if (serialize($nxs_suCkArray) != $options['suSvC']) {
         global $plgn_NS_SNAutoPoster;
         $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
         if (isset($options['ii']) && $options['ii'] !== '') {
             $gOptions['su'][$options['ii']]['suSvC'] = serialize($nxs_suCkArray);
             update_option('NS_SNAutoPoster', $gOptions);
         } else {
             foreach ($gOptions['su'] as $ii => $gpn) {
                 $result = array_diff($options, $gpn);
                 if (!is_array($result) || count($result) < 1) {
                     $gOptions['su'][$ii]['suSvC'] = serialize($nxs_suCkArray);
                     update_option('NS_SNAutoPoster', $gOptions);
                     break;
                 }
             }
         }
     }
     //## Process Results
     if (!is_array($ret) || $ret['isPosted'] != '1') {
         //## Error
         if ($postID == '0') {
             prr($ret);
         }
         nxs_addToLogN('E', 'Error', $logNT, '-=ERROR=- ' . print_r($ret, true), $extInfo);
     } else {
         // ## All Good - log it.
         if ($postID == '0') {
             nxs_addToLogN('S', 'Test', $logNT, 'OK - TEST Message Posted ');
             echo _e('OK - Message Posted, please see your ' . $logNT . ' Page. ', 'nxs_snap');
         } else {
//.........这里部分代码省略.........
开发者ID:brettex,项目名称:pspark,代码行数:101,代码来源:su.php


示例5: nxs_doPublishToTR

 function nxs_doPublishToTR($postID, $options)
 {
     $ntCd = 'TR';
     $ntCdL = 'tr';
     $ntNm = 'Tumblr';
     global $plgn_NS_SNAutoPoster;
     $ytUrl = '';
     $imgURL = '';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     //if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToTR',  array($postID, $options));
     if (empty($options['imgToUse'])) {
         $options['imgToUse'] = '';
     }
     if (empty($options['urlToUse'])) {
         $options['urlToUse'] = '';
     }
     if (empty($options['trMsgTFormat'])) {
         $options['trMsgTFormat'] = '';
     }
     if (empty($options['imgSize'])) {
         $options['imgSize'] = '';
     }
     $addParams = nxs_makeURLParams(array('NTNAME' => $ntNm, 'NTCODE' => $ntCd, 'POSTID' => $postID, 'ACCNAME' => $options['nName']));
     $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">Tumblr</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;
         }
     }
     //## Format
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $options['trMsgFormat'] = 'Test Post from ' . $blogTitle;
         $msgT = 'Test Post from ' . $blogTitle;
         $options['trPostType'] = 'T';
         $postDate = gmdate("Y-m-d H:i:s") . " GMT";
         $tags = '';
         $urlToGo = '';
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $options['trMsgFormat'] = nsFormatMessage($options['trMsgFormat'], $postID, $addParams);
         $options['trMsgTFormat'] = nsFormatMessage($options['trMsgTFormat'], $postID, $addParams);
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $tggs = array();
         if ($options['trInclTags'] == '1') {
             $t = wp_get_post_tags($postID);
             $tggs = array();
             foreach ($t as $tagA) {
                 $tggs[] = $tagA->name;
             }
             $tags = implode(',', $tggs);
         }
         if ($options['trInclCats'] == '1') {
             $t = wp_get_post_categories($postID);
             foreach ($t as $c) {
                 $cat = get_category($c);
                 $tggs[] = $cat->name;
             }
             $tags = implode(',', $tggs);
         }
         $postDate = ($options['useOrDate'] == '1' && $post->post_date_gmt != '0000-00-00 00:00:00' ? $post->post_date_gmt : gmdate("Y-m-d H:i:s", strtotime($post->post_date))) . " GMT";
         //## Adds date to Tumblr post. Thanks to Kenneth Lecky
         if ($options['trPostType'] == 'V') {
             $vids = nsFindVidsInPost($post);
             if (count($vids) > 0) {
                 $ytUrl = $vids[0];
             }
             if (trim($ytUrl) == '') {
                 $options['trPostType'] = 'T';
             }
         }
         if ($options['trPostType'] == 'U') {
             $aud = nsFindAudioInPost($post);
             if (count($aud) > 0) {
                 $aUrl = $aud[0];
             }
             if (trim($aUrl) == '') {
                 $options['trPostType'] = 'T';
             }
         }
//.........这里部分代码省略.........
开发者ID:brettex,项目名称:pspark,代码行数:101,代码来源:tr.php


示例6: nxs_doPublishToKT

 function nxs_doPublishToKT($postID, $options)
 {
     global $nxs_ktCkArray;
     $ntCd = 'KT';
     $ntCdL = 'kt';
     $ntNm = 'Kippt';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     //  if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToDI',  array($postID, $options));
     $addParams = nxs_makeURLParams(array('NTNAME' => $ntNm, 'NTCODE' => $ntCd, 'POSTID' => $postID, 'ACCNAME' => $options['nName']));
     $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:#000080">Kippt</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();
         $options['msgFormat'] = 'Test Message from ' . $link;
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $link = get_permalink($postID);
         $options['msgFrmt'] = nsFormatMessage($options['msgFrmt'], $postID, $addParams);
         $options['msgTFrmt'] = nsFormatMessage($options['msgTFrmt'], $postID, $addParams);
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
     }
     $extInfo = ' | PostID: ' . $postID . " - " . (isset($post) && is_object($post) ? $post->post_title : '');
     //## Create and Format message
     $t = wp_get_post_tags($postID);
     $tggs = array();
     foreach ($t as $tagA) {
         $tggs[] = $tagA->name;
     }
     $tags = implode(',', $tggs);
     $tags = str_replace(' ', '+', $tags);
     $message = array('url' => $link, 'surl' => $link, 'siteName' => $blogTitle, 'tags' => $tags);
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_KT();
     $ret = $ntToPost->doPostToNT($options, $message);
     //## Process Results
     if (!is_array($ret) || $ret['isPosted'] != '1') {
         //## Error
         if ($postID == '0') {
             prr($ret);
         }
         nxs_addToLogN('E', 'Error', $logNT, '-=ERROR=- ' . print_r($ret, true), $extInfo);
     } else {
         // ## All Good - log it.
         if ($postID == '0') {
             nxs_addToLogN('S', 'Test', $logNT, 'OK - TEST Message Posted ');
             echo _e('OK - Message Posted, please see your ' . $logNT . ' Page. ', 'social-networks-auto-poster-facebook-twitter-g');
         } else {
             nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPosted' => '1', 'pgID' => $ret['postID'], 'postURL' => $ret['postURL'], 'pDate' => date('Y-m-d H:i:s')));
             nxs_addToLogN('S', 'Posted', $logNT, 'OK - Message Posted ', $extInfo);
         }
     }
     //## Return Result
     if ($ret['isPosted'] == '1') {
         return 200;
     } else {
         return print_r($ret, true);
     }
 }
开发者ID:digideskio,项目名称:stammtisch,代码行数:84,代码来源:kt.php


示例7: nxs_doPublishToFL

 function nxs_doPublishToFL($postID, $options)
 {
     $ntCd = 'FL';
     $ntCdL = 'fl';
     $ntNm = 'Flickr';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     $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:#800000">Flickr</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;
         }
     }
     $message = array('message' => '', 'link' => '', 'imageURL' => '', 'videoURL' => '', 'announce' => '');
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $message['description'] = 'Test Post, Description';
         $message['title'] = 'Test Post - Title';
         $message['url'] = home_url();
         $message['tags'] = '';
         if ($options['defImg'] != '') {
             $imgURL = $options['defImg'];
         } else {
             $imgURL = "http://direct.gtln.us/img/nxs/NXS-Lama.jpg";
         }
         $message['imageURL'] = $imgURL;
     } else {
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $isNoImg = false;
         $tags = '';
         $options['msgFrmt'] = nsFormatMessage($options['msgFrmt'], $postID, $addParams);
         $options['msgTFrmt'] = nsFormatMessage($options['msgTFrmt'], $postID, $addParams);
         $tggs = array();
         if ($options['inclTags'] == '1') {
             $t = wp_get_post_tags($postID);
             $tggs = array();
             foreach ($t as $tagA) {
                 $tggs[] = $tagA->name;
             }
             $tags = '"' . implode('" "', $tggs) . '"';
         }
         $imgURL = nxs_getPostImage($postID, 'full');
         if (preg_match("/noImg.\\.png/i", $imgURL)) {
             $imgURL = '';
             $isNoImg = true;
         }
         $options = nxs_getURL($options, $postID);
         $urlToGo = $options['urlToUse'];
         $message = array('url' => $urlToGo, 'imageURL' => $imgURL, 'noImg' => $isNoImg, 'tags' => $tags);
         $lat = get_post_meta($postID, 'geo_latitude', true);
         $long = get_post_meta($postID, 'geo_longitude', true);
         if (!empty($lat) && !empty($long)) {
             $message['latitude'] = $lat;
             $message['longitude'] = $long;
         }
         $extInfo = ' | PostID: ' . $postID . " - " . (isset($post) && is_object($post) ? $post->post_title : '');
     }
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_FL();
     $ret = $ntToPost->doPostToNT($options, $message);
     //prr($ret);
     //## Process Results
     if (!is_array($ret) || $ret['isPosted'] != '1') {
         //## Error
         if ($postID == '0') {
             prr($ret);
         }
         nxs_addToLogN('E', 'Error', $logNT, '-=ERROR=- ' . print_r($ret, true), $extInfo);
     } else {
         // ## All Good - log it.
         if ($postID == '0') {
             nxs_addToLogN('S', 'Test', $logNT, 'OK - TEST Message Posted ');
             echo _e('OK - Message Posted, please see your ' . $logNT . ' Page. ', 'nxs_snap');
         } else {
             nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPosted' => '1', 'pgID' => $ret['postID'], 'postURL' => $ret['postURL'], 'pDate' => date('Y-m-d H:i:s')));
             $extInfo .= ' | <a href="' . $ret['postURL'] . '" target="_blank">Post Link</a>';
             nxs_addToLogN('S', 'Posted', $logNT, 'OK - Message Posted ', $extInfo);
//.........这里部分代码省略.........
开发者ID:jguzmanf88,项目名称:social-networks-auto-poster-facebook-twitter-g,代码行数:101,代码来源:fl.php


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


示例9: nxs_doPublishToSC

 function nxs_doPublishToSC($postID, $options)
 {
     global $plgn_NS_SNAutoPoster;
     $ntCd = 'SC';
     $ntCdL = 'sc';
     $ntNm = 'Scoop.It';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     $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:#800000">Scoop.It</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' . ' |' . $uqID);
             return;
         }
     }
     $message = array('message' => '', 'link' => '', 'imageURL' => '', 'videoURL' => '');
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $message['description'] = 'Test Post, Description';
         $message['title'] = 'Test Post - Title';
         $message['url'] = home_url();
     } else {
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $postType = $options['postType'];
         $isNoImg = false;
         $tags = '';
         $options['msgFrmt'] = nsFormatMessage($options['msgFrmt'], $postID, $addParams);
         $options['msgTFrmt'] = nsFormatMessage($options['msgTFrmt'], $postID, $addParams);
         $tggs = array();
         if ($options['inclTags'] == '1') {
             $t = wp_get_post_tags($postID);
             $tggs = array();
             foreach ($t as $tagA) {
                 $tggs[] = $tagA->name;
             }
             $tags = $tggs;
         }
         if ($postType == 'A') {
             if (trim($options['imgToUse']) != '') {
                 $imgURL = $options['imgToUse'];
             } else {
                 $imgURL = nxs_getPostImage($postID, 'medium');
             }
         }
         if ($postType == 'I') {
             if (trim($options['imgToUse']) != '') {
                 $imgURL = $options['imgToUse'];
             } else {
                 $imgURL = nxs_getPostImage($postID, 'full');
             }
         }
         if (preg_match("/noImg.\\.png/i", $imgURL)) {
             $imgURL = '';
             $isNoImg = true;
         }
         //## MyURL - URLToGo code
         if (!isset($options['urlToUse']) || trim($options['urlToUse']) == '') {
             $myurl = trim(get_post_meta($postID, 'snap_MYURL', true));
         }
         if ($myurl != '') {
             $options['urlToUse'] = $myurl;
         }
         if (isset($options['urlToUse']) && trim($options['urlToUse']) != '') {
             $urlToGo = $options['urlToUse'];
             $options['useFBGURLInfo'] = true;
         } else {
             $urlToGo = get_permalink($postID);
         }
         $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
         $addURLParams = trim($gOptions['addURLParams']);
         if ($addURLParams != '') {
             $urlToGo .= (strpos($urlToGo, '?') !== false ? '&' : '?') . $addURLParams;
         }
         $message = array('url' => $urlToGo, 'imageURL' => $imgURL, 'noImg' => $isNoImg, 'tags' => $tags);
         $extInfo = ' | PostID: ' . $postID . " - " . (isset($post) && is_object($post) ? $post->post_title : '');
     }
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_SC();
//.........这里部分代码省略.........
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:101,代码来源:sc.php


示例10: nxs_doPublishToAP

 function nxs_doPublishToAP($postID, $options)
 {
     $ntCd = 'AP';
     $ntCdL = 'ap';
     $ntNm = 'App.Net';
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     $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:#800000">App.Net</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' . ' |' . $uqID);
             return;
         }
     }
     $message = array('message' => '', 'link' => '', 'imageURL' => '', 'videoURL' => '');
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $message['description'] = 'Test Post, Description';
         $message['title'] = 'Test Post - Title';
         $message['url'] = home_url();
     } else {
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $apAttchImg = $options['attchImg'];
         $options['apTextFormat'] = nsFormatMessage($options['apTextFormat'], $postID, $addParams);
         $extInfo = ' | PostID: ' . $postID . " - " . (isset($post) && is_object($post) ? $post->post_title : '');
         if ($options['attchImg'] == '1') {
             if (trim($options['imgToUse']) != '') {
                 $imgURL = $options['imgToUse'];
             } else {
                 $imgURL = nxs_getPostImage($postID);
             }
             if (preg_match("/noImg.\\.png/i", $imgURL)) {
                 $imgURL = '';
             }
             if (trim($imgURL) == '') {
                 $options['attchImg'] = 0;
             }
         }
         $message = array('imageURL' => $imgURL);
     }
     //## Actual Post
     $ntToPost = new nxs_class_SNAP_AP();
     $ret = $ntToPost->doPostToNT($options, $message);
     //## Process Results
     if (!is_array($ret) || $ret['isPosted'] != '1') {
         //## Error
         if ($postID == '0') {
             prr($ret);
         }
         nxs_addToLogN('E', 'Error', $logNT, '-=ERROR=- ' . print_r($ret, true), $extInfo);
     } else {
         // ## All Good - log it.
         if ($postID == '0') {
             nxs_addToLogN('S', 'Test', $logNT, 'OK - TEST Message Posted ');
             echo _e('OK - Message Posted, please see your ' . $logNT . ' Page. ', 'nxs_snap');
         } else {
             nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPosted' => '1', 'pgID' => $ret['postID'], 'postURL' => $ret['postURL'], 'pDate' => date('Y-m-d H:i:s')));
             $extInfo .= ' | <a href="' . $ret['postURL'] . '" target="_blank">Post Link</a>';
             nxs_addToLogN('S', 'Posted', $logNT, 'OK - Message Posted ', $extInfo);
         }
     }
     //## Return Result
     if ($ret['isPosted'] == '1') {
         return 200;
     } else {
         return print_r($ret, true);
     }
 }
开发者ID:voquanghoa,项目名称:WebPhim,代码行数:90,代码来源:ap.php


示例11: nxs_doPublishToWP

 function nxs_doPublishToWP($postID, $options)
 {
     $ntCd = 'WP';
     $ntCdL = 'wp';
     $ntNm = 'WP Based Blog';
     global $plgn_NS_SNAutoPoster;
     if (!is_array($options)) {
         $options = maybe_unserialize(get_post_meta($postID, $options, true));
     }
     //if (isset($options['timeToRun'])) wp_unschedule_event( $options['timeToRun'], 'nxs_doPublishToWP',  array($postID, $options));
     $blogTitle = htmlspecialchars_decode(get_bloginfo('name'), ENT_QUOTES);
     if ($blogTitle == '') {
         $blogTitle = home_url();
     }
     $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:#1A9EE6">WP</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;
         }
     }
     if ($postID == '0') {
         echo "Testing ... <br/><br/>";
         $urlToGo = home_url();
         $options['wpMsgTFormat'] = 'Test Link from ' . $urlToGo;
         $options['wpMsgFormat'] = 'Test post please ignore';
     } else {
         $post = get_post($postID);
         if (!$post) {
             return;
         }
         $link = get_permalink($postID);
         $options['wpMsgFormat'] = nsFormatMessage($options['wpMsgFormat'], $postID);
         $options['wpMsgTFormat'] = nsFormatMessage($options['wpMsgTFormat'], $postID);
         //## MyURL - URLToGo code
         if (!isset($options['urlToUse']) || trim($options['urlToUse']) == '') {
             $myurl = trim(get_post_meta($postID, 'snap_MYURL', true));
         }
         if ($myurl != '') {
             $options['urlToUse'] = $myurl;
         }
         if (isset($options['urlToUse']) && trim($options['urlToUse']) != '') {
             $urlToGo = $options['urlToUse'];
             $options['useFBGURLInfo'] = true;
         } else {
             $urlToGo = get_permalink($postID);
         }
         $gOptions = $plgn_NS_SNAutoPoster->nxs_options;
         $addURLParams = trim($gOptions['addURLParams']);
         if ($addURLParams != '') {
             $urlToGo .= (strpos($urlToGo, '?') !== false ? '&' : '?') . $addURLParams;
         }
         nxs_metaMarkAsPosted($postID, $ntCd, $options['ii'], array('isPrePosted' => '1'));
     }
     $t = wp_get_post_tags($postID);
     $tggs = array();
     foreach ($t as $tagA) {
         $tggs[] = $tagA->name;
     }
     $tags = implode(',', $tggs);
     $postCats = wp_get_post_categories($postID);
     $cats = array();
     foreach ($postCats as $c) {
         $cat = get_category($c);
         $cats[] = str_ireplace('&', '&amp;', $cat->name);
     }
     // $cats = implode(',',$catsA);
     $extInfo = ' | PostID: ' . $postID . " - " . (!empty($post) && is_object($post) ? $post->post_title : '');
     //## Message & Format
     if (trim($options['imgToUse']) != '') {
         $imgURL = $options['imgToUse'];
     } else {
         $imgURL = nxs_getPostImage($postID, 'full');
     }
     $ 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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