Example #1
0
/**
 * show_social_links
 * echoes the social share links
 * TODO: Set this by db...
 */
function show_social_links($tag, $url, $url2)
{
    $html_tag = is_html_tag($tag) ? $tag : '';
    $html_closing_tag = html_closing_tag($html_tag);
    $url = urlencode($url);
    $social_services = array("Facebook" => array('url' => 'http://www.facebook.com/share.php?u=' . $url, 'target' => 'pop-up', 'pop_h' => 350, 'img' => 'ico-facebook.png'), "Twitter" => array('url' => 'http://twitter.com/share?url=' . $url . '&via=chevereto', 'target' => 'pop-up', 'pop_h' => 350, 'img' => 'ico-twitter.png'), "Pinterest" => array('url' => 'http://pinterest.com/pin/create/bookmarklet/?media=' . $url2 . '&url=' . $url . '&is_video=false&description=&title=', 'target' => 'pop-up', 'pop_h' => 300, 'img' => 'ico-pinterest.png'), "StumbleUpon" => array('url' => 'http://www.stumbleupon.com/submit?url=' . $url, 'target' => '_blank', 'img' => 'ico-stumbleupon.png'), "Tumblr" => array('url' => 'http://www.tumblr.com/share?v=3&u=' . $url, 'target' => 'pop-up', 'pop_h' => 450, 'img' => 'ico-tumblr.png'), "Delicious" => array('url' => 'http://www.delicious.com/save?v=5&noui&jump=close&url=' . $url, 'target' => 'pop-up', 'pop_h' => 450, 'img' => 'ico-delicious.png'), "reddit" => array('url' => 'http://reddit.com/submit?url=' . $url, 'target' => '_blank', 'img' => 'ico-reddit.png'), "Myspace" => array('url' => 'http://www.myspace.com/Modules/PostTo/Pages/?u=' . $url, 'target' => 'pop-up', 'pop_h' => 400, 'img' => 'ico-myspace.png'));
    foreach ($social_services as $key => $value) {
        if ($value['target'] == 'pop-up') {
            $target = 'rel="pop-up" data-height="' . $value['pop_h'] . '"';
        } else {
            $target = 'target="_blank"';
        }
        echo $html_tag . '<a href="' . $value['url'] . '" ' . $target . '><img src="' . get_theme_imgdir() . $value['img'] . '" alt="' . $key . '" title="' . $key . '" /></a>' . $html_closing_tag . "\n";
    }
}
/**
 * show_page_links
 * echoes the setted pages
 */
function show_page_links($tag)
{
    $html_tag = is_html_tag($tag) ? $tag : '';
    $html_closing_tag = html_closing_tag($html_tag);
    require __CHV_PATH_THEME__ . 'pages/pages_config.php';
    foreach ($pages_config as $key => $value) {
        if ($value['live']) {
            echo $html_tag . '<a href="' . __CHV_RELATIVE_ROOT__ . $key . '">' . $value['title'] . '</a>' . $html_closing_tag;
        }
    }
}