<!-- IF S_MCHAT_ENABLE and ... statement help
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
<!-- IF S_MCHAT_ENABLE and ... statement help
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!
<!-- 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!
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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
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!™
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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.
Maybe I missing something there.
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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!™
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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?
How can I use the statements to load mchat script only on index and custom page?
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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!™
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
Awesome! That works !! Thanks a lot!!
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
<!-- IF S_MCHAT_ENABLE and (S_MCHAT_ON_INDEX or U_MCHAT) -->
Isn't really needed at all actually.
Isn't really needed at all actually.
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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?
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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!™
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
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.
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
Would this work neuropass?
I don't like two consecutive IF statements to load some .js total .bs
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!™
Re: <!-- IF S_MCHAT_ENABLE and ... statement help
That works as well Sniper. I like it better!