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]
If Statements
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
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
-
- New member
- Posts: 8
- Joined: 13 Jul 2012, 05:26
- Location: United Stated
-
- New member
- Posts: 9
- Joined: 03 Jul 2012, 02:27
Re: If Statements
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.

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.


-
- New member
- Posts: 25
- Joined: 08 Mar 2011, 20:01
Re: If Statements
Is there any statement for groups?
For example: if is_newly_registered_user?
Edit: Found it: <!-- IF GROUP_ID eq number --><!-- ENDIF -->
For example: if is_newly_registered_user?
Edit: Found it: <!-- IF GROUP_ID eq number --><!-- ENDIF -->
- Sniper_E
- MOD Team
- Posts: 591
- Joined: 13 Jun 2011, 16:53
- Location: Shreveport, LA
Re: If Statements
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]
[ 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!™
-
- New member
- Posts: 34
- Joined: 07 Jul 2012, 13:40
Re: If Statements
great stuff including Sniper's LINK above
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:

<!-- 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:
-
- Member
- Posts: 76
- Joined: 04 Aug 2009, 20:31
Re: If Statements
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!
- kevinviet
- Member
- Posts: 96
- Joined: 03 Mar 2010, 10:09
Re: If Statements
Hi
Can anyone please check for me to see this is correct code ?
I just feel it not right and if it wrong how do a correct it ?
Thanks
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
- RMcGirr83
- Past Contributor
- Posts: 6243
- Joined: 30 Nov 2006, 14:23
- Real name: Rich McGirr
Re: If Statements
What is mchatpage_h and S_ENABLE_SNOW?
- Ooopsie
- Supporter
- Posts: 1213
- Joined: 19 Aug 2010, 16:34
- Location: Index, WA
Re: If Statements
I do know that the snow command normally causes the pages to jump for some reason. Smashable Lights is a better way to go.
-
- Member
- Posts: 172
- Joined: 06 Apr 2011, 02:01
Re: If Statements
Love smashable lights. Turning mine on Friday AM!
- Ooopsie
- Supporter
- Posts: 1213
- Joined: 19 Aug 2010, 16:34
- Location: Index, WA
Re: If Statements
WaGuns wrote:Love smashable lights. Turning mine on Friday AM!
Me too!
- Sniper_E
- MOD Team
- Posts: 591
- Joined: 13 Jun 2011, 16:53
- Location: Shreveport, LA
Re: If Statements
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!™
- kevinviet
- Member
- Posts: 96
- Joined: 03 Mar 2010, 10:09
Re: If Statements
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.
- RMcGirr83
- Past Contributor
- Posts: 6243
- Joined: 30 Nov 2006, 14:23
- Real name: Rich McGirr
Re: If Statements
There is nothing wrong with the code...that's just the way notepad++ works.
- kevinviet
- Member
- Posts: 96
- Joined: 03 Mar 2010, 10:09
Re: If Statements
Thanks Rich, I feel more confident now.
Return to “Modders MOD support”
Who is online
Users browsing this forum: CommonCrawl [Bot] and 0 guests