nxs_snapClassAP

The NextScripts: Social Networks Auto-Poster nxs snapClassAP class.

Defined (1)

The class is defined in the following location(s).

/inc-cl/ap.php  
  1. if (!class_exists("nxs_snapClassAP")) { class nxs_snapClassAP { var $ntInfo = array('code'=>'AP', 'lcode'=>'ap', 'name'=>'App.Net', 'defNName'=>'', 'tstReq' => true); 
  2. //#### Show Common Settings 
  3. function showGenNTSettings($ntOpts) { global $nxs_plurl, $nxs_snapSetPgURL, $nxs_gOptions; $ntInfo = $this->ntInfo; 
  4. if ( isset($_GET['code']) && $_GET['code']!='' && (isset($_GET['state']) && stripos($_GET['state'], 'ap-')!==false) ) { $at = $_GET['code']; $to = explode('-', $_GET['state']); $_GET['acc'] = $to[1]; 
  5. echo "-= This is normal technical authorization info that will dissapear (Unless you get some errors) =- <br/><br/><br/>"; 
  6. $fbo = $ntOpts[$_GET['acc']]; $wprg = array(); $response = wp_remote_get('https://graph.facebook.com/nextscripts', $wprg); 
  7. echo $nxs_snapSetPgURL.'&auth=ap&acc='.$_GET['acc']."||"; if(stripos($nxs_snapSetPgURL, 'page=NextScripts_SNAP.php')===false) { $newURL = explode('?', $nxs_snapSetPgURL); $nxs_snapSetPgURL = $newURL[0]; } 
  8. if( is_wp_error( $response) && isset($response->errors['http_request_failed']) && stripos($response->errors['http_request_failed'][0], 'SSL')!==false ) { prr($response->errors); $wprg['sslverify'] = false; } 
  9. if (isset($fbo['appID'])) { echo "-="; prr($fbo); 
  10. $wprg['body'] = array('client_id'=>$fbo['appID'], 'client_secret'=>$fbo['appSec'], 'grant_type'=>'authorization_code', 'redirect_uri'=>$nxs_snapSetPgURL, 'state'=>'ap-'.$_GET['acc'], 'code'=>$at); prr($wprg);  
  11. $response = wp_remote_post('https://account.app.net/oauth/access_token', $wprg);  
  12. if ( (is_object($response) && (isset($response->errors))) || (is_array($response) && stripos($response['body'], '"error":')!==false )) { prr($response); die(); }  
  13. $params = json_decode($response['body'], true); $fbo['apAppAuthToken'] = $params['access_token']; if ($params['user_id']>0) { $fbo['appAppUserID'] = $params['user_id']; $fbo['appAppUserName'] = $params['username']; } 
  14. if ($params['user_id']>0) { if (function_exists('get_option')) $nxs_gOptions = get_option('NS_SNAutoPoster'); if(!empty($nxs_gOptions)) {  
  15. $nxs_gOptions['ap'][$_GET['acc']] = $fbo; nxs_settings_save($nxs_gOptions); } ?><script type="text/javascript">window.location = "<?php echo $nxs_snapSetPgURL; ?>"</script>  
  16. <?php } die(); } 
  17. }  
  18. ?>  
  19. <div class="nxs_box"> 
  20. <div class="nxs_box_header">  
  21. <div class="nsx_iconedTitle" style="margin-bottom:1px;background-image:url(<?php echo $nxs_plurl;?>img/<?php echo $ntInfo['lcode']; ?>16.png);"><?php echo $ntInfo['name']; ?> 
  22. <?php $cbo = count($ntOpts); ?>  
  23. <?php if ($cbo>1) { ?><div class="nsBigText"><?php echo "(".($cbo=='0'?'No':$cbo)." "; _e('accounts', 'social-networks-auto-poster-facebook-twitter-g'); echo ")"; ?></div><?php } ?> 
  24. </div> 
  25. </div> 
  26. <div class="nxs_box_inside"> 
  27. <?php foreach ($ntOpts as $indx=>$pbo) { if (trim($pbo['nName']=='')) $pbo['nName'] = 'App.Net';  
  28. if (!isset($pbo[$ntInfo['lcode'].'OK']) || $pbo[$ntInfo['lcode'].'OK']=='') $pbo[$ntInfo['lcode'].'OK'] = (isset($pbo['appAppUserID']) && $pbo['appAppUserID']>1)?'1':''; 
  29. ?> 
  30. <p style="margin:0px;margin-left:5px;"> <img id="<?php echo $ntInfo['code'].$indx;?>LoadingImg" style="display: none;" src='<?php echo $nxs_plurl; ?>img/ajax-loader-sm.gif' /> 
  31.  
  32. <input value="0" name="<?php echo $ntInfo['lcode']; ?>[<?php echo $indx; ?>][apDo<?php echo $ntInfo['code']; ?>]" type="hidden" />  
  33. <?php if ((int)$pbo['do'.$ntInfo['code']] == 1 && isset($pbo['catSel']) && (int)$pbo['catSel'] == 1) { ?> <input type="radio" name="<?php echo $ntInfo['lcode']; ?>[<?php echo $indx; ?>][apDo<?php echo $ntInfo['code']; ?>]" id="rbtn<?php echo $ntInfo['lcode'].$indx; ?>" value="1" checked="checked" onmouseout="nxs_hidePopUpInfo('popOnlyCat');" onmouseover="nxs_showPopUpInfo('popOnlyCat', event);" /> <?php } else { ?>  
  34. <input value="1" name="<?php echo $ntInfo['lcode']; ?>[<?php echo $indx; ?>][apDo<?php echo $ntInfo['code']; ?>]" type="checkbox" <?php if ((int)$pbo['do'.$ntInfo['code']] == 1 && $pbo['catSel']!='1') echo "checked"; ?> />  
  35.  
  36. <?php } ?> 
  37.  
  38. <?php if (isset($pbo['catSel']) && (int)$pbo['catSel'] == 1) { ?> <span onmouseout="nxs_hidePopUpInfo('popOnlyCat');" onmouseover="nxs_showPopUpInfo('popOnlyCat', event);"><?php echo "*[".(substr_count($pbo['catSelEd'], ", ")+1)."]*" ?></span><?php } ?> 
  39. <?php if (isset($pbo['rpstOn']) && (int)$pbo['rpstOn'] == 1) { ?> <span onmouseout="nxs_hidePopUpInfo('popReActive');" onmouseover="nxs_showPopUpInfo('popReActive', event);"><?php echo "*[R]*" ?></span><?php } ?> 
  40. <strong><?php _e('Auto-publish to', 'social-networks-auto-poster-facebook-twitter-g'); ?> <?php echo $ntInfo['name']; ?> <i style="color: #005800;"><?php if($pbo['nName']!='') echo "(".$pbo['nName'].")"; ?></i></strong> 
  41.   <?php if ($ntInfo['tstReq'] && (!isset($pbo[$ntInfo['lcode'].'OK']) || $pbo[$ntInfo['lcode'].'OK']=='')) { ?><b style="color: #800000"><?php _e('Attention requred. Unfinished setup', 'social-networks-auto-poster-facebook-twitter-g'); ?> ==></b><?php } ?> 
  42. <a id="do<?php echo $ntInfo['code'].$indx; ?>AG" href="#" onclick="doGetHideNTBlock('<?php echo $ntInfo['code'];?>' , '<?php echo $indx; ?>');return false;">[<?php _e('Show Settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a>    
  43. <a href="#" onclick="doDelAcct('<?php echo $ntInfo['lcode']; ?>', '<?php echo $indx; ?>', '<?php if (isset($pbo['bgBlogID'])) echo $pbo['nName']; ?>');return false;">[<?php _e('Remove Account', 'social-networks-auto-poster-facebook-twitter-g'); ?>]</a> 
  44. </p><div id="nxsNTSetDiv<?php echo $ntInfo['code'].$indx; ?>"></div><?php //$pbo['ntInfo'] = $ntInfo; $this->showNTSettings($indx, $pbo);  
  45. }?> 
  46. </div> 
  47. </div> <?php  
  48. }  
  49. //#### Show NEW Settings Page 
  50. function showNewNTSettings($options) { $opts = array('nName'=>'', 'doAP'=>'1', 'apUName'=>'', 'apPageID'=>'', 'apCommID'=>'', 'postType'=>'A', 'apPass'=>''); $opts['ntInfo']= array('lcode'=>'ap'); $this->showNTSettings($options, $opts, true);} 
  51. //#### Show Unit Settings 
  52. function showNTSettings($ii, $options, $isNew=false) { global $nxs_plurl, $nxs_snapSetPgURL; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt);  
  53. if (!isset($options['nHrs'])) $options['nHrs'] = 0; if (!isset($options['nMin'])) $options['nMin'] = 0; if (!isset($options['catSel'])) $options['catSel'] = 0; if (!isset($options['catSelEd'])) $options['catSelEd'] = '';  
  54. if (!isset($options['nDays'])) $options['nDays'] = 0; if (!isset($options['qTLng'])) $options['qTLng'] = ''; if (!isset($options['attchImg'])) $options['attchImg'] = '';  
  55. if (!isset($options['appID'])) $options['appID'] = ''; if (!isset($options['appSec'])) $options['appSec'] = ''; ?>  
  56. <div id="doAP<?php echo $ii; ?>Div" class="insOneDiv<?php if ($isNew) echo " clNewNTSets"; ?>">  
  57. <input type="hidden" value="0" id="apDoS<?php echo $ntU.$ii; ?>" /> 
  58. <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?>img/ap16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation/app-net-social-networks-auto-poster-wordpress/"><?php $nType="App.Net"; printf( __( 'Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a></div> 
  59.  
  60. <div style="width:100%;"><strong><?php _e('Account Nickname', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> <i><?php _e('Just so you can easily identify it', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> </div><input name="ap[<?php echo $ii; ?>][nName]" id="apnName<?php echo $ii; ?>" style="font-weight: bold; color: #005800; border: 1px solid #ACACAC; width: 40%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['nName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /><br/> 
  61. <?php echo nxs_addQTranslSel('ap', $ii, $options['qTLng']); ?> 
  62. <br/> 
  63. <ul class="nsx_tabs"> 
  64. <li><a href="#nsx<?php echo $nt.$ii ?>_tab1"><?php _e('Account Info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a></li>  
  65. <?php if (!$isNew) { ?> <li><a href="#nsx<?php echo $nt.$ii ?>_tab2"><?php _e('Advanced', 'social-networks-auto-poster-facebook-twitter-g'); ?></a></li> <?php } ?> 
  66. </ul> 
  67. <div class="nsx_tab_container"><?php /** ######################## Account Tab ####################### */ ?> 
  68. <div id="nsx<?php echo $nt.$ii ?>_tab1" class="nsx_tab_content" style="background-image: url(<?php echo $nxs_plurl; ?>img/<?php echo $nt; ?>-bg.png); background-repeat: no-repeat; background-position:90% 10%;"> 
  69.  
  70. <div style="width:100%;"><strong>App.Net Client ID:</strong> </div><input name="ap[<?php echo $ii; ?>][appID]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['appID'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  71. <div style="width:100%;"><strong>App.Net Client Secret:</strong> </div><input name="ap[<?php echo $ii; ?>][appSec]" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['appSec'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>  
  72. <br/>  
  73.  
  74. <div id="altFormat" style="margin-left: 0px;"> 
  75. <div style="width:100%;"><strong id="altFormatText"><?php _e('Text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> (<a href="#" id="apTextFormat<?php echo $ii; ?>HintInfo" onclick="mxs_showHideFrmtInfo('apTextFormat<?php echo $ii; ?>'); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) 
  76. </div> 
  77.  
  78. <textarea cols="150" rows="3" id="ap<?php echo $ii; ?>SNAPformat" name="ap[<?php echo $ii; ?>][apTextFormat]" style="width:51%;max-width: 650px;" onfocus="jQuery('#ap<?php echo $ii; ?>SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apAPMsgFrmt<?php echo $ii; ?>');"><?php if ($isNew) _e("New post (%TITLE%) has been published on %SITENAME% - %URL%", 'social-networks-auto-poster-facebook-twitter-g'); else _e(apply_filters('format_to_edit', htmlentities($options['apTextFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?></textarea> 
  79.  
  80. <?php nxs_doShowHint("apTextFormat".$ii); ?> 
  81. </div> 
  82.  
  83. <p style="margin: 0px;"><input value="1" id="apAPAttch" type="checkbox" name="ap[<?php echo $ii; ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to App.net Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></p> 
  84. <br/><br/> 
  85. <?php if($options['appID']=='') { ?> 
  86. <b><?php _e('Authorize Your App.Net Account', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> <?php _e('Please click "Update Settings" to be able to Authorize your account.', 'social-networks-auto-poster-facebook-twitter-g'); ?> 
  87. <?php } else { if(isset($options['appAppUserID']) && $options['appAppUserID']>0) { ?> 
  88. <?php _e('Your App.Net Account has been authorized.', 'social-networks-auto-poster-facebook-twitter-g'); ?> User ID: <?php _e(apply_filters('format_to_edit', htmlentities($options['appAppUserID'].' - '.$options['appAppUserName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>. 
  89. <?php _e('You can', 'social-networks-auto-poster-facebook-twitter-g'); ?> Re- <?php } ?>  
  90. <a href="https://account.app.net/oauth/authenticate?client_id=<?php echo trim($options['appID']);?>&response_type=code&redirect_uri=<?php echo trim(urlencode($nxs_snapSetPgURL).'&state=ap-'.$ii.'&scope=stream+write_post+follow+messages+update_profile+files');?>">Authorize Your App.Net Account</a>  
  91. <?php if (!isset($options['appAppUserID']) || $options['appAppUserID']<1) { ?> <div class="blnkg"><=== <?php _e('Authorize your account', 'social-networks-auto-poster-facebook-twitter-g'); ?> ===</div>  
  92. <br/><br/><i> <?php _e('If you get App.Net message:', 'social-networks-auto-poster-facebook-twitter-g'); ?> <b>"Error. An error occurred. Please try again later."</b> or <b>"Error 191"</b> <?php _e('please make sure that domain name in your App.Net App matches your website domain exactly. Please note that www. and non www. versions are different domains.', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> <?php }?> 
  93. <?php } ?> 
  94. <br/> 
  95.  
  96.  
  97. <?php if ($isNew) { ?> <input type="hidden" name="ap[<?php echo $ii; ?>][apDoAP]" value="1" id="apDoNewAP<?php echo $ii; ?>" /> <?php } ?> 
  98. <?php if (isset($options['appAppUserID']) && $options['appAppUserID']>0) { ?> 
  99.  
  100. <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b>    <a href="#" class="NXSButton" onclick="testPost('AP', '<?php echo $ii; ?>'); return false;"><?php printf( __( 'Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a> <?php }  
  101. ?> 
  102.  
  103. </div> 
  104. <?php /** ######################## Tools Tab ####################### */ ?> 
  105. <?php if (!$isNew) { ?><div id="nsx<?php echo $nt.$ii ?>_tab2" class="nsx_tab_content">  
  106. <?php nxs_showCatTagsCTFilters($nt, $ii, $options); 
  107. nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); 
  108. nxs_showRepostSettings($nt, $ii, $options); ?>  
  109. </div> <?php } ?> <?php /** #### End of Tab #### */ ?> 
  110. </div><br/> <?php /** #### End of Tabs #### */ ?> 
  111.  
  112. <div class="submitX nxclear" style="padding-bottom: 0px;"><input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" /></div> 
  113.  
  114.  
  115. </div><?php 
  116. //#### Set Unit Settings from POST 
  117. function setNTSettings($post, $options) { $code = $this->ntInfo['code']; 
  118. foreach ($post as $ii => $pval) {  
  119. if (isset($pval['appID']) && $pval['appID']!='') { if (!isset($options[$ii])) $options[$ii] = array(); 
  120. if (isset($pval['nName'])) $options[$ii]['nName'] = trim($pval['nName']);  
  121.  
  122. if (isset($pval['appID'])) $options[$ii]['appID'] = trim($pval['appID']); 
  123.  
  124. if (isset($pval['appSec'])) $options[$ii]['appSec'] = trim($pval['appSec']); 
  125. if (isset($pval['apSubReddit'])) $options[$ii]['apSubReddit'] = trim($pval['apSubReddit']);  
  126.  
  127. if (isset($pval['catSel'])) $options[$ii]['catSel'] = trim($pval['catSel']); else $options[$ii]['catSel'] = 0; 
  128. if ($options[$ii]['catSel']=='1' && trim($pval['catSelEd'])!='') $options[$ii]['catSelEd'] = trim($pval['catSelEd']); else $options[$ii]['catSelEd'] = '';  
  129.  
  130. if (isset($pval['attchImg'])) $options[$ii]['attchImg'] = $pval['attchImg']; else $options[$ii]['attchImg'] = 0;  
  131. if (isset($pval['apTextFormat'])) $options[$ii]['apTextFormat'] = trim($pval['apTextFormat']);  
  132. if (isset($pval['apDoAP'])) $options[$ii]['doAP'] = $pval['apDoAP']; else $options[$ii]['doAP'] = 0;  
  133.  
  134. $options[$ii] = nxs_adjRpst($options[$ii], $pval);  
  135.  
  136. if (isset($pval['delayDays'])) $options[$ii]['nDays'] = trim($pval['delayDays']); 
  137. if (isset($pval['delayHrs'])) $options[$ii]['nHrs'] = trim($pval['delayHrs']); if (isset($pval['delayMin'])) $options[$ii]['nMin'] = trim($pval['delayMin']);  
  138. if (isset($pval['qTLng'])) $options[$ii]['qTLng'] = trim($pval['qTLng']);  
  139. } elseif ( count($pval)==1 ) if (isset($pval['apDo'.$code])) $options[$ii]['do'.$code] = $pval['apDo'.$code]; else $options[$ii]['do'.$code] = 0;  
  140. } return $options; 
  141. }  
  142. //#### Show Post->Edit Meta Box Settings 
  143. function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'ap'; $ntU = 'AP';  
  144. foreach($ntOpts as $ii=>$ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapAP', true));  
  145. if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii])) $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); if (empty($ntOpt['imgToUse'])) $ntOpt['imgToUse'] = ''; 
  146. $doAP = $ntOpt['doAP'] && (is_array($pMeta) || $ntOpt['catSel']!='1'); $imgToUse = $ntOpt['imgToUse'];  
  147. $isAvailAP = $ntOpt['appID']!='' && $ntOpt['appSec']!=''; $apMsgFormat = htmlentities($ntOpt['apTextFormat'], ENT_COMPAT, "UTF-8");  
  148. ?>  
  149. <tr><th style="text-align:left;" colspan="2"> 
  150. <?php if ($ntOpt['catSel']=='1' && trim($ntOpt['catSelEd'])!='') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; ?><?php echo $ii; ?>" value="<?php echo $ntOpt['catSelEd']; ?>" /> <?php } ?> 
  151. <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; ?><?php echo $ii; ?>" value="<?php echo $ntOpt['tagsSelX']; ?>" /> <?php } ?> 
  152. <?php if ($isAvailAP) { ?><input class="nxsGrpDoChb" value="1" id="doAP<?php echo $ii; ?>" <?php if ($post->post_status == "publish") echo 'disabled="disabled"';?> type="checkbox" name="ap[<?php echo $ii; ?>][doAP]" <?php if ((int)$doAP == 1) echo 'checked="checked" title="def"'; ?> />  
  153. <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="ap[<?php echo $ii; ?>][doAP]" value="<?php echo $doAP;?>"> <?php } ?> <?php } ?> 
  154.  
  155. <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?>img/ap16.png);">App.Net - <?php _e('publish to', 'social-networks-auto-poster-facebook-twitter-g') ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?></i>)</div></th> <td><?php //## Only show RePost button if the post is "published" 
  156. if ($post->post_status == "publish" && $isAvailAP) { ?><input alt="<?php echo $ii; ?>" style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToAP_repostButton" id="rePostToAP_button" value="<?php _e('Repost to App.Net', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  157. <?php } ?> 
  158.  
  159. <?php if (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID']) ) {  
  160.  
  161. ?> <span id="pstdAP<?php echo $ii; ?>" style="float: right;padding-top: 4px; padding-right: 10px;"> 
  162. <a style="font-size: 10px;" href="<?php echo $pMeta[$ii]['postURL']; ?>" target="_blank"><?php $nType="App.Net"; printf( __( 'Posted on', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(" (".$pMeta[$ii]['pDate'].")"):""; ?></a> 
  163. </span><?php } ?> 
  164.  
  165. </td></tr>  
  166.  
  167. <?php if (!$isAvailAP) { ?><tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your App.Net Account to AutoPost to App.Net</b></td></tr> 
  168. <?php } else { if ($post->post_status != "publish" && function_exists('nxs_doSMAS5') ) { $ntOpt['postTime'] = get_post_time('U', false, $post_id); nxs_doSMAS5($nt, $ii, $ntOpt); } ?> 
  169.  
  170. <?php if ($ntOpt['rpstOn']=='1') { ?>  
  171.  
  172. <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> 
  173. <input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?>ap" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) echo "checked"; ?> />  
  174. </th> 
  175. <td> <?php _e('Include in "Auto-Reposting" to this network.', 'social-networks-auto-poster-facebook-twitter-g') ?> 
  176. </td></tr> <?php } ?> 
  177.  
  178.  
  179. <tr id="altFormat1" style=""><th scope="row" style="vertical-align:top; padding-top: 6px; text-align:right; width:60px; padding-right:10px;"><?php _e('Text Format:', 'social-networks-auto-poster-facebook-twitter-g') ?></th><td>  
  180.  
  181. <textarea cols="150" rows="1" id="ap<?php echo $ii; ?>SNAPformat" name="ap[<?php echo $ii; ?>][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#ap<?php echo $ii; ?>SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apAPMsgFrmt<?php echo $ii; ?>');"><?php echo $apMsgFormat ?></textarea> 
  182.  
  183. </td></tr> 
  184. <tr><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 5px; padding-right:10px;"> 
  185. <input value="0" type="hidden" name="ap[<?php echo $ii; ?>][attchImg]"/> 
  186. <input value="1" type="checkbox" name="ap[<?php echo $ii; ?>][attchImg]" <?php if ((int)$ntOpt['attchImg'] == 1) echo "checked"; ?> /> </th><td><strong>Attach Image to App.net Post</strong></td> </tr>  
  187. <?php /** ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); ?> 
  188.  
  189.  
  190.  
  191. <?php }  
  192.  
  193. //#### Save Meta Tags to the Post 
  194. function adjMetaOpt($optMt, $pMeta) { if (isset($pMeta['isPosted'])) $optMt['isPosted'] = $pMeta['isPosted']; else $optMt['isPosted'] = '';  
  195. if (isset($pMeta['SNAPformat'])) $optMt['apTextFormat'] = $pMeta['SNAPformat'];  
  196. if (isset($pMeta['imgToUse'])) $optMt['imgToUse'] = $pMeta['imgToUse']; if (isset($pMeta['urlToUse'])) $optMt['urlToUse'] = $pMeta['urlToUse'];  
  197. if (isset($pMeta['timeToRun'])) $optMt['timeToRun'] = $pMeta['timeToRun']; if (isset($pMeta['rpstPostIncl'])) $optMt['rpstPostIncl'] = $pMeta['rpstPostIncl'];  
  198. if (isset($pMeta['attchImg'])) $optMt['attchImg'] = $pMeta['attchImg'] == 1?1:0; else { if (isset($pMeta['attchImg'])) $optMt['attchImg'] = 0; }  
  199. if (isset($pMeta['doAP'])) $optMt['doAP'] = $pMeta['doAP'] == 1?1:0; else { if (isset($pMeta['SNAPformat'])) $optMt['doAP'] = 0; }  
  200. if (isset($pMeta['SNAPincludeAP']) && $pMeta['SNAPincludeAP'] == '1' ) $optMt['doAP'] = 1;  
  201. return $optMt; 
  202. }  
  203. }}