function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = $this->ntInfo['lcode']; $ntU = $this->ntInfo['code']; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snap' . $ntU, true)); if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii])) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } $doIT = $ntOpt['do' . $ntU] && (is_array($pMeta) || $ntOpt['catSel'] != '1'); $imgToUse = $ntOpt['imgToUse']; $isAvail = $ntOpt['appKey'] != '' && $ntOpt['appSec'] != ''; $msgFormat = htmlentities($ntOpt['msgFrmt'], ENT_COMPAT, "UTF-8"); $msgFormatT = htmlentities($ntOpt['msgTFrmt'], ENT_COMPAT, "UTF-8"); ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvail) { ?> <input type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][do<?php echo $ntU; ?> ]" value="<?php echo $post->post_status == "publish" ? $doIT : '0'; ?> "> <input class="nxsGrpDoChb" value="1" id="do<?php echo $ntU . $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][do<?php echo $ntU; ?> ]" <?php if ((int) $doIT == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/<?php echo $nt; ?> 16.png);"><?php echo $this->ntInfo['name']; ?> - <?php _e('publish to', 'nxs_snap'); ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?> </i>)</div></th> <td><?php //## Only show RePost button if the post is "published" if ($post->post_status == "publish" && $isAvail) { ?> <input alt="<?php echo $ii; ?> " style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostTo<?php echo $ntU; ?> _repostButton" id="rePostTo<?php echo $ntU; ?> _button" value="<?php _e('Repost to ' . $this->ntInfo['name'], 'nxs_snap'); ?> " /> <?php } ?> <?php if (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID'])) { ?> <span id="pstd<?php echo $ntU; echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="<?php echo $pMeta[$ii]['postURL']; ?> " target="_blank"><?php $nType = $this->ntInfo['name']; printf(__('Posted on', 'nxs_snap'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?php if (!$isAvail) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your <?php echo $this->ntInfo['name']; ?> Account to AutoPost to <?php echo $this->ntInfo['name']; ?> </b></td></tr> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <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"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'nxs_snap'); ?> </td></tr> <?php } ?> <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:', 'NS_SPAP'); ?> </th> <td><input value="<?php echo $msgFormatT; ?> " type="text" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][msgTFrmt]" style="width:60%;max-width: 610px;" onfocus="jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('msgFrmtT<?php echo $nt . $ii; ?> ');"/><?php nxs_doShowHint("msgFrmtT" . $nt . $ii, '', '58'); ?> </td></tr> <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:', 'nxs_snap'); ?> </th><td> <textarea cols="150" rows="1" id="<?php echo $nt . $ii; ?> msgFrmt" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][msgFrmt]" style="width:60%;max-width: 610px;" onfocus="jQuery('#<?php echo $nt . $ii; ?> msgFrmt').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('msgFrmt<?php echo $nt . $ii; ?> ');"><?php echo $msgFormat; ?> </textarea> <?php nxs_doShowHint("msgFrmt" . $nt . $ii, '', '58'); ?> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); ?> <?php } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'li'; $ntU = 'LI'; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapLI', true)); if (is_array($pMeta) && isset($pMeta[$ii])) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } if (empty($ntOpt['catSel'])) { $ntOpt['catSel'] = ''; } $doLI = $ntOpt['doLI'] && (is_array($pMeta) || $ntOpt['catSel'] != '1'); $imgToUse = $ntOpt['imgToUse']; $urlToUse = $ntOpt['urlToUse']; $isAvailLI = isset($ntOpt['liOAuthVerifier']) && $ntOpt['liOAuthVerifier'] != '' && $ntOpt['liAccessTokenSecret'] != '' && $ntOpt['liAccessToken'] != '' && $ntOpt['liAPIKey'] != '' || $ntOpt['ulName'] !== '' && $ntOpt['uPass'] !== ''; $liMsgFormat = htmlentities($ntOpt['liMsgFormat'], ENT_COMPAT, "UTF-8"); $liMsgFormatT = htmlentities($ntOpt['liMsgFormatT'], ENT_COMPAT, "UTF-8"); ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvailLI) { ?> <input class="nxsGrpDoChb" value="1" id="doLI<?php echo $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="li[<?php echo $ii; ?> ][doLI]" <?php if ((int) $doLI == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="li[<?php echo $ii; ?> ][doLI]" value="<?php echo $doLI; ?> "> <?php } ?> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/li16.png);">LinkedIn - <?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" if ($post->post_status == "publish" && $isAvailLI) { ?> <input alt="<?php echo $ii; ?> " style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToLI_repostButton" id="rePostToLI_button" value="<?php _e('Repost to LinkedIn', 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <?php } ?> <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID'])) { // prr($pMeta[$ii]); ?> <span id="pstdLI<?php echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="<?php if ($pMeta[$ii]['postURL'] != '') { echo $pMeta[$ii]['postURL']; } elseif ($ntOpt['uPage'] != '') { echo $ntOpt['uPage']; } else { } ?> " target="_blank"><?php $nType = "LinkedIn"; printf(__('Posted on', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?php if (!$isAvailLI) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your LinkedIn Account to AutoPost to LinkedIn</b> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <input value="0" type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?> li" type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) { echo "checked"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'social-networks-auto-poster-facebook-twitter-g'); ?> </td></tr> <?php } ?> <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> <input type="radio" name="li[<?php echo $ii; ?> ][postType]" value="T" <?php if ($ntOpt['postType'] == 'T') { echo 'checked="checked"'; } ?> /><?php _e('Text Post', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('just text message', 'social-networks-auto-poster-facebook-twitter-g'); ?> </i><br/> <span class="nxs_li_nxapi_<?php echo $ii; ?> " style="display: <?php echo !empty($ntOpt['apiToUse']) && $ntOpt['apiToUse'] == 'nx' ? "block" : "none"; ?> ;"> <input type="radio" name="li[<?php echo $ii; ?> ][postType]" value="I" <?php if ($ntOpt['postType'] == 'I') { echo 'checked="checked"'; } ?> onchange="jQuery('#altFormatIMG<?php echo $nt . $ii; ?> ').show();" /> <?php _e('Post to LinkedIn as "Image post"', 'social-networks-auto-poster-facebook-twitter-g'); ?> - <i><?php _e('big image with text message', 'social-networks-auto-poster-facebook-twitter-g'); ?> </i><br/> </span> <input type="radio" name="li[<?php echo $ii; ?> ][postType]" value="A" <?php if (!isset($ntOpt['postType']) || $ntOpt['postType'] == '' || $ntOpt['postType'] == 'A') { echo 'checked="checked"'; } ?> onchange="jQuery('#altFormatIMG<?php echo $nt . $ii; ?> ').hide();" /><?php _e('Text Post with "attached" blogpost', 'social-networks-auto-poster-facebook-twitter-g'); ?> </td></tr> <tr id="altFormat1" style=""><th scope="row" style="vertical-align:top; padding-top: 6px; text-align:right; width:60px; padding-right:10px;"><?php _e('Message Format:', 'social-networks-auto-poster-facebook-twitter-g'); ?> </th> <td> <textarea cols="150" rows="1" id="li<?php echo $ii; ?> SNAPformat" name="li[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#li<?php echo $ii; ?> SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apLIMsgFrmt<?php echo $ii; ?> ');"><?php echo $liMsgFormat; ?> </textarea> <?php nxs_doShowHint("apLIMsgFrmt" . $ii); ?> </td></tr> <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 (Groups Only):', 'social-networks-auto-poster-facebook-twitter-g'); ?> </th> <td><input value="<?php echo $liMsgFormatT; ?> " type="text" name="li[<?php echo $ii; ?> ][SNAPformatT]" style="width:60%;max-width: 610px;" onfocus="jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apLIMsgFrmtT<?php echo $ii; ?> ');"/><?php nxs_doShowHint("apLIMsgFrmtT" . $ii, '', '58'); ?> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); nxs_showURLToUseDlg($nt, $ii, $urlToUse); ?> <?php } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'tr'; $ntU = 'TR'; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapTR', true)); // prr($ntOpts); echo "~~~~~~~~~~~~~~~~"; prr($pMeta); echo "#######"; if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii])) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } if (empty($ntOpt['trMsgTFormat'])) { $ntOpt['trMsgTFormat'] = ''; } $doTR = $ntOpt['doTR'] && (is_array($pMeta) || (is_array($pMeta) || $ntOpt['catSel'] != '1')); $imgToUse = $ntOpt['imgToUse']; $urlToUse = $ntOpt['urlToUse']; $isAvailTR = isset($ntOpt['trAccessTocken']) && isset($ntOpt['trAccessTocken']['oauth_token_secret']) && $ntOpt['trAccessTocken']['oauth_token_secret'] !== ''; $trMsgFormat = htmlentities($ntOpt['trMsgFormat'], ENT_COMPAT, "UTF-8"); $trMsgTFormat = htmlentities($ntOpt['trMsgTFormat'], ENT_COMPAT, "UTF-8"); ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvailTR) { ?> <input class="nxsGrpDoChb" value="1" id="doTR<?php echo $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="tr[<?php echo $ii; ?> ][doTR]" <?php if ((int) $doTR == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="tr[<?php echo $ii; ?> ][doTR]" value="<?php echo $doTR; ?> "> <?php } ?> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/tr16.png);">Tumblr - <?php _e('publish to', 'nxs_snap'); ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?> </i>) </div></th><td><?php //## Only show RePost button if the post is "published" if ($post->post_status == "publish" && $isAvailTR) { ?> <input alt="<?php echo $ii; ?> " style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;"Z type="button" class="button" name="rePostToTR_repostButton" id="rePostToTR_button" value="<?php _e('Repost to Tumblr', 'nxs_snap'); ?> " /> <?php } ?> <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID'])) { ?> <span id="pstdTR<?php echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="<?php echo $ntOpt['trURL']; ?> post/<?php echo $pMeta[$ii]['pgID']; ?> " target="_blank"><?php $nType = "Tumblr"; printf(__('Posted on', 'nxs_snap'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?php if (!$isAvailTR) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup and authorize your Tumblr Account to AutoPost to Tumblr</b> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <input value="0" type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?> tr" type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) { echo "checked"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'nxs_snap'); ?> </td></tr> <?php } ?> <tr id="altFormat1" style=""><th scope="row" style="text-align:right; width:60px; padding-right:10px;"> <input type="radio" name="tr[<?php echo $ii; ?> ][apTRPostType]" value="T" <?php if ($ntOpt['trPostType'] != 'I') { echo 'checked="checked"'; } ?> /> <br/> </th> <td><b><?php _e('Text Post. Title Format:', 'nxs_snap'); ?> </b> <input value="<?php echo $trMsgTFormat; ?> " type="text" name="tr[<?php echo $ii; ?> ][SNAPTformat]" style="width:270px;" onfocus="jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apTRTMsgFrmt<?php echo $ii; ?> ');"/> <?php nxs_doShowHint("apTRTMsgFrmt" . $ii); ?> </td></tr> <tr id="altFormat1" style=""><th scope="row" style="text-align:right; width:60px; padding-right:10px;"> <input type="radio" name="tr[<?php echo $ii; ?> ][apTRPostType]" value="I" <?php if ($ntOpt['trPostType'] == 'I') { echo 'checked="checked"'; } ?> /> <br/> </th> <td><b>Image Post</b> <input type="radio" name="tr[<?php echo $ii; ?> ][apTRPostType]" value="V" <?php if ($ntOpt['trPostType'] == 'V') { echo 'checked="checked"'; } ?> /> <b>Video Post</b> <?php nxs_doShowHint("apTRTMsgFrmt" . $ii); ?> <input type="radio" name="tr[<?php echo $ii; ?> ][apTRPostType]" value="U" <?php if ($ntOpt['trPostType'] == 'U') { echo 'checked="checked"'; } ?> /> <b>Audio Post</b> <?php nxs_doShowHint("apTRTMsgFrmt" . $ii); ?> </td></tr> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"><?php _e('Text Format:', 'nxs_snap'); ?> </th> <td> <textarea cols="150" rows="1" id="tr<?php echo $ii; ?> SNAPformat" name="tr[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#tr<?php echo $ii; ?> SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apTRMsgFrmt<?php echo $ii; ?> ');"><?php echo $trMsgFormat; ?> </textarea> <?php nxs_doShowHint("apTRMsgFrmt" . $ii); ?> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); nxs_showURLToUseDlg($nt, $ii, $urlToUse); ?> <?php } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'vk'; $ntU = 'VK'; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapVK', true)); if (is_array($pMeta)) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } $doVK = $ntOpt['doVK'] && (is_array($pMeta) || $ntOpt['catSel'] != '1'); $imgToUse = $ntOpt['imgToUse']; $urlToUse = $ntOpt['urlToUse']; $isAvailVK = $ntOpt['url'] != '' && $ntOpt['vkAppID'] != '' || $ntOpt['uPass'] != ''; $isAttachVK = $ntOpt['attch']; $msgFrmt = htmlentities($ntOpt['msgFrmt'], ENT_COMPAT, "UTF-8"); $postType = $ntOpt['postType']; ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvailVK) { ?> <input class="nxsGrpDoChb" value="1" id="doVK<?php echo $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="vk[<?php echo $ii; ?> ][doVK]" <?php if ((int) $doVK == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="vk[<?php echo $ii; ?> ][doVK]" value="<?php echo $doVK; ?> "> <?php } ?> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/vk16.png);">vKontakte(VK) - <?php _e('publish to', 'nxs_snap'); ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?> </i>)</div></th> <td><?php //## Only show RePost button if the post is "published" if ($post->post_status == "publish" && $isAvailVK) { ?> <input alt="<?php echo $ii; ?> " style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToVK_repostButton" id="rePostToVK_button" value="<?php _e('Repost to vKontakte(VK)', 'nxs_snap'); ?> " /> <?php } ?> <?php if (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID'])) { ?> <span id="pstdVK<?php echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="http://vk.com/wall<?php echo $pMeta[$ii]['pgID']; ?> " target="_blank"><?php $nType = "vKontakte(VK)"; printf(__('Posted on', 'nxs_snap'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span> <?php } ?> </td></tr> <?php if (!$isAvailVK) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup and Authorize your vKontakte(VK) Account to AutoPost to vKontakte(VK)</b> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <input value="0" type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?> vk" type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) { echo "checked"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'nxs_snap'); ?> </td></tr> <?php } ?> <tr id="altFormat1" style=""><th scope="row" valign="top" class="nxsTHRow"><?php _e('Message Format:', 'nxs_snap'); ?> </th> <td> <textarea cols="150" rows="1" id="vk<?php echo $ii; ?> SNAPformat" name="vk[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#vk<?php echo $ii; ?> SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apVKTMsgFrmt<?php echo $ii; ?> ');"><?php echo $msgFrmt; ?> </textarea> <?php nxs_doShowHint("apVKTMsgFrmt" . $ii); ?> <br/><div ><input value="0" type="hidden" name="vk[<?php echo $ii; ?> ][addBackLink]" /> <input value="1" type="checkbox" name="vk[<?php echo $ii; ?> ][addBackLink]" <?php if (isset($ntOpt['addBackLink']) && (int) $ntOpt['addBackLink'] == 1) { echo "checked"; } ?> /> <?php _e('Add backlink to the post', 'nxs_snap'); ?> </div> </td></tr> <tr><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'nxs_snap'); ?> <br/> (<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo $ii; ?> VKX');" onmouseover="showPopShAtt('<?php echo $ii; ?> VKX', event);" onclick="return false;" class="underdash" href="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>)</th><td> <input type="radio" name="vk[<?php echo $ii; ?> ][PostType]" value="T" <?php if ($postType == 'T') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post', 'nxs_snap'); ?> - <i><?php _e('just text message', 'nxs_snap'); ?> </i><br/> <input type="radio" name="vk[<?php echo $ii; ?> ][PostType]" value="I" <?php if ($postType == 'I') { echo 'checked="checked"'; } ?> /> <?php _e('Image Post', 'nxs_snap'); ?> - <i><?php _e('big image with text message', 'nxs_snap'); ?> </i> <?php if (function_exists("nxs_doPostToVK")) { ?> <br/> <input type="radio" name="vk[<?php echo $ii; ?> ][PostType]" value="A" <?php if (!isset($postType) || $postType == '' || $postType == 'A') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post with "attached" blogpost', 'nxs_snap'); ?> <?php } ?> <br/><div class="popShAtt" id="popShAtt<?php echo $ii; ?> VKX"><h3>vKontakte(VK) <?php _e('Post Types', 'nxs_snap'); ?> </h3><img src="<?php echo $nxs_plurl; ?> img/vkPostTypesDiff6.png" width="600" height="257" alt="<?php _e('Post Types', 'nxs_snap'); ?> "/></div> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); nxs_showURLToUseDlg($nt, $ii, $urlToUse); ?> <?php } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'pn'; $ntU = 'PN'; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapPN', true)); if (is_array($pMeta)) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } $doPN = $ntOpt['doPN'] && (is_array($pMeta) || $ntOpt['catSel'] != '1'); $imgToUse = $ntOpt['imgToUse']; $urlToUse = $ntOpt['urlToUse']; $isAvailPN = $ntOpt['pnUName'] != '' && $ntOpt['pnPass'] != ''; $pnMsgFormat = htmlentities($ntOpt['pnMsgFormat'], ENT_COMPAT, "UTF-8"); ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvailPN) { ?> <input class="nxsGrpDoChb" value="1" id="doPN<?php echo $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="pn[<?php echo $ii; ?> ][doPN]" <?php if ((int) $doPN == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="pn[<?php echo $ii; ?> ][doPN]" value="<?php echo $doPN; ?> "> <?php } ?> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/pn16.png);">Pinterest - <?php _e('publish to', 'nxs_snap'); ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?> </i>)</div></th> <td><?php //## Only show RePost button if the post is "published" if ($post->post_status == "publish" && $isAvailPN) { ?> <input alt="<?php echo $ii; ?> " style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToPN_repostButton" id="rePostToPN_button" value="<?php _e('Repost to Pinterest', 'nxs_snap'); ?> " /> <?php } ?> <?php if (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['postURL'])) { ?> <span id="pstdPN<?php echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="<?php echo $pMeta[$ii]['postURL']; ?> " target="_blank"><?php $nType = "Pinterest"; printf(__('Posted on', 'nxs_snap'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?php if (!$isAvailPN) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your Pinterest Account to AutoPost to Pinterest</b> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <input value="0" type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?> pn" type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) { echo "checked"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'nxs_snap'); ?> </td></tr> <?php } ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;">Select Board</th> <td><select name="pn[<?php echo $ii; ?> ][apPNBoard]" id="apPNBoard"> <?php if (!empty($ntOpt['pnBoardsList'])) { $gPNBoards = $ntOpt['pnBoardsList']; if (base64_encode(base64_decode($gPNBoards)) === $gPNBoards) { $gPNBoards = base64_decode($gPNBoards); } if ($ntOpt['pnBoard'] != '') { $gPNBoards = str_replace($ntOpt['pnBoard'] . '"', $ntOpt['pnBoard'] . '" selected="selected"', $gPNBoards); } echo $gPNBoards; } else { ?> <option value="0">None(Click above to retrieve your boards)</option> <?php } ?> </select></td> </tr> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"><?php _e('Text Message Format:', 'nxs_snap'); ?> </th> <td> <textarea cols="150" rows="1" id="pn<?php echo $ii; ?> SNAPformat" name="pn[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#pn<?php echo $ii; ?> SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apPNMsgFrmt<?php echo $ii; ?> ');"><?php echo $pnMsgFormat; ?> </textarea> <?php nxs_doShowHint("apPNMsgFrmt" . $ii); ?> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); nxs_showURLToUseDlg($nt, $ii, $urlToUse); ?> <?php } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'fb'; $ntU = 'FB'; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapFB', true)); if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii])) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['postType']) && !empty($ntOpt['fbPostType'])) { $ntOpt['postType'] = $ntOpt['fbPostType']; unset($ntOpt['fbPostType']); } //## Compatibility with ver <3.2 if (empty($ntOpt['postType']) && !empty($ntOpt['PostType'])) { $pt = $ntOpt['PostType']; unset($ntOpt['PostType']); $ntOpt['postType'] = $pt; } //## Compatibility with ver <3.2 if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } $doFB = $ntOpt['doFB'] && (is_array($pMeta) || $ntOpt['catSel'] != '1'); $imgToUse = $ntOpt['imgToUse']; $urlToUse = $ntOpt['urlToUse']; $isAvailFB = $ntOpt['fbURL'] != '' && $ntOpt['fbAppID'] != '' && $ntOpt['fbAppSec'] != ''; $isAttachFB = $ntOpt['fbAttch']; $fbMsgFormat = htmlentities($ntOpt['fbMsgFormat'], ENT_COMPAT, "UTF-8"); $fbPostType = $ntOpt['postType']; ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvailFB) { ?> <input class="nxsGrpDoChb" value="1" id="doFB<?php echo $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="fb[<?php echo $ii; ?> ][doFB]" <?php if ((int) $doFB == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="fb[<?php echo $ii; ?> ][doFB]" value="<?php echo $doFB; ?> "> <?php } ?> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/fb16.png);">Facebook - <?php _e('publish to', 'nxs_snap'); ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?> </i>)</div></th><td><?php //## Only show RePost button if the post is "published" if ($post->post_status == "publish" && $isAvailFB) { ?> <input alt="<?php echo $ii; ?> " style="float: right;margin-left: 10px" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToFB_repostButton" id="rePostToFB_button" value="<?php _e('Repost to Facebook', 'nxs_snap'); ?> " /> <?php if ($ntOpt['riComments'] == '1' && (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID']) && strpos($pMeta[$ii]['pgID'], '_') !== false)) { ?> <input alt="<?php echo $ii; ?> " style="float: right; " onclick="return false;" type="button" class="button" name="riToFB_repostButton" id="riToFB_button" value="<?php _e('Import Comments from Facebook', 'nxs_snap'); ?> " /> <?php } ?> <?php } ?> <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID']) && strpos($pMeta[$ii]['pgID'], '_') !== false) { $pid = explode('_', $pMeta[$ii]['pgID']); ?> <span id="pstdFB<?php echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="http://www.facebook.com/permalink.php?story_fbid=<?php echo $pid[1] . '&id=' . $pid[0]; ?> " target="_blank"><?php $nType = "Facebook"; printf(__('Posted on', 'nxs_snap'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?php if (!$isAvailFB) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup and Authorize your Facebook Account to AutoPost to Facebook</b> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <input value="0" type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?> fb" type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) { echo "checked"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'nxs_snap'); ?> </td></tr> <?php } ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"> <b></b> </th> <td></td> </tr> <tr><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'nxs_snap'); ?> <br/> (<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo $ii; ?> X');" onmouseover="showPopShAtt('<?php echo $ii; ?> X', event);" onclick="return false;" class="underdash" href="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>)</th><td> <input type="radio" name="fb[<?php echo $ii; ?> ][postType]" value="T" <?php if ($fbPostType == 'T') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post', 'nxs_snap'); ?> - <i><?php _e('just text message', 'nxs_snap'); ?> </i><br/> <input type="radio" name="fb[<?php echo $ii; ?> ][postType]" value="I" <?php if ($fbPostType == 'I') { echo 'checked="checked"'; } ?> /> <?php _e('Image Post', 'nxs_snap'); ?> - <i><?php _e('big image with text message', 'nxs_snap'); ?> </i><br/> <input type="radio" name="fb[<?php echo $ii; ?> ][postType]" value="A" <?php if (!isset($fbPostType) || $fbPostType == '' || $fbPostType == 'A') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post with "attached" blogpost', 'nxs_snap'); ?> <-- (<a id="showShAtt" onmouseout="hidePopShAtt('<?php echo $ii; ?> ');" onmouseover="showPopShAtt('<?php echo $ii; ?> ', event);" onclick="return false;" class="underdash" href="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>) <br/> <div style="width:100%; margin-left: 25px;"><strong><?php _e('Link attachment type:', 'nxs_snap'); ?> </strong> <input value="2" id="apFBAttchShare<?php echo $ii; ?> " onchange="doSwitchShAtt(0,<?php echo $ii; ?> );" type="radio" name="fb[<?php echo $ii; ?> ][AttachPost]" <?php if ((int) $isAttachFB == 2) { echo "checked"; } ?> /> <?php _e('Share a link to your blogpost', 'nxs_snap'); ?> .. <?php _e('or', 'nxs_snap'); ?> .. <input value="1" id="apFBAttch<?php echo $ii; ?> " onchange="doSwitchShAtt(1,<?php echo $ii; ?> );" type="radio" name="fb[<?php echo $ii; ?> ][AttachPost]" <?php if ((int) $isAttachFB == 1) { echo "checked"; } ?> /> <?php _e('Attach your blogpost', 'nxs_snap'); ?> </div> <div class="popShAtt" id="popShAtt<?php echo $ii; ?> "><h3><?php _e('Two ways of attaching post on Facebook', 'nxs_snap'); ?> </h3> <img src="<?php echo $nxs_plurl; ?> img/fb2wops.png" width="600" height="257" alt="<?php _e('Two ways of attaching post on Facebook', 'nxs_snap'); ?> "/></div> <div class="popShAtt" id="popShAtt<?php echo $ii; ?> X"><h3><?php _e('Facebook Post Types', 'nxs_snap'); ?> </h3><img src="<?php echo $nxs_plurl; ?> img/fbPostTypesDiff6.png" width="600" height="398" alt="<?php _e('Facebook Post Types', 'nxs_snap'); ?> "/></div> </td></tr> <tr id="altFormat1" style=""><th scope="row" style="vertical-align:top; padding-top: 6px; text-align:right; width:60px; padding-right:10px;"><?php _e('Message Format:', 'nxs_snap'); ?> </th> <td> <?php if (1 == 1) { ?> <textarea cols="150" rows="2" id="fb<?php echo $ii; ?> SNAPformat" name="fb[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#fb<?php echo $ii; ?> SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apFBTMsgFrmt<?php echo $ii; ?> ');"><?php echo $fbMsgFormat; ?> </textarea> <?php } else { ?> <input value="<?php echo $fbMsgFormat; ?> " type="text" name="fb[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apFBTMsgFrmt<?php echo $ii; ?> ');"/><?php nxs_doShowHint("apFBTMsgFrmt" . $ii, '', '58'); ?> <?php } ?> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); nxs_showURLToUseDlg($nt, $ii, $urlToUse); } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'tw'; $ntU = 'TW'; 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]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } $doTW = $ntOpt['doTW'] && (is_array($pMeta) || $ntOpt['catSel'] != '1' && empty($ntOpt['tagsSel'])); $imgToUse = $ntOpt['imgToUse']; $isAvailTW = $ntOpt['twURL'] != '' && $ntOpt['twConsKey'] != '' && $ntOpt['twConsSec'] != '' && $ntOpt['twAccToken'] != ''; $twMsgFormat = htmlentities($ntOpt['twMsgFormat'], ENT_COMPAT, "UTF-8"); $isAttchImg = $ntOpt['attchImg']; ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?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"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="tw[<?php echo $ii; ?> ][doTW]" value="<?php echo $doTW; ?> "> <?php } ?> <?php } ?> <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', 'nxs_snap'); ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?> </i>) </div></th><td><?php //## Only show RePost button if the post is "published" if ($post->post_status == "publish" && $isAvailTW) { ?> <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', 'nxs_snap'); ?> " /> <?php if ($ntOpt['riComments'] == '1' && (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID']) && $pMeta[$ii]['pgID'] != '')) { ?> <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', 'nxs_snap'); ?> " /> <?php } } ?> <?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;"> <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', 'nxs_snap'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?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> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <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"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'nxs_snap'); ?> </td></tr> <?php } ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"><?php _e('Message Format:', 'nxs_snap'); ?> </th> <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> </td></tr> <tr><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 5px; padding-right:10px;"> <input value="0" type="hidden" name="tw[<?php echo $ii; ?> ][attchImg]"/> <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> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); ?> <?php } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'wp'; $ntU = 'WP'; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapWP', true)); if (!empty($pMeta) && is_array($pMeta)) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } $doWP = $ntOpt['doWP'] && (is_array($pMeta) || $ntOpt['catSel'] != '1'); $imgToUse = $ntOpt['imgToUse']; $isAvailWP = $ntOpt['wpUName'] != '' && $ntOpt['wpPass'] != ''; $wpMsgFormat = htmlentities($ntOpt['wpMsgFormat'], ENT_COMPAT, "UTF-8"); $wpMsgTFormat = htmlentities($ntOpt['wpMsgTFormat'], ENT_COMPAT, "UTF-8"); ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvailWP) { ?> <input class="nxsGrpDoChb" value="1" id="doWP<?php echo $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="wp[<?php echo $ii; ?> ][doWP]" <?php if ((int) $doWP == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="wp[<?php echo $ii; ?> ][doWP]" value="<?php echo $doWP; ?> "> <?php } ?> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/wp16.png);">WP Blog - <?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" if ($post->post_status == "publish" && $isAvailWP) { ?> <input alt="<?php echo $ii; ?> " style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToWP_repostButton" id="rePostToWP_button" value="<?php _e('Repost to WP Blog', 'social-networks-auto-poster-facebook-twitter-g'); ?> " /> <?php } ?> <?php if (is_array($pMeta) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID'])) { $wpURL = str_ireplace('/xmlrpc.php', '', $ntOpt['wpURL']); if (substr($wpURL, -1) == '/') { $wpURL = substr($wpURL, 0, -1); } $wpURL = $wpURL . "/"; ?> <span id="pstdWP<?php echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="<?php echo $wpURL; ?> ?p=<?php echo $pMeta[$ii]['pgID']; ?> " target="_blank"><?php $nType = "Wordpress Blog"; printf(__('Posted on', 'social-networks-auto-poster-facebook-twitter-g'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?php if (!$isAvailWP) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your WP Blog Account to AutoPost to WP Blogs</b> <?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); } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <input value="0" type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?> wp" type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) { echo "checked"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'social-networks-auto-poster-facebook-twitter-g'); ?> </td></tr> <?php } ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"><?php _e('Title Format:', 'social-networks-auto-poster-facebook-twitter-g'); ?> </th> <td><input value="<?php echo $wpMsgTFormat; ?> " type="text" name="wp[<?php echo $ii; ?> ][SNAPformatT]" style="width:60%;max-width: 610px;" onfocus="jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apWPTMsgFrmt<?php echo $ii; ?> ');"/><?php nxs_doShowHint("apWPTMsgFrmt" . $ii); ?> </td></tr> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"><?php _e('Text Format:', 'social-networks-auto-poster-facebook-twitter-g'); ?> </th> <td> <textarea cols="150" rows="1" id="wp<?php echo $ii; ?> SNAPformat" name="wp[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#wp<?php echo $ii; ?> SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apWPMsgFrmt<?php echo $ii; ?> ');"><?php echo $wpMsgFormat; ?> </textarea> <?php nxs_doShowHint("apWPMsgFrmt" . $ii); ?> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse); ?> <?php } } }
function showEdPostNTSettings($ntOpts, $post) { global $nxs_plurl; $post_id = $post->ID; $nt = 'gp'; $ntU = 'GP'; foreach ($ntOpts as $ii => $ntOpt) { $pMeta = maybe_unserialize(get_post_meta($post_id, 'snapGP', true)); if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii])) { $ntOpt = $this->adjMetaOpt($ntOpt, $pMeta[$ii]); } if (empty($ntOpt['imgToUse'])) { $ntOpt['imgToUse'] = ''; } if (empty($ntOpt['urlToUse'])) { $ntOpt['urlToUse'] = ''; } $doGP = $ntOpt['doGP'] && (is_array($pMeta) || $ntOpt['catSel'] != '1'); $imgToUse = $ntOpt['imgToUse']; $urlToUse = $ntOpt['urlToUse']; $isAvailGP = $ntOpt['gpUName'] != '' && $ntOpt['gpPass'] != ''; $gpMsgFormat = htmlentities($ntOpt['gpMsgFormat'], ENT_COMPAT, "UTF-8"); if (!isset($ntOpt['postType']) || $ntOpt['postType'] == '') { if ((int) $ntOpt['imgPost'] == 1) { $ntOpt['postType'] = 'I'; } if ((int) $ntOpt['gpAttch'] == 1 || $isNew) { $ntOpt['postType'] = 'A'; } } $gpPostType = $ntOpt['postType']; ?> <tr><th style="text-align:left;" colspan="2"> <?php if ($ntOpt['catSel'] == '1' && trim($ntOpt['catSelEd']) != '') { ?> <input type="hidden" class="nxs_SC" id="nxs_SC_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['catSelEd']; ?> " /> <?php } ?> <?php if (!empty($ntOpt['tagsSelX'])) { ?> <input type="hidden" class="nxs_TG" id="nxs_TG_<?php echo $ntU; echo $ii; ?> " value="<?php echo $ntOpt['tagsSelX']; ?> " /> <?php } ?> <?php if ($isAvailGP) { ?> <input class="nxsGrpDoChb" value="1" id="doGP<?php echo $ii; ?> " <?php if ($post->post_status == "publish") { echo 'disabled="disabled"'; } ?> type="checkbox" name="gp[<?php echo $ii; ?> ][doGP]" <?php if ((int) $doGP == 1) { echo 'checked="checked" title="def"'; } ?> /> <?php if ($post->post_status == "publish") { ?> <input type="hidden" name="gp[<?php echo $ii; ?> ][doGP]" value="<?php echo $doGP; ?> "> <?php } ?> <?php } ?> <div class="nsx_iconedTitle" style="display: inline; font-size: 13px; background-image: url(<?php echo $nxs_plurl; ?> img/gp16.png);">Google+ - <?php _e('publish to', 'nxs_snap'); ?> (<i style="color: #005800;"><?php echo $ntOpt['nName']; ?> </i>)</div></th> <td><?php //## Only show RePost button if the post is "published" if ($post->post_status == "publish" && $isAvailGP) { ?> <input alt="<?php echo $ii; ?> " style="float: right;" onmouseout="hidePopShAtt('SV');" onmouseover="showPopShAtt('SV', event);" onclick="return false;" type="button" class="button" name="rePostToGP_repostButton" id="rePostToGP_button" value="<?php _e('Repost to Google+', 'nxs_snap'); ?> " /> <?php } ?> <?php if (is_array($pMeta) && isset($pMeta[$ii]) && is_array($pMeta[$ii]) && isset($pMeta[$ii]['pgID'])) { ?> <span id="pstdGP<?php echo $ii; ?> " style="float: right;padding-top: 4px; padding-right: 10px;"> <a style="font-size: 10px;" href="https://plus.google.com/<?php echo $pMeta[$ii]['pgID']; ?> " target="_blank"><?php $nType = "Google+"; printf(__('Posted on', 'nxs_snap'), $nType); ?> <?php echo isset($pMeta[$ii]['pDate']) && $pMeta[$ii]['pDate'] != '' ? " (" . $pMeta[$ii]['pDate'] . ")" : ""; ?> </a> </span><?php } ?> </td></tr> <?php if (!$isAvailGP) { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;"></th> <td><b>Setup your Google+ Account to AutoPost to Google+</b> <?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); } if ((int) $doGP == 1 && $post->post_status == "publish" && isset($ntOpt['timeToRun']) && $ntOpt['timeToRun'] > time()) { ?> <tr><th style="text-align:left; color: purple;" colspan="2"> ===>>>> <?php _e('Autopost has been schedulled for', 'nxs_snap'); ?> <?php echo date('F j, Y, g:i a', $ntOpt['timeToRun']); ?> </th> <?php } ?> <?php if ($ntOpt['rpstOn'] == '1') { ?> <tr id="altFormat1" style=""><th scope="row" class="nxsTHRow"> <input value="0" type="hidden" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]"/><input value="nxsi<?php echo $ii; ?> gp" type="checkbox" name="<?php echo $nt; ?> [<?php echo $ii; ?> ][rpstPostIncl]" <?php if (!empty($ntOpt['rpstPostIncl'])) { echo "checked"; } ?> /> </th> <td> <?php _e('Include in "Auto-Reposting" to this network.', 'nxs_snap'); ?> </td></tr> <?php } ?> <tr><th scope="row" style="text-align:right; width:150px; vertical-align:top; padding-top: 0px; padding-right:10px;"> <?php _e('Post Type:', 'nxs_snap'); ?> <br/> (<a id="showShAtt" style="font-weight: normal" onmouseout="hidePopShAtt('<?php echo $ii; ?> XG');" onmouseover="showPopShAtt('<?php echo $ii; ?> XG', event);" onclick="return false;" class="underdash" href="http://www.nextscripts.com/blog/"><?php _e('What\'s the difference?', 'nxs_snap'); ?> </a>) </th><td> <input type="radio" name="gp[<?php echo $ii; ?> ][postType]" value="T" <?php if ($gpPostType == 'T') { echo 'checked="checked"'; } ?> /> <?php _e('Text Post', 'nxs_snap'); ?> - <i><?php _e('just text message', 'nxs_snap'); ?> </i><br/> <input type="radio" name="gp[<?php echo $ii; ?> ][postType]" value="I" <?php if ($gpPostType == 'I') { echo 'checked="checked"'; } ?> onchange="jQuery('#altFormatIMG<?php echo $nt . $ii; ?> ').show();" /> <?php _e('Post to Google+ as "Image post"', 'nxs_snap'); ?> - <i><?php _e('big image with text message', 'nxs_snap'); ?> </i><br/> <input type="radio" name="gp[<?php echo $ii; ?> ][postType]" value="A" <?php if (!isset($gpPostType) || $gpPostType == '' || $gpPostType == 'A') { echo 'checked="checked"'; } ?> onchange="jQuery('#altFormatIMG<?php echo $nt . $ii; ?> ').hide();" /><?php _e('Text Post with "attached" blogpost', 'nxs_snap'); ?> <div class="popShAtt" id="popShAtt<?php echo $ii; ?> XG"><h3><?php _e('Google+ Post Types', 'nxs_snap'); ?> </h3><img src="<?php echo $nxs_plurl; ?> img/gpPostTypesDiff6.png" width="600" height="285" alt="<?php _e('Google+ Post Types', 'nxs_snap'); ?> "/></div> </td></tr> <?php if ($ntOpt['gpCommID'] != '') { ?> <tr><th scope="row" style="text-align:right; width:150px; padding-top: 5px; padding-right:10px;">Community Category</th> <td><select name="gp[<?php echo $ii; ?> ][apGPCCat]" id="apGPCCat"> <?php if (!empty($ntOpt['gpCCatsList'])) { $gCats = $ntOpt['gpCCatsList']; if (base64_encode(base64_decode($gCats)) === $gCats) { $gCats = base64_decode($gCats); } if ($ntOpt['gpCCat'] != '') { $gCats = str_replace($ntOpt['gpCCat'] . '"', $ntOpt['gpCCat'] . '" selected="selected"', $gCats); } echo $gCats; } else { ?> <option value="0">None(Please go to settings and retreive)</option> <?php } ?> </select></td> </tr> <?php } ?> <?php /* ## Message Format ## */ ?> <tr id="altFormat1" style=""><th scope="row" style="vertical-align:top; padding-top: 6px; text-align:right; width:60px; padding-right:10px;"><?php _e('Message Format:', 'nxs_snap'); ?> </th> <td> <?php if (1 == 1) { ?> <textarea cols="150" rows="1" id="gp<?php echo $ii; ?> SNAPformat" name="gp[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('#gp<?php echo $ii; ?> SNAPformat').attr('rows', 4); jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apGPMsgFrmt<?php echo $ii; ?> ');"><?php echo $gpMsgFormat; ?> </textarea> <?php } else { ?> <input value="<?php echo $gpMsgFormat; ?> " type="text" name="gp[<?php echo $ii; ?> ][SNAPformat]" style="width:60%;max-width: 610px;" onfocus="jQuery('.nxs_FRMTHint').hide();mxs_showFrmtInfo('apGPMsgFrmt<?php echo $ii; ?> ');"/><?php nxs_doShowHint("apGPMsgFrmt" . $ii); ?> <?php } ?> </td></tr> <?php /* ## Select Image & URL ## */ nxs_showImgToUseDlg($nt, $ii, $imgToUse, !isset($gpPostType) || $gpPostType == '' || $gpPostType == 'A'); nxs_showURLToUseDlg($nt, $ii, $urlToUse); ?> <?php } } }