function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     $buffy = '';
     //output buffer
     $trending_style = '';
     // style 2
     if (!empty($atts['style'])) {
         $trending_style = ' td-pb-full-cell td-trending-style2';
     }
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes() . $trending_style . '">';
     //get the sub category filter for this block
     $buffy .= $this->get_pull_down_filter();
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts, '', $atts);
     //inner content of the block
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination();
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
 function render($atts, $content = null)
 {
     parent::render($atts);
     $buffy = '';
     extract(shortcode_atts(array('limit' => '6', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'header_color' => ''), $atts));
     $cat_args = array('show_count' => true, 'orderby' => 'count', 'hide_empty' => false, 'order' => 'DESC', 'number' => $limit, 'exclude' => get_cat_ID(TD_FEATURED_CAT));
     // exclude categories from the demo
     if (TD_DEPLOY_MODE == 'demo' or TD_DEPLOY_MODE == 'dev') {
         $cat_args['exclude'] = '90, 91, 92, 93 , 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 82, 83, 84, 85, 86, 87, 88, 89, 98, ' . get_cat_ID(TD_FEATURED_CAT);
     }
     $categories = get_categories($cat_args);
     // has a limit of 6 by default
     $buffy .= '<div class="' . $this->get_block_classes(array('widget', 'widget_categories')) . '">';
     $buffy .= $this->get_block_title();
     if (!empty($categories)) {
         $buffy .= '<ul class="td-pb-padding-side">';
         foreach ($categories as $category) {
             if (strtolower($category->cat_name) != 'uncategorized') {
                 $buffy .= '<li><a href="' . get_category_link($category->cat_ID) . '">' . $category->name . '<span class="td-cat-no">' . $category->count . '</span></a></li>';
             }
         }
         $buffy .= '</ul>';
     }
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
Esempio n. 3
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     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
     }
     $buffy = '';
     //output buffer
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the block title
     $buffy .= $this->get_block_title();
     //get the sub category filter for this block
     $buffy .= $this->get_pull_down_filter();
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner td-column-' . $td_column_number . '">';
     $buffy .= $this->inner($this->td_query->posts, $td_column_number);
     //inner content of the block
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination();
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
 function render($atts, $content = null)
 {
     $atts['limit'] = 5;
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     if (is_category()) {
         // we have no related posts to display
         if ($this->td_query->post_count == 0) {
             return '<div class="td_line_above_cat_big_grid"> </div>';
         }
         /** if we have posts in the big grid and we are on a category, do not show the default page no posts message. @see td_global::$custom_no_posts_message */
         td_global::$custom_no_posts_message = false;
     }
     $buffy = '';
     //output buffer
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the block title
     $buffy .= $this->get_block_title();
     //get the sub category filter for this block
     $buffy .= $this->get_pull_down_filter();
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts);
     //inner content of the block
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination();
     $buffy .= '</div> <!-- ./block -->';
     $buffy .= '<div class="clearfix"></div>';
     return $buffy;
 }
