nxs_snapClassRD

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

Defined (1)

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

/inc-cl/rd.php  
  1. if (!class_exists("nxs_snapClassRD")) { class nxs_snapClassRD {  
  2. //#### Show Common Settings 
  3. function showGenNTSettings($ntOpts) { global $nxs_plurl; $ntInfo = array('code'=>'RD', 'lcode'=>'rd', 'name'=>'Reddit', 'defNName'=>'rdUName', 'tstReq' => false); ?>  
  4. <div class="nxs_box"> 
  5. <div class="nxs_box_header">  
  6. <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']; ?> 
  7. <?php $cbo = count($ntOpts); ?>  
  8. <?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 } ?> 
  9. </div> 
  10. </div> 
  11. <div class="nxs_box_inside"> 
  12. <?php if(!function_exists('doConnectToRD')) {?> Reddit doesn't have a built-in API for automated posts yet. <br/>You need to get a special <a target="_blank" href="http://www.nextscripts.com/reddit-automated-posting">library module</a> to be able to publish your content to Reddit.  
  13. <?php } else foreach ($ntOpts as $indx=>$pbo) { if (trim($pbo['nName']=='')) $pbo['nName'] = $pbo[$ntInfo['defNName']]; ?> 
  14. <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' /> 
  15. <input value="0" name="<?php echo $ntInfo['lcode']; ?>[<?php echo $indx; ?>][apDo<?php echo $ntInfo['code']; ?>]" type="hidden" />  
  16. <?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 { ?>  
  17. <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"; ?> /> 
  18. <?php } ?> 
  19. <?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 } ?> 
  20. <?php if (isset($pbo['rpstOn']) && (int)$pbo['rpstOn'] == 1) { ?> <span onmouseout="nxs_hidePopUpInfo('popReActive');" onmouseover="nxs_showPopUpInfo('popReActive', event);"><?php echo "*[R]*" ?></span><?php } ?> 
  21. <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> 
  22.   <?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 } ?><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>   
  23. <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> 
  24. </p><div id="nxsNTSetDiv<?php echo $ntInfo['code'].$indx; ?>"></div><?php //$pbo['ntInfo'] = $ntInfo; $this->showNTSettings($indx, $pbo);  
  25. }?> 
  26. </div> 
  27. </div> <?php  
  28. }  
  29. //#### Show NEW Settings Page 
  30. function showNewNTSettings($mrdo) { $rdo = array('nName'=>'', 'doRD'=>'1', 'rdUName'=>'', 'rdPageID'=>'', 'rdCommID'=>'', 'postType'=>'A', 'rdPass'=>''); $rdo['ntInfo']= array('lcode'=>'rd'); $this->showNTSettings($mrdo, $rdo, true);} 
  31. //#### Show Unit Settings 
  32. function showNTSettings($ii, $options, $isNew=false) { global $nxs_plurl; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt);  
  33. 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'] = '';  
  34. if (!isset($options['nDays'])) $options['nDays'] = 0; if (!isset($options['qTLng'])) $options['qTLng'] = ''; if (!isset($options['rdSubReddit'])) $options['rdSubReddit'] = ''; ?> 
  35. <div id="doRD<?php echo $ii; ?>Div" class="insOneDiv<?php if ($isNew) echo " clNewNTSets"; ?>"> <input type="hidden" name="apDoSRD<?php echo $ii; ?>" value="0" id="apDoSRD<?php echo $ii; ?>" />  
  36.  
  37. <?php if(!function_exists('doConnectToRD')) {  
  38. nxs_show_noLibWrn('Reddit API Library module NOT found.<br/><br/><span style="color:black;">Reddit does not have a free native API for automated posts yet.</span><br/><br/><span style="font-size: 12px;color:black;">You need to have a special API Library Module to be able to publish your content to Reddit.</span>'); echo "</div>"; return; }; ?>  
  39.  
  40. <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?>img/rd16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-reddit-social-networks-auto-poster-wordpress/"><?php $nType="Reddit"; printf( __( 'Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a></div> 
  41.  
  42. <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="rd[<?php echo $ii; ?>][nName]" id="rdnName<?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/> 
  43. <?php echo nxs_addQTranslSel('rd', $ii, $options['qTLng']); ?> 
  44.  
  45.  
  46. <br/> 
  47. <ul class="nsx_tabs"> 
  48. <li><a href="#nsx<?php echo $nt.$ii ?>_tab1"><?php _e('Account Info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a></li>  
  49. <?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 } ?> 
  50. </ul> 
  51. <div class="nsx_tab_container"><?php /** ######################## Account Tab ####################### */ ?> 
  52. <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%;"> 
  53.  
  54.  
  55. <div style="width:100%;"><strong>Reddit Username:</strong> </div><input name="rd[<?php echo $ii; ?>][uName]" id="apRDUName<?php echo $ii; ?>" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['rdUName'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  56. <div style="width:100%;"><strong>Reddit Password:</strong> </div><input autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" name="rd[<?php echo $ii; ?>][uPass]" id="apRDPass<?php echo $ii; ?>" type="password" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities(substr($options['rdPass'], 0, 5)=='n5g9a'?nsx_doDecode(substr($options['rdPass'], 5)):$options['rdPass'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> <br/>  
  57.  
  58. <div style="width:100%;"><strong>Subreddit ID:</strong>  
  59. Please <a href="#" onclick="nxs_getBrdsOrCats(jQuery('<?php if ($isNew) echo "#nsx_addNT "; ?>#apRDUName<?php echo $ii; ?>').val(), jQuery('<?php if ($isNew) echo "#nsx_addNT "; ?>#apRDPass<?php echo $ii; ?>').val(), 'rd' , '<?php echo $ii; ?>', 'rdSubReddit'); return false;">click here to retrieve your subreddits</a> 
  60. </div> 
  61. <img id="rdLoadingImg<?php echo $ii; ?>" style="display: none;" src='<?php echo $nxs_plurl; ?>img/ajax-loader-sm.gif' />  
  62. <select name="rd[<?php echo $ii; ?>][rdSubReddit]" id="rdSubReddit<?php echo $ii; ?>"> 
  63. <?php if ($options['rdSubRedditsList']!='') { $gBoards = $options['rdSubRedditsList']; if ( base64_encode(base64_decode($gBoards)) === $gBoards) $gBoards = base64_decode($gBoards);  
  64. if ($options['rdSubReddit']!='') $gBoards = str_replace($options['rdSubReddit'].'"', $options['rdSubReddit'].'" selected="selected"', $gBoards); echo $gBoards;} else { ?> 
  65. <option value="0">None(Click above to retrieve your subreddits)</option> 
  66. <?php } ?> 
  67. </select> 
  68.  
  69. <br/><br/>  
  70. <?php /** <input name="rd[<?php echo $ii; ?>][rdSubReddit]" id="apRDPage" style="width: 30%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['rdSubReddit'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> */ ?> 
  71. <i style="color: #580000;">Please do not try to post to subredits that you do not own. Reddit is very serious about it's policy that prohibits sharing your own links. You will loose posting privileges and you account will be <b>banned</b> if you post to public subreddits. </i> 
  72. <br/> <br/>  
  73.  
  74. <div id="altFormat" style=""> 
  75. <div style="width:100%;"><strong id="altFormatText"><?php _e('Post Title Format', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong> (<a href="#" id="rdTitleFormat<?php echo $ii; ?>HintInfo" onclick="mxs_showHideFrmtInfo('rdTitleFormat<?php echo $ii; ?>'); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>)</div> 
  76. <input name="rd[<?php echo $ii; ?>][rdTitleFormat]" id="rdTitleFormat<?php echo $ii; ?>" style="width: 50%;" value="<?php if ($isNew) echo "%TITLE%"; else _e(apply_filters('format_to_edit', htmlentities($options['rdTitleFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?>" onfocus="mxs_showFrmtInfo('rdTitleFormat<?php echo $ii; ?>');" /><?php nxs_doShowHint("rdTitleFormat".$ii); ?> 
  77. </div><br/>  
  78.  
  79. <div style="width:100%;"><strong id="altFormatText">Post Type:</strong></div>  
  80. <div style="margin-left: 10px;"> 
  81. <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($options['postType']) || $options['postType'] == '' || $options['postType'] == 'A') echo 'checked="checked"'; ?> /> <?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> 
  82. <br/> 
  83. <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="T" <?php if ($options['postType'] == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('set the text format below', 'social-networks-auto-poster-facebook-twitter-g'); ?></i> 
  84. </div><br/> 
  85.  
  86. <div id="altFormat" style="margin-left: 20px;"> 
  87. <div style="width:100%;"><strong id="altFormatText"><?php _e('Text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong> (<a href="#" id="rdTextFormat<?php echo $ii; ?>HintInfo" onclick="mxs_showHideFrmtInfo('rdTextFormat<?php echo $ii; ?>'); return false;"><?php _e('Show format info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a>) 
  88. </div> 
  89.  
  90. <textarea cols="150" rows="3" id="rd<?php echo $ii; ?>SNAPformat" name="rd[<?php echo $ii; ?>][rdTextFormat]" style="width:51%;max-width: 650px;" onfocus="jQuery('#rd<?php echo $ii; ?>SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apRDMsgFrmt<?php echo $ii; ?>');"><?php if ($isNew) _e("New post (%TITLE%) has been published on %SITENAME%", 'social-networks-auto-poster-facebook-twitter-g'); else _e(apply_filters('format_to_edit', htmlentities($options['rdTextFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g'); ?></textarea> 
  91.  
  92. <?php nxs_doShowHint("rdTextFormat".$ii); ?> 
  93. </div><br/>  
  94.  
  95.  
  96. <?php if ($isNew) { ?> <input type="hidden" name="rd[<?php echo $ii; ?>][apDoRD]" value="1" id="apDoNewRD<?php echo $ii; ?>" /> <?php } ?> 
  97. <?php if ($options['rdPass']!='') { ?> 
  98.  
  99. <b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b>    <a href="#" class="NXSButton" onclick="testPost('RD', '<?php echo $ii; ?>'); return false;"><?php printf( __( 'Submit Test Post to %s', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a> <?php }  
  100. ?> 
  101. </div> 
  102.  
  103. <?php /** ######################## Advanced Tab ####################### */ ?> 
  104. <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt.$ii ?>_tab2" class="nsx_tab_content"> 
  105.  
  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.  
  110.  
  111. </div> <?php } ?> <?php /** #### End of Tab #### */ ?> 
  112. </div><br/> <?php /** #### End of Tabs #### */ ?> 
  113.  
  114. <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> 
  115.  
  116. </div><?php 
  117. //#### Set Unit Settings from POST 
  118. function setNTSettings($post, $options) { $code = 'RD'; $lcode = 'rd';  
  119. foreach ($post as $ii => $pval) {  
  120. if (!empty($pval['uName']) && !empty($pval['uPass'])) { if (!isset($options[$ii])) $options[$ii] = array();  
  121. if (isset($pval['uName'])) $options[$ii]['rdUName'] = trim($pval['uName']); 
  122. if (isset($pval['nName'])) $options[$ii]['nName'] = trim($pval['nName']); 
  123. if (isset($pval['uPass'])) $options[$ii]['rdPass'] = 'n5g9a'.nsx_doEncode($pval['uPass']); else $options[$ii]['rdPass'] = '';  
  124.  
  125. if (empty($options[$ii]['rdSubRedditsList'])) { $pass = substr($options[$ii]['rdPass'], 0, 5)=='n5g9a'?nsx_doDecode(substr($options[$ii]['rdPass'], 5)):$options[$ii]['rdPass']; 
  126. $loginInfo = doConnectToRD($options[$ii]['rdUName'], $pass); if (is_array($loginInfo)) {  
  127. $options[$ii]['rdSubRedditsList'] = doGetSubredditsFromRD(); 
  128. }  
  129.  
  130. if (isset($pval['rdSubReddit'])) $options[$ii]['rdSubReddit'] = trim($pval['rdSubReddit']);  
  131.  
  132. if (isset($pval['catSel'])) $options[$ii]['catSel'] = trim($pval['catSel']); else $options[$ii]['catSel'] = 0; 
  133. if ($options[$ii]['catSel']=='1' && trim($pval['catSelEd'])!='') $options[$ii]['catSelEd'] = trim($pval['catSelEd']); else $options[$ii]['catSelEd'] = ''; 
  134.  
  135. if (isset($pval['postType'])) $options[$ii]['postType'] = $pval['postType'];  
  136. if (isset($pval['rdTitleFormat'])) $options[$ii]['rdTitleFormat'] = trim($pval['rdTitleFormat']); 
  137. if (isset($pval['rdTextFormat'])) $options[$ii]['rdTextFormat'] = trim($pval['rdTextFormat']); 
  138.  
  139. if (isset($pval['apDoRD'])) $options[$ii]['doRD'] = $pval['apDoRD']; else $options[$ii]['doRD'] = 0;  
  140.  
  141. $options[$ii] = nxs_adjRpst($options[$ii], $pval);  
  142.  
  143. if (isset($pval['delayDays'])) $options[$ii]['nDays'] = trim($pval['delayDays']); 
  144. if (isset($pval['delayHrs'])) $options[$ii]['nHrs'] = trim($pval['delayHrs']); if (isset($pval['delayMin'])) $options[$ii]['nMin'] = trim($pval['delayMin']);  
  145. if (isset($pval['qTLng'])) $options[$ii]['qTLng'] = trim($pval['qTLng']);  
  146. } elseif ( count($pval)==1 ) if (isset($pval['apDo'.$code])) $options[$ii]['do'.$code] = $pval['apDo'.$code]; else $options[$ii]['do'.$code] = 0;  
  147. } return $options; 
  148. }  
  149. //#### Show Post->Edit Meta Box Settings 
  150. function showEdPostNTSettings($ntOpts, $post) {global $nxs_plurl; $post_id = $post->ID; $nt = 'rd'; $ntU = 'RD';  
  151. foreach($ntOpts as $ii=>$ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapRD', true)); if (!empty($pMeta) && is_array($pMeta)) $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]);  
  152. $doRD = $ntOpt['doRD'] && (is_array($pMeta) || $ntOpt['catSel']!='1');  
  153. $isAvailRD = $ntOpt['rdUName']!='' && $ntOpt['rdPass']!=''; $rdMsgFormat = htmlentities($ntOpt['rdTextFormat'], ENT_COMPAT, "UTF-8"); $rdMsgTFormat = htmlentities($ntOpt['rdTitleFormat'], ENT_COMPAT, "UTF-8");  
  154. $rdPostType = $ntOpt['postType']; 
  155. ?>  
  156. <tr><th style="text-align:left;" colspan="2"> 
  157. <?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 } ?> 
  158. <?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 } ?> 
  159. <?php if ($isAvailRD) { ?><input class="nxsGrpDoChb" value="1" id="doRD<?php echo $ii; ?>" <?php if ($post->post_status == "publish") echo 'disabled="disabled"';?> type="checkbox" name="rd[<?php echo $ii; ?>][doRD]" <?php if ((int)$doRD == 1) echo 'checked="checked" title="def"'; ?> />  
  160. <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="rd[<?php echo $ii; ?>][doRD]" value="<?php echo $doRD;?>"> <?php } ?> <?php } ?> 
  161.  
  162. <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?>img/rd16.png);">Reddit - <?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" 
  163. if ($post->post_status == "publish" && $isAvailRD) { ?><input alt="<?php echo $ii; ?>" style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToRD_repostButton" id="rePostToRD_button" value="<?php _e('Repost to Reddit', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  164. <?php } ?> 
  165.  
  166. <?php if (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID']) ) {  
  167.  
  168. ?> <span id="pstdRD<?php echo $ii; ?>" style="float: right;padding-top: 4px; padding-right: 10px;"> 
  169. <a style="font-size: 10px;" href="<?php echo $pMeta[$ii]['pgID']; ?>" target="_blank"><?php $nType="Reddit"; printf( __( 'Posted on', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(" (".$pMeta[$ii]['pDate'].")"):""; ?></a> 
  170. </span><?php } ?> 
  171.  
  172. </td></tr>  
  173.  
  174. <?php if (!$isAvailRD) { ?><tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your Reddit Account to AutoPost to Reddit</b></td></tr> 
  175. <?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); } ?> 
  176.  
  177. <?php if ($ntOpt['rpstOn']=='1') { ?>  
  178.  
  179. <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> 
  180. <input value="0" type="hidden" name="<?php echo $nt; ?>[<?php echo $ii; ?>][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?>rd" type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) echo "checked"; ?> /> 
  181. </th> 
  182. <td> <?php _e('Include in "Auto-Reposting" to this network.', 'social-networks-auto-poster-facebook-twitter-g') ?>  
  183. </td></tr> <?php } ?> 
  184.  
  185.  
  186. <tr id="altFormat1" style=""><th scope="row" style="vertical-align:top; padding-top: 6px; text-align:right; width:60px; padding-right:10px;"><?php _e('Title Format:', 'social-networks-auto-poster-facebook-twitter-g') ?></th> 
  187. <td><input value="<?php echo $rdMsgTFormat ?>" type="text" name="rd[<?php echo $ii; ?>][SNAPformatT]" style="width:60%;max-width: 610px;" onfocus="jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apRDMsgTFrmt<?php echo $ii; ?>');"/><?php nxs_doShowHint("apRDMsgTFrmt".$ii, '', '58'); ?></td></tr>  
  188.  
  189. <tr><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'social-networks-auto-poster-facebook-twitter-g') ?> </th><td>  
  190. <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="A" <?php if ( !isset($rdPostType) || $rdPostType == '' || $rdPostType == 'A') echo 'checked="checked"'; ?> /><?php _e('Link Post', 'social-networks-auto-poster-facebook-twitter-g') ?> 
  191. <br/> 
  192. <input type="radio" name="rd[<?php echo $ii; ?>][postType]" value="T" <?php if ($rdPostType == 'T') echo 'checked="checked"'; ?> /> <?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g') ?><br/>  
  193. </td></tr> 
  194.  
  195. <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>  
  196.  
  197. <textarea cols="150" rows="1" id="rd<?php echo $ii; ?>SNAPformat" name="rd[<?php echo $ii; ?>][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#rd<?php echo $ii; ?>SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apRDMsgFrmt<?php echo $ii; ?>');"><?php echo $rdMsgFormat ?></textarea>  
  198.  
  199. </td></tr> 
  200. <?php }  
  201. //#### Save Meta Tags to the Post 
  202. function adjMetaOpt($optMt, $pMeta) { if (isset($pMeta['isPosted'])) $optMt['isPosted'] = $pMeta['isPosted']; else $optMt['isPosted'] = '';  
  203. if (isset($pMeta['SNAPformat'])) $optMt['rdTextFormat'] = $pMeta['SNAPformat']; if (isset($pMeta['SNAPformatT'])) $optMt['rdTitleFormat'] = $pMeta['SNAPformatT'];  
  204. if (isset($pMeta['imgToUse'])) $optMt['imgToUse'] = $pMeta['imgToUse'];  
  205. if (isset($pMeta['timeToRun'])) $optMt['timeToRun'] = $pMeta['timeToRun']; if (isset($pMeta['rpstPostIncl'])) $optMt['rpstPostIncl'] = $pMeta['rpstPostIncl'];  
  206. if (isset($pMeta['postType'])) $optMt['postType'] = $pMeta['postType']; 
  207. if (isset($pMeta['doRD'])) $optMt['doRD'] = $pMeta['doRD'] == 1?1:0; else { if (isset($pMeta['SNAPformat'])) $optMt['doRD'] = 0; }  
  208. if (isset($pMeta['SNAPincludeRD']) && $pMeta['SNAPincludeRD'] == '1' ) $optMt['doRD'] = 1;  
  209. return $optMt; 
  210. }  
  211. }}