Module: Automatic Mobile Template
Posted by Brian Moon
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
mod_mobile-1.0.3.zip | 7 KB | open | download | Brian Moon | 09/11/2015 | Read message |
mod_mobile-1.0.3.tar.gz | 3.5 KB | open | download | Brian Moon | 09/11/2015 | Read message |
photo.PNG | 65.7 KB | open | download | Durtdawber | 04/08/2011 | Read message |
February 27, 2011 10:01AM |
Admin Registered: 22 years ago Posts: 4,495 |
This module lets you pick a template to have automatically enabled when a mobile device is detected. You can select the template to use and you can enter the user agent keywords to look for to enable the template. There is a new Mobile Template that works with this module. Feel free to make your own.
This module is running here at Phorum.org.
Edited 4 time(s). Last edit at 09/11/2015 04:45AM by Oliver Riesen.
This module is running here at Phorum.org.
Changelog: ---------- 2015-09-11 v1.0.3 Oliver Riesen <oliver@riesen.org> - README added. - Fixed PHP Notice, Undefined index: HTTP_USER_AGENT. - German language files added. 2011-09-07 v1.0.2 Bruno Tournay - use Phorum API method phorum_switch_template() - translation strings are now used only with mobile template - the list of pages supported by the template is defined by the template itself (by optional "supported_pages" parameter in settings.tpl). "file" and "redirect" are always supported implicitly. Example: {DEFINE supported_pages "index,list,read,post,login,search,pm"} 2010-03-28 v1.0.1 Thomas Seifert - added the file page to the allowed pages and category, version fields to info.txt 2010-02-27 v1.0.0 - initial release by Brian Moon
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Edited 4 time(s). Last edit at 09/11/2015 04:45AM by Oliver Riesen.
March 02, 2011 07:19PM |
Registered: 16 years ago Posts: 533 |
The phrase "New Topic" becomes simply "New" even when viewing from the PC (normal template) after having enabled the mobile template.
Robert Angle
Phorum lover, nothing more.
Ruminations
Robert Angle
Phorum lover, nothing more.
Ruminations
March 04, 2011 08:46AM |
Registered: 16 years ago Posts: 533 |
Quote
Robert Angle
The phrase "New Topic" becomes simply "New" even when viewing from the PC (normal template) after having enabled the mobile template.
If you look at the link at the top, the same thing is happening here at phorum.org
Robert Angle
Phorum lover, nothing more.
Ruminations
Re: Module: Automatic Mobile Template March 05, 2011 12:43PM |
Registered: 15 years ago Posts: 27 |
This is really cool. Thanks for putting it together.
I've been customizing it to add an icon to the home screen when bookmarked and to run in full screen mode (as a web app basically). Has anyone come across a way to have links open within the webapp rather than popping open in the browser?
Again, great work. Thank you.
I've been customizing it to add an icon to the home screen when bookmarked and to run in full screen mode (as a web app basically). Has anyone come across a way to have links open within the webapp rather than popping open in the browser?
Again, great work. Thank you.
Re: Module: Automatic Mobile Template March 05, 2011 12:56PM |
Registered: 15 years ago Posts: 27 |
I found this thread that seems to have some info on how to get links from within webapps to actually open in the webapp itself rather than opening in Safari. Not sure how to implement this in the Phorum mobile template to get every link to open in the webapp page. Is it possible?
[forums.macrumors.com]
Edited 1 time(s). Last edit at 03/05/2011 12:58PM by shawn y..
[forums.macrumors.com]
Quote
Ok, here is how I ended up getting it to work.
I have 2 ways of specifying a link in the WebApp.
For links that I want to open within the WebApp and not open in Safari, I use this:
Code:
<a onclick="parent.location='URL GOES HERE'">Link</a>
For links that I want to open in Safari, I use the standard HTML link:
Code:
<a href="URL GOES HERE">Link</a>
That's it. Simple once you know how.
Edited 1 time(s). Last edit at 03/05/2011 12:58PM by shawn y..
Re: Module: Automatic Mobile Template March 08, 2011 01:15PM |
Registered: 12 years ago Posts: 4 |
I appologize ahead of time, I don't have a smartphone to try this out so my scenarios below haven't been narrowed down very well. Just going by what people tell me.
I installed everything, and got some users lined up to try it. Enabled the module. They said they didn't see any change. So, while I had people lined up, I just switched one of my lesser used forums over to the mobile template manually. I started seeing the "New Topics" link change to "New" like Robert described above in all the other Emerald templated forums, and I didn't see a "New" link in the foum I had using the mobile template. My users then did see the mobile template for that one forum.
My test window was over, so I switched my forum back to Emerald. I also went into the Settings for this module and added BlackBerry since it wasn't in the default list, and saved the list then turned the module Off (I had originally gone into the settings for the module and look at them when I turned it on, but didn't change or save them, just assumed it would default OK). Then I started getting posts about how much people liked the new template. I said, "Its off, are you sure you are seenig it?" So far, it sounds like it, but I haven't seen it with my own eyes. They said they can create new topics too, so the "New" link must be there.
Not sure if you have to save the settings to get the module to detect the default list of agents and truly be on. Also the Off setting may not work after that.
I installed everything, and got some users lined up to try it. Enabled the module. They said they didn't see any change. So, while I had people lined up, I just switched one of my lesser used forums over to the mobile template manually. I started seeing the "New Topics" link change to "New" like Robert described above in all the other Emerald templated forums, and I didn't see a "New" link in the foum I had using the mobile template. My users then did see the mobile template for that one forum.
My test window was over, so I switched my forum back to Emerald. I also went into the Settings for this module and added BlackBerry since it wasn't in the default list, and saved the list then turned the module Off (I had originally gone into the settings for the module and look at them when I turned it on, but didn't change or save them, just assumed it would default OK). Then I started getting posts about how much people liked the new template. I said, "Its off, are you sure you are seenig it?" So far, it sounds like it, but I haven't seen it with my own eyes. They said they can create new topics too, so the "New" link must be there.
Not sure if you have to save the settings to get the module to detect the default list of agents and truly be on. Also the Off setting may not work after that.
Re: Module: Automatic Mobile Template March 08, 2011 09:37PM |
Registered: 12 years ago Posts: 4 |
OK, I was able to spend a few minutes with a smartphone. When the module was off, the mobile template was turned off. When I turned the template on, it did go into the mobile template. But I'm still not sure it did originally - seems like I had to save the settings on the module first. Wasn't able to try that whole scenario today, though.
Don
Don
Re: Module: Automatic Mobile Template March 09, 2011 12:00AM |
Admin Registered: 17 years ago Posts: 566 |
Don,
Yes you should save the settings when you enable a module, even if you haven't changed anything. The original defaults in the admin come from the module settings.php, but the module may/will use data from a table(s) when it is running (not the settings script). If you haven't saved, it never gets written to the table.
Yes you should save the settings when you enable a module, even if you haven't changed anything. The original defaults in the admin come from the module settings.php, but the module may/will use data from a table(s) when it is running (not the settings script). If you haven't saved, it never gets written to the table.
Broken image thumbnail and links March 28, 2011 03:14PM |
Registered: 17 years ago Posts: 125 |
Re: Broken image thumbnail and links March 28, 2011 03:19PM |
Admin Registered: 21 years ago Posts: 9,240 |
Sorry, only registered users may post in this forum.