News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

All forum admins should look: SMF 2.0 iPhone and iPod Touch Theme (NOW FREE!)

Started by farfromperfection, March 10, 2009, 11:09:28 AM

Previous topic - Next topic

~DS~

Well the mod finally work perfect, but the Curve mobile mod override SMF4iPhone.
2. Disable the simpleportal or other portal as it messed with the iPhone theme.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

kaamaru


LC

Personally, I think that if the mod is not submitted to SMF for approval and is available though the mod page, don't upload it.

Just saying.

I am sure some of the people here have good intentions, but this is the internet after all.

kaamaru


LC

Quote from: Calumks on January 06, 2010, 06:23:32 PM
We don't submit to SMF as we are not the original creators.
Understandable. I know you want to improve on it.

I wonder if there is a way to "officially" update the theme for SMF to approve.

Fabius85

Quote from: LC on January 06, 2010, 06:32:09 PM
Quote from: Calumks on January 06, 2010, 06:23:32 PM
We don't submit to SMF as we are not the original creators.
Understandable. I know you want to improve on it.

I wonder if there is a way to "officially" update the theme for SMF to approve.
creating a different theme with the improved code by me and other contributors, giving it another (maybe similar) name and hoping the original author will not complain

ps: when a full and completely stable version of the mod is released i could do that.

butchs

Quote from: Dismal Shadow on January 05, 2010, 11:51:33 PM
Well the mod finally work perfect, but the Curve mobile mod override SMF4iPhone.

That is because Curve Mobile uses the load.php file and we check at index.template.php.  Thins is doe because copying the code is a no no and the people who worked on this mod found a proven script method.

If you edit the "curve-mobile-mod" it will not over-ride this mod. You can edit it as follows.  In Load.php change:
$user_agents = array(
array('iPhone', 'iphone'),
array('iPod', 'ipod'),
array('PocketIE', 'iemobile'),
array('Opera Mini', isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])),
array('Opera Mobile', 'Opera Mobi'),
array('Android', 'android'),
array('Symbian', 'symbian'),
array('Symbian S60', 'series60'),
array('Symbian S70', 'series70'),
array('Symbian S80', 'series80'),
array('Symbian S90', 'series90'),
array('BlackBerry', 'blackberry'),
array('BlackBerry Storm', 'blackberry05'),
array('Palm', 'palm'),
array('Web OS', 'webos'),
);

to:
$user_agents = array(
array('PocketIE', 'iemobile'),
array('Opera Mini', isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])),
array('Opera Mobile', 'Opera Mobi'),
array('Symbian', 'symbian'),
array('Symbian S60', 'series60'),
array('Symbian S70', 'series70'),
array('Symbian S80', 'series80'),
array('Symbian S90', 'series90'),
array('BlackBerry', 'blackberry'),
array('BlackBerry Storm', 'blackberry05'),
array('Palm', 'palm'),
array('Web OS', 'webos'),
);


:)

I do not think someone is going to make a mod for both themes.  ???
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

butchs

I have a few more days left to do some hacking so I gave this another shot.

This time I accessed the Movila Free Device detection which is a free server that detects wether or not you are using a mobile device.  This service takes some of the problems out of the picture.  Not only will it check just the user agent but it will check domain names that are used for mobile devices.  The web site clams it is more reliable and it is free!!!  :) ???

Install the latest "SMF4iphone" theme before you install this mod.

During installation the attached mod assumes that the "SMF4iphone" theme is installed before it is installed.  The mod searches for the theme and attempts to get the correct theme id and tries to put the correct theme id in the mod settings.

The problem is that I do not have a method to test this mod and see if it works.

It loads cleanly on my test server and seems to work.  But I can only test it for false.

Is there anyone who is interested in testing it?  If it works for one mobile device I am sure it will work for all others.  I hope.   :P
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

~DS~

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

butchs

Thank you.  :)  :)  :)  I just added a version 2.6 above.  I moved the theme change code form index.template.php to load.php.  This will allow the theme to load faster.  It seems to be a better way.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

CFCParadox

characters remaining: 575

~DS~

Mod 2.5 works for me but 2.6 didn't, don't know why. BTW the Classic button goes in a loop with the same iPhone theme. I see this when clicking the classic button.

index.php?theme=


"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

butchs

Quote from: Dismal Shadow on January 09, 2010, 04:26:15 PM
index.php?theme=

I believe that is in part to an error in the theme and in part the mod.

In "Surfez Couvert" excellent theme revision.
if you take...
Quoteif (((!empty($_GET['action'])) && ($_GET['action']=='iphone')) || !$_GET){
   $backlink = 'index.php?theme=' . $modSettings['id_theme'];
   $backname = $txt['iClassic'];

and replace it with...
Quoteif (((!empty($_GET['action'])) && ($_GET['action']=='iphone')) || !$_GET){
   $backlink = 'index.php?theme=1;';
   $backname = $txt['iClassic'];

Replace the "1" with your actual default theme ID.

In the mod.
I added a session so that the the iphone theme will only be loaded once while your browser is running.  The session variable is temporary and will be reset when you quit the browser.  See attached version 2.5.1.   Please test it.

Does it work with the theme changes?

I will like to note to anyone else who wishes to edit this.  If you run the following in php the session will be destroyed:
unset($_SESSION['smf4iphone']);

Furthermore this mod looks at all mobile devices so if you have another mod installed this will end up being your default.  I believe this is the most accurate mobile detection to date.  I am sure someone else will do better later.

Finally, the mod settings can be changed so this mod can be used with other themes by simply changing the theme ID.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

butchs

If that works I will add a default theme id to the mod settings that can be used in the theme.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

~DS~

It works, but instead of you putting what default theme it will be, let us choose which should be default like the one in the iPhone setting "Enter the theme ID for default (usually 1 or 2):"

And BTW I did this:
Quote from: butchs on January 09, 2010, 06:50:01 PM..
Quoteif (((!empty($_GET['action'])) && ($_GET['action']=='iphone')) || !$_GET){
   $backlink = 'index.php?theme=' . $modSettings['id_theme'];
   $backname = $txt['iClassic'];

and replace it with...
Quoteif (((!empty($_GET['action'])) && ($_GET['action']=='iphone')) || !$_GET){
   $backlink = 'index.php?theme=1' .$modSettings['id_theme'];
   $backname = $txt['iClassic'];

Replace the "1" with your actual default theme ID.


Notice I didn't remove the
.$modSettings['id_theme'];
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

~DS~

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

butchs

Ok, I knew what you wanted and have been on top of it all along.  I am reaching my limit of my expertise with this one.  Probably drove right by the bus stop.   :o  But here is what I tried to do with the attached:
1.  Added a default theme ID into the mod.  This is where the mod transfers to when you hit classic.
2.  Adjusted the iphonetheme to go to the default ID based on modsettings.
3.  Added 2 other filtered themes to the mod.
4.  Added a failsafe theme to the mod.  This where the mobile device goes when no other devices are filtered.  It can be changed to any other theme or smf built in mobile theme theme.

Read the notes at the bottom of the mod settings CAREFULLY.  One error and it will not work!!!!

Hopefully this does the trick, my brain is burnt?   O:)
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

butchs

Quote from: Dismal Shadow on January 10, 2010, 02:30:32 PM
The picture says: No access?

I was trying to fix the theme and it did not work so I deleted the post.  The post is back above this post.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

butchs

I just installed the mod  on my server.  [nofollow] www.eastcoastrollingthunder.com/smf/index.php [nofollow]

It seems to work well for me with no crashes.  But I can not test it with a mobile device.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

~DS~

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Advertisement: