finalize filters and forum notifications

This commit is contained in:
Mario Vavti
2018-06-02 22:11:11 +02:00
parent db0a3a7534
commit 8189408190
12 changed files with 149 additions and 90 deletions

View File

@@ -394,10 +394,19 @@ function get_features($filtered = true, $level = (-1)) {
feature_level('order_tab',2),
],
[
'forums_tab',
t('Forum Filter'),
t('Ability to display only posts of a specific forum'),
false,
get_config('feature_lock','forums_tab'),
feature_level('forums_tab',1),
],
[
'personal_tab',
t('Network Personal Tab'),
t('Enable tab to display only Network posts that you\'ve interacted on'),
t('Personal Posts Filter'),
t('Ability to display only Network posts that you\'ve interacted on'),
false,
get_config('feature_lock','personal_tab'),
feature_level('personal_tab',1),

View File

@@ -91,10 +91,10 @@ function nav($template = 'default') {
if(local_channel()) {
if(! $_SESSION['delegate']) {
$nav['manage'] = array('manage', t('Manage Channels'), "", t('Manage your channels'),'manage_nav_btn');
$nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage your channels'),'manage_nav_btn');
}
$nav['group'] = array('group', t('Manage Privacy Groups'),"", t('Add and edit privacy groups'),'group_nav_btn');
$nav['group'] = array('group', t('Privacy Groups'),"", t('Manage your privacy groups'),'group_nav_btn');
$nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'),'settings_nav_btn');

View File

@@ -3335,22 +3335,54 @@ function unique_multidim_array($array, $key) {
return $temp_array;
}
function network_qstring($req) {
function get_forum_channels($uid) {
$ret = '?f=';
if(! $uid)
return;
if(x($req, 'cid'))
$ret .= '&cid=' . $req['cid'];
$perms_sql = item_permissions_sql($uid) . item_normal();
if(x($req, 'gid'))
$ret .= '&gid=' . $req['gid'];
$xf = false;
if(x($req, 'star'))
$ret .= '&star=' . $req['star'];
$x1 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'send_stream' and v = '0'",
intval($uid)
);
if($x1) {
$xc = ids_to_querystr($x1,'xchan',true);
if(x($req, 'conv'))
$ret .= '&conv=' . $req['conv'];
$x2 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'tag_deliver' and v = '1' and xchan in (" . $xc . ") ",
intval($uid)
);
return $ret;
if($x2) {
$xf = ids_to_querystr($x2,'xchan',true);
// private forums
$x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") and not xchan in (" . $xf . ") ",
intval(local_channel())
);
if($x3) {
$xf = ids_to_querystr(array_merge($x2,$x3),'xchan',true);
}
}
}
$sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
$r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 $sql_extra order by xchan_name",
intval($uid)
);
for($x = 0; $x < count($r); $x ++) {
if($x3) {
foreach($x3 as $xx) {
if($r[$x]['xchan_hash'] == $xx['xchan']) {
$r[$x]['private_forum'] = 1;
}
}
}
}
return $r;
}