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; }
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_9 = new td_module_9($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 $buffy .= $td_module_9->render($post); $buffy .= $td_block_layout->close12(); break; case '2': //two column layout $buffy .= $td_block_layout->open_row(); $buffy .= $td_block_layout->open6(); //added in 010 theme - span 12 doesn't use rows $buffy .= $td_module_9->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_9->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; }
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; }
function inner($posts, $td_column_number = '') { $buffy = ''; $td_block_layout = new td_block_layout(); $td_post_count = 0; // the number of posts rendered if (!empty($posts)) { foreach ($posts as $post) { $td_module_mx7 = new td_module_mx7($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 $buffy .= $td_module_6->render($post); $buffy .= $td_block_layout->close12(); break; case '2': //two column layout $buffy .= $td_block_layout->open_row(); $buffy .= $td_block_layout->open4(); $buffy .= $td_module_mx7->render($post); $buffy .= $td_block_layout->close4(); if ($td_post_count == 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_mx7->render($post); $buffy .= $td_block_layout->close4(); if ($td_post_count == 4) { $buffy .= $td_block_layout->close_row(); } break; } $td_post_count++; // close the row after 3(for 2 columns) or 5 posts(for 3 columns) if ($td_column_number == 2 and $td_post_count == 3 or $td_column_number == 3 and $td_post_count == 5) { $td_post_count = 0; } } } $buffy .= $td_block_layout->close_all_tags(); return $buffy; }
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; }
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; }
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_mx1 = new td_module_mx1($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_mx1->render(); } else { $buffy .= $td_module_mx2->render(); } 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) $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) $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; }
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; }
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 if (!empty($posts)) { foreach ($posts as $post) { $td_module_2 = new td_module_2($post); $td_module_3 = new td_module_3($post); switch ($td_column_number) { case '1': //one column layout if ($td_post_count == 0) { //first post $buffy .= $td_module_2->render(); } else { $buffy .= $td_module_3->render(); } 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_2->render(); $buffy .= $td_block_layout->close6(); } else { //the rest $buffy .= $td_block_layout->open6(); $buffy .= $td_module_3->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_2->render(); $buffy .= $td_block_layout->close4(); } else { //2-3 cols $buffy .= $td_block_layout->open4(); $buffy .= $td_module_3->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; }