Changeset 1286


Ignore:
Timestamp:
Apr 28, 2006, 6:38:36 AM (19 years ago)
Author:
rvelices
Message:

merge -r1285 in from branch-1_6 to trunk
bug 359: transform rating html A links to FORM because some bots rate
pictures (even if rel="nofollow" is set)

Location:
trunk
Files:
8 edited

Legend:

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

    r1094 r1286  
    5555  }
    5656
     57  $user_rate = null;
    5758  if ($conf['rate_anonymous'] or is_autorize_status(ACCESS_CLASSIC) )
    5859  {
     
    7980      {
    8081        $row = mysql_fetch_array($result);
    81         $sentence = $lang['already_rated'];
    82         $sentence.= ' ('.$row['rate'].'). ';
    83         $sentence.= $lang['update_rate'];
    84       }
    85       else
    86       {
    87         $sentence = $lang['never_rated'].'. '.$lang['Rate'];
     82        $user_rate = $row['rate'];
    8883      }
    8984    }
    90     else
    91     {
    92       $sentence = $lang['never_rated'].'. '.$lang['Rate'];
    93     }
     85
    9486    $template->assign_block_vars(
    9587      'rate',
    9688      array(
    97         'CONTENT' => $value,
    98         'SENTENCE' => $sentence
     89        'SENTENCE' =>isset($user_rate) ? l10n('update_rate') : l10n('new_rate'),
     90        'F_ACTION' => add_url_params(
     91                        $url_self,
     92                        array('action'=>'rate')
     93                      )
    9994        )
    10095      );
    10196
    10297    $template->assign_block_vars('info_rate', array('CONTENT' => $value));
    103 
    104     $template->assign_vars(
    105       array(
    106         'INFO_RATE' => $value
    107         )
    108       );
    10998
    11099    foreach ($conf['rate_items'] as $num => $mark)
     
    114103        array(
    115104          'OPTION'    => $mark,
    116           'URL'       => add_url_params(
    117                           $url_self,
    118                           array(
    119                             'action'=>'rate',
    120                             'rate'=>$mark
    121                           )
    122                         ),
    123105          'SEPARATOR' => ($num > 0 ? '|' : ''),
    124106          )
    125107        );
     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      }
    126116    }
    127117  }
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r1172 r1286  
    131131$lang['all'] = 'all';
    132132$lang['all_categories'] = 'all categories';
    133 $lang['already_rated'] = 'You\'ve already rated this item';
    134133$lang['ascending'] = 'ascending';
    135134$lang['author(s) : %s'] = 'author(s) : %s';
     
    245244$lang['nb_row_per_page'] = 'Number of rows per page';
    246245$lang['nbm_unknown_identifier'] = 'Unknown identifier';
    247 $lang['never_rated'] = 'You\'ve never rated this item';
    248246$lang['new_password'] = 'New password';
    249247$lang['new_password_hint'] = 'You only have to give a password if you wish to change it.';
    250248$lang['next_page'] = 'Next';
     249$lang['new_rate'] = 'Rate this picture';
    251250$lang['no'] = 'No';
    252251$lang['no_category'] = 'Home';
  • trunk/language/fr_FR.iso-8859-1/common.lang.php

    r1172 r1286  
    130130$lang['all'] = 'tout';
    131131$lang['all_categories'] = 'toutes les catégories';
    132 $lang['already_rated'] = 'Vous avez déjà voté pour cette image';
    133132$lang['ascending'] = 'croissant';
    134133$lang['author(s) : %s'] = 'auteur(s) : %s';
     
    244243$lang['nb_row_per_page'] = 'Nombre de lignes par page';
    245244$lang['nbm_unknown_identifier'] = 'Identifiants inconnus';
    246 $lang['never_rated'] = 'Vous n\'avez jamais voté pour cette image';
    247245$lang['new_password'] = 'Nouveau mot de passe';
    248246$lang['new_password_hint'] = 'Vous n\'avez à confirmer votre mot de passe que si vous désirez en changer.';
     247$lang['new_rate'] = 'Votez pur cette image';
    249248$lang['next_page'] = 'Suivant';
    250249$lang['no'] = 'Non';
  • trunk/picture.php

    r1247 r1286  
    166166    {
    167167      include_once(PHPWG_ROOT_PATH.'include/functions_rate.inc.php');
    168       rate_picture($page['image_id'], $_GET['rate']);
     168      rate_picture($page['image_id'],
     169          isset($_POST['rate']) ? $_POST['rate'] : $_GET['rate'] );
    169170      redirect($url_self);
    170171    }
  • trunk/template/yoga/image.css

    r1253 r1286  
    108108}
    109109
     110.rateButton, .rateButtonSelected {
     111  background-color:transparent;
     112  padding:0;
     113  border:0;
     114}
     115
     116.rateButton {
     117  cursor: pointer;
     118}
     119
     120.rateButtonSelected {
     121  color:inherit;
     122  font-weight:bold;
     123  font-size:120%;
     124}
     125
    110126#comments {
    111127    text-align: left;
  • trunk/template/yoga/picture.tpl

    r1266 r1286  
    154154
    155155<!-- BEGIN rate -->
    156 <p>
    157 {rate.SENTENCE} :
     156<form action="{rate.F_ACTION}" method="post">
     157<div>{rate.SENTENCE} :
    158158<!-- BEGIN rate_option -->
    159 {rate.rate_option.SEPARATOR} <a href="{rate.rate_option.URL}" rel="nofollow" {TAG_INPUT_ENABLED}>{rate.rate_option.OPTION}</a>
     159{rate.rate_option.SEPARATOR}
     160<!-- BEGIN my_rate -->
     161<input type="button" name="rate" value="{rate.rate_option.OPTION}" class="rateButtonSelected" />
     162<!-- END my_rate -->
     163<!-- BEGIN not_my_rate -->
     164<input type="submit" name="rate" value="{rate.rate_option.OPTION}" class="rateButton" />
     165<!-- END not_my_rate -->
    160166<!-- END rate_option -->
    161 </p>
     167</div>
     168</form>
    162169<!-- END rate -->
    163170
  • trunk/template/yoga/theme/clear/theme.css

    r1176 r1286  
    5454
    5555/* links */
    56 A {
     56A, .rateButton {
    5757    color: #005e89;
    5858    background: transparent;
  • trunk/template/yoga/theme/dark/theme.css

    r1197 r1286  
    8484
    8585/* links */
    86 A {
     86A, .rateButton {
    8787  color: #FFFFFF;
    8888}
Note: See TracChangeset for help on using the changeset viewer.