• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP td_block_layout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (!empty($posts)) {
         foreach ($posts as $post) {
             switch ($td_column_number) {
                 case '1':
                     $td_module_mx3 = new td_module_mx3($post);
                     $buffy .= $td_module_mx3->render($post);
                     break;
                 case '2':
                     $td_module_14 = new td_module_14($post);
                     $buffy .= $td_module_14->render($post);
                     break;
                 case '3':
                     //we use module 14 - maybe use a full screen one?
                     $td_module_14 = new td_module_14($post);
                     $buffy .= $td_module_14->render($post);
                     break;
             }
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:luxifel,项目名称:Bionerd,代码行数:26,代码来源:td_block_20.php


示例2: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     if (!empty($posts)) {
         foreach ($posts as $post) {
             switch ($td_column_number) {
                 case '1':
                     $td_module_mx3 = new td_module_mx3($post);
                     $buffy .= $td_module_mx3->render($post);
                     break;
                 case '2':
                     $td_module_14 = new td_module_14($post);
                     $buffy .= $td_module_14->render($post);
                     break;
                 case '3':
                     //we use module 14 - maybe use a full screen one?
                     $td_module_14 = new td_module_14($post);
                     $buffy .= $td_module_14->render($post);
                     break;
             }
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:tuanlibra,项目名称:thptxuanang,代码行数:30,代码来源:td_block_13.php


示例3: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     $td_post_count = 0;
     // the number of posts rendered
     $td_current_column = 1;
     //the current column
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_mx8 = new td_module_mx8($post);
             $td_module_10 = new td_module_10($post);
             $td_module_mx2 = new td_module_mx2($post);
             switch ($td_column_number) {
                 case '1':
                     //one column layout
                     if ($td_post_count == 0) {
                         //first post
                         $buffy .= $td_module_mx8->render();
                     } else {
                         $buffy .= $td_module_mx2->render();
                     }
                     break;
                 case '2':
                     //two column layout
                     if ($td_post_count == 0) {
                         // big posts
                         $buffy .= $td_module_mx8->render();
                     } else {
                         $buffy .= $td_module_10->render();
                     }
                     break;
                 case '3':
                     //three column layout
                     if ($td_post_count == 0) {
                         // big posts
                         $buffy .= $td_module_mx8->render();
                     } else {
                         $buffy .= $td_module_10->render();
                     }
                     break;
             }
             //current column
             if ($td_current_column == $td_column_number) {
                 $td_current_column = 1;
             } else {
                 $td_current_column++;
             }
             $td_post_count++;
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:tuanlibra,项目名称:thptxuanang,代码行数:54,代码来源:td_block_18.php


示例4: inner

 function inner($posts, $td_column_number = '')
 {
     //global $post;
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = $td_block_layout->get_column_number();
         // get the column width of the block
     }
     $td_post_count = 0;
     // the number of posts rendered
     $td_current_column = 1;
     //the current column
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_3 = new td_module_3($post);
             switch ($td_column_number) {
                 case '1':
                     //one column layout
                     $buffy .= $td_module_3->render($post);
                     break;
                 case '2':
                     //two column layout
                     $buffy .= $td_block_layout->open_row();
                     $buffy .= $td_block_layout->open6();
                     $buffy .= $td_module_3->render($post);
                     $buffy .= $td_block_layout->close6();
                     if ($td_current_column == 2) {
                         $buffy .= $td_block_layout->close_row();
                     }
                     break;
                 case '3':
                     //three column layout
                     $buffy .= $td_block_layout->open_row();
                     $buffy .= $td_block_layout->open4();
                     $buffy .= $td_module_3->render($post);
                     $buffy .= $td_block_layout->close4();
                     if ($td_current_column == 3) {
                         $buffy .= $td_block_layout->close_row();
                     }
                     break;
             }
             //current column
             if ($td_current_column == $td_column_number) {
                 $td_current_column = 1;
             } else {
                 $td_current_column++;
             }
             $td_post_count++;
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:Vatia13,项目名称:wordpress,代码行数:54,代码来源:td_block_4.php


示例5: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_16 = new td_module_16($post);
             $buffy .= $td_module_16->render($post);
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:tuanlibra,项目名称:thptxuanang,代码行数:13,代码来源:td_block_21.php


示例6: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_11 = new td_module_11($post);
             $buffy .= $td_block_layout->open12();
             //added in 010 theme - span 12 doesn't use rows
             $buffy .= $td_module_11->render($post);
             $buffy .= $td_block_layout->close12();
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:luxifel,项目名称:Bionerd,代码行数:16,代码来源:td_block_12.php


示例7: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = $td_block_layout->get_column_number();
         // get the column width of the block
     }
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_8 = new td_module_8($post);
             $buffy .= $td_module_8->render($post);
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:Vatia13,项目名称:wordpress,代码行数:17,代码来源:td_block_9.php


示例8: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_9 = new td_module_9($post);
             $buffy .= $td_module_9->render($post);
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:17,代码来源:td_block_10.php


示例9: inner

 function inner($posts, $td_column_number = '')
 {
     $td_block_layout = new td_block_layout();
     $td_block_layout->row_class = 'td-related-row';
     $td_block_layout->span4_class = 'td-related-span4';
     $buffy = '';
     $td_current_column = 1;
     //the current column
     if (!empty($posts)) {
         foreach ($posts as $td_post_count => $post) {
             $td_module_related_posts = new td_module_related_posts($post);
             switch ($td_column_number) {
                 case '3':
                     //the layout when we are on content + sidebar
                     $buffy .= $td_block_layout->open_row();
                     $buffy .= $td_block_layout->open4();
                     $buffy .= $td_module_related_posts->render();
                     $buffy .= $td_block_layout->close4();
                     if ($td_current_column == 3) {
                         $buffy .= $td_block_layout->close_row();
                     }
                     break;
                 case '5':
                     //the layout when we are on
                     $buffy .= $td_block_layout->open_row();
                     $buffy .= $td_block_layout->open4();
                     $buffy .= $td_module_related_posts->render();
                     $buffy .= $td_block_layout->close4();
                     if ($td_current_column == 5) {
                         $buffy .= $td_block_layout->close_row();
                     }
                     break;
             }
             //current column
             if ($td_current_column == $td_column_number) {
                 $td_current_column = 1;
             } else {
                 $td_current_column++;
             }
         }
         //end for each
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:tuanlibra,项目名称:thptxuanang,代码行数:45,代码来源:td_block_related_posts.php


示例10: inner

 function inner($posts, $td_column_number = '', $atts)
 {
     $buffy = '';
     $navigation = '';
     if (!empty($atts['navigation'])) {
         $navigation = $atts['navigation'];
     }
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     $td_post_count = 0;
     // the number of posts rendered
     $td_current_column = 1;
     //the current columng
     if (!empty($posts)) {
         $td_module_trending_now = new td_module_trending_now();
         switch ($td_column_number) {
             case '1':
                 //one column layout
                 $buffy .= $td_block_layout->open_row();
                 $buffy .= $td_module_trending_now->render(array($posts, $navigation));
                 if ($td_current_column == 1) {
                     $buffy .= $td_block_layout->close_row();
                 }
                 break;
             case '2':
                 //two column layout
                 $buffy .= $td_block_layout->open_row();
                 //$buffy .= $td_block_layout->open6();
                 $buffy .= $td_module_trending_now->render(array($posts, $navigation));
                 //$buffy .= $td_block_layout->close6();
                 if ($td_current_column == 2) {
                     $buffy .= $td_block_layout->close_row();
                 }
                 break;
             case '3':
                 //three column layout
                 $buffy .= $td_block_layout->open_row();
                 //$buffy .= $td_block_layout->open4();
                 $buffy .= $td_module_trending_now->render(array($posts, $navigation));
                 //$buffy .= $td_block_layout->close4();
                 if ($td_current_column == 3) {
                     $buffy .= $td_block_layout->close_row();
                 }
                 break;
         }
         //current column
         if ($td_current_column == $td_column_number) {
             $td_current_column = 1;
         } else {
             $td_current_column++;
         }
         $td_post_count++;
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:59,代码来源:td_block_trending_now.php


示例11: inner

 function inner($posts)
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (!empty($posts)) {
         $buffy .= '<div class="td-big-grid-wrapper">';
         $post_count = 0;
         // when 2 posts make post scroll full
         $td_scroll_posts = '';
         if (count($posts) == 2) {
             $td_scroll_posts = ' td-scroll-full';
         }
         foreach ($posts as $post) {
             if ($post_count == 0) {
                 $td_module_mx5 = new td_module_mx5($post);
                 $buffy .= $td_module_mx5->render($post_count);
                 $buffy .= '<div class="td-big-grid-scroll' . $td_scroll_posts . '">';
                 $post_count++;
                 continue;
             }
             if ($post_count == 1) {
                 $td_module_mx11 = new td_module_mx11($post);
                 $buffy .= $td_module_mx11->render($post_count);
                 $post_count++;
                 continue;
             }
             $td_module_mx6 = new td_module_mx6($post);
             $buffy .= $td_module_mx6->render($post_count);
             $post_count++;
         }
         if ($post_count < self::POST_LIMIT) {
             for ($i = $post_count; $i < self::POST_LIMIT; $i++) {
                 $td_module_mx_empty = new td_module_mx_empty();
                 $buffy .= $td_module_mx_empty->render($i);
             }
         }
         $buffy .= '</div>';
         // close td-big-grid-scroll
         $buffy .= '</div>';
         // close td-big-grid-wrapper
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:luxifel,项目名称:Bionerd,代码行数:44,代码来源:td_block_big_grid_3.php


示例12: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     //if we are on 3 columns
     //if ($td_column_number == 3) {//@todo nu merge functia td_util::vc_get_column_number()
     $td_block_layout = new td_block_layout();
     //if we have posts
     if (!empty($posts)) {
         $td_module_big_grid = new td_module_big_grid();
         $buffy .= $td_module_big_grid->render($posts);
     }
     $buffy .= $td_block_layout->close_all_tags();
     //}
     return $buffy;
 }
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:19,代码来源:td_block_big_grid.php


示例13: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_11 = new td_module_11($post);
             $buffy .= $td_block_layout->open12();
             //added in 010 theme - span 12 doesn't use rows
             $buffy .= $td_module_11->render($post);
             $buffy .= $td_block_layout->close12();
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:20,代码来源:td_block_12.php


示例14: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $navigation = '';
     if (!empty($this->atts['navigation'])) {
         $navigation = $this->atts['navigation'];
     }
     $td_block_layout = new td_block_layout();
     if (!empty($posts)) {
         $buffy .= $td_block_layout->open_row();
         $trending_now_unique_id = td_global::td_generate_unique_id();
         //generate unique id for this object
         $buffy .= '<div class="td-trending-now-wrapper" id="' . $trending_now_unique_id . '" data-start="' . esc_attr($navigation) . '">';
         $buffy .= '<div class="td-trending-now-title">' . __td('Trending Now', TD_THEME_NAME) . '</div><div class="td-trending-now-display-area">';
         foreach ($posts as $post_count => $post) {
             $td_module_trending_now = new td_module_trending_now($post);
             $buffy .= $td_module_trending_now->render($post_count);
         }
         $buffy .= '</div>';
         // ZA Cutom
         // $buffy .= '<div class="td-next-prev-wrap">';
         //     $buffy .= '<a href="#"
         //                   class="td_ajax-prev-pagex td-trending-now-nav-left"
         //                   data-wrapper-id="' . $trending_now_unique_id . '"
         //                   data-moving="left"
         //                   data-control-start="' . $navigation . '"><i class="td-icon-menu-left"></i></a>';
         //     $buffy .= '<a href="#"
         //                   class="td_ajax-next-pagex td-trending-now-nav-right"
         //                   data-wrapper-id="' . $trending_now_unique_id . '"
         //                   data-moving="right"
         //                   data-control-start="' . $navigation . '"><i class="td-icon-menu-right"></i></a>';
         // $buffy .= '</div>';
         $buffy .= '</div>';
         $buffy .= $td_block_layout->close_row();
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:weerapat,项目名称:wp-daily,代码行数:38,代码来源:td_block_trending_now.php


示例15: inner

 function inner($posts)
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (!empty($posts)) {
         $buffy .= '<div class="td-big-grid-wrapper">';
         $post_count = 0;
         foreach ($posts as $post) {
             $td_module_mx5 = new td_module_mx5($post);
             $buffy .= $td_module_mx5->render($post_count);
             $post_count++;
         }
         if ($post_count < self::POST_LIMIT) {
             for ($i = $post_count; $i < self::POST_LIMIT; $i++) {
                 $td_module_mx_empty = new td_module_mx_empty();
                 $buffy .= $td_module_mx_empty->render($i);
             }
         }
         $buffy .= '</div>';
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:luxifel,项目名称:Bionerd,代码行数:23,代码来源:td_block_big_grid_4.php


示例16: inner

 function inner($posts, $td_column_number = '')
 {
     //global $post;
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = $td_block_layout->get_column_number();
         // get the column width of the block
     }
     //echo $td_column_number;
     if ($td_column_number == 3 and !empty($posts)) {
         //$td_module_big_grid = new td_module_big_grid();
         $td_module_big_grid = new td_module_slide_big();
         $buffy .= $td_module_big_grid->render(array($posts, $this->td_create_slider, 'iosSlider_' . $this->block_uid));
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:Vatia13,项目名称:tofido,代码行数:18,代码来源:td_slide_big.php


示例17: inner

    /**
     * @param $posts
     * @param string $td_column_number - get the column number
     * @param string $autoplay - not use via ajax
     * @param bool $is_ajax - if true the script will return the js inline, if not, it will use the td_js_buffer class
     * @return string
     */
    function inner($posts, $td_column_number = '', $autoplay = '', $is_ajax = false)
    {
        //global $post;
        $buffy = '';
        $td_block_layout = new td_block_layout();
        if (empty($td_column_number)) {
            $td_column_number = $td_block_layout->get_column_number();
            // get the column width of the block
        }
        $td_post_count = 0;
        // the number of posts rendered
        $td_current_column = 1;
        //the current column
        $td_unique_id_slide = td_global::td_generate_unique_id();
        $buffy .= '<div id="' . $td_unique_id_slide . '" class="iosSlider iosSlider-col-' . $td_column_number . ' td_mod_wrap">';
        $buffy .= '<div class="slider ">';
        if (!empty($posts)) {
            foreach ($posts as $post) {
                //$buffy .= td_modules::mod_slide_render($post, $td_column_number, $td_post_count);
                $td_module_slide = new td_module_slide($post);
                $buffy .= $td_module_slide->render($td_column_number, $td_post_count);
                //current column
                if ($td_current_column == $td_column_number) {
                    $td_current_column = 1;
                } else {
                    $td_current_column++;
                }
                $td_post_count++;
            }
        }
        $buffy .= $td_block_layout->close_all_tags();
        $buffy .= '</div>';
        //close slider
        $buffy .= '<div class = "prevButton"></div>';
        $buffy .= '<div class = "nextButton"></div>';
        $buffy .= '</div>';
        //clos ios
        if (!empty($autoplay)) {
            $autoplay_string = '
            autoSlide: true,
            autoSlideTimer: ' . $autoplay * 1000 . ',
            ';
        } else {
            $autoplay_string = '';
        }
        $slide_js = '
jQuery(document).ready(function() {
    jQuery("#' . $td_unique_id_slide . '").iosSlider({
        snapToChildren: true,
        desktopClickDrag: true,
        keyboardControls: false,
        ' . $autoplay_string . '

        infiniteSlider: true,
        navPrevSelector: jQuery("#' . $td_unique_id_slide . ' .prevButton"),
        navNextSelector: jQuery("#' . $td_unique_id_slide . ' .nextButton"),
        onSlideComplete: slideContentComplete,
        onSlideStart: slideStartedMoving
    });
});
    ';
        if ($is_ajax) {
            $buffy .= '<script>' . $slide_js . '</script>';
        } else {
            td_js_buffer::add_to_footer($slide_js);
        }
        return $buffy;
    }
开发者ID:Vatia13,项目名称:tofido,代码行数:75,代码来源:td_slide.php


示例18: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     $td_post_count = 0;
     // the number of posts rendered
     $td_current_column = 1;
     //the current column
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_mx1 = new td_module_mx1($post);
             $td_module_mx2 = new td_module_mx2($post);
             switch ($td_column_number) {
                 case '1':
                     //one column layout
                     $buffy .= $td_block_layout->open12();
                     //added in 010 theme - span 12 doesn't use rows
                     if ($td_post_count == 0) {
                         //first post
                         $buffy .= $td_module_mx1->render();
                     } else {
                         $buffy .= $td_module_mx2->render();
                     }
                     $buffy .= $td_block_layout->close12();
                     break;
                 case '2':
                     //two column layout
                     $buffy .= $td_block_layout->open_row();
                     if ($td_post_count <= 1) {
                         // big posts
                         $buffy .= $td_block_layout->open6();
                         $buffy .= $td_module_mx1->render();
                         $buffy .= $td_block_layout->close6();
                     }
                     if ($td_post_count == 1) {
                         //close big posts
                         $buffy .= $td_block_layout->close_row();
                     }
                     if ($td_post_count > 1) {
                         //4th post (big posts are rendered)
                         if ($td_current_column == 1) {
                             // column 1
                             $buffy .= $td_block_layout->open_row();
                         }
                         $buffy .= $td_block_layout->open6();
                         $buffy .= $td_module_mx2->render();
                         $buffy .= $td_block_layout->close6();
                         if ($td_current_column == 2) {
                             // column 2
                             $buffy .= $td_block_layout->close_row();
                         }
                     }
                     break;
                 case '3':
                     //three column layout
                     $buffy .= $td_block_layout->open_row();
                     if ($td_post_count <= 2) {
                         // big posts
                         $buffy .= $td_block_layout->open4();
                         $buffy .= $td_module_mx1->render();
                         $buffy .= $td_block_layout->close4();
                     }
                     if ($td_post_count == 2) {
                         //close big posts
                         $buffy .= $td_block_layout->close_row();
                     }
                     if ($td_post_count > 2) {
                         //4th post (big posts are rendered)
                         if ($td_current_column == 1) {
                             // column 1
                             $buffy .= $td_block_layout->open_row();
                         }
                         $buffy .= $td_block_layout->open4();
                         $buffy .= $td_module_mx2->render();
                         $buffy .= $td_block_layout->close4();
                         if ($td_current_column == 3) {
                             // column 3
                             $buffy .= $td_block_layout->close_row();
                         }
                     }
                     break;
             }
             //current column
             if ($td_current_column == $td_column_number) {
                 $td_current_column = 1;
             } else {
                 $td_current_column++;
             }
             $td_post_count++;
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:98,代码来源:td_block_15.php


示例19: inner

 function inner($posts, $td_column_number = '')
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block from the page builder API
     }
     $td_post_count = 0;
     // the number of posts rendered
     if (!empty($posts)) {
         foreach ($posts as $post) {
             $td_module_4 = new td_module_4($post);
             $td_module_6 = new td_module_6($post);
             switch ($td_column_number) {
                 case '1':
                     //one column layout
                     $buffy .= $td_block_layout->open12();
                     //added in 010 theme - span 12 doesn't use rows
                     if ($td_post_count == 0) {
                         //first post
                         $buffy .= $td_module_4->render();
                     } else {
                         $buffy .= $td_module_6->render();
                     }
                     $buffy .= $td_block_layout->close12();
                     break;
                 case '2':
                     //two column layout
                     $buffy .= $td_block_layout->open_row();
                     if ($td_post_count == 0) {
                         //first post
                         $buffy .= $td_block_layout->open6();
                         $buffy .= $td_module_4->render();
                         $buffy .= $td_block_layout->close6();
                     } else {
                         //the rest
                         $buffy .= $td_block_layout->open6();
                         $buffy .= $td_module_6->render();
                     }
                     break;
                 case '3':
                     //three column layout
                     $buffy .= $td_block_layout->open_row();
                     if ($td_post_count == 0) {
                         //first post
                         $buffy .= $td_block_layout->open4();
                         $buffy .= $td_module_4->render();
                         $buffy .= $td_block_layout->close4();
                     } else {
                         //2-3 cols
                         $buffy .= $td_block_layout->open4();
                         $buffy .= $td_module_6->render();
                         if ($td_post_count == 4) {
                             //make new column
                             $buffy .= $td_block_layout->close4();
                         }
                     }
                     break;
             }
             $td_post_count++;
         }
     }
     $buffy .= $td_block_layout->close_all_tags();
     return $buffy;
 }
开发者ID:luxifel,项目名称:Bionerd,代码行数:66,代码来源:td_block_1.php


示例20: inner

 function inner($posts)
 {
     $buffy = '';
     $td_block_layout = new td_block_layout();
     if (!empty($posts)) {
         $buffy .= '<div class="td-big-grid-wrapper">';
         $post_count = 0;
         // when 2 posts make post scroll full
         $td_scroll_posts = '';
         if (count($posts) == 3) {
             $td_scroll_posts = ' td-scroll-full';
         }
         foreach ($posts as $post) {
             // group 1
             if ($post_count == 0) {
                 $buffy .= '<div class="td-grid-columns td-grid-group-1">';
                 $td_module_mx14 = new td_module_mx14($post);
                 $buffy .= $td_module_mx14->render($post_count);
                 $post_count++;
                 continue;
             }
             if ($post_count == 1) {
                 $td_module_mx12 = new td_module_mx12($post);
                 $buffy .= $td_module_mx12->render($post_count);
                 $post_count++;
                 continue;
             }
             // group 2
             if ($post_count == 2) {
                 $buffy .= '</div>';
                 $buffy .= '<div class="td-big-grid-scroll' . $td_scroll_posts . '">';
                 $buffy .= '<div class="td-grid-columns td-grid-group-2">';
             }
             if ($post_count >= 2 && $post_count <= 4) {
                 $td_module_mx12 = new td_module_mx12($post);
                 $buffy .= $td_module_mx12->render($post_count);
                 $post_count++;
                 continue;
             }
             // group 3
             if ($post_count == 5) {
                 $buffy .= '</div>';
                 $buffy .= '<div class="td-grid-columns td-grid-group-3">';
                 $td_module_mx12 = new td_module_mx12($post);
                 $buffy .= $td_module_mx12->render($post_count);
                 $post_count++;
                 continue;
             }
             if ($post_count == 6) {
                 $td_module_mx14 = new td_module_mx14($post);
                 $buffy .= $td_module_mx14->render($post_count);
                 $buffy .= '</div>';
                 $post_count++;
                 continue;
             }
         }
         if ($post_count < self::POST_LIMIT) {
             for ($i = $post_count; $i < self::POST_LIMIT; $i++) {
                 // group 1
                 if ($post_count == 0) {
                     $buffy .= '<div class="td-grid-columns td-grid-group-1">';
                     $td_module_mx_empty = new td_module_mx_empty();
                     $buffy .= $td_module_mx_empty->render($post_count);
                     $post_count++;
                 }
                 if ($post_count == 1) {
                     $td_module_mx_empty = new td_module_mx_empty();
                     $buffy .= $td_module_mx_empty->render($post_count);
                     $post_count++;
                 }
                 // group 2
                 if ($post_count == 2) {
                     $buffy .= '</div>';
                     $buffy .= '<div class="td-big-grid-scroll' . $td_scroll_posts . '">';
                     $buffy .= '<div class="td-grid-columns td-grid-group-2">';
                 }
                 if ($post_count >= 2 && $post_count <= 4) {
                     $td_module_mx_empty = new td_module_mx_empty();
                     $buffy .= $td_module_mx_empty->render($post_count);
                     $post_count++;
                 }
                 // group 3
                 if ($post_count == 5) {
                     $buffy .= '</div>';
                     $buffy .= '<div class="td-grid-columns td-grid-group-3">';
                     $td_module_mx_empty = new td_module_mx_empty();
                     $buffy .= $td_module_mx_empty->render($post_count);
                     $post_count++;
                 }
                 if ($post_count == 6) {
                     $td_module_mx_empty = new td_module_mx_empty();
                     $buffy .= $td_module_mx_empty->render($post_count);
                     $post_count++;
                     $buffy .= '</div>';
                 }
             }
         }
         $buffy .= '</div>';
         // close td-big-grid-scroll
         $buffy .= '</div>';
//.........这里部分代码省略.........
开发者ID:weerapat,项目名称:wp-daily,代码行数:101,代码来源:td_block_big_grid_8.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP td_demo_media类代码示例发布时间:2022-05-23
下一篇:
PHP task类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap