aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/identity.php6
-rw-r--r--include/widgets.php27
2 files changed, 33 insertions, 0 deletions
diff --git a/include/identity.php b/include/identity.php
index 2fc183368..aef6471e5 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -943,6 +943,11 @@ logger('online: ' . $profile['online']);
$tpl = get_markup_template('profile_vcard.tpl');
+// This isn't ideal here because it requires local_channel().
+// We need the rating widget to recognise and take you home if you're remote.
+// require_once('include/widgets.php');
+// $z = widget_rating(array('target' => $profile['channel_hash']));
+
$o .= replace_macros($tpl, array(
'$profile' => $profile,
'$connect' => $connect,
@@ -954,6 +959,7 @@ logger('online: ' . $profile['online']);
'$homepage' => $homepage,
'$chanmenu' => $channel_menu,
'$diaspora' => $diaspora,
+ '$rating' => $z,
'$contact_block' => $contact_block,
));
diff --git a/include/widgets.php b/include/widgets.php
index 523318850..71407ad3d 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -903,3 +903,30 @@ function widget_random_block($arr) {
return $o;
}
+
+
+function widget_rating($arr) {
+ $a = get_app();
+ if(! local_channel())
+ return;
+
+ $channel = $a->get_channel();
+
+ if($arr['target'])
+ $hash = $arr['target'];
+ else
+ $hash = $a->poi['xchan_hash'];
+
+ if(! $hash)
+ return;
+
+ if($hash == $channel['channel_hash'])
+ return;
+
+ head_add_js('ratings.js');
+
+ $o = '<div class="widget rateme">';
+ $o .= '<div class="rateme fakelink" onclick="doRatings(\'' . $hash . '\'); return false;"><i class="icon-pencil"></i> ' . t('Rate Me') . '</div></div>';
+ return $o;
+
+} \ No newline at end of file