From 17e27d0d87d1197bd2928030ad98cd19869f78d4 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 16 Dec 2014 00:25:41 -0800 Subject: [PATCH] add Thomas's Diaspora repair script as include/fixd.php - altered so it can be re-run if necessary with a count of remaining hublocs to be fixed. Some sites are down so it probably can't ever get to zero. The check for a null join is quite an expensive query. It could block your DB for a couple minutes while it runs. Also some preliminary work on a means to take the channel module out of list/forum mode if a specific mid is requested. --- include/fixd.php | 33 +++++++++++++++++++++++++++++++++ include/network.php | 24 +++++++++++++----------- mod/channel.php | 9 ++++----- version.inc | 2 +- 4 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 include/fixd.php diff --git a/include/fixd.php b/include/fixd.php new file mode 100644 index 000000000..bce5eb348 --- /dev/null +++ b/include/fixd.php @@ -0,0 +1,33 @@ +profile['profile_uid'],$remote_contact,$groups); - if(get_pconfig($a->profile['profile_uid'],'system','channel_list_mode')) + if(get_pconfig($a->profile['profile_uid'],'system','channel_list_mode') && (! $mid)) $page_mode = 'list'; else $page_mode = 'client'; @@ -147,7 +147,7 @@ function channel_content(&$a, $update = 0, $load = false) { if(($update) && (! $load)) { if ($mid) { $r = q("SELECT parent AS item_id from item where mid = '%s' and uid = %d AND item_restrict = 0 - AND (item_flags & %d)>0 AND (item_flags & %d)>0 $sql_extra limit 1", + AND (item_flags & %d) > 0 AND (item_flags & %d) > 0 $sql_extra limit 1", dbesc($mid), intval($a->profile['profile_uid']), intval(ITEM_WALL), @@ -157,7 +157,7 @@ function channel_content(&$a, $update = 0, $load = false) { $r = q("SELECT distinct parent AS `item_id`, created from item left join abook on item.author_xchan = abook.abook_xchan WHERE uid = %d AND item_restrict = 0 - AND (item_flags & %d)>0 AND ( item_flags & %d )>0 + AND (item_flags & %d) > 0 AND ( item_flags & %d ) > 0 AND ((abook.abook_flags & %d) = 0 or abook.abook_flags is null) $sql_extra ORDER BY created DESC", @@ -171,7 +171,6 @@ function channel_content(&$a, $update = 0, $load = false) { } else { - if(x($category)) { $sql_extra .= protect_sprintf(term_query('item', $category, TERM_CATEGORY)); } diff --git a/version.inc b/version.inc index d2690e375..2dafb05e5 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-12-15.890 +2014-12-16.891