Ignore:
Timestamp:
Mar 9, 2011, 11:47:08 AM (13 years ago)
Author:
patdenice
Message:

Code optimisation.

Location:
extensions/PWG_Stuffs/modules
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/modules/BestRated/main.inc.php

    r9369 r9581  
    8383
    8484  // template thumbnail initialization
    85   $template->set_filenames( array( 'pwgs_best_rated' => 'thumbnails.tpl',));
    86 
    8785  trigger_action('loc_begin_index_thumbnails', $pictures);
    88   $tpl_thumbnails_var = array();
     86  $block['thumbnails'] = array();
    8987
    9088  foreach ($pictures as $row)
     
    148146    }
    149147
    150     $tpl_thumbnails_var[] = $tpl_var;
     148    $block['thumbnails'][] = $tpl_var;
    151149  }
    152150
    153   $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
    154   $template->assign('thumbnails', $tpl_thumbnails_var);
     151  $block['thumbnails'] = trigger_event('loc_end_index_thumbnails', $block['thumbnails'], $pictures);
    155152
    156   $block['CONTENT'] = $template->parse('pwgs_best_rated', true);
    157   $block['TEMPLATE'] = 'stuffs_bestrated.tpl';
    158 }
    159 else
    160 {
    161   return false;
     153  $block['TEMPLATE'] = 'stuffs_thumbnails.tpl';
    162154}
    163155
  • extensions/PWG_Stuffs/modules/FeaturedPhotos/main.inc.php

    r9369 r9581  
    6464
    6565  // template thumbnail initialization
    66   $template->set_filenames( array( 'pwgs_feat' => 'thumbnails.tpl',));
    67 
    6866  trigger_action('loc_begin_index_thumbnails', $pictures);
    69   $tpl_thumbnails_var = array();
     67  $block['thumbnails'] = array();
    7068
    7169  foreach ($pictures as $row)
     
    129127    }
    130128
    131     $tpl_thumbnails_var[] = $tpl_var;
     129    $block['thumbnails'][] = $tpl_var;
    132130  }
    133131
    134   $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
    135   $template->assign('thumbnails', $tpl_thumbnails_var);
     132  $block['thumbnails'] = trigger_event('loc_end_index_thumbnails', $block['thumbnails'], $pictures);
    136133
    137   $block['CONTENT'] = $template->parse('pwgs_feat', true);
    138   $block['TEMPLATE'] = 'stuffs_featuredphotos.tpl';
     134  $block['TEMPLATE'] = 'stuffs_thumbnails.tpl';
    139135}
    140136
  • extensions/PWG_Stuffs/modules/MostVisited/main.inc.php

    r9369 r9581  
    8383
    8484  // template thumbnail initialization
    85   $template->set_filenames( array( 'pwgs_most_visited' => 'thumbnails.tpl',));
    86 
    8785  trigger_action('loc_begin_index_thumbnails', $pictures);
    88   $tpl_thumbnails_var = array();
     86  $block['thumbnails'] = array();
    8987
    9088  foreach ($pictures as $row)
     
    153151    }
    154152
    155     $tpl_thumbnails_var[] = $tpl_var;
     153    $block['thumbnails'][] = $tpl_var;
    156154  }
    157155
    158   $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
    159   $template->assign('thumbnails', $tpl_thumbnails_var);
     156  $block['thumbnails'] = trigger_event('loc_end_index_thumbnails', $block['thumbnails'], $pictures);
    160157
    161   $block['CONTENT'] = $template->parse('pwgs_most_visited', true);
    162   $block['TEMPLATE'] = 'stuffs_mostvisited.tpl';
     158  $block['TEMPLATE'] = 'stuffs_thumbnails.tpl';
    163159}
    164160
  • extensions/PWG_Stuffs/modules/Random/main.inc.php

    r9369 r9581  
    8282
    8383  // template thumbnail initialization
    84   $template->set_filenames( array( 'pwgs_random' => 'thumbnails.tpl',));
    85 
    8684  trigger_action('loc_begin_index_thumbnails', $pictures);
    87   $tpl_thumbnails_var = array();
     85  $block['thumbnails'] = array();
    8886
    8987  foreach ($pictures as $row)
     
    147145    }
    148146
    149     $tpl_thumbnails_var[] = $tpl_var;
     147    $block['thumbnails'][] = $tpl_var;
    150148  }
    151149
    152   $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
    153   $template->assign('thumbnails', $tpl_thumbnails_var);
     150  $block['thumbnails'] = trigger_event('loc_end_index_thumbnails', $block['thumbnails'], $pictures);
    154151
    155   $block['CONTENT'] = $template->parse('pwgs_random', true);
    156   $block['TEMPLATE'] = 'stuffs_random.tpl';
     152  $block['TEMPLATE'] = 'stuffs_thumbnails.tpl';
    157153}
    158154
  • extensions/PWG_Stuffs/modules/Recent/main.inc.php

    r9369 r9581  
    7878
    7979  // template thumbnail initialization
    80   $template->set_filenames( array( 'pwgs_recent' => 'thumbnails.tpl',));
    81 
    8280  trigger_action('loc_begin_index_thumbnails', $pictures);
    83   $tpl_thumbnails_var = array();
     81  $block['thumbnails'] = array();
    8482
    8583  foreach ($pictures as $row)
     
    143141    }
    144142
    145     $tpl_thumbnails_var[] = $tpl_var;
     143    $block['thumbnails'][] = $tpl_var;
    146144  }
    147145
    148   $tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
    149   $template->assign('thumbnails', $tpl_thumbnails_var);
     146  $block['thumbnails'] = trigger_event('loc_end_index_thumbnails', $block['thumbnails'], $pictures);
    150147
    151   $block['CONTENT'] = $template->parse('pwgs_recent', true);
    152   $block['TEMPLATE'] = 'stuffs_recent.tpl';
     148  $block['TEMPLATE'] = 'stuffs_thumbnails.tpl';
    153149}
    154150
Note: See TracChangeset for help on using the changeset viewer.