aboutsummaryrefslogtreecommitdiffstats
path: root/include/picture_rate.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-04-28 04:37:28 +0000
committerrvelices <rv-github@modusoptimus.com>2006-04-28 04:37:28 +0000
commit1cc593f7606c34428271a4beee5755a301988e4e (patch)
treeff688255aef1838ca3a62eb8e936c0bf5f3eb3c0 /include/picture_rate.inc.php
parentd6264b468c3708ac027c8caac40fd26c83143ed8 (diff)
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/branches/branch-1_6@1285 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-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() );
+ }
}
}
}