From 6f11f20992c88ff48a55929e94d9003fcc437062 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Jan 2015 15:35:42 -0800 Subject: first cut at unpacking bitfields in hubloc, fixed hubloc_error and hubloc_deleted --- mod/locs.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mod/locs.php') diff --git a/mod/locs.php b/mod/locs.php index b1169fcca..352112e3a 100644 --- a/mod/locs.php +++ b/mod/locs.php @@ -50,8 +50,7 @@ function locs_post(&$a) { notice( t('Primary location cannot be removed.') . EOL); return; } - $r = q("update hubloc set hubloc_flags = (hubloc_flags & %d) where hubloc_id = %d and hubloc_hash = '%s'", - intval(HUBLOC_FLAGS_DELETED), + $r = q("update hubloc set hubloc_deleted = 1 where hubloc_id = %d and hubloc_hash = '%s'", intval($hubloc_id), dbesc($channel['channel_hash']) ); @@ -66,7 +65,6 @@ function locs_post(&$a) { function locs_content(&$a) { - if(! local_user()) { notice( t('Permission denied.') . EOL); return; @@ -86,7 +84,7 @@ function locs_content(&$a) { for($x = 0; $x < count($r); $x ++) { $r[$x]['primary'] = (($r[$x]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false); - $r[$x]['deleted'] = (($r[$x]['hubloc_flags'] & HUBLOC_FLAGS_DELETED) ? true : false); + $r[$x]['deleted'] = (intval($r[$x]['hubloc_deleted']) ? true : false); } -- cgit v1.2.3