当前位置: 首页>>代码示例>>PHP>>正文


PHP parse_shortcode函数代码示例

本文整理汇总了PHP中parse_shortcode函数的典型用法代码示例。如果您正苦于以下问题:PHP parse_shortcode函数的具体用法?PHP parse_shortcode怎么用?PHP parse_shortcode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了parse_shortcode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sectionYTShortcode

function sectionYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('background' => '#ffffff', 'image' => '', 'repeat' => 'repeat', 'parallax' => 'yes', 'speed' => '10', 'max_width' => '960', 'margin' => '0px 0px 0px 0px', 'padding' => '30px 0px 30px 0px', 'border' => 'none', 'color' => '#333333', 'text_align' => 'inharit', 'text_shadow' => 'none', 'url_youtube' => '', 'url_webm' => '', 'url_vimeo' => '', 'font_size' => '12px', 'class' => ''), $atts, 'section');
    $id_section = uniqid('sec_') . rand() . time();
    $id_video = uniqid('svb_sec_') . rand() . time();
    $background = $atts['image'] ? sprintf('%s %s url(\'%s\') repeat %s', $atts['background'], '50% 0', yt_image_media($atts['image']), $atts['parallax'] === 'yes' ? 'fixed' : 'scroll') : $atts['background'];
    if ($atts['image'] && $atts['parallax'] === 'yes') {
        $atts['class'] .= ' yt-section-parallax';
    }
    if ($atts['url_youtube']) {
        $atts['class'] .= ' yt-panel-clickable';
    }
    JHtml::_('jquery.framework');
    if ($atts['image'] && $atts['parallax'] === 'yes' or $atts['url_youtube']) {
        JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/section.js");
    }
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/modernizr.video.js");
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/swfobject.js");
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/video_background.js");
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/css/section.css", 'text/css');
    $atts['text_align'] = $atts['text_align'] != 'inherit' ? 'text-align:' . $atts['text_align'] . ';' : '';
    $atts['text_shadow'] = $atts['text_shadow'] ? ' -webkit-text-shadow:' . $atts['text_shadow'] . ';-moz-text-shadow:' . $atts['text_shadow'] . ';text-shadow:' . $atts['text_shadow'] . ';' : '';
    if ($atts['url_youtube'] != '') {
        return '<div class="yt-section-forcefullwidth"><div id="' . $id_section . '" class="yt-section-wrapper" data-id="' . $id_section . '"><div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div><div class="yt-section-overlay"></div><div class="yt-section-video" id="' . $id_video . '" data-id="' . $id_video . '" data-loop="true" data-muted="true" data-autoplay="true" data-ratio="1.77" data-overlay="" data-swfpath=""  data-youtube="' . $atts['url_youtube'] . '"><div id="video_background_video_1" style="z-index: 0; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; overflow: hidden;"></div></div></div></div></div>';
    } else {
        if ($atts['url_webm'] != '') {
            return '<div class="yt-section-forcefullwidth"><div id="' . $id_section . '" class="yt-section-wrapper" data-id="' . $id_section . '"><div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />"), " ", $content)) . '</div><div class="yt-section-overlay"></div><div class="yt-section-video" id="' . $id_video . '" data-id="' . $id_video . '" data-loop="true" data-muted="true" data-autoplay="true" data-ratio="1.77" data-overlay="" data-swfpath=""  data-webm="' . $atts['url_webm'] . '"><div id="video_background_video_1" style="z-index: 0; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; overflow: hidden;"><video  autoplay="" loop="" onended="this.play()"><source src="' . $atts['url_webm'] . '" type="video/webm"></video></div></div></div></div></div>';
        } else {
            return '<div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div></div>';
        }
    }
}
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:32,代码来源:shortcode.php

示例2: accordion_itemYTShortcode

