aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-15 19:05:42 -0800
committerfriendica <info@friendica.com>2015-01-15 19:05:42 -0800
commitdfe31dc3b7a041050203b7c0edfd245b1efc0121 (patch)
treef8550796016c421c6a3312c40cd231d7733d7201 /mod
parent10960be69d9b00547546006e724321f8244fa685 (diff)
downloadvolse-hubzilla-dfe31dc3b7a041050203b7c0edfd245b1efc0121.tar.gz
volse-hubzilla-dfe31dc3b7a041050203b7c0edfd245b1efc0121.tar.bz2
volse-hubzilla-dfe31dc3b7a041050203b7c0edfd245b1efc0121.zip
more heavy lifting on poco rep
Diffstat (limited to 'mod')
-rw-r--r--mod/prep.php35
1 files changed, 28 insertions, 7 deletions
diff --git a/mod/prep.php b/mod/prep.php
index 7cff34bfc..45cdddad6 100644
--- a/mod/prep.php
+++ b/mod/prep.php
@@ -1,7 +1,7 @@
<?php
-function prep_content(&$a) {
+function prep_init(&$a) {
$poco_rating = get_config('system','poco_rating_enable');
// if unset default to enabled
@@ -23,19 +23,40 @@ function prep_content(&$a) {
dbesc($hash . '%')
);
+ if($p)
+ $a->poi = $p[0];
+
+}
+
+
+
+
+
+function prep_content(&$a) {
+
+
+ $poco_rating = get_config('system','poco_rating_enable');
+ // if unset default to enabled
+ if($poco_rating === false)
+ $poco_rating = true;
+
+ if(! $poco_rating)
+ return;
+
+ if(! $a->poi)
+ return;
+
$r = q("select * from xlink left join xchan on xlink_xchan = xchan_hash where xlink_link like '%s' and xlink_rating != 0",
- dbesc($hash . '%')
+ dbesc($a->poi['xchan_hash'])
);
$ret = array();
- if($p && $r) {
- $ret['poi'] = $p[0];
- $ret['raters'] = $r;
-
+ if($r) {
$o = replace_macros(get_markup_template('prep.tpl'),array(
'$header' => t('Ratings'),
- '$poi' => $p[0],
+ '$rating_lbl' => t('Rating: ' ),
+ '$rating_text_lbl' => t('Description: '),
'$raters' => $r
));