aboutsummaryrefslogtreecommitdiffstats
path: root/mod/network.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 /mod/network.php
parentceabd7629bab4a490515aa8608acf0738159e1d0 (diff)
downloadvolse-hubzilla-f0b640058427aff2d9d60899f9005980ab89c0ef.tar.gz
volse-hubzilla-f0b640058427aff2d9d60899f9005980ab89c0ef.tar.bz2
volse-hubzilla-f0b640058427aff2d9d60899f9005980ab89c0ef.zip
more lint
Diffstat (limited to 'mod/network.php')
-rw-r--r--mod/network.php40
1 files changed, 11 insertions, 29 deletions
diff --git a/mod/network.php b/mod/network.php
index cbd8b6bc3..a6e03440b 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -3,6 +3,8 @@
function network_init(&$a) {
require_once('include/group.php');
+ if(! x($a->page,'aside'))
+ $a->page['aside'] = '';
$a->page['aside'] .= group_side('network','network');
}
@@ -10,7 +12,9 @@ function network_init(&$a) {
function network_content(&$a, $update = 0) {
if(! local_user())
- return;
+ return '';
+
+ $o = '';
require_once("include/bbcode.php");
@@ -140,32 +144,10 @@ function network_content(&$a, $update = 0) {
$dlike = array();
if(count($r)) {
- foreach($r as $item) {
- $sparkle = '';
-
- if(($item['verb'] == ACTIVITY_LIKE) && ($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(! is_array($alike[$item['parent'] . '-l']))
- $alike[$item['parent'] . '-l'] = array();
- $alike[$item['parent']] ++;
- $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>';
- }
- if(($item['verb'] == ACTIVITY_DISLIKE) && ($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(! is_array($dlike[$item['parent'] . '-l']))
- $dlike[$item['parent'] . '-l'] = array();
- $dlike[$item['parent']] ++;
- $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>';
- }
+ foreach($r as $item) {
+ like_puller($a,$item,$alike,'like');
+ like_puller($a,$item,$dlike,'dislike');
}
foreach($r as $item) {
@@ -177,7 +159,7 @@ function network_content(&$a, $update = 0) {
$profile_url = $item['url'];
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
- if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
+ if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent']))
continue;
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
@@ -274,8 +256,8 @@ function network_content(&$a, $update = 0) {
}
- $like = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
- $dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
+ $like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
+ $dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
$location = (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
$coord = (($item['coord']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');