aboutsummaryrefslogtreecommitdiffstats
path: root/include/picture_rate.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-04-28 04:38:36 +0000
committerrvelices <rv-github@modusoptimus.com>2006-04-28 04:38:36 +0000
commit0510cfdc5ad38487600f8f1bf8e4d4f9747781df (patch)
tree5ca76dc04fa5e1e93eb9f2e781bfec5ed227c55c /include/picture_rate.inc.php
parentb0751afea224486bb4b423e569e2c75a502b4e35 (diff)
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) git-svn-id: http://piwigo.org/svn/trunk@1286 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/picture_rate.inc.php')
-rw-r--r--include/picture_rate.inc.php42
1 files changed, 16 insertions, 26 deletions
diff --git a/include/picture_rate.inc.php b/include/picture_rate.inc.php
index 46263d968..172d02ceb 100644
--- a/include/picture_rate.inc.php
+++ b/include/picture_rate.inc.php
@@ -54,6 +54,7 @@ SELECT COUNT(rate) AS count
);
}
+ $user_rate = null;
if ($conf['rate_anonymous'] or is_autorize_status(ACCESS_CLASSIC) )
{
if ($row['count']>0)
@@ -78,51 +79,40 @@ SELECT COUNT(rate) AS count
if (mysql_num_rows($result) > 0)
{
$row = mysql_fetch_array($result);
- $sentence = $lang['already_rated'];
- $sentence.= ' ('.$row['rate'].'). ';
- $sentence.= $lang['update_rate'];
+ $user_rate = $row['rate'];
}
- else
- {
- $sentence = $lang['never_rated'].'. '.$lang['Rate'];
- }
- }
- else
- {
- $sentence = $lang['never_rated'].'. '.$lang['Rate'];
}
+
$template->assign_block_vars(
'rate',
array(
- 'CONTENT' => $value,
- 'SENTENCE' => $sentence
+ 'SENTENCE' =>isset($user_rate) ? l10n('update_rate') : l10n('new_rate'),
+ 'F_ACTION' => add_url_params(
+ $url_self,
+ array('action'=>'rate')
+ )
)
);
$template->assign_block_vars('info_rate', array('CONTENT' => $value));
- $template->assign_vars(
- array(
- 'INFO_RATE' => $value
- )
- );
-
foreach ($conf['rate_items'] as $num => $mark)
{
$template->assign_block_vars(
'rate.rate_option',
array(
'OPTION' => $mark,
- 'URL' => add_url_params(
- $url_self,
- array(
- 'action'=>'rate',
- 'rate'=>$mark
- )
- ),
'SEPARATOR' => ($num > 0 ? '|' : ''),
)
);
+ if (isset($user_rate) and $user_rate==$mark)
+ {
+ $template->assign_block_vars('rate.rate_option.my_rate', array() );
+ }
+ else
+ {
+ $template->assign_block_vars('rate.rate_option.not_my_rate', array() );
+ }
}
}
}