' . $infoImage . '
' : '';
$onlyimage = in_array($data->networkId, $this->onlyImage) ? 'b2sOnlyWithImage' : '';
$content = '';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
) . ')
';
$content .= '
';
$content .= '
';
//XING deprecated
if ($data->networkId == 8) {
$content .='
' . esc_html__('Connection expires on 31 March 2019', 'blog2social') . '
';
}
// G+ deprecated
if ($data->networkId == 10) {
$content .='
' . esc_html__('Connection expires on 2 April 2019', 'blog2social') . '
';
}
$content .= '
' . esc_html(stripslashes($network_display_name)) . '
';
$content .= '
';
$content .= '
' . esc_html(($data->networkId == 19 && $data->networkType == 1 && isset($networkKindName[$data->networkKind]) ? $networkKindName[$data->networkKind] . '-' : '') . $networkTypeName[$data->networkType] . (($data->networkId == 19 && (int) $data->networkType == 1 && (int) $data->networkKind == 0) ? ' (' . __('Employer Branding', 'blog2social') . ')' : '') . ' | ' . $networkName[$data->networkId]);
$content .= '
';
$content .= '
' . $messageInfo . '';
$content .= '
';
if (in_array($data->networkId, $this->setPostFormat)) {
$postFormatType = ($data->networkId == 12) ? 'image' : 'post';
$addCSS = (B2S_PLUGIN_USER_VERSION == 0) ? 'b2s-btn-disabled' : '';
$content .= '
';
if (B2S_PLUGIN_USER_VERSION > 0) {
$content .= '
';
} else {
if ($this->viewMode != 'modal') {
$content .= '
SMART';
}
}
}
if ($data->networkId == 15) {
$content .= '
';
}
$content .='
';
$content .= (in_array($data->networkId, $this->setPostFormat)) ? ' | ' : '';
if (in_array($data->networkId, $this->getText)) {
$content .= ' | ';
}
$content .= ' | ';
$content .= $textareaLimitInfo . '';
$content .= '';
//TOS Twitter 030218
if ($data->networkType == 0 && in_array($data->networkId, $this->networkTosProfile)) {
$content .='
' . esc_html__('Please keep in mind that according to Twitter’s new TOS, users are no longer allowed to post identical or substantially similar content to multiple accounts or multiple duplicate updates on one account.', 'blog2social') . '
' . esc_html__('Violating these rules can result in Twitter suspending your account. Always vary your Tweets with different comments, hashtags or handles to prevent duplicate posts.', 'blog2social') . ' ' . esc_html__('Learn more about this', 'blog2social') . '';
}
//TOS Xing Group 080218
if ($data->networkType == 2 && in_array($data->networkId, $this->networkTosGroup)) {
$content .='
';
}
if ($data->networkId == 12) {
$content .='
' . esc_html__('Instagram supports up to 30 hashtags. Please reduce the number of hashtags in your post.', 'blog2social') . '
';
$content .='
' . esc_html__('Please keep in mind that users are not allowed to post identical or substantially similar content to multiple accounts or multiple duplicate updates on one account.', 'blog2social') . '
' . esc_html__('Violating these rules can result in suspending your account. Always vary your content with different images, comments, hashtags or handles to prevent duplicate posts.', 'blog2social') . '
';
}
$content .= '
';
$content .= (in_array($data->networkId, $this->showBoards) || ($data->networkType == 2 && in_array($data->networkId, $this->showBoardsGroup))) ? $this->getBoardHtml($data->networkAuthId, $data->networkId) : '';
$content .= (in_array($data->networkId, $this->showGroups) && ($data->networkType == 2 || $data->networkId == 15)) ? $this->getGroupsHtml($data->networkAuthId, $data->networkId) : '';
$content .= (in_array($data->networkId, $this->showMarketplace) && $data->networkType == 2) ? $this->getMarketplaceAreaHtml($data->networkAuthId, $data->networkId, $data->networkType, $data->networkKind) : '';
$content .= ((in_array($data->networkId, $this->showTitleProfile) && $data->networkType == 0) || (((in_array($data->networkId, $this->showTitlePage) && isset($this->showTitlePage[$data->networkId]) && !is_array($this->showTitlePage[$data->networkId]) ) || (isset($this->showTitlePage[$data->networkId]) && is_array($this->showTitlePage[$data->networkId]) && in_array($data->networkKind, $this->showTitlePage[$data->networkId]))) && $data->networkType == 1) || (in_array($data->networkId, $this->showTitleGroup) && $data->networkType == 2)) ? $this->getTitleHtml($data->networkId, $data->networkAuthId, $data->networkKind, $data->networkType, $this->postData->post_title) : '';
$content .= $this->getCustomEditArea($data->networkId, $data->networkAuthId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
$content .= (in_array($data->networkId, $this->allowTag) && $data->networkType == 0) ? $this->getTagsHtml($data->networkId, $data->networkAuthId, (($allowUserHashTag === false || $allowUserHashTag == 1) ? true : false)) : '';
//Calendar
if (!(isset($this->viewMode) && $this->viewMode == 'modal')) {
$content .='
';
$content .='
';
$content .='';
$content .='
';
if (in_array($data->networkId, $this->showRelay)) {
$content .= $this->getRelayBtnHtml($data->networkAuthId, $data->networkId);
}
$content .='
' . esc_html__("show calendar", "blog2social") . '';
$content .='
';
if (in_array($data->networkId, $this->showRelay)) {
$content .= $this->getRelayContentHtml($data->networkAuthId, $data->networkId);
}
}
if ($show_time) {
$content .= $this->getShippingTimeHtml($data->networkAuthId, $data->networkType, $data->networkId, $data->networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, isset($data->image_url) ? $data->image_url : null);
}
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
$content .= '
';
return $content;
}
public function getCustomEditArea($networkId, $networkAuthId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $imageUrl = null) {
$meta = array();
if ($networkId == 1 || ($networkId == 8 && $networkType == 0) || $networkId == 19 || $networkId == 3 || $networkId == 2 || $networkId == 15) {
if (trim(strtolower($this->postStatus)) == 'publish' || $this->b2sPostType == 'ex') {
//is calendar edit => scrape post url and not custom post url by override from edit function for meta tags!
//$editPostUrl = $this->viewMode == 'modal') ? (get_permalink($this->postData->ID) !== false ? get_permalink($this->postData->ID) : $this->postData->guid) : $this->postUrl;
$meta = B2S_Util::getMetaTags($this->postId, $this->postUrl, $networkId);
//Case: no twitter image tag try og image tag
if ($networkId == 2 && !isset($meta['image'])) {
$meta = B2S_Util::getMetaTags($this->postId, $this->postUrl);
}
} else {
$desc = B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, false, (in_array($networkId, $this->allowNoEmoji) ? false : true), $this->userLang), 150);
if (empty($desc) && isset($this->postData->post_excerpt) && !empty($this->postData->post_excerpt)) {
$desc = B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_excerpt, $this->postUrl, false, (in_array($networkId, $this->allowNoEmoji) ? false : true), $this->userLang), 150);
}
$meta = array('title' => B2S_Util::getExcerpt(B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang), 50) . ' - ' . $this->websiteName, 'description' => $desc);
}
//EDIT Function - Calendar
$meta = (is_array($meta)) ? $meta : array();
$meta = $this->hook_meta($meta);
$imageUrl = $imageUrl ? $imageUrl : (isset($meta['image']) ? $meta['image'] : null);
if ($networkId == 1) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 && !empty($meta['image']) ? $meta['image'] : $this->defaultImage)) . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
if (B2S_PLUGIN_USER_VERSION > 0) {
$edit .= '
';
} else {
$edit .= '
SMART';
$edit .= '
' . esc_html__('You want to change your link image, link title and link description for this network? Click here.', 'blog2social') . ' ';
}
$edit .= '
';
$edit .= '
';
$edit .= $this->getUrlHtml($networkId, $networkType, $networkAuthId, $limit, $limitValue, true, 'og-url-input', true, $imageUrl);
$edit .= '
';
$edit .= '
';
}
if ($networkId == 2) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 && !empty($meta['image']) ? $meta['image'] : $this->defaultImage)) . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
if (B2S_PLUGIN_USER_VERSION > 0) {
$edit .= '
';
} else {
$edit .= '
SMART';
$edit .= '
' . esc_html__('You want to change your link image, link title and link description for this network? Click here.', 'blog2social') . ' ';
}
$edit .= '
';
$edit .= '
';
$edit .= $this->getUrlHtml($networkId, $networkType, $networkAuthId, $limit, $limitValue, true, 'tw-url-input', true);
$edit .= '
';
$edit .= '
';
}
if ($networkId == 3) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 && !empty($meta['image']) ? $meta['image'] : $this->defaultImage)) . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
if (B2S_PLUGIN_USER_VERSION > 0) {
$edit .= '
';
} else {
$edit .= '
SMART';
$edit .= '
' . esc_html__('You want to change your link image, link title and link description for this network? Click here.', 'blog2social') . ' ';
}
$edit .= '
';
$edit .= '
';
$edit .= $this->getUrlHtml($networkId, $networkType, $networkAuthId, $limit, $limitValue, true, 'og-url-input', true);
$edit .= '
';
$edit .= '
';
}
if (($networkId == 8 || $networkId == 19)) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 && !empty($meta['image']) ? $meta['image'] : $this->defaultImage)) . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
if (B2S_PLUGIN_USER_VERSION > 0) {
$edit .= '
';
} else {
$edit .= '
SMART';
$edit .= '
' . esc_html__('You want to change your link image, link title and link description for this network? Click here.', 'blog2social') . ' ';
}
$edit .= '
';
$edit .= '
';
$edit .= $this->getUrlHtml($networkId, $networkType, $networkAuthId, $limit, $limitValue, true, 'og-url-input', true);
$edit .= '
';
$edit .= '
';
}
if (($networkId == 15)) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 && !empty($meta['image']) ? $meta['image'] : $this->defaultImage)) . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
if (B2S_PLUGIN_USER_VERSION > 0) {
$edit .= '
';
} else {
$edit .= '
SMART';
$edit .= '
' . esc_html__('You want to change your link image, link title and link description for this network? Click here.', 'blog2social') . ' ';
}
$edit .= '
';
$edit .= '
';
$edit .= $this->getUrlHtml($networkId, $networkType, $networkAuthId, $limit, $limitValue, true, 'og-url-input', true);
$edit .= '
';
$edit .= '
';
}
} else {
$edit = '
';
$edit .= '
';
//EDIT Function - Calendar
$meta = $this->hook_meta(array());
$imageUrl = $imageUrl ? $imageUrl : (isset($meta['image']) ? $meta['image'] : null);
$edit .= $this->getUrlHtml($networkId, $networkType, $networkAuthId, $limit, $limitValue, false, '', false, $imageUrl);
if ($networkId == 14) { //FeatureImage Network Torial (Portfolio)
$edit .= '
';
}
}
return $edit;
}
public function getCustomEditSchedArea($schedCount = 0, $networkId, $networkAuthId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $infoArea, $imageUrl = null) {
if ($networkId == 1 || ($networkId == 8 && $networkType == 0) || $networkId == 19 || $networkId == 3 || $networkId == 2 || $networkId == 15) {
if ($networkId == 1) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= $infoArea;
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
}
if ($networkId == 2) {
$edit = '
';
//TOS Twitter 032018
$edit .='
' . esc_html__('Please keep in mind that according to Twitter’s new TOS, users are no longer allowed to post identical or substantially similar content to multiple accounts or multiple duplicate updates on one account.', 'blog2social') . '
' . esc_html__('Violating these rules can result in Twitter suspending your account. Always vary your Tweets with different comments, hashtags or handles to prevent duplicate posts.', 'blog2social') . ' ' . esc_html__('Learn more about this', 'blog2social') . '';
$edit .= '
';
$edit .= '
';
$edit .= '
 . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= $infoArea;
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
}
if ($networkId == 3) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= $infoArea;
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
}
if ($networkId == 8 || $networkId == 19) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= $infoArea;
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
}
if ($networkId == 15) {
$edit = '
';
$edit .= '
';
$edit .= '
';
$edit .= '
 . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= $infoArea;
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
}
} else {
$edit = '
';
if ((in_array($networkId, $this->showImageAreaProfile) && $networkType == 0) || (in_array($networkId, $this->showImageAreaPage) && $networkType == 1) || (in_array($networkId, $this->showImageAreaGroup) && $networkType == 2)) {
$edit .= '
';
$edit .= '
';
$edit .= '
 . ')
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= '
';
$edit .= $infoArea;
$edit .= '
';
$edit .= '
';
$edit .= '
';
} else {
$edit .= '
';
$edit .= $infoArea;
$edit .= '
';
$edit .= '
';
$edit .= '
';
}
$edit .= '
';
}
return $edit;
}
private function getUrlHtml($networkId, $networkType, $networkAuthId, $limit, $limitValue, $hideInfo = false, $class = '', $refeshBtn = false, $imageUrl = null) {
if (in_array($networkId, $this->allowEditUrl)) {
$urlLimit = ($limit !== false) ? ' onkeyup="networkLimitAll(\'' . esc_attr($networkAuthId) . '\',\'' . esc_attr($networkId) . '\',\'' . esc_attr($limitValue) . '\');"' : 'onkeyup="networkCount(\'' . esc_attr($networkAuthId) . '\');"';
$isRequiredClass = (in_array($networkId, $this->requiredUrl)) ? 'required_network_url' : '';
$isRequiredText = (!empty($isRequiredClass)) ? '
(' . esc_html__('required', 'blog2social') . ')' : '';
$url = '';
if ((in_array($networkId, $this->showImageAreaProfile) && $networkType == 0) || (in_array($networkId, $this->showImageAreaPage) && $networkType == 1) || (in_array($networkId, $this->showImageAreaGroup) && $networkType == 2)) {
$url .= '
';
$url .= '
';
$url .= '
';
$url .= '
';
$url .= '
';
$url .= '
 ? $imageUrl : $this->defaultImage)) . ')
';
$url .= '
';
$url .= '
';
$url .= '
';
$url .= '
';
$url .= '
';
}
$url .= (!$hideInfo) ? '
Link ' . $isRequiredText . '
' : '';
$cur_post_url = $this->postUrl;
if($this->gd_cdn_setting['weburl']){
$cur_post_url = str_replace($this->cur_home_url.'/',$this->gd_cdn_setting['weburl'],$cur_post_url);
}
if ($refeshBtn && (trim(strtolower($this->postStatus)) == 'publish' || $this->b2sPostType == 'ex')) {
$url .= '
';
} else {
$url .= '
';
}
if ((in_array($networkId, $this->showImageAreaProfile) && $networkType == 0) || (in_array($networkId, $this->showImageAreaPage) && $networkType == 1) || (in_array($networkId, $this->showImageAreaGroup) && $networkType == 2)) {
$url .= '
';
$url .= '
';
$url .= '
';
}
} else {
$cur_post_url = $this->postUrl;
if($this->gd_cdn_setting['weburl']){
$cur_post_url = str_replace($this->cur_home_url.'/',$this->gd_cdn_setting['weburl'],$cur_post_url);
}
$url = '
';
}
return $url;
}
protected function hook_message($message) {
return $message;
}
protected function hook_meta(array $meta) {
return $meta;
}
protected function hook_sched_data(array $schedData) {
return $schedData;
}
private function getHashTagsString($add = "\n\n") {
//WooCommerce keyword support
if ($this->postData->post_type == 'product' && taxonomy_exists('product_tag')) {
$hashTagsData = get_the_terms($this->postId, 'product_tag');
} else {
$hashTagsData = get_the_tags($this->postId);
}
$hashTags = '';
if (is_array($hashTagsData) && !empty($hashTagsData)) {
foreach ($hashTagsData as $tag) {
$hashTags .= ' #' . str_replace(array(" ", "-", '"', "'", "!", "?", ",", ".", ";", ":"), "", $tag->name);
}
}
return (!empty($hashTags) ? (!empty($add) ? $add . $hashTags : $hashTags) : '');
}
private function getBoardHtml($networkAuthId, $networkId) {
$board = '';
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getBoards', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $networkAuthId, 'selBoard' => $this->selBoard, 'networkId' => $networkId)));
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
$board = '
';
}
return $board;
}
private function getGroupsHtml($networkAuthId, $networkId) {
$group = '';
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getGroups', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $networkAuthId, 'selGroup' => $this->selGroup, 'networkId' => $networkId, 'lang' => B2S_LANGUAGE)));
$changeDisplayName = in_array($networkId, $this->changeDisplayName) ? 'true' : 'false';
if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
$group = '
';
}
return $group;
}
private function getMarketplaceAreaHtml($networkAuthId = 0, $networkId = 0, $networkType = 0, $networkKind = 0) {
$marketplace = '
';
$marketplace .='
selMarketplaceCategory == 1) ? 'checked=""' : '') . ' name="b2s[' . esc_attr($networkAuthId) . '][marketplace_category]" value="1">
';
$marketplace .='
selMarketplaceCategory == 2) ? 'checked=""' : '') . ' name="b2s[' . esc_attr($networkAuthId) . '][marketplace_category]" value="2">
';
$marketplace .='
selMarketplaceCategory == 3) ? 'checked=""' : '') . ' name="b2s[' . esc_attr($networkAuthId) . '][marketplace_category]" value="3">
';
$marketplace .='
';
$marketplace .='
selMarketplaceType == 1) ? 'checked=""' : '') . ' name="b2s[' . esc_attr($networkAuthId) . '][marketplace_type]" value="1">
';
$marketplace .='
selMarketplaceType == 2) ? 'checked=""' : '') . ' name="b2s[' . esc_attr($networkAuthId) . '][marketplace_type]" value="2">
';
$marketplace .='
';
$marketplace .='
';
return $marketplace;
//
}
private function getTitleHtml($networkId = 0, $networkdAutId = 0, $networkKind = 0, $networkType = 0, $title = '') {
$title = in_array($networkId, $this->allowNoEmoji) ? B2S_Util::remove4byte(B2S_Util::getTitleByLanguage($title, $this->userLang)) : B2S_Util::getTitleByLanguage($title, $this->userLang);
$maxLength = ($networkType == 1 && isset($this->limitCharacterTitlePage[$networkId][$networkKind])) ? (int) $this->limitCharacterTitlePage[$networkId][$networkKind] : 254;
return '
';
}
private function getTagsHtml($networkId, $networkAuthId, $allowTags = true) {
$tags = '
';
$info = '';
if (isset($this->limitTag[$networkId])) {
$tags .= '
';
$info = '('.sprintf(esc_html__('max. %s Tags', 'blog2social'),$this->limitTag[$networkId]).')';
}
$tags .= '
' . esc_html__('Hashtags', 'blog2social') .' '. $info.'
';
$tags .= '
';
$tags .= '
';
return $tags;
}
private function getRelayBtnHtml($networkAuthId, $networkId) {
$relay = '
';
return $relay;
}
private function getRelayContentHtml($networkAuthId, $networkId) {
$relay = '';
if (B2S_PLUGIN_USER_VERSION > 0) {
$relay .= '
';
$relay .= '
';
$relay .= '- ';
for ($relaycount = 0; $relaycount < $this->setRelayCount; $relaycount++) {
$relay .= '
';
$relay .= $relaycount != 0 ? '
' : '';
$relay .= '
';
$relay .= '
';
$relay .= '
';
$relay .= '
';
$relay .='
';
$relay .= '
';
$relay .='
';
$relay .= '
';
$relay .= ( $relaycount >= 1) ? '' : '';
$relay .= $relaycount < $this->setRelayCount - 1 ? '' : '';
$relay .= '
';
$relay .= '
';
$relay .= '';
}
$relay .= ' ';
$relay .= '
';
$relay .= '
';
}
return $relay;
}
private function getShippingTimeHtml($networkAuthId, $networkTyp, $networkId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $imageUrl = null) {
$isSelectedSched = (B2S_PLUGIN_USER_VERSION > 0 && (trim(strtolower($this->postStatus)) == 'future' || !empty($this->selSchedDate))) ? 'selected="selected"' : '';
$isSelectedNow = (empty($isSelectedSched)) ? 'selected="selected"' : '';
$showSchedRegularly = (!($networkTyp == 2 || (in_array($networkId, $this->noScheduleRegularly)) || ($networkTyp == 1 && in_array($networkId, $this->noScheduleRegularlyPage)))) ? true : false;
$shipping = '
';
$shipping .= '
';
if (B2S_PLUGIN_USER_VERSION > 0) {
$shipping .= '
';
//TOS Twitter 032018
$shipping .= '
' . esc_html__('Please keep in mind that according to Twitter’s new TOS, users are no longer allowed to post identical or substantially similar content to multiple accounts or multiple duplicate updates on one account.', 'blog2social') . '
' . esc_html__('Violating these rules can result in Twitter suspending your account. Always vary your Tweets with different comments, hashtags or handles to prevent duplicate posts.', 'blog2social') . ' ' . esc_html__('Learn more about this', 'blog2social') . '';
$shipping .= '
';
$shipping .= '- ';
//Sched post
$time = time();
if (trim(strtolower($this->postStatus)) == 'future') {
$time = strtotime($this->postData->post_date);
}
//Routing form calendar
if (!empty($this->selSchedDate)) {
$time = strtotime($this->selSchedDate);
}
if (date('H') == '23' && date('i') >= 30) {
$time = strtotime('+ 1 days');
}
$currentDate = (strtolower(substr(get_locale(), 0, 2)) == 'de') ? date('d.m.Y', $time) : date('Y-m-d', $time);
$currentDay = date('d', $time);
$maxSchedCount = ($networkId == 18) ? 1 : $this->maxSchedCount;
for ($schedcount = 0; $schedcount < $maxSchedCount; $schedcount++) {
$shipping .= '
';
$shipping .= $schedcount != 0 ? '
' : '';
//deprecated Network
if ($networkId == 8) {
$shipping.='
' . esc_html__("Please note: Your account is connected via an old XING API that is no longer supported by XING after March 31. Please connect your XING profile, as well as your XING company pages (Employer branding profiles) and business pages with the new XING interface in the Blog2Social network settings. To do this, go to the Blog2Social Networks section and connect your XING accounts with the new XING.", "blog2social") . '
' . esc_html__('Learn more', 'blog2social') . '';
}
//deprecated Network
if ($networkId == 10) {
$shipping.='
' . esc_html__("Please note: Google will shut down Google+ for all private accounts (profiles, pages, groups) on 2nd April 2019. You can find further information and the next steps, including how to download your photos and other content here:", "blog2social") . '
https://support.google.com/plus/answer/9195133';
}
$shipping .= '
';
$shipping .= '
';
//new since 4.5.0
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
if ($showSchedRegularly) {
$shipping .= '
';
$shipping .= '
';
//new since 4.5.0
$shipping .= '
';
//new since 4.5.0
$shipping .= '
';
//new since 4.5.0
$shipping .= '
';
}
//new since 4.5.0
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= '
';
if (!($networkTyp >= 1 && (in_array($networkId, $this->addNoMoreSchedPage) || in_array($networkId, $this->addNoMoreSchedGroup)))) {
$shipping .= ( $schedcount >= 1) ? '' : '';
$shipping .= $schedcount < $maxSchedCount - 1 ? '' : '';
}
$shipping .= '
';
//since 4.8.0 customize content
if (in_array($networkId, $this->allowSchedCustomizeContent)) {
$countCharacter = 0;
if ($limit !== false) {
$textareaLimitInfo = '
' . (int) esc_html($countCharacter) . '/' . esc_html($limitValue) . ' ' . esc_html__('characters', 'blog2social') . '';
} else {
$textareaLimitInfo = '
' . (int) esc_html($countCharacter) . ' ' . esc_html__('characters', 'blog2social') . '';
}
$edit = '
';
$edit .= ' | ';
if (in_array($networkId, $this->getText)) {
$edit .= ' | ';
}
$edit .= ' | ';
$edit .= $textareaLimitInfo . '
';
$shipping .= '
';
$shipping .= '
';
$shipping .= $this->getCustomEditSchedArea($schedcount, $networkId, $networkAuthId, $networkType, $message, $isRequiredTextarea, $textareaOnKeyUp, $limit, $limitValue, $edit, $imageUrl);
$shipping .= '
';
}
$shipping .= '
';
}
$shipping .= '';
$shipping .= '';
$shipping .= '';
$shipping .= '';
$shipping .= '
';
$shipping .= ' ';
$shipping .= '
';
$shipping .= '
';
}
return $shipping;
}
public function setPostUrl($value) {
$this->postUrl = $value;
}
public function setTitle($value) {
if ($this->postData) {
$this->postData->post_title = $value;
}
}
public function getMessagebyTemplate($data) {
require_once(B2S_PLUGIN_DIR . 'includes/Options.php');
$options = new B2S_Options(get_current_user_id());
$post_template = $options->_getOption("post_template");
if (B2S_PLUGIN_USER_VERSION < 1 || $post_template == false || !isset($post_template[$data->networkId][$data->networkType])) {
$post_template = unserialize(B2S_PLUGIN_NETWORK_SETTINGS_TEMPLATE_DEFAULT);
}
$post_template = $post_template[$data->networkId][$data->networkType];
//V5.6.1
if (!isset($post_template['short_text']['excerpt_range_max'])) {
$defaultSchema = unserialize(B2S_PLUGIN_NETWORK_SETTINGS_TEMPLATE_DEFAULT);
$post_template['short_text']['excerpt_range_max'] = $defaultSchema[$data->networkId][$data->networkType]['short_text']['excerpt_range_max'];
}
if (!isset($post_template['short_text']['excerpt_range_min'])) {
$defaultSchema = unserialize(B2S_PLUGIN_NETWORK_SETTINGS_TEMPLATE_DEFAULT);
$post_template['short_text']['excerpt_range_min'] = $defaultSchema[$data->networkId][$data->networkType]['short_text']['excerpt_range_min'];
}
$message = $post_template['content'];
//B2S CC
if ($this->b2sPostType == 'ex' && isset($this->postData->post_content) && !empty($this->postData->post_content)) {
$preContent = B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, false, (in_array($data->networkId, $this->allowNoEmoji) ? false : true), $this->userLang), (int) $post_template['short_text']['range_min'], (int) $post_template['short_text']['range_max']);
$appendFirst = true;
if (strpos($message, '{CONTENT}') !== false) {
$message = preg_replace("/\{CONTENT\}/", addcslashes($preContent, "\\$"), $message);
$appendFirst = false;
}
$message = preg_replace(array("/\{TITLE\}/", "/\{EXCERPT\}/", "/\{KEYWORDS\}/", "/\{AUTHOR\}/"), "", $message);
if ($appendFirst) {
$message = $preContent . ' ' . $message;
}
//B2S Customize
} else {
$allowUserHashTag = $options->_getOption('user_allow_hashtag');
if (isset($this->postData->post_content) && !empty($this->postData->post_content)) {
$preContent = B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_content, $this->postUrl, false, (in_array($data->networkId, $this->allowNoEmoji) ? false : true), $this->userLang), (int) $post_template['short_text']['range_min'], (int) $post_template['short_text']['range_max']);
$message = preg_replace("/\{CONTENT\}/", addcslashes($preContent, "\\$"), $message);
} else {
$message = preg_replace("/\{CONTENT\}/", "", $message);
}
if (isset($this->postData->post_title) && !empty($this->postData->post_title)) {
$title = in_array($data->networkId, $this->allowNoEmoji) ? B2S_Util::remove4byte(B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang)) : B2S_Util::getTitleByLanguage($this->postData->post_title, $this->userLang);
$message = stripslashes(preg_replace("/\{TITLE\}/", addcslashes($title, "\\$"), $message));
} else {
$message = preg_replace("/\{TITLE\}/", "", $message);
}
if (isset($this->postData->post_excerpt) && !empty($this->postData->post_excerpt)) {
$excerpt = B2S_Util::getExcerpt(B2S_Util::prepareContent($this->postId, $this->postData->post_excerpt, $this->postUrl, false, (in_array($data->networkId, $this->allowNoEmoji) ? false : true), $this->userLang), (int) $post_template['short_text']['excerpt_range_min'], (int) $post_template['short_text']['excerpt_range_max']);
$message = stripslashes(preg_replace("/\{EXCERPT\}/", addcslashes($excerpt, "\\$"), $message));
} else {
$message = preg_replace("/\{EXCERPT\}/", "", $message);
}
if (strpos($message, "{KEYWORDS}") !== false) {
$hashtags = $this->getHashTagsString("");
$message = stripslashes(preg_replace("/\{KEYWORDS\}/", addcslashes($hashtags, "\\$"), $message));
} else if (in_array($data->networkId, $this->allowHashTags) && ($allowUserHashTag === false || $allowUserHashTag == 1)) {
$add = ($data->networkId != 2) ? "\n\n" : "";
$hashtags = $this->getHashTagsString($add);
$message .= " " . $hashtags;
}
if (isset($this->postData->post_author) && (int) $this->postData->post_author > 0) {
$hook_filter = new B2S_Hook_Filter();
$author_name = $hook_filter->get_wp_user_post_author_display_name((int) $this->postData->post_author);
$message = stripslashes(preg_replace("/\{AUTHOR\}/", addcslashes($author_name, "\\$"), $message));
} else {
$message = preg_replace("/\{AUTHOR\}/", "", $message);
}
}
return $message;
}
}