aboutsummaryrefslogtreecommitdiffstats
path: root/mod/prep.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/prep.php')
-rw-r--r--mod/prep.php29
1 files changed, 18 insertions, 11 deletions
diff --git a/mod/prep.php b/mod/prep.php
index 45cdddad6..896717826 100644
--- a/mod/prep.php
+++ b/mod/prep.php
@@ -19,6 +19,14 @@ function prep_init(&$a) {
return;
}
+ if(strpos($hash,'@')) {
+ $r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
+ dbesc($hash)
+ );
+ if($r)
+ $hash = $r[0]['hubloc_hash'];
+ }
+
$p = q("select * from xchan where xchan_hash like '%s'",
dbesc($hash . '%')
);
@@ -50,19 +58,18 @@ function prep_content(&$a) {
dbesc($a->poi['xchan_hash'])
);
- $ret = array();
+ if(! $r)
+ notice( t('No ratings available') . EOL);
- if($r) {
- $o = replace_macros(get_markup_template('prep.tpl'),array(
- '$header' => t('Ratings'),
- '$rating_lbl' => t('Rating: ' ),
- '$rating_text_lbl' => t('Description: '),
- '$raters' => $r
- ));
- return $o;
- }
- return '';
+ $o = replace_macros(get_markup_template('prep.tpl'),array(
+ '$header' => t('Ratings'),
+ '$rating_lbl' => t('Rating: ' ),
+ '$rating_text_lbl' => t('Description: '),
+ '$raters' => $r
+ ));
+
+ return $o;
}
\ No newline at end of file