Esempio n. 5
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     extract(shortcode_atts(array('autoplay' => ''), $atts));
     $buffy = '';
     //output buffer
     if (!empty($class)) {
         $class = ' ' . $class;
     } else {
         $class = '';
     }
     if ($this->td_query->have_posts() and $this->td_query->found_posts > 1) {
         //get the js for this block
         $buffy .= $this->get_block_js();
         $buffy .= '<div class="td_block_wrap td_block_slide td_normal_slide' . $class . '">';
         //get the block title
         $buffy .= $this->get_block_title();
         //get the sub category filter for this block
         $buffy .= $this->get_pull_down_filter();
         $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
         //inner content of the block
         $buffy .= $this->inner($this->td_query->posts, '', $autoplay);
         $buffy .= '</div>';
         $buffy .= '</div> <!-- ./block1 -->';
     }
     return $buffy;
 }
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     // this block need td_column_number to add rows if more posts are displayed on a post.
     /// the td_column_number is not standard here, it's    5 for full width / 3 for content + sidebar
     extract(shortcode_atts(array('td_column_number' => ''), $atts));
     // we have no related posts to display
     if ($this->td_query->post_count == 0) {
         return;
     }
     $buffy = '';
     //output buffer
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the filter for this block
     $buffy .= '<h4 class="td-related-title">';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-left td-cur-simple-item" data-td_filter_value="" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('RELATED ARTICLES', TD_THEME_NAME) . '</a>';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_related_more_from_author" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('MORE FROM AUTHOR', TD_THEME_NAME) . '</a>';
     $buffy .= '</h4>';
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts, $td_column_number);
     //inner content of the block
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination();
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
 function render($atts, $content = null)
 {
     parent::render($atts);
     $td_social_api = new td_social_api();
     extract(shortcode_atts(array('icon_style' => '1', 'icon_size' => '32', 'custom_title' => '', 'header_color' => '', 'open_in_new_window' => ''), $atts));
     $td_target = '';
     if (!empty($open_in_new_window)) {
         $td_target = ' target="_blank"';
     }
     $buffy = '';
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     $buffy .= $this->get_block_title();
     foreach (td_social_icons::$td_social_icons_array as $td_social_id => $td_social_name) {
         if (!empty($atts[$td_social_id])) {
             $social_network_meta = $this->get_social_network_meta($td_social_id, $atts[$td_social_id], $td_social_api);
             $buffy .= '<div class="td_social_type td-pb-margin-side td_social_' . $td_social_id . '">';
             $buffy .= '<div class="td-sp td-sp-' . $td_social_id . '"></div>';
             $buffy .= '<span class="td_social_info">' . number_format($social_network_meta['api']) . '</span>';
             $buffy .= '<span class="td_social_info td_social_info_name">' . $social_network_meta['text'] . '</span>';
             $buffy .= '<span class="td_social_button"><a href="' . $social_network_meta['url'] . '"' . $td_target . '>' . $social_network_meta['button'] . '</a></span>';
             $buffy .= '</div>';
         }
     }
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     // we have no related posts to display
     if ($this->td_query->post_count == 0) {
         return;
     }
     $buffy = '';
     //output buffer
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the filter for this block
     $buffy .= '<h4 class="td-related-title">';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-left td-cur-simple-item" data-td_filter_value="" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('RELATED ARTICLES') . '</a>';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_related_more_from_author" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('MORE FROM AUTHOR') . '</a>';
     $buffy .= '</h4>';
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts);
     //inner content of the block
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination();
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
 function render($atts, $content = null)
 {
     parent::render($atts);
     $buffy = '';
     extract(shortcode_atts(array('limit' => '6', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'header_color' => ''), $atts));
     $cat_args = array('show_count' => true, 'orderby' => 'count', 'hide_empty' => false, 'order' => 'DESC', 'number' => $limit + 1, 'exclude' => get_cat_ID(TD_FEATURED_CAT));
     // exclude categories from the demo
     if (TD_DEPLOY_MODE == 'demo' or TD_DEPLOY_MODE == 'dev') {
         $cat_args['exclude'] = '44,45,46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 110, ' . get_cat_ID(TD_FEATURED_CAT);
     }
     $categories = get_categories($cat_args);
     $buffy .= '<div class="td_block_wrap td_popular_categories widget widget_categories">';
     $buffy .= $this->get_block_title();
     if (!empty($categories)) {
         $buffy .= '<ul class="td-pb-padding-side">';
         foreach ($categories as $category) {
             if (strtolower($category->cat_name) != 'uncategorized') {
                 $buffy .= '<li><a href="' . get_category_link($category->cat_ID) . '">' . $category->name . '<span class="td-cat-no">' . $category->count . '</span></a></li>';
             }
         }
         $buffy .= '</ul>';
     }
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
Esempio n. 10
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     $buffy = '';
     //output buffer
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts);
     //inner content of the block
     $buffy .= '</div>';
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
Esempio n. 11
0
 function render($atts, $content = null)
 {
     // for big grids, extract the td_grid_style
     extract(shortcode_atts(array('td_grid_style' => 'td-grid-style-1'), $atts));
     $atts['limit'] = self::POST_LIMIT;
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     $buffy = '';
     $buffy .= '<div class="' . $this->get_block_classes(array($td_grid_style, 'td-hover-1')) . '">';
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts);
     //inner content of the block
     $buffy .= '<div class="clearfix"></div>';
     $buffy .= '</div>';
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
Esempio n. 12
0
 function render($atts, $content = null)
 {
     $buffy_categories = '';
     $td_no_subcats_class = '';
     extract(shortcode_atts(array('limit' => 5, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'show_child_cat' => '', 'sub_cat_ajax' => ''), $atts));
     if (!empty($show_child_cat) and !empty($category_id)) {
         // check for subcats existence
         $td_subcats = get_categories(array('child_of' => $category_id, 'number' => 1));
         if (!empty($td_subcats)) {
             $atts['limit'] = 3;
             //alter the loop because we don't have space now with the categories
         }
     }
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     //get subcategories, it returns false if there are no categories
     $get_block_sub_cats = $this->get_mega_menu_subcategories($atts);
     //we have subcategories
     if ($get_block_sub_cats !== false) {
         $buffy_categories .= '<div class="td_mega_menu_sub_cats">';
         //get the sub category filter for this block
         $buffy_categories .= $get_block_sub_cats;
         $buffy_categories .= '</div>';
     } else {
         $td_no_subcats_class = ' td-no-subcats';
     }
     $buffy = '';
     //output buffer
     //custom categories
     //end custom categories
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes(array($td_no_subcats_class)) . '">';
     //add the categories IF we have some
     $buffy .= $buffy_categories;
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     //inner content of the block
     $buffy .= $this->inner($this->td_query->posts);
     $buffy .= '</div>';
     $buffy .= $this->get_block_pagination();
     //get the ajax pagination for this block
     $buffy .= '<div class="clearfix"></div>';
     $buffy .= '</div> <!-- ./block1 -->';
     return $buffy;
 }
