From 8f8700ddd2902525270a1e0e593b916ebb6f51fb Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Jan 2015 00:53:04 -0800 Subject: mod_prep usability enhancements, doc updates --- mod/prep.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'mod/prep.php') 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 -- cgit v1.2.3