function vf_send_user_data_to_vanilla($user_id)
{
    $options = get_option(VF_OPTIONS_NAME);
    $base_vanilla_url = vf_get_value('url', $options, '');
    $clientID = vf_get_value('sso-clientid', $options, '');
    $sso_string = vf_get_sso_string(intval($user_id));
    $data = array('client_id' => $clientID, 'sso' => $sso_string);
    $user_url = $base_vanilla_url . 'entry/jsconnect?' . http_build_query($data);
    $result = wp_remote_get($user_url);
    return $result;
}
Exemplo n.º 2
0
    ?>
'; // Required: your unique identifier for the content being commented on
var vanilla_url = '<?php 
    echo get_permalink();
    ?>
'; // Current page's url
<?php 
    if ($categoryid) {
        ?>
var vanilla_category_id = '<?php 
        echo $categoryid;
        ?>
'; // Embed comments in this category
<?php 
    }
    if ($sso = vf_get_sso_string()) {
        echo "var vanilla_sso = '{$sso}';";
        // Single-Sign-On string.
    }
    ?>
(function() {
	var vanilla = document.createElement('script');
	vanilla.type = 'text/javascript';
	var timestamp = new Date().getTime();
	vanilla.src = vanilla_forum_url + '/js/embed.js';
	(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(vanilla);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://vanillaforums.com/?ref_noscript">comments powered by Vanilla.</a></noscript>
<div class="vanilla-credit"><a class="vanilla-anchor" href="http://vanillaforums.com">Comments by <span class="vanilla-logo">Vanilla</span></a></div>
<?php 
Exemplo n.º 3
0
/**
 * Replace the page content with the vanilla embed code if viewing the page that
 * is supposed to contain the forum.
 *
 * @param string $content The content of the current page.
 */
function vf_embed_content($content)
{
    global $post;
    if ($post->ID == vf_get_option('embed-post-id')) {
        $content = '';
        if ($sso = vf_get_sso_string()) {
            // Add the sso string for automatic signin.
            $content = "<script type='text/javascript'>var vanilla_sso = '{$sso}';</script>";
        }
        $content .= stripslashes(vf_get_option('embed-code'));
        vf_forum_embedded(true);
    }
    return $content;
}