Template variable for checking group membership

Support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Forum rules
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Template variable for checking group membership

Postby RMcGirr83 » 21 Dec 2008, 15:00

Last edited by RMcGirr83 on 13 Jan 2015, 00:00, edited 9 times in total.
Reason: fixed code if not in group

muggins
New member
New member
Posts: 7
Joined: 02 Nov 2008, 22:12
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby muggins » 23 Jun 2009, 14:55

Sweet! Thank you, sir. :thumbup:
Muggins

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby RMcGirr83 » 23 Jun 2009, 14:58

:)

statm
New member
New member
Posts: 3
Joined: 29 Aug 2009, 10:02
Location: NC, US
Contact:

Re: Template variable for checking group membership

Postby statm » 29 Aug 2009, 10:08

Wow, I asked about this exact thing on the phpbb board a few years ago and never really got a good answer. And here you are with a mod to do the very thing..

Thank you very much!

Lyndka
New member
New member
Posts: 8
Joined: 06 Feb 2009, 20:54
Contact:

Re: Template variable for checking group membership

Postby Lyndka » 30 Aug 2009, 11:28

I've been Googling for just this sort of MOD - BUT (sorry - there's always a but...) could this be incorporated into a BBcode that would do either of the following?

Either display some text if the condition is true or grayed if false

or

Show text if true or hide text if false

(the BBcode can do one or the other - it doesnt have to offer both within the same tag)

I want to be able to post a topic 'common' to several groups but mask or differentiate text to members of certain groups,

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby RMcGirr83 » 13 Jan 2010, 14:15

No you can't pass IF statements within custom bbcode tags.

LDD
New member
New member
Posts: 4
Joined: 17 May 2010, 11:24
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby LDD » 17 May 2010, 11:49

YOU ARE THE BEST !

Very thank you !

:cheers:

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby RMcGirr83 » 17 May 2010, 12:04

You're very welcome. :)

falcon
New member
New member
Posts: 2
Joined: 09 May 2011, 06:25
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby falcon » 15 Jun 2011, 16:39

thanks

Futeki
New member
New member
Posts: 1
Joined: 30 Jun 2011, 10:14
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby Futeki » 30 Jun 2011, 10:26

Hello, I am trying to define the "Guests" group so that unregistered guest will be able to view the members list and forums but would not be able to click the member names which would lead to profile view.

I've tried to put this

$_profile_cache['tpl_profile'] = '<!-- IF not S_GROUP_1 --><a href="{PROFILE_URL}" target="_blank">{USERNAME}</a><!-- ELSE -->{USERNAME}<!-- ENDIF -->';

in functions_content.php and it is not working. Can anyone here help me please? Thank you very much!

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby RMcGirr83 » 30 Jun 2011, 11:37


Ashley.S.
New member
New member
Posts: 35
Joined: 01 Aug 2009, 23:02
Location: Falmouth, Cornwall, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby Ashley.S. » 14 Jul 2011, 14:26

this is a great snippet, thanks Rich :cool:
Kind Regards,
-Ashley.S. [ Moderator ]

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby RMcGirr83 » 14 Jul 2011, 14:44

If you became a donor you could get the hook file which does the same thing but you don't have to edit any php file. ;)

Ashley.S.
New member
New member
Posts: 35
Joined: 01 Aug 2009, 23:02
Location: Falmouth, Cornwall, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby Ashley.S. » 14 Jul 2011, 17:56

Kind Regards,
-Ashley.S. [ Moderator ]

neuropass
Member
Member
Posts: 66
Joined: 12 Apr 2010, 17:07
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Template variable for checking group membership

Postby neuropass » 28 Jul 2011, 15:42



[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “Modders MOD support”

Who is online

Users browsing this forum: No registered users and 7 guests