function accordion_itemYTShortcode($atts, $content = null)
{
    global $style_acc;
    extract(ytshortcode_atts(array("title" => '', "icon" => 'plus', 'background' => '#fff', "color_title" => '#333', "color_desc" => '#333', "width" => '100', "height" => '100%', "active" => '', "border_color" => '', "icon_color" => '#ccc', "icon_size" => '16', "background_active" => '#fff', "color_active" => '#4e9e31'), $atts));
    $id = uniqid('yt_acc_item_') . rand() . time();
    $css = '';
    $icon_color = $icon_color ? 'color:' . $icon_color . ';' : '';
    $icon_size_ = $icon_size ? 'font-size: ' . intval($icon_size) . 'px;' : '';
    $style = $style_acc == 'border' ? 'border:1px solid ' . $border_color : '';
    $acc_item = "<li class='yt-accordion-group' id='" . $id . "' style='" . $style . "'>";
    $active = $active == "yes" ? 'enable' : 'disable';
    $acc_item .= "<h3 class='accordion-heading " . $active . "'";
    $acc_item .= " style='background:" . $background . "; box-shadow: 0px 1px 0px " . $background . " inset ; color:" . $color_title . ";font-size:" . $icon_size . "px'>";
    if ($icon != '') {
        if (strpos($icon, 'icon:') !== false) {
            $acc_item .= "<i class='icon_accordion fa fa-" . trim(str_replace('icon:', '', $icon)) . "'></i> ";
            if ($icon_color or $icon_size) {
                $css .= '#' . $id . ' .icon_accordion {' . $icon_color . $icon_size_ . '}';
            }
        } else {
            $acc_item .= '<img src="' . yt_image_media($icon) . '" style="width:' . $icon_size . 'px" alt="" /> ';
        }
    }
    $acc_item .= ' ' . $title . "</h3>";
    $acc_item .= "<div class='yt-accordion-inner' style='background:" . $background . ";color:" . $color_desc . ";border-color:" . $color_title . "'>" . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . "</div>";
    $acc_item .= "</li>";
    $doc = JFactory::getDocument();
    $doc->addStyleDeclaration($css);
    return $acc_item;
}
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:30,代码来源:shortcode.php

示例3: notificationYTShortcode

function notificationYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('effect' => 1, 'button_text' => 'Open notification', 'button_class' => '', 'close_button' => '', 'title' => 'notification Title', 'title_background' => 'rgba(0,0,0,0.1)', 'title_color' => '#222222', 'background' => '#ffffff', 'color' => '#666666', 'border' => 'none', 'shadow' => '0 solid #000000', 'width' => '640px', 'height' => 'auto', 'overlay_background' => '#000', 'class' => ''), $atts, 'notification');
    $id = uniqid('ytmodal_') . rand() . time();
    $id_over = uniqid() . rand() . time();
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/notification/css/notification.css", 'text/css');
    JHtml::_('jquery.framework');
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/notification/js/notification.js");
    $css = '
          #' . $id . ' .yt-modal-content-wrapper { height: ' . $atts['height'] . '; width: ' . $atts['width'] . '; background: ' . $atts['background'] . '; color: ' . $atts['color'] . '; border: ' . $atts['border'] . '; box-shadow: ' . $atts['shadow'] . '; }
          #' . $id . ' .yt-modal-title-wrapper { background: ' . $atts['title_background'] . '; }
          #' . $id . ' .yt-modal-title-wrapper h3 { color: ' . $atts['title_color'] . '; }
        ';
    $doc = JFactory::getDocument();
    $doc->addStyleDeclaration($css);
    $overlay_style = 'style=" background-color: ' . $atts['overlay_background'] . ';"';
    $close_button = $atts['close_button'] === 'yes' ? '<a href="javascript:void(0);" class="yt-modal-close"><i class="fa fa-remove"></i></a>' : '';
    $return = '<div class="yt-modal-wrapper">';
    $return .= '<a href="javascript:void(0);" class="yt-modal-trigger ' . $atts['button_class'] . '" data-modal="' . $id . '">' . $atts['button_text'] . '</a>';
    $return .= '<div class="yt-modal yt-modal-effect-' . $atts['effect'] . '" id="' . $id . '">
            <div class="yt-modal-content-wrapper">';
    $return .= '<div class="yt-modal-title-wrapper">';
    $return .= '<h3>' . $atts['title'] . '</h3>';
    $return .= $close_button;
    $return .= '</div>';
    $return .= '<div class="yt-content">';
    $return .= parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content));
    $return .= '</div>
            </div>
        </div>
        <div class="yt-modal-overlay ' . $id . '" ' . $overlay_style . '></div>';
    $return .= '</div>';
    return $return;
}
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:34,代码来源:shortcode.php

示例4: masonryYTShortcode

function masonryYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('id_masonry' => '', 'gutter' => null, 'rtl' => 'no'), $atts, 'yt_masonry');
    global $intense_masonry_gutter;
    $intense_masonry_gutter = $atts['gutter'];
    if (empty($intense_masonry_gutter)) {
        $intense_masonry_gutter = '0';
    }
    if (empty($id_masonry)) {
        $id_masonry = rand();
    }
    // intense_add_script( 'packery' );
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/masonry/js/masonry.js");
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/masonry/css/masonry.css", 'text/css');
    $init_script = '<script>
			function intenseInitMasonry() {
				var $ = jQuery;
					var $container = $(".intense.masonry");
					$container.packery({
					  itemSelector: ".item",
					  gutter: 0,
					  isOriginLeft: ' . ($atts['rtl'] == "no" ? 'false' : 'true') . '
					});
				return $container;
			}
			jQuery(function($){ $(window).load(function() {
				setTimeout(intenseInitMasonry, 250);
				intenseInitMasonry();
            }); });</script>';
    return $init_script . '<div id="' . $id_masonry . '" class="intense masonry' . (!empty($class) ? ' ' . $class : '') . '" style="position: relative;">' . parse_shortcode(str_replace(array("<br/>", "<br />"), " ", $content)) . '</div><div class="clearfix"></div>';
}
开发者ID:rodhoff,项目名称:MNW,代码行数:31,代码来源:shortcode.php

示例5: blockquoteYTShortcode

function blockquoteYTShortcode($atts, $content = null)
{
    extract(ytshortcode_atts(array("title" => '', "align" => 'none', 'border' => '#666', 'color' => '#fff', 'width' => 'auto'), $atts));
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/blockquote/css/blockquote.css");
    $source_title = $title != '' ? "<small>" . $title . "</small>" : '';
    return '<blockquote class="yt-clearfix yt-boxquote pull-' . $align . '" style="width:' . $width . '%;border-color:' . $border . ';color:' . $color . '">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . $source_title . '</blockquote>';
}
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:7,代码来源:shortcode.php

示例6: animationYTShortcode

function animationYTShortcode($atts, $content = null)
{
    $atts = ytshortcode_atts(array('type' => 'bounceIn', 'duration' => 1, 'delay' => 0, 'inline_block' => 'no', 'class' => ''), $atts, 'animation');
    $id = uniqid('yta') . rand() . time();
    $inline = $atts['inline_block'] === 'yes' ? ' display: inline-block;' : '';
    $style = array('duration' => array(), 'delay' => array());
    // CSS Prefix manage
    foreach (array('-webkit-', '-moz-', '-ms-', '-o-', '') as $vendor) {
        $style['duration'][] = $vendor . 'animation-duration:' . $atts['duration'] . 's';
        $style['delay'][] = $vendor . 'animation-delay:' . $atts['delay'] . 's';
    }
    // Get Css in $css variable
    $css = '#' . $id . ' {visibility:hidden;' . $inline . implode(';', $style['duration']) . ';' . implode(';', $style['delay']) . '}';
    // Add CSS in head
    $doc = JFactory::getDocument();
    $doc->addStyleDeclaration($css);
    // Add CSS file in head
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/assets/css/animate.css");
    JHtml::_('jquery.framework');
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.appear.js");
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/animation/js/animate.js");
    // Output HTML
    $output = '<div id="' . $id . '" class="yt-clearfix yt-animate " data-animation="' . $atts['type'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div>';
    return $output;
}
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:25,代码来源:shortcode.php

示例7: columnsYTShortcode

function columnsYTShortcode($atts, $content = null)
{
    extract(ytshortcode_atts(array("grid" => 'no'), $atts));
    $show_grid = $grid == 'yes' ? 'show-grid' : '';
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/columns/css/columns.css");
    return '<div class="yt-clearfix yt-show-grid ' . $show_grid . ' ">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>';
}
开发者ID:rodhoff,项目名称:MNW,代码行数:7,代码来源:shortcode.php

示例8: frameYTShortcode

function frameYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('style' => 'default', 'align' => 'left', 'class' => ''), $atts, 'yt_frame');
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/frame/css/frame.css", 'text/css');
    JHtml::script("plugins/system/ytshortcodes/shortcodes/frame/js/frame.js");
    return '<span class="yt-frame yt-frame-align-' . $atts['align'] . ' yt-frame-style-' . $atts['style'] . '"><span class="yt-frame-inner">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</span></span><div class="clear clearfix"></div>';
}
开发者ID:rodhoff,项目名称:MNW,代码行数:7,代码来源:shortcode.php

