Jump to content

Recommended Posts

Posted

Hello everybody,

I'm looking for solution to display text only in specific forums.

I've checked forum but I can't find solution for my problem.

I've found this

but section " Check if the current forum is forum ID x"  don't work for me.

Posted

I'm puting my code in forums -> topics -> post template. I want to display text in every post for specific groups in specific forums.
My code:
 

    {{if in_array( \IPS\Member::loggedIn()->member_group_id, array( 2, 3, 4, 8, 10, 16, 19 ) )}}
	{{elseif request.app == 'forums' && request.module == 'forums' && request.id == 3}}
    <center>
  	sample text
  	</center>
    {{endif}}

 

Posted (edited)

Which specific groups and in which specific forums?

Knowing this will help with checking your code - the above currently means that:

If they are in the listed groups then show nothing, otherwise if the forum is 3 then show something, otherwise nothing (go with \in_array, by the way)

Edited by Nathan Explosion
Posted
6 minutes ago, Nathan Explosion said:

Which specific groups and in which specific forums?

Groups IDs: 2, 3, 4, 8, 10, 16, 19

Forum IDs: 3, 15, 23, 56, 73
Code above maybe runs in forum display but in post doesn't work.

Posted (edited)
13 minutes ago, Nexus_Web_Media said:

post doesn't work.

Yep, because request.id will be the id of the topic.

Is that the entirety of the requirement?

Those groups, and those forums, and show in posts?

Edited by Nathan Explosion
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...