Ignore:
Timestamp:
Feb 29, 2008, 2:25:13 AM (16 years ago)
Author:
rvelices
Message:

picture, footer and picture modify template migration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/picture_rate.inc.php

    r2201 r2227  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    7 // | branch        : BSF (Best So Far)
    8 // | file          : $RCSfile$
     7// | file          : $Id$
    98// | last update   : $Date$
    109// | last modifier : $Author$
     
    3635SELECT COUNT(rate) AS count
    3736     , ROUND(AVG(rate),2) AS average
    38      , ROUND(STD(rate),2) AS STD
     37     , ROUND(STD(rate),2) AS std
    3938  FROM '.RATE_TABLE.'
    4039  WHERE element_id = '.$picture['current']['id'].'
    4140;';
    4241  $row = mysql_fetch_array(pwg_query($query));
    43   if ($row['count'] == 0)
    44   {
    45     $value = l10n('no_rate');
    46   }
    47   else
    48   {
    49     $value = sprintf(
    50       l10n('%.2f (rated %d times, standard deviation = %.2f)'),
    51       $row['average'],
    52       $row['count'],
    53       $row['STD']
    54       );
    55   }
     42  $template->assign('rate_summary', $row);
    5643
    5744  $user_rate = null;
     
    8471    }
    8572
    86     $template->assign_block_vars(
    87       'rate',
    88       array(
    89         'SENTENCE' =>isset($user_rate) ? l10n('update_rate') : l10n('new_rate'),
    90         'F_ACTION' => add_url_params(
     73    $template->assign(
     74        'rating',
     75        array(
     76          'F_ACTION' => add_url_params(
    9177                        $url_self,
    9278                        array('action'=>'rate')
    93                       )
     79                      ),
     80          'USER_RATE'=> $user_rate,
     81          'marks'    => $conf['rate_items']
    9482        )
    9583      );
    96 
    97     $template->assign_block_vars('info_rate', array('CONTENT' => $value));
    98 
    99     foreach ($conf['rate_items'] as $num => $mark)
    100     {
    101       $template->assign_block_vars(
    102         'rate.rate_option',
    103         array(
    104           'OPTION'    => $mark,
    105           'SEPARATOR' => ($num > 0 ? '|' : ''),
    106           )
    107         );
    108       if (isset($user_rate) and $user_rate==$mark)
    109       {
    110         $template->assign_block_vars('rate.rate_option.my_rate', array() );
    111       }
    112       else
    113       {
    114         $template->assign_block_vars('rate.rate_option.not_my_rate', array() );
    115       }
    116     }
    11784  }
    11885}
Note: See TracChangeset for help on using the changeset viewer.