示例9: tabsYTShortcode

function tabsYTShortcode($atts, $content = null)
{
    global $tab_array;
    global $index_tab;
    extract(ytshortcode_atts(array("style" => '', "type" => 'basic', "width" => '', "align" => '', "height" => ''), $atts));
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/tabs/css/tabs.css");
    parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content));
    $tabs_style = $style != '' ? "style-" . $style : "";
    $num = count($tab_array);
    $tab = "<p><div class='yt-tabs " . $type . " " . $tabs_style . " pull-" . $align . "' style='width:" . $width . "; height:" . $height . "'><ul class='nav-tabs clearfix'>";
    for ($i = 0; $i < $num; $i++) {
        $active = $i == 0 ? 'active' : '';
        $tab_id = str_replace(' ', '-', $tab_array[$i]["title"]);
        $tab .= '<li class="' . $active . '"><a href="#' . $tab_id . $index_tab . '" class="';
        //$icon = ($tab_array[$i]["icon"] !='fa fa-' ? '<i class="'.$tab_array[$i]["icon"].'"></i><br/>' : '');
        $tab .= $active . '" >' . $tab_array[$i]["icon"] . '' . $tab_array[$i]["title"] . '</a></li>';
    }
    $tab .= "</ul>";
    $tab .= "<div class='tab-content'>";
    for ($i = 0; $i < $num; $i++) {
        $active = $i == 0 ? 'active' : '';
        $tab_id = str_replace(' ', '-', $tab_array[$i]["title"]);
        $tab = $tab . '<div id="' . $tab_id . $index_tab . '" class="clearfix ';
        $tab = $tab . $active . '" >' . $tab_array[$i]["content"] . '</div>';
    }
    $index_tab++;
    $tab .= "</div></div></p>";
    $tab_array = array();
    return $tab;
}
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:30,代码来源:shortcode.php

示例10: countdownYTShortcode

function countdownYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('count_date' => '2020/12/25', 'count_time' => '', 'count_size' => '32', 'count_color' => '', 'background' => '#FFFFFF', 'text_align' => 'default', 'text_size' => '14', 'text_color' => '#666666', 'align' => 'left', 'padding' => '', 'margin' => '', 'border' => '0px solid #DDD', 'radius' => '', 'divider' => 'none', 'divider_color' => 'rgba(100,100,100,.1)', 'class' => ''), $atts, 'countdown');
    $id = uniqid('yt_countdown_') . rand() . time();
    $css = '';
    $js = '';
    $divider_style = '';
    if ($atts['divider'] == 'colon') {
        $divider_style = '#' . $id . ' .yt-countdown-content .yt-cd-timer > span:after { font-size: ' . round($atts['count_size'] / 2) . 'px;line-height: ' . round($atts['count_size'] / 2) . 'px; color: ' . $atts['divider_color'] . ';}';
    }
    if ($atts['divider'] == 'vertical_line' || $atts['divider'] == 'horizontal_line') {
        $divider_style = '#' . $id . ' .yt-countdown-content .yt-cd-timer > span:after {background-color: ' . $atts['divider_color'] . ';}';
    } else {
        $divider_style = '#' . $id . ' .yt-countdown-content .yt-cd-timer > span:after { font-size: ' . $atts['count_size'] . 'px;line-height: ' . $atts['count_size'] . 'px; color: ' . $atts['divider_color'] . ';}';
    }
    if ($atts['margin'] or $atts['padding'] or $atts['radius'] or $atts['border'] or $atts['background']) {
        $margin = $atts['margin'] ? 'margin: ' . $atts['margin'] . ';' : '';
        $padding = $atts['padding'] ? 'padding: ' . $atts['padding'] . ';' : '';
        $radius = $atts['radius'] ? 'border-radius: ' . $atts['radius'] . ';' : '';
        $border = $atts['border'] ? 'border: ' . $atts['border'] . ';' : '';
        $background = $atts['background'] ? 'background-color: ' . $atts['background'] . ';' : '';
        $css .= '#' . $id . ' {' . $margin . $padding . $radius . $border . $background . '}';
    }
    $count_color = $atts['count_color'] ? 'color: ' . $atts['count_color'] . ';' : '';
    $css .= '#' . $id . '  .yt-cd-timer > span span[class*="text"] { color: ' . $atts['text_color'] . '; font-size: ' . $atts['text_size'] . 'px; }
			      #' . $id . '  .yt-cd-timer span > span { font-size: ' . $atts['count_size'] . 'px; line-height: ' . $atts['count_size'] . 'px; ' . $count_color . '}
			     ' . $divider_style . '
        ';
    $message = '';
    $countdown = $atts['count_date'];
    $countdown .= $atts['count_time'] ? ' ' . $atts['count_time'] : '';
    if (isset($content)) {
        $message = '.on("finish.countdown", function(event) {
                $(this).parent()
                   .addClass("disabled")
                   .html("' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />", "<p>", "</p>"), " ", $content)) . '");
            })';
    }
    $js .= '
            jQuery(document).ready(function ($) {
               $("#' . $id . ' .yt-cd-timer").countdown("' . $countdown . '").on("update.countdown", function(event) {
                   var $this = $(this).html(event.strftime(
                       "<span class=\'yt-cd-day\'><span class=\'yt-cd-day-data\'>%-D</span> <span class=\'yt-cd-day-text\'>DAY</span></span> "
                     + "<span class=\'yt-cd-hour\'><span class=\'yt-cd-hour-data\'>%H</span> <span class=\'yt-cd-hour-text\'>HOUR</span></span> "
                     + "<span class=\'yt-cd-minute\'><span class=\'yt-cd-minute-data\'>%M</span> <span class=\'yt-cd-minute-text\'>MIN</span></span> "
                     + "<span class=\'yt-cd-second\'><span class=\'yt-cd-second-data\'>%S</span> <span class=\'yt-cd-second-text\'>SEC</span></span>"));
                })' . $message . ';
            });
        ';
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/countdown/css/countdown.css", 'text/css');
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/countdown/js/jquery.countdown.js");
    $doc = JFactory::getDocument();
    $doc->addStyleDeclaration($css);
    $doc->addScriptDeclaration($js);
    return '<div id="' . $id . '" class="yt-countdown-wrapper clearfix yt-countdown-' . $atts['align'] . ' yt-cd-divider-' . $atts['divider'] . ' yt-countdown-text-' . $atts['text_align'] . '">
            <div class="yt-countdown-content">
                <div class="yt-cd-timer"></div>
            </div>
        </div>';
}
开发者ID:rodhoff,项目名称:MNW,代码行数:60,代码来源:shortcode.php

