Hide posts from private forums in "latest posts"
#1 27-11-2012 
Hi Lee, do you know how can I hide posts from private forums in "latests posts"? (in homepage abc and in other pages)?
Thank you in advance

#2 27-11-2012 
Yup, you need to add in a NOT IN (1,2,3) in the query. Post the latest threads query (just the call to the DB) and we can edit those out.
The site don't jive? PRESS F5 Flower

#3 27-11-2012 
Ok, I have edited in index.php:

// get sample forums

    $mybb->settings['abc_showsamples'] = '3';

    $sample = '107,87,92,88,94,90,93,91,89,101,109,114';

    $viewsample = " AND fid IN ($sample)";

I cancelled forum number 121, after 114, and now latest threads of 121 forum are disapperar in homepage site and pages (samples, contests, testare).

The problem now is "newposts".

$query = $db->query("
    SELECT t.*, u.username, u.displaygroup, u.avatar, u.usergroup, u.avatardimensions, f.name AS forumname, lp.avatar as lpavatar
        FROM ".TABLE_PREFIX."threads t
        LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
        LEFT JOIN ".TABLE_PREFIX."users lp ON (lp.uid=t.lastposteruid)
        LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
        WHERE 1=1 $uv AND t.visible='1'
        AND t.fid NOT IN(15,20,43,44,68,45,36)
        ORDER BY t.lastpost DESC
        LIMIT ".(($page-1)*$perpage).", ".$perpage

I add 121 in AND t.fid NOT IN(15,20,43,44,68,45,36)?

As always, thank you Big Grin

EDIT: Thank you Lee!! It works and latest posts in 121 forum are hidden Big Grin thank you very much

#4 28-11-2012 
Lee I can't do in this way with unread posts Sad

I tried to add AND t.fid NOT IN(121) in // Make a query to calculate unread posts and // Make a query to search topics with unread posts

but nothing, posts from 121 forum are still visible in unread postsSad

#5 28-11-2012 
121 is a private admin forum?
The site don't jive? PRESS F5 Flower

#6 28-11-2012 
No, there are only permissions: guests, they can see only 121 forum and nothing other, forum is active and open, only admin/mod and usergroup number 20 can see threads inside this forum

#7 28-11-2012 
By unread posts, do you mean the mod from MyBB to show only unread posts? Or do you mean the search posts, like today and new?
The site don't jive? PRESS F5 Flower

#8 28-11-2012 
Unread posts mod, I think it is the same plugin you have also here: http://mods.mybb.com/view/view-unreads-posts

in plugin I have 3 files: unreadPosts.tpl.php, unreadPosts.settings.php and unreadPosts.php

I tried to edit in unreadPosts.php but nothing changed, maybe there is need of other hook.

In Get all forums exceptions to SQL WHERE statement I found:

if (sizeof($exceptions_list) > 0)
            $this->where .= " AND t.fid NOT IN (" . implode(',', $exceptions_list) . ")";


#9 29-11-2012 
Ok, so there must be a variable called exceptions list.

in the settings there are forums which will not be searched :

Exception forums list
Forums IDs which will not be searched, comma separated

so it probably there that you need to add forum 121
The site don't jive? PRESS F5 Flower

#10 29-11-2012 
arghhhh right.. Sad Sad I didn't remember of check in admin acp Sad Sad ok, sorry


Sorry, that is a members only option