nxs_snapClassTW

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

Defined (1)

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

/inc-cl/tw.php  
  1. if (!class_exists("nxs_snapClassTW")) { class nxs_snapClassTW { 
  2. //#### Show Common Settings  
  3. function showGenNTSettings($ntOpts) { global $nxs_plurl; $ntInfo = array('code'=>'TW', 'lcode'=>'tw', 'name'=>'Twitter', 'defNName'=>'dlUName', 'tstReq' => true);  
  4. $ntParams = array('ntInfo'=>$ntInfo, 'nxs_plurl'=>$nxs_plurl, 'ntOpts'=>$ntOpts, 'chkField'=>'twAccTokenSec'); nxs_showListRow($ntParams);  
  5. }  
  6. //#### Show NEW Settings Page 
  7. function showNewNTSettings($mtwo) { $options = array('nName'=>'', 'doTW'=>'1', 'twURL'=>'', 'twConsKey'=>'', 'twMsgFormat'=>'%TITLE% - %URL%', 'twConsSec'=>'', 'twAccToken'=>'', 'twAccTokenSec'=>'', 'attchImg'=>0, 'twAttch'=>'', 'twAccTokenSec'=>'');  
  8. $options['ntInfo']= array('lcode'=>'tw'); $this->showNTSettings($mtwo, $options, true);} 
  9. //#### Show Unit Settings 
  10. function showNTSettings($ii, $options, $isNew=false) { global $nxs_plurl, $plgn_NS_SNAutoPoster; $nt = $options['ntInfo']['lcode']; $ntU = strtoupper($nt); $tmzFrmt = _x('Y-m-d G:i:s', 'timezone date format'); 
  11. if (!isset($plgn_NS_SNAutoPoster)) $gOptions = array(); else $gOptions = $plgn_NS_SNAutoPoster->nxs_options;  
  12. 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'] = '';  
  13. if (!isset($options['riComments'])) $options['riComments'] = ''; if (!isset($options['riCommentsAA'])) $options['riCommentsAA'] = ''; if (!isset($options['riCommentsM'])) $options['riCommentsM'] = '';  
  14. if (!isset($options['nDays'])) $options['nDays'] = 0; if (!isset($options['qTLng'])) $options['qTLng'] = ''; ?> 
  15.  
  16. <div id="doTW<?php echo $ii; ?>Div" class="insOneDiv<?php if ($isNew) echo " clNewNTSets"; ?>" > <input type="hidden" name="apDoSTW<?php echo $ii; ?>" value="0" id="apDoSTW<?php echo $ii; ?>" />  
  17.  
  18. <div class="nsx_iconedTitle" style="float: right; background-image: url(<?php echo $nxs_plurl; ?>img/tw16.png);"><a style="font-size: 12px;" target="_blank" href="http://www.nextscripts.com/setup-installation-twitter-social-networks-auto-poster-wordpress/"><?php $nType="Twitter"; printf( __( 'Detailed %s Installation/Configuration Instructions', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?></a></div> 
  19.  
  20. <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 type="text" name="tw[<?php echo $ii; ?>][nName]" id="twnName<?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/> 
  21. <?php echo nxs_addQTranslSel('tw', $ii, $options['qTLng']); ?> 
  22. <br/> 
  23. <ul class="nsx_tabs"> 
  24. <li><a href="#nsx<?php echo $nt.$ii ?>_tab1"><?php _e('Account Info', 'social-networks-auto-poster-facebook-twitter-g'); ?></a></li>  
  25. <?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 } ?> 
  26. </ul> 
  27. <div class="nsx_tab_container"><?php /** ######################## Account Tab ####################### */ ?> 
  28. <div id="nsx<?php echo $nt.$ii ?>_tab1" class="nsx_tab_content" style="background-image: url(<?php echo $nxs_plurl; ?>img/tw-bg.png); background-repeat: no-repeat; background-position:90% 10%;"> 
  29.  
  30. <div class="nxs_tls_lbl"><strong>Your Twitter URL:</strong> </div><input type="text" name="tw[<?php echo $ii; ?>][apTWURL]" id="apTWURL" style="width: 40%;border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['twURL'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  31. <div class="nxs_tls_lbl"><strong>Your Twitter API Key:</strong> </div><input type="text" name="tw[<?php echo $ii; ?>][apTWConsKey]" id="apTWConsKey" style="width: 40%; border: 1px solid #ACACAC;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['twConsKey'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" />  
  32. <div class="nxs_tls_lbl"><strong>Your Twitter API Secret:</strong> </div><input type="text" name="tw[<?php echo $ii; ?>][apTWConsSec]" id="apTWConsSec" style="width: 40%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['twConsSec'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  33. <div class="nxs_tls_lbl"><strong>Your Access Token:</strong> </div><input type="text" name="tw[<?php echo $ii; ?>][apTWAccToken]" id="apTWAccToken" style="width: 40%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['twAccToken'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  34. <div class="nxs_tls_lbl"><strong>Your Access Token Secret:</strong> </div><input type="text" name="tw[<?php echo $ii; ?>][apTWAccTokenSec]" id="apTWAccTokenSec" style="width: 40%;" value="<?php _e(apply_filters('format_to_edit', htmlentities($options['twAccTokenSec'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  35. <?php if ($isNew) { ?> <input type="hidden" name="tw[<?php echo $ii; ?>][apDoTW]" value="1" id="apDoNewTW<?php echo $ii; ?>" /> <?php } ?> 
  36. <br/><br/> 
  37. <p style="margin: 0px;"><input value="1" id="apLIAttch" type="checkbox" name="tw[<?php echo $ii; ?>][attchImg]" <?php if ((int)$options['attchImg'] == 1) echo "checked"; ?> /> <strong><?php _e('Attach Image to Twitter Post', 'social-networks-auto-poster-facebook-twitter-g'); ?></strong></p> 
  38. <br/> 
  39. <strong id="altFormatText"><?php _e('Message text Format', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</strong><br/> 
  40.  
  41. <textarea cols="150" rows="3" id="tw<?php echo $ii; ?>SNAPformat" name="tw[<?php echo $ii; ?>][apTWMsgFrmt]" style="width:51%;max-width: 610px;" onfocus="jQuery('#tw<?php echo $ii; ?>SNAPformat').attr('rows', 6); mxs_showFrmtInfo('apTWMsgFrmt<?php echo $ii; ?>');"><?php _e(apply_filters('format_to_edit', htmlentities($options['twMsgFormat'], ENT_COMPAT, "UTF-8")), 'social-networks-auto-poster-facebook-twitter-g') ?></textarea> <?php nxs_doShowHint("apTWMsgFrmt".$ii); ?>  
  42.  
  43.  
  44. <?php nxs_doShowHint("apTWMsgFrmt".$ii, '<br/><br/><b>%TAGS% and %CATS% will be posted as hashtags. <br/>Please remember that Twitter takes only 140 characters.</b>'); ?> 
  45.  
  46.  
  47.  
  48. <?php if($options['twAccTokenSec']!='') { ?>  
  49. <br/><br/><b><?php _e('Test your settings', 'social-networks-auto-poster-facebook-twitter-g'); ?>:</b>    <?php if (!isset($options['twOK']) || $options['twOK']!='1') { ?> <div class="blnkg">=== Submit Test Post to Complete ===></div> <?php } ?> <a href="#" class="NXSButton" onclick="testPost('TW', '<?php echo $ii; ?>'); return false;"><?php printf( __( 'Submit Test Post to %s' , 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?></a> <br/> 
  50. <?php }?> 
  51.  
  52.  
  53. </div> 
  54. <?php /** ######################## Tools Tab ####################### */ ?> 
  55. <?php if (!$isNew) { ?> <div id="nsx<?php echo $nt.$ii ?>_tab2" class="nsx_tab_content"> 
  56.  
  57. <?php nxs_showCatTagsCTFilters($nt, $ii, $options);  
  58. nxs_addPostingDelaySelV3($nt, $ii, $options['nHrs'], $options['nMin'], $options['nDays']); ?>  
  59.  
  60. <div class="nxs_tls_cpt"><?php _e('Auto Import of Replies and Mentions:', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 
  61. <div class="nxs_tls_bd"> 
  62. <div class="nxs_tls_sbInfo"><?php _e('Plugin could grab Replies and Mentions from Twitter and import them as Wordpress Comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></div> 
  63. <?php if ( !empty($gOptions['riActive']) && $gOptions['riActive'] == '1' ) { ?> 
  64. <input value="1" id="riC<?php echo $ii; ?>" <?php if (trim($options['riComments'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][riComments]"/> <b><?php _e('Import Twitter Replies', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 
  65. <br/> 
  66. <input value="1" id="riCM<?php echo $ii; ?>" <?php if (trim($options['riCommentsM'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][riCommentsM]"/> <b><?php _e('Import Twitter Mentions', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 
  67. <br/>  
  68. <input value="1" id="riCA<?php echo $ii; ?>" <?php if (trim($options['riCommentsAA'])=='1') echo "checked"; ?> type="checkbox" name="<?php echo $nt; ?>[<?php echo $ii; ?>][riCommentsAA]"/> <b><?php _e('Auto-approve imported comments', 'social-networks-auto-poster-facebook-twitter-g'); ?></b> 
  69. <?php } else { echo "<br/>"; _e('Please activate the "Comments Import" from SNAP Settings Tab', 'social-networks-auto-poster-facebook-twitter-g'); } ?>  
  70. </div> 
  71.  
  72. <?php nxs_showRepostSettings($nt, $ii, $options); ?> 
  73.  
  74. </div> <?php } ?> 
  75. </div><br/>  
  76.  
  77. <div class="submitX nxclear" style="padding-bottom: 0px;">  
  78. <input type="submit" class="button-primary" name="update_NS_SNAutoPoster_settings" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  79. <?php /** 
  80. <input type="button" id="svBtn<?php echo $nt.$ii ?>" onclick="nxs_svSet('<?php echo $nt; ?>', '<?php echo $ii; ?>')" class="button-primary" value="<?php _e('Update Settings', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  81. <div id="nxsSaveLoadingImg<?php echo $nt.$ii; ?>" class="doneMsg">Saving.....</div> <div id="doneMsg<?php echo $nt.$ii; ?>" class="doneMsg">Done</div> 
  82. */ ?> 
  83. </div> 
  84.  
  85. </div> 
  86. <?php 
  87. //#### Set Unit Settings from POST 
  88. function setNTSettings($post, $options) { $code = 'TW'; $lcode = 'tw';  
  89. foreach ($post as $ii => $pval) {  
  90. if (isset($pval['apTWURL']) && $pval['apTWURL']!='') { if (!isset($options[$ii])) $options[$ii] = array(); 
  91. if (isset($pval['apDoTW'])) $options[$ii]['doTW'] = $pval['apDoTW']; else $options[$ii]['doTW'] = 0; 
  92. if (isset($pval['nName'])) $options[$ii]['nName'] = trim($pval['nName']); 
  93. if (isset($pval['apTWURL'])) $options[$ii]['twURL'] = trim($pval['apTWURL']); if ( substr($options[$ii]['twURL'], 0, 4)!='http' ) $options[$ii]['twURL'] = 'http://'.$options[$ii]['twURL']; 
  94. if (isset($pval['apTWConsKey'])) $options[$ii]['twConsKey'] = trim($pval['apTWConsKey']); 
  95. if (isset($pval['apTWConsSec'])) $options[$ii]['twConsSec'] = trim($pval['apTWConsSec']);  
  96. if (isset($pval['apTWAccToken'])) $options[$ii]['twAccToken'] = trim($pval['apTWAccToken']);  
  97.  
  98. if (isset($pval['catSel'])) $options[$ii]['catSel'] = trim($pval['catSel']); else $options[$ii]['catSel'] = 0; 
  99. if (isset($options[$ii]['catSel']) && $options[$ii]['catSel']=='1' && trim($pval['catSelEd'])!='') $options[$ii]['catSelEd'] = trim($pval['catSelEd']); else $options[$ii]['catSelEd'] = ''; 
  100.  
  101. if (isset($pval['riComments'])) $options[$ii]['riComments'] = $pval['riComments']; else $options[$ii]['riComments'] = 0; 
  102. if (isset($pval['riCommentsM'])) $options[$ii]['riCommentsM'] = $pval['riCommentsM']; else $options[$ii]['riCommentsM'] = 0; 
  103. if (isset($pval['riCommentsAA'])) $options[$ii]['riCommentsAA'] = $pval['riCommentsAA']; else $options[$ii]['riCommentsAA'] = 0; 
  104.  
  105. $options[$ii] = nxs_adjRpst($options[$ii], $pval); 
  106.  
  107. if (isset($pval['apTWAccTokenSec']))$options[$ii]['twAccTokenSec'] = trim($pval['apTWAccTokenSec']);  
  108. if (isset($pval['apTWMsgFrmt'])) $options[$ii]['twMsgFormat'] = trim($pval['apTWMsgFrmt']); 
  109. if (isset($pval['attchImg'])) $options[$ii]['attchImg'] = $pval['attchImg']; else $options[$ii]['attchImg'] = 0;  
  110. if (isset($pval['delayHrs'])) $options[$ii]['nHrs'] = trim($pval['delayHrs']); if (isset($pval['delayMin'])) $options[$ii]['nMin'] = trim($pval['delayMin']); if (isset($pval['delayDays'])) $options[$ii]['nDays'] = trim($pval['delayDays']);  
  111. if (isset($pval['qTLng'])) $options[$ii]['qTLng'] = trim($pval['qTLng']);  
  112. } elseif ( count($pval)==1 ) if (isset($pval['apDo'.$code])) $options[$ii]['do'.$code] = $pval['apDo'.$code]; else $options[$ii]['do'.$code] = 0;  
  113. } return $options; 
  114. }  
  115. //#### Show Post->Edit Meta Box Settings 
  116. function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'tw'; $ntU = 'TW'; 
  117. foreach($ntOpts as $ii=>$ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapTW', true)); if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii])) $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]);  
  118. if (empty($ntOpt['imgToUse'])) $ntOpt['imgToUse'] = ''; if (empty($ntOpt['urlToUse'])) $ntOpt['urlToUse'] = '';  
  119. $doTW = $ntOpt['doTW'] && (is_array($pMeta) || ($ntOpt['catSel']!='1' && empty($ntOpt['tagsSel']))); $imgToUse = $ntOpt['imgToUse'];  
  120. $isAvailTW = $ntOpt['twURL']!='' && $ntOpt['twConsKey']!='' && $ntOpt['twConsSec']!='' && $ntOpt['twAccToken']!=''; $twMsgFormat = htmlentities($ntOpt['twMsgFormat'], ENT_COMPAT, "UTF-8"); $isAttchImg = $ntOpt['attchImg'];  
  121. ?>  
  122. <tr><th style="text-align:left;" colspan="2"> 
  123. <?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 } ?> 
  124. <?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 } ?> 
  125. <?php if ($isAvailTW) { ?><input class="nxsGrpDoChb" value="1" id="doTW<?php echo $ii; ?>" <?php if ($post->post_status == "publish") echo 'disabled="disabled"';?> type="checkbox" name="tw[<?php echo $ii; ?>][doTW]" <?php if ((int)$doTW == 1) echo 'checked="checked" title="def"'; ?> />  
  126. <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="tw[<?php echo $ii; ?>][doTW]" value="<?php echo $doTW;?>"> <?php } ?> <?php } ?> 
  127. <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?>img/tw16.png);">Twitter - <?php _e('autopost to', 'social-networks-auto-poster-facebook-twitter-g') ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?></i>) 
  128. </div></th><td><?php //## Only show RePost button if the post is "published" 
  129. if ($post->post_status == "publish" && $isAvailTW) { ?> 
  130. <input alt="<?php echo $ii; ?>" style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToTW_repostButton" id="rePostToTW_button" value="<?php _e('Repost to Twitter', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  131.  
  132. <?php if ($ntOpt['riComments']=='1' && (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID']) && $pMeta[$ii]['pgID']!='' ) ) { ?> 
  133. <input alt="<?php echo $ii; ?>" style="float: right; " onclick="return false;" type="button" class="button" name="riToTW_repostButton" id="riToTW_button" value="<?php _e('Import Replies/Mentions from Twitter', 'social-networks-auto-poster-facebook-twitter-g') ?>" /> 
  134. <?php } } ?> 
  135. <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID'])) { ?> <span style="float: right;padding-top: 4px; padding-right: 10px;"> 
  136. <a id="pstdTW<?php echo $ii; ?>" style="font-size: 10px;" href="<?php echo $ntOpt['twURL'].'/status/'.$pMeta[$ii]['pgID']; ?>" target="_blank"><?php $nType="Twitter"; printf( __( 'Posted on', 'social-networks-auto-poster-facebook-twitter-g' ), $nType); ?> <?php echo (isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate']!='')?(" (".$pMeta[$ii]['pDate'].")"):""; ?></a> 
  137. </span><?php } ?> 
  138. </td></tr> 
  139.  
  140. <?php if (!$isAvailTW) { ?><tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your Twitter Account to AutoPost to Twitter</b> 
  141. <?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); } ?> 
  142.  
  143. <?php if ($ntOpt['rpstOn']=='1') { ?>  
  144.  
  145. <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> 
  146. <input value="0" type="hidden" name="tw[<?php echo $ii; ?>][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?>tw" type="checkbox" name="tw[<?php echo $ii; ?>][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) echo "checked"; ?> />  
  147. </th> 
  148. <td> <?php _e('Include in "Auto-Reposting" to this network.', 'social-networks-auto-poster-facebook-twitter-g') ?> 
  149. </td></tr> <?php } ?> 
  150.  
  151. <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"><?php _e('Message Format:', 'social-networks-auto-poster-facebook-twitter-g') ?></th> 
  152. <td><textarea cols="150" rows="2" id="tw<?php echo $ii; ?>SNAPformat" name="tw[<?php echo $ii; ?>][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#tw<?php echo $ii; ?>SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apTWMsgFrmt<?php echo $ii; ?>');"><?php echo $twMsgFormat ?></textarea>  
  153. </td></tr> 
  154.  
  155. <tr><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 5px; padding-right:10px;"> 
  156. <input value="0" type="hidden" name="tw[<?php echo $ii; ?>][attchImg]"/> 
  157. <input value="1" type="checkbox" name="tw[<?php echo $ii; ?>][attchImg]" <?php if ((int)$isAttchImg == 1) echo "checked"; ?> /> </th><td><strong>Attach Image to Twitter Post</strong></td> </tr>  
  158.  
  159. <?php /** ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); ?> 
  160.  
  161. <?php }  
  162. }  
  163. //####  
  164. function adjMetaOpt($optMt, $pMeta) { if (isset($pMeta['isPosted'])) $optMt['isPosted'] = $pMeta['isPosted']; else $optMt['isPosted'] = '';  
  165. if (isset($pMeta['SNAPformat'])) $optMt['twMsgFormat'] = $pMeta['SNAPformat'];  
  166. if (isset($pMeta['imgToUse'])) $optMt['imgToUse'] = $pMeta['imgToUse'];  
  167. if (isset($pMeta['timeToRun'])) $optMt['timeToRun'] = $pMeta['timeToRun']; if (isset($pMeta['rpstPostIncl'])) $optMt['rpstPostIncl'] = $pMeta['rpstPostIncl'];  
  168. if (isset($pMeta['attchImg'])) $optMt['attchImg'] = $pMeta['attchImg'] == 1?1:0; else { if (isset($pMeta['attchImg'])) $optMt['attchImg'] = 0; }  
  169. if (isset($pMeta['doTW'])) $optMt['doTW'] = $pMeta['doTW'] == 1?1:0; else { if (isset($pMeta['SNAPformat'])) $optMt['doTW'] = 0; }  
  170. if (isset($pMeta['SNAPincludeTW']) && $pMeta['SNAPincludeTW'] == '1' ) $optMt['doTW'] = 1; // <2.6 Compatibility fix  
  171. return $optMt; 
  172. }}