示例11: galleryYTShortcode

function galleryYTShortcode($atts, $content = null)
{
    global $gwidth, $gheight, $gcolumns, $galleryArray, $cation_gallery, $border_gallery, $padding_item, $id_uniq, $hover_gallery;
    $gwidth = 100;
    $gheight = 100;
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.prettyPhoto.js");
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/gallery/css/gallery.css");
    extract(ytshortcode_atts(array("title" => '', "width" => 100, "height" => 100, "columns" => 3, "align" => 'center', "caption" => '0', "border" => '0px solid #4e9e41', "border_size" => '0px', "border_color" => '#4e9e41', "border_style" => 'solid', "padding" => '0px', "hover" => '1'), $atts));
    //$border_gallery = ($border_size =='0px') ? '' : "border:".$border_size." ".$border_style." #4e9e41;";
    $border_gallery = "border: " . $border . "";
    switch ($caption) {
        case '1':
            $cation_gallery = 'caption_gallery_1';
            break;
        case '2':
            $cation_gallery = 'caption_gallery_2';
            break;
        default:
            $cation_gallery = '';
            break;
    }
    $hover_gallery = $hover;
    $padding_item = $padding == '0px' ? '' : "padding:" . $padding . "";
    $id_uniq = uniqid("yt") . rand() . time();
    $gwidth = $width;
    $gheight = $height;
    $gcolumns = $columns;
    $gallery = '';
    $galleryArray = array();
    parse_shortcode($content);
    $tags = array();
    $tags = '';
    foreach ($galleryArray as $key => $item) {
        $tags .= ',' . strtolower($item['tag']);
    }
    $tags = ltrim($tags, ',');
    $tags = explode(',', $tags);
    $newtags = array();
    foreach ($tags as $tag) {
        $newtags[] = trim($tag);
    }
    $tags = array_values(array_unique($newtags));
    if ($align != '') {
        $align = 'pull-' . $align;
    } else {
        $align = '';
    }
    $gallery .= '<div class="yt-gallery clearfix ' . $align . '" style="margin:0 auto">';
    $gallery .= '<div class = "yt-gallery-tabbed" style="display:table; margin-bottom:10px;">';
    $gallery .= '<ul class="tabnav">';
    $gallery .= '<li class="showall active ' . $id_uniq . '"><span >Show all</span></li>';
    foreach ($tags as $tag) {
        $gallery .= '<li id=' . trim($tag) . $id_uniq . ' class="' . $id_uniq . '"><span>' . ucfirst(trim($tag)) . '</span></li>';
    }
    $gallery .= '</ul>';
    $gallery .= '</div>';
    $gallery .= '<ul class="gallery-list clearfix">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />", "<p>", "</p>"), " ", $content)) . '</ul>';
    $gallery .= '</div>';
    return $gallery;
}
开发者ID:educacionbe,项目名称:stabwall,代码行数:60,代码来源:shortcode.php

