<!-- IF S_MCHAT_ENABLE and ... statement help

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
Post Reply
neuropass
Member
Member
Posts: 66
Joined: 12 Apr 2010, 17:07

<!-- IF S_MCHAT_ENABLE and ... statement help

Post by neuropass »

This says:

<!-- IF S_MCHAT_ENABLE and (S_MCHAT_ON_INDEX or U_MCHAT) -->

which means if mchat is enabled and on index or custom mchat page show the script.

That means if an user is viewing a topic the script is not loaded. Doesn't seem to be the case.

Any clarification on how that works would be great!

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

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by Sniper_E »

Isn't the U_MCHAT part of that line the "link to the custom page"? You are understanding it to be the "custom mchat page" itself.

I could be corrected but I see that line to be:

If mchat is enabled and mchat on index page is enabled
OR
If mchat is enabled and the mchat link to the custom page exists
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
neuropass
Member
Member
Posts: 66
Joined: 12 Apr 2010, 17:07

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by neuropass »

The thing that is confusing to me is that mchat scripts seem to be loaded even if you are viewing lets say the viewtopic page. Shouldn't be the script not served unless you are on index or custom mchat page?
Maybe I missing something there.
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by Sniper_E »

No you are seeing it right, the only thing you are missing is that the author of the mchat mod is a nub. Additional IF statements can be added to accomplish what you think it should be. He also has an IF statement in the mchat_body.html template that I think is off but Hey... I'm still impressed with his work. I can live with what he has created here.
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
neuropass
Member
Member
Posts: 66
Joined: 12 Apr 2010, 17:07

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by neuropass »

lol I knew Rich <--- note the name would mess something up!

How can I use the statements to load mchat script only on index and custom page?
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by Sniper_E »

Code: Select all

<!-- IF SCRIPT_NAME == "index" or SCRIPT_NAME == "mchat" -->
<!-- IF S_MCHAT_ENABLE and (S_MCHAT_ON_INDEX or U_MCHAT) -->
<script type="text/javascript" src="{ROOT_PATH}mchat/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="{ROOT_PATH}mchat/jquery_cookie_mini.js"></script>
<!-- ENDIF -->
<!-- ENDIF -->
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
neuropass
Member
Member
Posts: 66
Joined: 12 Apr 2010, 17:07

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by neuropass »

Awesome! That works !! Thanks a lot!!
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by RMcGirr83 »

<!-- IF S_MCHAT_ENABLE and (S_MCHAT_ON_INDEX or U_MCHAT) -->

Isn't really needed at all actually.
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by RMcGirr83 »

Sniper_E wrote:He also has an IF statement in the mchat_body.html template that I think is off but Hey... I'm still impressed with his work. I can live with what he has created here.


Which one?
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by Sniper_E »

RMcGirr83 wrote:<!-- IF S_MCHAT_ENABLE and (S_MCHAT_ON_INDEX or U_MCHAT) -->
Isn't really needed at all actually.

I didn't think so either. It's not like those two scripts are pulling a huge server load or anything. They could load on any page.

RMcGirr83 wrote:Which one?

Awhile back I was playing with the IF statements on the Who's chatting and could not get the results I wanted. It's no big deal though.
Who's chatting shows in the bottom panel of the chat on the index page. If you set the 'Stats on Index: Yes' in the ACP it also shows by the Who's online section.

I was trying to make the <!-- IF not (MCHAT_ARCHIVE_MODE or MCHAT_CUSTOM_PAGE) and MCHAT_WHOIS and S_MCHAT_INDEX_STATS --> in the mchat_body
work with the <!-- IF S_MCHAT_ENABLE and MCHAT_INDEX_STATS and U_MCHAT --> in the mchat_stats

I was trying to have the Who's chatting show up either in the bottom panel of the chat -OR- by the Who's online section, not in both places.

Same on the custom page. I was trying to make that <!-- IF not (MCHAT_ARCHIVE_MODE or MCHAT_CUSTOM_PAGE) and MCHAT_WHOIS and S_MCHAT_INDEX_STATS -->
work with the <!-- IF MCHAT_CUSTOM_PAGE and MCHAT_WHOIS --> in the mchat_body but I failed miserably on both.

I gave up quickly because it's fine the way it is, it was just a small preference. Your mchat rocks just the way it is. :rock:
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
neuropass
Member
Member
Posts: 66
Joined: 12 Apr 2010, 17:07

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by neuropass »

RMcGirr83 wrote:<!-- IF S_MCHAT_ENABLE and (S_MCHAT_ON_INDEX or U_MCHAT) -->

Isn't really needed at all actually.


then it doesn't look like its working the way it should. It loads on any other page. Unless you add the if script etc etc. When you have mobile users, that is extra resources downloaded for no reason. That's why I was trying to have mchat stuff loaded only where mchat is suppose to be used.
User avatar
Sniper_E
MOD Team
MOD Team
Posts: 591
Joined: 13 Jun 2011, 16:53
Location: Shreveport, LA
Contact:

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by Sniper_E »

Would this work neuropass?
I don't like two consecutive IF statements to load some .js total .bs

Code: Select all

<!-- IF S_MCHAT_ENABLE and (SCRIPT_NAME == "index" or SCRIPT_NAME == "mchat") -->
<script type="text/javascript" src="{ROOT_PATH}mchat/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="{ROOT_PATH}mchat/jquery_cookie_mini.js"></script>
<!-- ENDIF -->
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
neuropass
Member
Member
Posts: 66
Joined: 12 Apr 2010, 17:07

Re: <!-- IF S_MCHAT_ENABLE and ... statement help

Post by neuropass »

That works as well Sniper. I like it better! :-)
Post Reply