aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-17 03:10:19 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-17 03:10:19 -0700
commita50947a4bc3f779df8fa4e6777bc025fcefc8d21 (patch)
tree2196406c0c64494f5a4b604c695db6bbcd81897d /boot.php
parentc5031139ebb46ce4994d3bd62059ae4eaba71359 (diff)
downloadvolse-hubzilla-a50947a4bc3f779df8fa4e6777bc025fcefc8d21.tar.gz
volse-hubzilla-a50947a4bc3f779df8fa4e6777bc025fcefc8d21.tar.bz2
volse-hubzilla-a50947a4bc3f779df8fa4e6777bc025fcefc8d21.zip
like, dislike, activity streams, etc.
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index 1a1a05418..537c7d73a 100644
--- a/boot.php
+++ b/boot.php
@@ -47,7 +47,9 @@ define ( 'ACTIVITY_OBJ_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'photo' );
define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' );
define ( 'ACTIVITY_OBJ_ALBUM', NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' );
-
+define ( 'GRAVITY_PARENT', 0);
+define ( 'GRAVITY_LIKE', 3);
+define ( 'GRAVITY_COMMENT', 6);
if(! class_exists('App')) {
@@ -850,3 +852,24 @@ function allowed_url($url) {
return $found;
}}
+if(! function_exists('format_like')) {
+function format_like($cnt,$arr,$type,$id) {
+ if($cnt == 1)
+ $o .= $arr[0] . (($type == 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
+ else {
+ $o .= '<span class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');" >'
+ . $cnt . ' ' . t('people') . '</span> ' . (($type == 'like') ? t('like this.') : t('don\'t like this.')) . EOL ;
+ $total = count($arr);
+ if($total >= 75)
+ $arr = array_slice($arr,0,74);
+ if($total < 75)
+ $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1];
+ $str = implode(', ', $arr);
+ if($total >= 75)
+ $str .= t(', and ') . $total - 75 . t(' other people');
+ $str .= (($type == 'like') ? t(' like this.') : t(' don\'t like this.'));
+ $o .= '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
+ }
+ return $o;
+}}
+