function sp_setup_meta_tags()
{
    global $spGlobals;
    if (empty($spGlobals['metadescription'])) {
        $description = sp_get_metadescription();
        if ($description != '') {
            $description = str_replace('"', '', $description);
            echo '<meta name="description" content="' . $description . '" />' . "\n";
        }
    }
    if (empty($spGlobals['metakeywords'])) {
        $keywords = sp_get_metakeywords();
        if ($keywords != '') {
            $keywords = str_replace('"', '', $keywords);
            echo '<meta name="keywords" content="' . $keywords . '" />' . "\n";
        }
    }
    if (empty($spGlobals['canonicalurl'])) {
        # output the canonical url
        $url = sp_canonical_url();
        echo '<link rel="canonical" href="' . $url . '" />' . "\n";
    }
}
function sp_setup_meta_tags()
{
    global $spGlobals, $spVars;
    $spVars['seodescription'] = '';
    $spVars['seokeywords'] = '';
    $spVars['seourl'] = '';
    echo "\n\n";
    if (empty($spGlobals['metadescription'])) {
        $description = sp_get_metadescription();
        if ($description != '') {
            $description = str_replace('"', '', $description);
            echo "\t" . '<meta name="description" content="' . $description . '" />' . "\n";
        }
        # add to SEO data
        $spVars['seodescription'] = $description;
    }
    if (empty($spGlobals['metakeywords'])) {
        $keywords = sp_get_metakeywords();
        if ($keywords != '') {
            $keywords = str_replace('"', '', $keywords);
            echo "\t" . '<meta name="keywords" content="' . $keywords . '" />' . "\n";
        }
        $spVars['seokeywords'] = $keywords;
    }
    if (empty($spGlobals['canonicalurl'])) {
        # output the canonical url
        $url = sp_canonical_url();
        echo "\t" . '<link rel="canonical" href="' . $url . '" />' . "\n";
        $spVars['seourl'] = $url;
    }
}
function sp_get_permalink($link, $id, $sample)
{
    global $spIsForum;
    if ($spIsForum) {
        if ($id == sp_get_option('sfpage') && (sp_get_option('sfinloop') && in_the_loop())) {
            $link = sp_canonical_url();
        }
    }
    return $link;
}