aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-31 16:38:22 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-31 16:38:22 -0700
commitf0b640058427aff2d9d60899f9005980ab89c0ef (patch)
treea7e2f2d7fca62e73f725dc072fa1944150a86bd0 /boot.php
parentceabd7629bab4a490515aa8608acf0738159e1d0 (diff)
downloadvolse-hubzilla-f0b640058427aff2d9d60899f9005980ab89c0ef.tar.gz
volse-hubzilla-f0b640058427aff2d9d60899f9005980ab89c0ef.tar.bz2
volse-hubzilla-f0b640058427aff2d9d60899f9005980ab89c0ef.zip
more lint
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 6cac527eb..2e3ae0e65 100644
--- a/boot.php
+++ b/boot.php
@@ -608,8 +608,7 @@ function goaway($s) {
if(! function_exists('xml_status')) {
function xml_status($st, $message = '') {
- if(strlen($message))
- $xml_message = "\t<message>" . xmlify($message) . "</message>\r\n";
+ $xml_message = ((strlen($message)) ? "\t<message>" . xmlify($message) . "</message>\r\n" : '');
header( "Content-type: text/xml" );
echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
@@ -1334,3 +1333,28 @@ function qp($s) {
return str_replace ("%","=",rawurlencode($s));
}}
+
+if(! function_exists('like_puller')) {
+function like_puller($a,$item,&$arr,$mode) {
+
+ $url = '';
+ $sparkle = '';
+ $verb = (($mode === 'like') ? ACTIVITY_LIKE : ACTIVITY_DISLIKE);
+
+ if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) {
+ $url = $item['url'];
+ if(($item['network'] === 'dfrn') && (! $item['self'])) {
+ $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+ $sparkle = ' class="sparkle" ';
+ }
+ if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l']))))
+ $arr[$item['parent'] . '-l'] = array();
+ if(! isset($arr[$item['parent']]))
+ $arr[$item['parent']] = 1;
+ else
+ $arr[$item['parent']] ++;
+ $arr[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>';
+ }
+ return;
+}}
+