예제 #1
0
/**
 * Shortcode to diplay Twine Social in your site.
 * 
 * The list of arguments is below:
 *     'app' (string) - You twinesocial site id
 *                    Default: twinesocial
 *     'height' (int) - height of the iframe
 *                    Default: initial auto adjustable to 20 posts.
 * 
 * Usage: 
 * [twinesocial app="twinesocial"]
 * [twinesocial app="twinesocial" height="1500"]
 */
function twinesocial_shortcode($atts)
{
    $tw_widget = new twinesocial_Widget();
    $height = '';
    if (isset($atts['height']) && !empty($atts['height'])) {
        $height = $atts['height'];
    }
    $width = '0';
    if (isset($atts['width']) && !empty($atts['width'])) {
        $width = $atts['width'];
    }
    $app = '';
    if (isset($atts['app']) && !empty($atts['app'])) {
        $app = $atts['app'];
    }
    $collection = '';
    if (isset($atts['collection']) && !empty($atts['collection'])) {
        $collection = urlencode($atts['collection']);
    }
    if (isset($atts['language']) && !empty($atts['language'])) {
        $language = urlencode($atts['language']);
    }
    if (isset($atts['theme']) && !empty($atts['theme'])) {
        $theme = urlencode($atts['theme']);
    }
    if (isset($atts['color']) && !empty($atts['color'])) {
        $color = urlencode($atts['color']);
    }
    if (isset($atts['scrolloptions']) && !empty($atts['scrolloptions'])) {
        $scrolloptions = urlencode($atts['scrolloptions']);
    }
    if (isset($atts['pagesize']) && !empty($atts['pagesize'])) {
        $pagesize = urlencode($atts['pagesize']);
    }
    $nav = '0';
    if (isset($atts['nav']) && !empty($atts['nav'])) {
        $nav = '1';
    }
    return $tw_widget->tw_render(array('app' => $app, 'height' => $height, 'collection' => $collection, 'language' => $language, 'theme' => $theme, 'color' => $color, 'scrolloptions' => $scrolloptions, 'pagesize' => $pagesize, 'width' => $width, 'nav' => $nav, 'noAnimate' => false));
}
예제 #2
0
/**
 * Shortcode to diplay Twine Social in your site.
 * 
 * The list of arguments is below:
 *     'app' (string) - You twinesocial site id
 *                    Default: twinesocial
 *     'height' (int) - height of the iframe
 *                    Default: initial auto adjustable to 20 posts.
 * 
 * Usage: 
 * [twinesocial app="twinesocial"]
 * [twinesocial app="twinesocial" height="1500"]
 */
function twinesocial_shortcode($atts)
{
    $tw_widget = new twinesocial_Widget();
    $height = '';
    if (isset($atts['height']) && !empty($atts['height'])) {
        $height = $atts['height'];
    }
    $width = '0';
    if (isset($atts['width']) && !empty($atts['width'])) {
        $width = $atts['width'];
    }
    $app = '';
    if (isset($atts['app']) && !empty($atts['app'])) {
        $app = $atts['app'];
    }
    $collection = '';
    if (isset($atts['collection']) && !empty($atts['collection'])) {
        $collection = urlencode($atts['collection']);
    }
    $scroll = '';
    if (empty($atts['scroll'])) {
        $scroll = "no";
    }
    $carousel = '0';
    if (isset($atts['carousel']) && !empty($atts['carousel'])) {
        $carousel = $atts['carousel'];
    }
    $nav = '0';
    if (isset($atts['nav']) && !empty($atts['nav'])) {
        $nav = '1';
    }
    return $tw_widget->tw_render(array('app' => $app, 'height' => $height, 'scroll' => $scroll, 'collection' => $collection, 'width' => $width, 'nav' => $nav, 'noAnimate' => false, 'carousel' => $carousel));
}