예제 #1
0
function sw_email_button_html($array)
{
    if ($array['options']['email']) {
        // Collect the Title
        $title = SW_META_meta('nc_ogTitle');
        if (!$title) {
            $title = get_the_title();
        }
        // Collect the Description
        $description = SW_META_meta('nc_ogDescription');
        if (!$description) {
            $description = sw_get_excerpt_by_id($array['postID']);
        }
        $array['resource']['email'] = '<div class="nc_tweetContainer sw_email">';
        $link = urlencode(urldecode(sw_process_url($array['url'], 'email', $array['postID'])));
        $array['resource']['email'] .= '<a href="mailto:?subject=' . urlencode($title) . '&body=' . urlencode($description) . ' Read here: ' . $link . '" class="nc_tweet">';
        $array['resource']['email'] .= '<span class="sw_count sw_hide"><span class="iconFiller"><span class="spaceManWilly"><i class="sw sw-email"></i><span class="sw_share"> ' . $array['language']['email'] . '</span></span></span></span>';
        $array['resource']['email'] .= '</a>';
        $array['resource']['email'] .= '</div>';
        ++$array['count'];
    }
    return $array;
}
예제 #2
0
function sw_tumblr_button_html($array)
{
    // If we've already generated this button, just use our existing html
    if (isset($_GLOBALS['sw']['buttons'][$array['postID']]['tumblr'])) {
        $array['resource']['tumblr'] = $_GLOBALS['sw']['buttons'][$array['postID']]['tumblr'];
        // If not, let's check if Facebook is activated and create the button HTML
    } elseif (isset($array['options']['tumblr']) && $array['options']['tumblr']) {
        $array['totes'] += $array['shares']['tumblr'];
        ++$array['count'];
        // Collect the Title
        $title = SW_META_meta('nc_ogTitle');
        if (!$title) {
            $title = get_the_title();
        }
        // Collect the Description
        $description = SW_META_meta('nc_ogDescription');
        $array['resource']['tumblr'] = '<div class="nc_tweetContainer sw_tumblr" data-id="' . $array['count'] . '">';
        $link = urlencode(urldecode(sw_process_url($array['url'], 'tumblr', $array['postID'])));
        $array['resource']['tumblr'] .= '<a target="_blank" href="http://www.tumblr.com/share/link?url=' . $link . '&name=' . urlencode($title) . ($description ? '&description=' : '') . urlencode($description) . '" data-link="http://www.tumblr.com/share/link?url=' . $link . '&name=' . urlencode($title) . ($description ? '&description=' : '') . urlencode($description) . '" class="nc_tweet">';
        if ($array['options']['totesEach'] && $array['shares']['totes'] >= $array['options']['minTotes'] && $array['shares']['tumblr'] > 0) {
            $array['resource']['tumblr'] .= '<span class="iconFiller">';
            $array['resource']['tumblr'] .= '<span class="spaceManWilly">';
            $array['resource']['tumblr'] .= '<i class="sw sw-tumblr"></i>';
            $array['resource']['tumblr'] .= '<span class="sw_share"> ' . $array['language']['tumblr'] . '</span>';
            $array['resource']['tumblr'] .= '</span></span>';
            $array['resource']['tumblr'] .= '<span class="sw_count">' . kilomega($array['shares']['tumblr']) . '</span>';
        } else {
            $array['resource']['tumblr'] .= '<span class="sw_count sw_hide"><span class="iconFiller"><span class="spaceManWilly"><i class="sw sw-tumblr"></i><span class="sw_share"> ' . $array['language']['tumblr'] . '</span></span></span></span>';
        }
        $array['resource']['tumblr'] .= '</a>';
        $array['resource']['tumblr'] .= '</div>';
        // Store these buttons so that we don't have to generate them for each set
        $_GLOBALS['sw']['buttons'][$array['postID']]['tumblr'] = $array['resource']['tumblr'];
    }
    return $array;
}