How to check if mobile joomla is working for jomsocial template

alterna
14 years, 10 months ago
Could you tell me how to check if mobile joomla is active using the bot ?

Jomsocial is able to check whether the user agent is iphone to switch template but this is not good

I would prefer it to check if mobile joomla is active in order to switch to iphone template

Any idea how to get this ?

For now the test of jomsocial is:
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod'))

I would like to change this for a test of mobilejoomla activated but did not get the right function through the mobilebot

with the old pdabot, that was easy, just checking if it was false or true
craig.reilly
14 years, 10 months ago
You could load Safari as your browser. The Developer Menu has the option to change to different USER AGENTS, and you can also edit C:Program FilesSafariSafari.resourcesUserAgents.plist to add User agents. I know this is possible on a mac but I do not know the location of the useragent file. This is how I developer my iPhone Web Apps and it works well.
alterna
14 years, 10 months ago
Well of course I know how to use safari with the developper menu

My question was: what kind of test could I make in PHP in order to check that mobile bot is active in the page that is loaded ! in order for jomsocial to activate its iphone template automatically if the mobile bot has detected a mobile user !

for now the test is : if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod'))
which is not good as it stops iphone users to switch the the regular template, so I try to find a solution to change this test in order to include mobile bot checking
craig.reilly
14 years, 10 months ago
I guess I totally missed your question and don't understand what you are trying to do. C'est la vie.
alterna
14 years, 10 months ago
ok sorry, let me try in my poor french

Jomsocial has an inside php test to check if the useragent is an iphone/ipod and I want to change this php test to something testing if mobilejoomla has switched the user to a mobile template instead of the regular template.

this way jomsocial would run the iphone template ONLY if mobile joomla is active with a mobile template, if not, jomsocial would use the regular template

is this better formulated ?
craig.reilly
14 years, 10 months ago
Ah I think I see it now.
so if user on mobile switched to regular, then joomsocial should show regular as well?
I do not know enough about Joomla and its components to help you. I am having a ton of fun testing this mobile template and getting my site up and running and ironing out the bugs. Good luck.
grvulture
13 years, 5 months ago
You need to replace the JomSocial condition with:
 
if (defined('_MJ'))


This way, JomSocial will only change when MobileJoomla is active.

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.