diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-12 17:11:06 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-12 17:11:06 -0700 |
commit | f1977d420ea025e9d8b1f47fb41b25468d07218f (patch) | |
tree | d7517a4693ff2e53374e80a3e789465deaa7fc90 /boot.php | |
parent | 744edcf2abaa5b567c0642277d9cdc29df7dc1d5 (diff) | |
download | volse-hubzilla-f1977d420ea025e9d8b1f47fb41b25468d07218f.tar.gz volse-hubzilla-f1977d420ea025e9d8b1f47fb41b25468d07218f.tar.bz2 volse-hubzilla-f1977d420ea025e9d8b1f47fb41b25468d07218f.zip |
minor cleanup
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -17,6 +17,11 @@ define ( 'REL_VIP', 1); define ( 'REL_FAN', 2); define ( 'REL_BUD', 3); +// Maximum number of "people who like (or don't like) this" we will list by name + +define ( 'MAX_LIKERS', 75); + + define ( 'NOTIFY_INTRO', 0x0001 ); define ( 'NOTIFY_CONFIRM', 0x0002 ); define ( 'NOTIFY_WALL', 0x0004 ); @@ -841,7 +846,7 @@ function webfinger_dfrn($s) { $links = webfinger($s); if(count($links)) { foreach($links as $link) - if($link['@attributes']['rel'] == NAMESPACE_DFRN) + if($link['@attributes']['rel'] === NAMESPACE_DFRN) return $link['@attributes']['href']; } return ''; @@ -1086,13 +1091,13 @@ function format_like($cnt,$arr,$type,$id) { $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) + if($total >= MAX_LIKERS) + $arr = array_slice($arr, 0, MAX_LIKERS - 1); + if($total < MAX_LIKERS) $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1]; $str = implode(', ', $arr); - if($total >= 75) - $str .= t(', and ') . $total - 75 . t(' other people'); + if($total >= MAX_LIKERS) + $str .= t(', and ') . $total - MAX_LIKERS . 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>'; } |