Ejemplo n.º 1
0
function jnewsbot_share_replaceMedia(&$html, &$text)
{
    preg_match_all('#\\{tag:share.{3,}?\\}#', $html, $tags);
    $replace = array();
    $replacebyHTML = array();
    $replacebyText = array();
    if (!empty($tags[0])) {
        if (@(include_once JNEWSPATH_CLASS . 'socialshare.php')) {
            if (class_exists('jNews_SocialShare')) {
                $format = JRequest::getVar('format', false, 'GET', 'WORD');
                if ($format == "raw") {
                    $full_screen = true;
                } else {
                    $full_screen = strpos($html, "&format=raw");
                }
                foreach ($tags[0] as $tag) {
                    $social = explode('tag:share name=', $tag);
                    $socialTags = explode('}', $social[1]);
                    $mediaShare = explode(',', $socialTags[0]);
                    if (!empty($replace[$tag])) {
                        continue;
                    }
                    $replace[$tag] = $tag;
                    $mailingId = JRequest::getInt('mailingid', 0, 'request');
                    $mediaShareHTML = jNews_SocialShare::mediaShare($mediaShare, true, $mailingId, $full_screen);
                    $replacebyHTML[$tag] = $mediaShareHTML;
                }
            }
        }
    }
    $html = str_replace($replace, $replacebyHTML, $html);
    $text = str_replace($replace, $replacebyText, $text);
}
Ejemplo n.º 2
0
 /**
  * 
  *replacign the tag with twitter share image link
  * @param unknown_type $mailingId
  */
 static function displayTwitter($mailingId = 0)
 {
     $twitterHTML = '';
     $twitterHTML .= jNews_SocialShare::displaySocialShare($mailingId, 'twitter');
     return $twitterHTML;
 }