Advertisement
nlozovan

Untitled

Jul 28th, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. <?php
  2. class layout{
  3. static $size = array(
  4. 'large' => 'twelve',
  5. 'lmedium' => 'eight',
  6. 'medium' => 'eight'
  7. );
  8. static function side( $side = 'right' , $post_id = 0 , $template = null ){
  9. $position = false;
  10. if( strlen( $side ) ){
  11. if( $post_id > 0 ){
  12. $layout = meta::get_meta( $post_id , 'layout' );
  13.  
  14. if( is_array($layout) && isset( $layout['type'] ) && !empty( $layout['type'] ) ){
  15. $result = $layout['type'];
  16. }else{
  17.  
  18. if( strlen( $template ) ){
  19. $result = options::get_value( 'layout' , $template );
  20. }else{
  21. $result = $side;
  22. }
  23. }
  24. }else{
  25. if( strlen( $template ) ){
  26. $result = options::get_value( 'layout' , $template );
  27. }else{
  28. $result = $side;
  29. }
  30. }
  31.  
  32. if( $result == $side ){
  33. echo '<div id="secondary" class="widget-area four columns '. $side .'-column" role="complementary">';
  34. echo '<div class="row">';
  35.  
  36. if( isset( $layout) && is_array($layout) && isset( $layout['sidebar'] ) && !empty( $layout['sidebar'] ) ){
  37.  
  38. }else{
  39. $layout = options::get_value( 'layout' , $template . '_sidebar' );
  40. if( !empty( $layout ) ){
  41.  
  42. }else{
  43. if(!is_author()){
  44. get_template_part('author-box');
  45. }
  46.  
  47. $cat = get_the_category( $post_id );
  48.  
  49. if ($cat[0]->cat_ID == 3) {
  50.  
  51. dynamic_sidebar('nicushor');
  52. } else {
  53. dynamic_sidebar('main');
  54. }
  55.  
  56. }
  57.  
  58. }
  59. echo '</div>';
  60. echo '</div>';
  61.  
  62. $position = true;
  63. }
  64. }
  65.  
  66. return $position;
  67. }
  68.  
  69. static function length( $post_id = 0 , $template = null , $larger = false ){
  70. $layout = meta::get_meta( $post_id , 'layout' );
  71. if( isset( $layout['type'] ) && !empty( $layout['type'] ) && $layout['type'] == 'full' ) {
  72. $length = self::$size['large'];
  73. }else{
  74. if( strlen( $template ) ){
  75. $result = options::get_value( 'layout' , $template );
  76. if( $result == 'full' ){
  77. if( isset( $layout['type'] ) && $layout['type'] != 'full' ){
  78. if( $larger ){
  79. $length = self::$size['lmedium'];
  80. }else{
  81. $length = self::$size['medium'];
  82. }
  83. }else{
  84. $length = self::$size['large'];
  85. }
  86. }else{
  87. if( $larger ){
  88. $length = self::$size['lmedium'];
  89. }else{
  90. $length = self::$size['medium'];
  91. }
  92. }
  93. }
  94. }
  95.  
  96. return $length;
  97. }
  98.  
  99. }
  100. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement