Support Forum

Most recent topics with unread posts excluding a forum…

CA Carlos
Carlos
Member

Hi! what i need is to exclude a forum from the ” most recent topics with unread posts” I know that is possible but read the codex and not sure of what to do and on what files… please can anyone bring me some help? 

 

The forum id that i want to exclude is the 2173

 

thanks in advance

14 Answers

New Answer

MP Mr Papa
Mr Papa
Member

are you talking about the sp_RecentPostsTag() template function in the template tags plugin??

per the codex, there is not an exclude… instead you have to use the forumIds argument and pass the forum ids that you do want to show…

there is an open ticket to add an exclusion, but not ETA…

CA Carlos
Carlos
Member

Thanks, is great to hear that! 

I´m reffering to this button!Sinulo.jpg

MP Mr Papa
Mr Papa
Member

oh, sorry didnt catch you were talking about that…

but why would you want to exclude a forum from there?  what’s the use case?  maybe I am just missing it…  you only see forums that you have permission to view already…

so afraid no easy option type way to exclude a forum from that list..  frankly, its never been asked for before…

but a couple of ways it can be done:

o  use the filters for the list topic class to exclude the forum you want to

o  edit your sp theme, the spNewPostsView.php template file… find this statement:

            $spListView = new spTopicList($spThisUser->newposts[‘topics’], $count, $group, ”, $first);

and change it…  the fourth argument, currently ”, and change it to a comma separated list of the forum ids  you WANT in the posts… no way to exclude, list the ones you want…

CA Carlos
Carlos
Member

Hi! First of all thanks for helping me and my english :)

 

i tried it… but doesn´t worked for me…

 

this is what i wrote

$spListView = new spTopicList($spThisUser->newposts[‘topics’], 0, $group,1,2169,2188,2271,2206,2211,2217,2220,2224,2228,2,2186,2182,2184,2230, $first);
sp_load_template(‘spListView.php’);

 

what is going wrong? 

MP Mr Papa
Mr Papa
Member

Carlos,

the comma separated forum ids need to be a string…  so

$spListView = new spTopicList($spThisUser->newposts[‘topics’], 0, $group, ‘1,2169,2188,2271,2206,2211,2217,2220,2224,2228,2,2186,2182,2184,2230’, $first);
 

CA Carlos
Carlos
Member

Hi… i have been testing and doesn´t work for me… :(  

YS Yellow Swordfish
Yellow Swordfish
Member

Are they really genuine forum IDs? That means you have created over 2000 forums? Is that literally correct?

CA Carlos
Carlos
Member

I imported from BbPress so… maybe that is the reason of those high numbers… 

 

take a look here:

dsgsdg.jpg

 

YS Yellow Swordfish
Yellow Swordfish
Member

Ah yes – that would explain it.

When you say it doesn’t work what, exactly, does that mean please? And also – it would be interesting to understand why you need to do this as Steve (Mr papa) asked from the start. If it is just a matter of access by certain users then this should be taken care of through the user groups and permissions which is a much better way of doing this as it then applies to every view.

CA Carlos
Carlos
Member

The main reason is that my site is a guitar teaching site with a community, where users interact with others… 

I have also a forum where the users “ask for a guitar tutorial” or “request a song”, this is one of the more used forums, so is very difficult to the users to keep on “whats happening on” outside the “request” forum…  

So… that is the main reason…  

 

hope you know what i mean… my english is veeeeery bad!!! 

 

thanks in advance :)

YS Yellow Swordfish
Yellow Swordfish
Member

Your English is fine. And I understood perfectly what you meant.
I will look at the code later today to se if I can find any reason for a problem and let you know what I find.

MP Mr Papa
Mr Papa
Member

ticket is open, so research needed… will let you know what we find….

YS Yellow Swordfish
Yellow Swordfish
Member

Could you try something for me please?

Could youy replace that line if code with these two:

$groupIDS = array(1,2169,2188,2271,2206,2211,2217,2220,2224,2228,2,2186,2182,2184,2230);
$spListView = new spTopicList($spThisUser->newposts['topics'], 0, $group, $groupIDS, $first);

and let me know if this resolves it for you…?