示例12: BoxYTShortcode

function BoxYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('style' => 'default', 'title' => 'Box Title', 'title_color' => '#FFFFFF', 'box_color' => '#333333', 'color' => null, 'radius' => '', 'class' => ''), $atts, 'box');
    // Initioal Variables
    $id = uniqid('yt_box_') . rand() . time();
    $radius = '';
    $css = '';
    // Color Manage
    if ($atts['color'] !== null) {
        $atts['box_color'] = $atts['color'];
    }
    // Radius Manage
    if ($atts['radius']) {
        $radius = $atts['radius'] != '0' ? 'border-radius:' . $atts['radius'] . 'px;' : '';
    }
    // Get Css in $css variable
    $css .= '#' . $id . '{' . $radius . 'border-color:' . $atts['box_color'] . ';} #' . $id . ' .yt-box-title { background-color:' . $atts['box_color'] . ';color:' . $atts['title_color'] . ';}';
    // Add CSS in head
    $doc = JFactory::getDocument();
    $doc->addStyleDeclaration($css);
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/box/css/box.css");
    // Output HTML
    $return = '<div id="' . $id . '" class="yt-clearfix yt-box yt-box-style-' . $atts['style'] . '">
                    <div class="yt-box-title">' . $atts['title'] . '
                    </div>
                    <div class="yt-box-content yt-clearfix">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />", "<p>", "</p>"), " ", $content)) . '</div>
                </div>';
    return $return;
}
开发者ID:rodhoff,项目名称:MNW,代码行数:29,代码来源:shortcode.php

示例13: toggle_boxYTShortcode

function toggle_boxYTShortcode($atts, $content = null)
{
    extract(ytshortcode_atts(array("width" => '', "align" => '', "height" => ''), $atts));
    $toggle_box = "<ul class='yt-toggle-box pull-" . $align . "' style='width:" . $width . "' >";
    $toggle_box = $toggle_box . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content));
    $toggle_box = $toggle_box . "</ul>";
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/toggle_box/css/toggle_box.css");
    return $toggle_box;
}
开发者ID:rodhoff,项目名称:MNW,代码行数:9,代码来源:shortcode.php

示例14: pricing_tablesYTShortcode

function pricing_tablesYTShortcode($atts, $content = null)
{
    global $pcolumns, $type;
    extract(ytshortcode_atts(array("columns" => '3', "width" => '100%', "style" => '', "type" => ''), $atts));
    $pcolumns = $columns;
    $class = 'yt-pricing block col-' . $columns . ' pricing-' . $style;
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/pricing_tables/css/pricingtable.css", 'text/css', "screen");
    return '<div class="' . $class . '"  style="width:' . $width . ';" >' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>';
}
开发者ID:rodhoff,项目名称:MNW,代码行数:9,代码来源:shortcode.php

示例15: highlightYTShortcode

function highlightYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('background' => '#ddff99', 'bg' => null, 'color' => '#000000', 'size' => '14', 'class' => ''), $atts, 'highlight');
    if ($atts['bg'] !== null) {
        $atts['background'] = $atts['bg'];
    }
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/highlight/css/highlight.css", 'text/css');
    return '<span class="yt-highlight' . trim($atts['class']) . '" style="background:' . $atts['background'] . ';color:' . $atts['color'] . '; font-size:' . $atts['size'] . 'px; line-height:' . $atts['size'] . 'px">&nbsp;' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '&nbsp;</span>';
}
开发者ID:rodhoff,项目名称:MNW,代码行数:9,代码来源:shortcode.php


注:本文中的parse_shortcode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。