Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * uses module 11
  5. * Class td_block_12
  6. */
  7. class td_block_12 extends td_block {
  8.  
  9.  
  10. function render($atts, $content = null){
  11. parent::render($atts); // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
  12.  
  13. $buffy = ''; //output buffer
  14.  
  15. //get the js for this block
  16. $buffy .= $this->get_block_js();
  17.  
  18. $buffy .= '<div class="' . $this->get_block_classes() . '">';
  19.  
  20. //get the block title
  21. $buffy .= $this->get_block_title();
  22.  
  23. //get the sub category filter for this block
  24. $buffy .= $this->get_pull_down_filter();
  25.  
  26. $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
  27. $buffy .= $this->inner($this->td_query->posts); //inner content of the block
  28. $buffy .= '</div>';
  29.  
  30. //get the ajax pagination for this block
  31. $buffy .= $this->get_block_pagination();
  32. $buffy .= '</div> <!-- ./block -->';
  33. return $buffy;
  34. }
  35.  
  36. function inner($posts, $td_column_number = '') {
  37.  
  38. $buffy = '';
  39. $td_block_layout = new td_block_layout();
  40. $countModules = 0;
  41. if (!empty($posts)) {
  42. foreach ($posts as $post) {
  43. $td_module_11 = new td_module_11($post);
  44.  
  45. $buffy .= $td_block_layout->open12(); //added in 010 theme - span 12 doesn't use rows
  46. $buffy .= $td_module_11->render($post);
  47. $buffy .= $td_block_layout->close12();
  48.  
  49. $countModules++;
  50. if ($countModules == 5) {
  51. $buffy .= $td_block_layout->open12();
  52. $buffy .= td_global_blocks::get_instance('td_block_ad_box')->render(array('spot_id' => 'custom_ad_1'));
  53. $buffy .= $td_block_layout->close12();
  54. }
  55. }
  56. }
  57. $buffy .= $td_block_layout->close_all_tags();
  58. return $buffy;
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement