If Statements

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
shadowslight
New member
New member
Posts: 8
Joined: 13 Jul 2012, 05:26
Location: United Stated

Re: If Statements

Post by shadowslight »

oh thank you so much for this guide!

i have been trying to figure out how to make it so some new buttons on my header were only visible to members. this helps a ton!

[ Post made via Android ] [img]http://www.rmcgirr83.org/images/mobile/Android.png[/img]
juango
New member
New member
Posts: 9
Joined: 03 Jul 2012, 02:27

Re: If Statements

Post by juango »

i've had a doubt about this, how is the correct way to add a IF statement for two forum pages

i've tried this: <!-- IF SCRIPT_NAME == 'index' or SCRIPT_NAME == 'viewtopic' -->some content<!-- ENDIF -->
but i thought i could make it shorter and try this: <!-- IF SCRIPT_NAME == ('posting' or 'viewtopic') -->some content<!-- ENDIF --> but it doesn't seem to work i still see the code in the index page.
or is it " or ' i've tried my first example and it works!

sorry for so many questions in one, but i think i might not be the only one...... or maybe i am. :x :D
nBd
New member
New member
Posts: 25
Joined: 08 Mar 2011, 20:01

Re: If Statements

Post by nBd »

Is there any statement for groups?

For example: if is_newly_registered_user?

Edit: Found it: <!-- IF GROUP_ID eq number --><!-- ENDIF -->
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: If Statements

Post by Sniper_E »

Don't miss [url=http://RMcGirr83.org/viewtopic.php?p=308#p308]this page[/url]

[ Post made via Android ] [img]http://www.rmcgirr83.org/images/mobile/Android.png[/img]
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
noth
New member
New member
Posts: 34
Joined: 07 Jul 2012, 13:40

Re: If Statements

Post by noth »

great stuff including Sniper's LINK above :D

<!-- IF S_REGISTERED_USER --> If user is logged in and not a bot

I'm a bit baffled by this one, I assume bot= googlebot, yahoobot - all those? in which case why would an admin want to stop a googlebot, yahoobot ? :call:
ciscoa
Member
Member
Posts: 76
Joined: 04 Aug 2009, 20:31
Contact:

Re: If Statements

Post by ciscoa »

because even though you may have a forum or a section to be able to be seen by bots, there are certain areas, specially a link to a custom page or other custom stuff that you don't want a bot to see then you would use that statement for that!
User avatar
kevinviet
Member
Member
Posts: 96
Joined: 03 Mar 2010, 10:09

Re: If Statements

Post by kevinviet »

Hi

Can anyone please check for me to see this is correct code ?

Code: Select all

<div id="mchatpage_h" class="<!-- IF S_ENABLE_SNOW -->forabg2<!-- ELSE -->forabg<!-- ENDIF -->" style="display: none">


I just feel it not right and if it wrong how do a correct it ?

Thanks
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: If Statements

Post by RMcGirr83 »

What is mchatpage_h and S_ENABLE_SNOW?
User avatar
Ooopsie
Supporter
Supporter
Posts: 1213
Joined: 19 Aug 2010, 16:34
Location: Index, WA
Contact:

Re: If Statements

Post by Ooopsie »

I do know that the snow command normally causes the pages to jump for some reason. Smashable Lights is a better way to go.
WaGuns
Member
Member
Posts: 172
Joined: 06 Apr 2011, 02:01
Contact:

Re: If Statements

Post by WaGuns »

Love smashable lights. Turning mine on Friday AM!
User avatar
Ooopsie
Supporter
Supporter
Posts: 1213
Joined: 19 Aug 2010, 16:34
Location: Index, WA
Contact:

Re: If Statements

Post by Ooopsie »

WaGuns wrote:Love smashable lights. Turning mine on Friday AM!

Me too!
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: If Statements

Post by Sniper_E »

Ooopsie wrote:
WaGuns wrote:Love smashable lights. Turning mine on Friday AM!

Me too!

Each to his own I guess. Don't like the smashable lights. I'd rather have light falling snow with a pile of snow laying on top of the letters of my logo image. Maybe a Christmas tree with presents under it nested somewhere in the page. Hmmm, I need to work on that when I get home.

[ Post made via Android ] [img]http://www.rmcgirr83.org/images/mobile/Android.png[/img]
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
kevinviet
Member
Member
Posts: 96
Joined: 03 Mar 2010, 10:09

Re: If Statements

Post by kevinviet »

RMcGirr83 wrote:What is mchatpage_h and S_ENABLE_SNOW?


It's a Snow Effect mod that when I enable the mod it changes the forum background

No body says the code is wrong so I assume the code is fine. However after added the if statement the words style="display: none"> turn in black color on notepad ++ then I thought I doing in wrong :)
Last edited by kevinviet on 20 Nov 2012, 17:40, edited 1 time in total.
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: If Statements

Post by RMcGirr83 »

There is nothing wrong with the code...that's just the way notepad++ works.
User avatar
kevinviet
Member
Member
Posts: 96
Joined: 03 Mar 2010, 10:09

Re: If Statements

Post by kevinviet »

Thanks Rich, I feel more confident now.
Post Reply