aboutsummaryrefslogtreecommitdiffstats
path: root/mod/rate.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-15 23:45:22 -0800
committerfriendica <info@friendica.com>2015-02-15 23:45:22 -0800
commit1c4b9199809581504ee66212f3bb434fd9773aff (patch)
tree30ab8105e3b42c4b089b04a89b69a4ed7192eba7 /mod/rate.php
parent8774089005501a6429eb9a99a73de504598a24c3 (diff)
downloadvolse-hubzilla-1c4b9199809581504ee66212f3bb434fd9773aff.tar.gz
volse-hubzilla-1c4b9199809581504ee66212f3bb434fd9773aff.tar.bz2
volse-hubzilla-1c4b9199809581504ee66212f3bb434fd9773aff.zip
force site_url to be lowercase when stored. Otherwise rating hubs on postgres could get real messy.
Diffstat (limited to 'mod/rate.php')
-rw-r--r--mod/rate.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/mod/rate.php b/mod/rate.php
index cc12dcac9..2555b36a2 100644
--- a/mod/rate.php
+++ b/mod/rate.php
@@ -21,6 +21,13 @@ function rate_init(&$a) {
if($r) {
$a->poi = $r[0];
}
+ else {
+ $r = q("select * from site where site_url like '%s' ",
+ dbesc('%' . $target)
+ );
+ if($r)
+ $a->data['site'] = strtolower($r[0]);
+ }
}
@@ -145,6 +152,8 @@ function rate_content(&$a) {
$o = replace_macros(get_markup_template('rating_form.tpl'),array(
'$header' => t('Rating'),
+ '$website' => t('Website:'),
+ '$site' => (($a->data['site']) ? '<a href="' . $a->data['site']['site_url'] . '" >' . $a->data['site']['site_url'] . '</a>' : ''),
'target' => $a->data['target'],
'$tgt_name' => (($a->poi && $a->poi['xchan_name']) ? $a->poi['xchan_name'] : sprintf( t('Remote Channel [%s] (not yet known on this site)'), substr($a->data['target'],0,16))),
'$lbl_rating' => t('Rating (this information is public)'),