Changeset 1048


Ignore:
Timestamp:
Feb 20, 2006, 11:14:24 PM (18 years ago)
Author:
plg
Message:

request 290: replace function get_themes name to avoid redeclaration from
Wordpress in jillij template.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r1044 r1048  
    254254    $blockname = 'default.template_option';
    255255
    256     foreach (get_themes() as $pwg_template)
     256    foreach (get_pwg_themes() as $pwg_template)
    257257    {
    258258      if (isset($_POST['submit']))
  • trunk/admin/include/functions.php

    r1042 r1048  
    13171317function update_average_rate( $element_id=-1 )
    13181318{
    1319   $average_rates = array();
    1320  
    13211319  $query = '
    13221320SELECT element_id,
     
    13301328 
    13311329  $result = pwg_query($query);
     1330
     1331  $datas = array();
     1332 
    13321333  while ($row = mysql_fetch_array($result))
    1333   {
    1334     array_push($average_rates, $row);
    1335   }
    1336 
    1337   $datas = array();
    1338   foreach ($average_rates as $item)
    13391334  {
    13401335    array_push(
    13411336      $datas,
    13421337      array(
    1343         'id' => $item['element_id'],
    1344         'average_rate' => $item['average_rate']
     1338        'id' => $row['element_id'],
     1339        'average_rate' => $row['average_rate']
    13451340        )
    13461341      );
    13471342  }
    1348   $fields = array('primary' => array('id'), 'update' => array('average_rate'));
    1349   mass_updates(IMAGES_TABLE, $fields, $datas);
     1343 
     1344  mass_updates(
     1345    IMAGES_TABLE,
     1346    array(
     1347      'primary' => array('id'),
     1348      'update' => array('average_rate')
     1349      ),
     1350    $datas
     1351    );
    13501352
    13511353  $query='
  • trunk/admin/user_list.php

    r1004 r1048  
    592592$blockname = 'template_option';
    593593
    594 foreach (get_themes() as $pwg_template)
     594foreach (get_pwg_themes() as $pwg_template)
    595595{
    596596  if (isset($_POST['pref_submit']))
  • trunk/include/functions.inc.php

    r1035 r1048  
    547547
    548548/**
    549  * returns available templates/themes
    550  */
    551 function get_templates()
    552 {
    553   return get_dirs(PHPWG_ROOT_PATH.'theme');
    554 }
    555 function get_themes()
     549 * returns available template/theme
     550 */
     551function get_pwg_themes()
    556552{
    557553  $themes = array();
    558554
    559   foreach (get_dirs(PHPWG_ROOT_PATH.'template') as $template)
    560   {
    561     foreach (get_dirs(PHPWG_ROOT_PATH.'template/'.$template.'/theme') as $theme)
     555  $template_dir = PHPWG_ROOT_PATH.'template';
     556 
     557  foreach (get_dirs($template_dir) as $template)
     558  {
     559    foreach (get_dirs($template_dir.'/'.$template.'/theme') as $theme)
    562560    {
    563561      array_push($themes, $template.'/'.$theme);
Note: See TracChangeset for help on using the changeset viewer.