Fix for trying to install cooolzine theme: Fatal error: Call to undefined method stdClass::execute() in node.front.tpl.php line 19.

  1. <div class="fluid">
  2. <?php
  3.        
  4.         /// ads ///
  5.         if (theme_get_setting('cooolzine_ads') == 'true') {
  6.        
  7.         $display_id = 'default';
  8.         $ad = views_get_view('ads');
  9.         $ad->set_arguments(array('taxonomy'));
  10.         $ad->pager['items_per_page'] = theme_get_setting('cooolzine_maxads') * 4;
  11.         $ad->execute();
  12.        
  13.         $adblocks = cooolzine_adblocks($ad->result);
  14.         } // use ads
  15.  
  16.         $display_id = 'default';
  17.         $av = views_get_view('front_tops');
  18.         $av->pager['items_per_page'] = theme_get_setting('cooolzine_depnumberf');
  19.         $av->execute();
  20.        
  21.        
  22.         $list = array();
  23.        
  24.         foreach($av->result as $k => $r) {
  25.        
  26.                 switch($r->node_data_field_appearence_field_appearence_value) {
  27.                        
  28.                         case '0':
  29.                                 if (count($list['top']) < 1) {
  30.                                         $list['top'][] = $r->nid;
  31.                                 }
  32.                                 else {
  33.                                         $list['top5'][] = $r->nid;
  34.                                 }
  35.                         break;
  36.                        
  37.                         case '1':
  38.                                 if (count($list['top5']) < 5) {
  39.                                         $list['top5'][] = $r->nid;
  40.                                 }
  41.                                 else {
  42.                                         $list['default'][] = $r->nid;
  43.                                 }
  44.                         break;
  45.                
  46.                         case '2':
  47.                        
  48.                         $list['default'][] = $r->nid;
  49.                         break;
  50.                
  51.                         case '':
  52.                        
  53.                         $list['default'][] = $r->nid;
  54.                         break;
  55.                
  56.                 }
  57.                
  58.         }
  59.  
  60.         // top article set
  61.        
  62.         if ($node->field_top['0']['nid'] != '') {
  63.                
  64.                 print cooolzine_toparticle($node->field_top['0']['nid']);      
  65.                
  66.         } // top article set
  67.         else {
  68.                 print cooolzine_toparticle($list['top']['0'])
  69.         }
  70.        
  71.         // top2 article set
  72.         if ($node->field_top2['0']['nid'] != '') {
  73.                 print cooolzine_boxarticle($node->field_top2['0']['nid']);     
  74.         } // top2 article set
  75.         else {
  76.                 print cooolzine_boxarticle($list['top5']['0']);
  77.                 array_shift($list['top5']);
  78.         }
  79.        
  80.        
  81.         // top3 article set
  82.         if ($node->field_top3['0']['nid'] != '') {
  83.                
  84.                 print cooolzine_boxarticle($node->field_top3['0']['nid']);     
  85.                
  86.         } // top3 article set
  87.         else {
  88.                 print cooolzine_boxarticle($list['top5']['0']);
  89.                 array_shift($list['top5']);
  90.         }
  91.        
  92.        
  93.         // top4 article set
  94.         if ($node->field_top4['0']['nid'] != '') {
  95.                 print cooolzine_boxarticle($node->field_top4['0']['nid']);                     
  96.         } // top4 article set
  97.         else {
  98.                 print cooolzine_boxarticle($list['top5']['0']);
  99.                 array_shift($list['top5']);
  100.         }
  101.        
  102.         // top5 article set
  103.         if ($node->field_top5['0']['nid'] != '') {
  104.                
  105.                 print cooolzine_boxarticle($node->field_top5['0']['nid']);     
  106.                 // add ads
  107.                 if (theme_get_setting('cooolzine_ads') == 'true') {
  108.                         print cooolzine_createads($adblocks,'top5');
  109.                 } // ads
  110.                
  111.         } // top4 article set
  112.         else {
  113.                 print cooolzine_boxarticle($list['top5']['0']);
  114.                 array_shift($list['top5']);
  115.                 // add ads
  116.                 if (theme_get_setting('cooolzine_ads') == 'true') {
  117.                         print cooolzine_createads($adblocks,'top5');
  118.                 } // ads
  119.         }
  120.        
  121.         // top6 article set
  122.         if ($node->field_top6['0']['nid'] != '') {
  123.                
  124.                 print cooolzine_boxarticle($node->field_top6['0']['nid']);     
  125.                
  126.         } // top4 article set
  127.         else {
  128.                 print cooolzine_boxarticle($list['top5']['0']);
  129.                 array_shift($list['top5']);
  130.         }
  131.        
  132.        
  133.         /** tabbed **/
  134.         if ($node->field_usetabs['0']['value'] == 'yes') {
  135.  
  136.                 //*tab1
  137.                 switch($node->field_tab1['0']['value']) {
  138.                        
  139.                         case 'freestyle':
  140.                                
  141.                                 $tab1 = $node->field_tab1free['0']['view'];
  142.                                
  143.                         break;
  144.                                
  145.                         case 'block':
  146.                                
  147.                                 $tab1 =  $node->field_tab1block['0']['view'];
  148.                                
  149.                         break;
  150.                                
  151.                         case 'mostpop':
  152.                                
  153.                                 $display_id = 'default';
  154.                                 $mp1 = views_get_view('tab_mostpop');
  155.                                 $mp1->pager['items_per_page'] = 17;
  156.                                 $mp1->execute();
  157.                                
  158.                                 $tab1 = cooolzine_list($mp1->result,true,30);
  159.                                                                
  160.                         break;
  161.  
  162.                         case 'mostcom':
  163.  
  164.                                 $display_id = 'default';
  165.                                 $mc1 = views_get_view('tab_mostcon');
  166.                                 $mc1->pager['items_per_page'] = 17;
  167.                                 $mc1->execute();
  168.                                
  169.                                 $tab1 = cooolzine_list($mc1->result,true,30);
  170.                        
  171.                         break;
  172.                                
  173.                         case 'recentcom':
  174.  
  175.                                 $display_id = 'default';
  176.                                 $mc1 = views_get_view('tab_recentcon');
  177.                                 $mc1->pager['items_per_page'] = 17;
  178.                                 $mc1->execute();
  179.                                
  180.                                 $tab1 = cooolzine_commentlist($mc1->result,true,20);
  181.                        
  182.                         break;
  183.                                
  184.                                
  185.                 } // switch
  186.  
  187.                 //*tab2
  188.                 switch($node->field_tab2['0']['value']) {
  189.                        
  190.                         case 'freestyle':
  191.                                
  192.                                 $tab2 = $node->field_tab2free['0']['view'];
  193.                                
  194.                         break;
  195.                                
  196.                         case 'block':
  197.                                
  198.                                 $tab2 =  $node->field_tab2block['0']['view'];
  199.                                
  200.                         break;
  201.  
  202.                         case 'mostpop':
  203.                                
  204.                                 $display_id = 'default';
  205.                                 $mp2 = views_get_view('tab_mostpop');
  206.                                 $mp2->pager['items_per_page'] = 17;
  207.                                 $mp2->execute();
  208.                                
  209.                                 $tab2 = cooolzine_list($mp2->result,true,30);
  210.                                                                
  211.                         break;
  212.  
  213.                         case 'mostcom':
  214.  
  215.                                 $display_id = 'default';
  216.                                 $mc2 = views_get_view('tab_mostcon');
  217.                                 $mc2->pager['items_per_page'] = 17;
  218.                                 $mc2->execute();
  219.                                
  220.                                 $tab2 = cooolzine_list($mc2->result,true,30);
  221.                        
  222.                         break;
  223.  
  224.                         case 'recentcom':
  225.  
  226.                                 $display_id = 'default';
  227.                                 $mc2 = views_get_view('tab_recentcon');
  228.                                 $mc2->pager['items_per_page'] = 17;
  229.                                 $mc2->execute();
  230.                                
  231.                                 $tab2 = cooolzine_commentlist($mc2->result,true,30);
  232.                        
  233.                         break;
  234.                                
  235.                                
  236.                                
  237.                 } // switch
  238.                
  239.                 //*tab3
  240.  
  241.                 switch($node->field_tab3['0']['value']) {
  242.                        
  243.                         case 'freestyle':
  244.                                
  245.                                 $tab3 = $node->field_tab3free['0']['view'];
  246.                                
  247.                         break;
  248.                                
  249.                         case 'block':
  250.                                
  251.                                 $tab3 =  $node->field_tab3block['0']['view'];
  252.                                
  253.                         break;
  254.  
  255.                         case 'mostpop':
  256.                                
  257.                                 $display_id = 'default';
  258.                                 $mp3 = views_get_view('tab_mostpop');
  259.                                 $mp3->pager['items_per_page'] = 17;
  260.                                 $mp3->execute();
  261.                                
  262.                                 $tab3 = cooolzine_list($mp3->result,true,30);
  263.                                                                
  264.                         break;
  265.  
  266.  
  267.                         case 'mostcom':
  268.  
  269.                                 $display_id = 'default';
  270.                                 $mc3 = views_get_view('tab_mostcon');
  271.                                 $mc3->pager['items_per_page'] = 17;
  272.                                 $mc3->execute();
  273.                                
  274.                                 $tab3 = cooolzine_list($mc3->result,true,30);
  275.                        
  276.                         break;
  277.  
  278.                         case 'recentcom':
  279.  
  280.                                 $display_id = 'default';
  281.                                 $mc3 = views_get_view('tab_recentcon');
  282.                                 $mc3->pager['items_per_page'] = 17;
  283.                                 $mc3->execute();
  284.                                
  285.                                 $tab3 = cooolzine_commentlist($mc3->result,true,30);
  286.                        
  287.                         break;
  288.                                
  289.                                
  290.                                
  291.                 } // switch
  292. ?>             
  293. <div class="tabs box">
  294.         <ul class="tabnav">
  295.                 <?php if ($node->field_tab1head['0']['value']) { ?>
  296.             <li><a href="#tab1"><?php print $node->field_tab1head['0']['value'] ?></a></li>
  297.             <?php } ?>
  298.            
  299.                 <?php if ($node->field_tab2head['0']['value']) { ?>
  300.             <li><a href="#tab2"><?php print $node->field_tab2head['0']['value'] ?></a></li>
  301.             <?php } ?>
  302.                 <?php if ($node->field_tab3head['0']['value']) { ?>
  303.             <li><a href="#tab3"><?php print $node->field_tab3head['0']['value'] ?></a></li>
  304.             <?php } ?>
  305.         </ul>
  306.  
  307.                 <?php if ($node->field_tab1head['0']['value']) { ?>
  308.                         <div class="tabcontent" id="tab1">
  309.                                         <?php print $tab1; ?>
  310.                         </div>
  311.             <?php } ?>
  312.  
  313.                 <?php if ($node->field_tab2head['0']['value']) { ?>
  314.                         <div class="tabcontent" id="tab2">
  315.                                         <?php print $tab2; ?>
  316.                         </div>
  317.             <?php } ?>
  318.  
  319.                 <?php if ($node->field_tab3head['0']['value']) { ?>
  320.                         <div class="tabcontent" id="tab3">
  321.                                         <?php print $tab3; ?>
  322.                         </div>
  323.             <?php } ?>
  324.  
  325. </div><!--tabcon-->
  326.        
  327. <?php          
  328.  
  329.  
  330. } // use tabs
  331.  
  332.         // top5 is set
  333.         if(array_key_exists('top5',$list)) {
  334.                
  335.                 foreach($list['top5'] as $k5 => $a5) {
  336.                        
  337.                         print cooolzine_boxarticle($a5);
  338.                         if (theme_get_setting('cooolzine_ads') == 'true') {
  339.                                 $c = count($list['default']) - 1;
  340.                                 if ($k5 == 4) {
  341.                                         print cooolzine_createads($adblocks,'top5');
  342.                                 } // 10
  343.                         } // ads
  344.  
  345.                 }// foreach
  346.                
  347.                 if(array_key_exists('default',$list)) {
  348.                         foreach($list['default'] as $k => $a) {
  349.  
  350.                                 print cooolzine_boxarticle($a);
  351.                                 if (theme_get_setting('cooolzine_ads') == 'true') {
  352.                                         $c = count($list['default']) - 1;
  353.                                         if ($k == 9) {
  354.                                                 print cooolzine_createads($adblocks,'top10');
  355.                                         } // 10
  356.                                 } // ads
  357.  
  358.                         } // foreach default
  359.                 } // if default
  360.                
  361.         } // top5 exist
  362.        
  363.         // no tops at all
  364.         else {
  365.  
  366.                 foreach($list['default'] as $k => $a) {
  367.  
  368.                         /* end top articles  */
  369.                         if ($k < theme_get_setting('cooolzine_depnumberf')) {
  370.                        
  371.                                 print cooolzine_boxarticle($a);
  372.                                
  373.                                 if (theme_get_setting('cooolzine_ads') == 'true') {
  374.                                         $c = count($list['default']) - 1;
  375.                                         if ($k == 4) {
  376.                                                 print cooolzine_createads($adblocks,'top5');
  377.                                         } // 10
  378.                                         if ($k == 9) {
  379.                                                 print cooolzine_createads($adblocks,'top10');
  380.                                         } // 10
  381.                                 } // ads
  382.                         }
  383.                        
  384.                         /* top cooolzine_depnumber articles */
  385.                        
  386.                        
  387.                 } // foreach
  388.                
  389.         } // no tops
  390.  
  391. /* get tops */
  392.  
  393.  
  394.        
  395.         if ($node->field_cattops['0']['value'] != '') {
  396.                
  397.                 foreach($node->field_cattops as $ct) {
  398.                        
  399.                         $display_id = 'default';
  400.                         $av = views_get_view('taxonomy_tops');
  401.                         $av->set_arguments(array($ct['value']));
  402.                         $av->pager['items_per_page'] = 18;
  403.                         $av->execute();
  404.                        
  405.                         $out = '<div class="box toplist '.str_replace(' ','-',strtolower($ct['view'])).'">
  406.                                         <div class="meta">
  407.                                           <a class="cat_'.str_replace(' ','-',strtolower($ct['view'])).'" href="'.base_path().'taxonomy/term/'.$ct['value'].'">'.$ct['view'].'</a>
  408.                                         </div>';
  409.  
  410.                         $out .= cooolzine_list($av->result,NULL,17);
  411.                        
  412.                         $out .= '</div>';
  413.                        
  414.                         print $out;
  415.                
  416.                 } // foreach
  417.                
  418.         } // has tops
  419.  
  420.                 if (theme_get_setting('cooolzine_ads') == 'true') {
  421.                                 print cooolzine_createads($adblocks,'default');
  422.                 } // ads
  423.  
  424. ?>
  425. </div><!--fluid-->
  426.        

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.