Esempio n. 13
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query
     $buffy = '';
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     $buffy .= $this->get_block_title();
     $buffy .= '<div class="td_mod_wrap">';
     //only run the filter if we have visual composer
     if (function_exists('wpb_js_remove_wpautop')) {
         $buffy .= wpb_js_remove_wpautop($content);
     } else {
         $buffy .= $content;
         //no visual composer
     }
     $buffy .= '</div>';
     $buffy .= '</div>';
     return $buffy;
 }
Esempio n. 14
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     $buffy = '';
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the block title
     $buffy .= $this->get_block_title();
     //get the sub category filter for this block
     $buffy .= $this->get_pull_down_filter();
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts);
     //inner content of the block
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination();
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
Esempio n. 15
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     extract(shortcode_atts(array('autoplay' => ''), $atts));
     $buffy = '';
     //output buffer
     if ($this->td_query->have_posts() and $this->td_query->found_posts > 1) {
         //get the js for this block
         $buffy .= $this->get_block_js();
         $buffy .= '<div class="' . $this->get_block_classes() . '">';
         $buffy .= $this->get_block_title();
         $buffy .= $this->get_pull_down_filter();
         $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
         $buffy .= $this->inner($this->td_query->posts, '', $autoplay);
         $buffy .= '</div>';
         $buffy .= '</div> <!-- ./block1 -->';
     }
     return $buffy;
 }
Esempio n. 16
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     // this block need td_column_number to add rows if more posts are displayed on a post.
     /// the td_column_number is not standard here, it's    5 for full width / 3 for content + sidebar
     extract(shortcode_atts(array('td_column_number' => ''), $atts));
     // we have no related posts to display
     if ($this->td_query->post_count == 0) {
         return;
     }
     $buffy = '';
     //output buffer
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the filter for this block
     $buffy .= '<h4 class="td-related-title">';
     // $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-left td-cur-simple-item" data-td_filter_value="" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('RELATED ARTICLES', TD_THEME_NAME) . '</a>';
     $buffy .= '<span class="title-inner">' . __td('RELATED ARTICLES', TD_THEME_NAME) . '</span>';
     // ZA Custom
     $buffy .= '<div id="related-filter">Filter <img src="/wp-content/uploads/2015/12/icon-caret-down_white.png" alt=""></div>';
     $buffy .= '<div class="td-related-mobile">';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right " data-td_filter_value="td_related_more_from_author" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="NEUTRAL" src="/wp-content/uploads/2015/12/icon-articleNeutual.png" alt=""><img class="NEUTRAL-hover" src="/wp-content/uploads/2015/12/icon-articleNeutual-selected.png" alt=""><span> NEUTRAL</span></div></div></a>';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_happy" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleHappy.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleHappy-selected.png" alt=""><span> HAPPY</span></div></div></a>';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_funny" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleFunny.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleFunny-selected.png" alt=""><span> FUNNY</span></div></div></a>';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_romantic" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleRomantic.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleRomantic-selected.png" alt=""><span> ROMANTIC</span></div></div></a>';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_surprised" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleSurprised.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleSurprised-selected.png" alt=""><span> SURPRISED</span></div></div></a>';
     $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_sad" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleSad.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleSad-selected.png" alt=""><span> SAD</span></div></div></a>';
     $buffy .= '</div>';
     // End ZA Custom
     $buffy .= '</h4>';
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     $buffy .= $this->inner($this->td_query->posts, $td_column_number);
     //inner content of the block
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination();
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
Esempio n. 17
0
 function render($atts, $content = null)
 {
     if (empty($atts['custom_title'])) {
         $atts['custom_title'] = 'Weather';
     }
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     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
     }
     $buffy = '';
     //output buffer
     $buffy .= '<div class="' . $this->get_block_classes() . '">';
     //get the block title
     $buffy .= $this->get_block_title();
     $buffy .= '<div id=' . $this->block_uid . ' class="td-weather-wrap td_block_inner td-column-' . $td_column_number . '">';
     $buffy .= td_weather::render_generic($atts, $this->block_uid);
     $buffy .= '</div>';
     $buffy .= '</div> <!-- ./block -->';
     return $buffy;
 }
 function render($atts, $content = null)
 {
     parent::render($atts);
     // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
     extract(shortcode_atts(array('limit' => 5, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'show_child_cat' => '', 'tag_slug' => '', 'header_color' => ''), $atts));
     $buffy = '';
     //output buffer
     //custom categories
     //get subcategories, it returns false if there are no categories
     $get_block_sub_cats = $this->get_pull_down_filter();
     $buffy_categories = '';
     $td_no_subcats_class = '';
     //we have subcategories
     if ($get_block_sub_cats !== false) {
         $buffy_categories .= '<div class="td_mega_menu_sub_cats">';
         //get the sub category filter for this block
         $buffy_categories .= $get_block_sub_cats;
         $buffy_categories .= '</div>';
     } else {
         $td_no_subcats_class = ' td-no-subcats';
     }
     //end custom categories
     //get the js for this block
     $buffy .= $this->get_block_js();
     $buffy .= '<div class="' . $this->get_block_classes(array($td_no_subcats_class)) . '">';
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     //inner content of the block
     $buffy .= $this->inner($this->td_query->posts);
     $buffy .= '</div>';
     //add the categories IF we have some
     $buffy .= $buffy_categories;
     $buffy .= $this->get_block_pagination();
     //get the ajax pagination for this block
     $buffy .= '<div class="clearfix"></div>';
     $buffy .= '</div> <!-- ./block1 -->';
     return $buffy;
 }
Esempio n. 19
0
 function render($atts, $content = null)
 {
     parent::render($atts);
     global $wpdb;
     $sort = '';
     extract(shortcode_atts(array('sort' => '', 'exclude' => '', 'include' => ''), $this->atts));
     //print_r($atts);
     //die;
     $get_users_array = array();
     if (!empty($exclude)) {
         $exclude_array = explode(',', $exclude);
         $get_users_array['exclude'] = $exclude_array;
     }
     if (!empty($include)) {
         $include_array = explode(',', $include);
         $get_users_array['include'] = $include_array;
     }
     if (empty($sort)) {
         $get_users_array['orderby'] = 'display_name';
         //$td_authors = get_users(array('orderby' => 'display_name'));
     } else {
         $get_users_array['orderby'] = 'post_count';
         $get_users_array['order'] = 'DESC';
         //$td_authors = get_users(array('orderby' => 'post_count', 'order' => 'DESC'));
     }
     $td_authors = get_users($get_users_array);
     $buffy = '';
     $buffy .= '<div class="' . $this->get_block_classes(array('td_top_authors')) . '">';
     $buffy .= $this->get_block_title();
     if (!empty($td_authors)) {
         foreach ($td_authors as $td_author) {
             //echo td_global::$current_author_obj->ID;
             //echo $td_author->ID;
             //print_r($td_author);
             $current_author_class = '';
             if (!empty(td_global::$current_author_obj->ID) and td_global::$current_author_obj->ID == $td_author->ID) {
                 $current_author_class = ' td-active';
             }
             $buffy .= '<div class="td_mod_wrap td-pb-padding-side' . $current_author_class . '">';
             $buffy .= '<a href="' . get_author_posts_url($td_author->ID) . '">' . get_avatar($td_author->user_email, '70') . '</a>';
             $buffy .= '<div class="item-details">';
             $buffy .= '<div class="td-authors-name">';
             $buffy .= '<a href="' . get_author_posts_url($td_author->ID) . '">' . $td_author->display_name . '</a>';
             $buffy .= '</div>';
             $buffy .= '<span class="td-author-post-count">';
             $buffy .= count_user_posts($td_author->ID) . ' ' . __td('POSTS', TD_THEME_NAME);
             $buffy .= '</span>';
             $buffy .= '<span class="td-author-comments-count">';
             $comment_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) AS total FROM {$wpdb->comments} WHERE comment_approved = 1 AND user_id = %d", $td_author->ID));
             $buffy .= $comment_count . ' ' . __td('COMMENTS', TD_THEME_NAME);
             $buffy .= '</span>';
             $buffy .= '<div class="td-authors-url">';
             $buffy .= '<a href="' . $td_author->user_url . '">' . $td_author->user_url . '</a>';
             $buffy .= '</div>';
             $buffy .= '</div>';
             $buffy .= '</div>';
         }
     }
     $buffy .= '</div>';
     return $buffy;
 }
Esempio n. 20
0
<?php

//new template - we should only keep this one
global $td_row_count, $td_column_count;
$td_row_count++;
$output = $el_class = $bg_image = $bg_color = $bg_image_repeat = $font_color = $padding = $margin_bottom = $css = '';
extract(shortcode_atts(array('el_class' => '', 'bg_image' => '', 'bg_color' => '', 'bg_image_repeat' => '', 'font_color' => '', 'padding' => '', 'margin_bottom' => '', 'css' => '', 'custom_title' => '', 'header_color' => '', 'header_text_color' => ''), $atts));
wp_enqueue_style('js_composer_front');
wp_enqueue_script('wpb_composer_front_js');
wp_enqueue_style('js_composer_custom_css');
$el_class = $this->getExtraClass($el_class);
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_row ' . get_row_css_class() . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']);
//tagdiv mod the block title
if ($custom_title != '') {
    $output .= '<div class="' . $css_class . '">';
    $output .= '<div class="span12 wpb_column column_container">';
    $td_tmp_block_class = new td_block();
    //we use this class to generate the title
    $output .= $td_tmp_block_class->get_block_title_raw($atts);
    $output .= '</div>';
    $output .= '</div>' . $this->endBlockComment('row');
}
$style = $this->buildStyle($bg_image, $bg_color, $bg_image_repeat, $font_color, $padding, $margin_bottom);
$output .= '<div class="' . $css_class . '"' . $style . '>';
$output .= wpb_js_remove_wpautop($content);
$output .= '</div>' . $this->endBlockComment('row');
$td_row_count--;
echo $output;