function sf_linked_topic_post_count()
{
    global $wp_query;
    $result = '';
    $postid = $wp_query->post->ID;
    $checkrow = sf_blog_links_postmeta('read', $postid, '');
    if ($checkrow) {
        # link found for this post
        $keys = explode('@', $checkrow->meta_value);
        $result = sf_get_posts_count_in_topic($keys[1]);
    }
    echo $result;
    return;
}
function sf_blog_linked_tag($postid, $show_img = true)
{
    sf_initialise_globals();
    include_once SF_PLUGIN_DIR . '/linking/sf-links-forum.php';
    $checkrow = sf_blog_links_postmeta('read', $postid, '');
    if ($checkrow) {
        $keys = explode('@', $checkrow->meta_value);
        $sfpostlinking = array();
        $sfpostlinking = get_option('sfpostlinking');
        $text = stripslashes($sfpostlinking['sflinkblogtext']);
        $icon = '<img src="' . SFRESOURCES . 'bloglink.png" alt="" />';
        if ($show_img) {
            $text = str_replace('%ICON%', $icon, $text);
        } else {
            $text = str_replace('%ICON%', '', $text);
        }
        $postcount = sf_get_posts_count_in_topic($keys[1]);
        $counttext = ' - (' . $postcount . ') ' . __("Posts", "sforum");
        echo '<span class="sfforumlink"><a href="' . sf_build_url(sf_get_forum_slug($keys[0]), sf_get_topic_slug($keys[1]), 1, 0) . '">' . $text . '</a>' . $counttext . '</span>';
    }
}