예제 #1
0
function plugin_fb_comments_convert()
{
    global $script, $vars;
    $page = $vars['page'];
    $r_page = rawurlencode($page);
    $qm = get_qm();
    $qt = get_qt();
    $args = func_get_args();
    if (!exist_plugin("fb_root")) {
        die('Fatal error: fb_root plugin not found');
    }
    $orders = array('social', 'reverse_time', 'time');
    // scaffold
    $def_attrs = array('href' => '', 'width' => FALSE, 'numposts' => '2', 'colorscheme' => 'light', 'mobile' => FALSE, 'order-by' => array(FALSE, $orders));
    $attrs = plugin_fb_root_parse_args($args, $def_attrs);
    //default URL set
    if ($attrs['href'] == '') {
        if ($page === $defaultpage) {
            $attrs['href'] = dirname($script . 'dummy');
        } else {
            $attrs['href'] = $script . '?' . $r_page;
        }
    }
    plugin_fb_root_set_jsapi(TRUE);
    $tag = plugin_fb_root_create_tag('fb-comments', $attrs);
    $body = $tag;
    return $tag;
}
예제 #2
0
function plugin_fb_likebutton_body($args)
{
    global $script, $vars, $defaultpage;
    $page = $vars['page'];
    $r_page = rawurlencode($page);
    $qm = get_qm();
    $qt = get_qt();
    $layouts = array('standard', 'button_count', 'box_count');
    $actions = array('like', 'recommend');
    // scaffold
    $def_attrs = array('href' => '', 'layout' => array('standard', $layouts), 'show-faces' => 'true', 'width' => FALSE, 'colorscheme' => FALSE, 'action' => array('like', $actions), 'ref' => FALSE, 'share' => 'true', 'kid-directed-site' => FALSE);
    $attrs = plugin_fb_root_parse_args($args, $def_attrs);
    //default URL set
    if ($attrs['href'] == '') {
        if ($page === $defaultpage) {
            $attrs['href'] = dirname($script . 'dummy');
        } else {
            $attrs['href'] = $script . '?' . $r_page;
        }
    }
    plugin_fb_root_set_jsapi(TRUE);
    $tag = plugin_fb_root_create_tag('fb-like', $attrs);
    $body = $tag;
    return $body;
}
예제 #3
0
function plugin_fb_recommends_convert()
{
    if ($alt = plugin_fb_root_is_deprecated('recommends')) {
        $args = func_get_args();
        return call_user_func_array($alt, $args);
    }
    global $script, $vars;
    $page = $vars['page'];
    $r_page = rawurlencode($page);
    $qm = get_qm();
    $qt = get_qt();
    $args = func_get_args();
    // scaffold
    $def_attrs = array('site' => '', 'width' => FALSE, 'height' => FALSE, 'header' => 'true', 'colorscheme' => 'light', 'ref' => FALSE, 'action' => 'og.likes', 'app-id' => FALSE, 'linktarget' => FALSE, 'max-age' => FALSE);
    $attrs = plugin_fb_root_parse_args($args, $def_attrs);
    //default site set
    if ($attrs['site'] == '') {
        $parsed = parse_url($script);
        $host = $parsed['host'];
        $attrs['site'] = $host;
    }
    plugin_fb_root_set_jsapi(TRUE);
    $body = plugin_fb_root_create_tag('fb-recommendations', $attrs);
    if (edit_auth($page, FALSE, FALSE)) {
        $fb_pagebox_help = h(QHM_HOME . '?PageName');
        $warning = <<<EOM
\t\t\t<div class="alert alert-warning">
\t\t\t\tFacebook Recommends は Graph API v2.3 より廃止されました。<br>
\t\t\t\t<strong>2015 年 6 月 23 日</strong>に完全に使えなくなります。
\t\t\t</div>
EOM;
        $body = $warning . $body;
    }
    return $body;
}
예제 #4
0
function plugin_fb_pagebox_convert()
{
    global $script, $vars;
    $page = $vars['page'];
    $r_page = rawurlencode($page);
    $qm = get_qm();
    $qt = get_qt();
    $args = func_get_args();
    // scaffold
    $def_attrs = array('href' => '', 'width' => FALSE, 'height' => FALSE, 'hide-cover' => FALSE, 'show-facepile' => TRUE, 'show-posts' => FALSE, 'hide-cta' => FALSE);
    $attrs = plugin_fb_root_parse_args($args, $def_attrs);
    //no URL error
    if ($attrs['href'] === '') {
        $errmsg = 'error - #fb_pagebox: no facebook page url';
        return "<p>{$errmsg}</p>\n";
    }
    plugin_fb_root_set_jsapi(TRUE);
    return plugin_fb_root_create_tag('fb-page', $attrs);
}
예제 #5
0
function plugin_fb_likebox_convert()
{
    if ($alt = plugin_fb_root_is_deprecated('likebox')) {
        $args = func_get_args();
        return call_user_func_array($alt, $args);
    }
    global $script, $vars;
    $page = $vars['page'];
    $r_page = rawurlencode($page);
    $qm = get_qm();
    $qt = get_qt();
    $args = func_get_args();
    // scaffold
    $def_attrs = array('href' => '', 'width' => FALSE, 'height' => FALSE, 'colorscheme' => 'light', 'show-faces' => 'true', 'stream' => 'true', 'header' => 'true', 'force-wall' => 'false', 'show-border' => 'true');
    $attrs = plugin_fb_root_parse_args($args, $def_attrs);
    //no URL error
    if ($attrs['href'] == '') {
        $errmsg = 'error - #fb_likebox: no facebook page url';
        return "<p>{$errmsg}</p>\n";
    }
    plugin_fb_root_set_jsapi(TRUE);
    $body = plugin_fb_root_create_tag('fb-like-box', $attrs);
    if (edit_auth($page, FALSE, FALSE)) {
        $fb_pagebox_help = h(QHM_HOME . '?FacebookPlugins#pagebox');
        $warning = <<<EOM
\t\t\t<div class="alert alert-warning">
\t\t\t\tFacebook Like Box は Graph API v2.3 より廃止されました。<br>
\t\t\t\t<strong>2015 年 6 月 23 日</strong>に完全に使えなくなりますので、
\t\t\t\t<code>#fb_pagebox</code> プラグインへの移行をしてください。<br>
\t\t\t\tなお、このプラグインは <strong>2015 年 6 月 23 日</strong>に自動的に
\t\t\t\t<code>#fb_pagebox</code> を利用するように切り替わります。<br>
\t\t\t\tオプションは引き継ぎませんので、細かい設定を行いたい場合は
\t\t\t\t<a href="{$fb_pagebox_help}">こちら</a>
\t\t\t\tを参考に
\t\t\t\t<code>#fb_pagebox</code> プラグインへ書き換えてください。
\t\t\t</div>
EOM;
        $body = $warning . $body;
    }
    return $body;
}