aboutsummaryrefslogtreecommitdiffstats
path: root/include/hubloc.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-02-01 17:17:23 -0800
committerzotlabs <mike@macgirvin.com>2018-02-01 17:17:23 -0800
commitcc0cd0b292f825d70a626c1ae5d46d0a43a825b9 (patch)
tree28120e3a5b6eed79affabb6de61b39fe5e2e090f /include/hubloc.php
parentc92bb6176a79ef575c9a9b5dec8fde7034c6421c (diff)
downloadvolse-hubzilla-cc0cd0b292f825d70a626c1ae5d46d0a43a825b9.tar.gz
volse-hubzilla-cc0cd0b292f825d70a626c1ae5d46d0a43a825b9.tar.bz2
volse-hubzilla-cc0cd0b292f825d70a626c1ae5d46d0a43a825b9.zip
more generalisation of commonly used code constructs
Diffstat (limited to 'include/hubloc.php')
-rw-r--r--include/hubloc.php16
1 files changed, 1 insertions, 15 deletions
diff --git a/include/hubloc.php b/include/hubloc.php
index d5abda7fb..0d1a2e560 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -266,25 +266,11 @@ function hubloc_mark_as_down($posturl) {
function locations_by_netid($netid) {
- $strloc = '';
-
$locs = q("select hubloc_addr as location from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_deleted = 0 and site_dead = 0",
dbesc($netid)
);
- if($locs) {
- foreach($locs as $l) {
- if(!($l['location']))
- continue;
- if(strpos($strloc,$l['location']) !== false)
- continue;
- if(strlen($strloc))
- $strloc .= ', ';
- $strloc .= $l['location'];
- }
- }
-
- return $strloc;
+ return array_elm_to_str($locs,'location',', ');
}