aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-12-16 00:25:41 -0800
committerfriendica <info@friendica.com>2014-12-16 00:25:41 -0800
commit17e27d0d87d1197bd2928030ad98cd19869f78d4 (patch)
tree71e63acca364838d8320d763d8292ba38aaa23eb /mod
parent2e990743e757bea6712a3f3e9639a43c89b52901 (diff)
downloadvolse-hubzilla-17e27d0d87d1197bd2928030ad98cd19869f78d4.tar.gz
volse-hubzilla-17e27d0d87d1197bd2928030ad98cd19869f78d4.tar.bz2
volse-hubzilla-17e27d0d87d1197bd2928030ad98cd19869f78d4.zip
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.
Diffstat (limited to 'mod')
-rw-r--r--mod/channel.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/mod/channel.php b/mod/channel.php
index f85f904aa..e819de0e0 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -47,7 +47,7 @@ function channel_content(&$a, $update = 0, $load = false) {
$category = $datequery = $datequery2 = '';
- $mid = $_GET['mid'];
+ $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
@@ -138,7 +138,7 @@ function channel_content(&$a, $update = 0, $load = false) {
$sql_extra = item_permissions_sql($a->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));
}