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~

Quote from: Fabius85 on December 28, 2009, 05:53:18 PM
Quote from: Dismal Shadow on December 28, 2009, 01:12:03 PM
The first code does not appear in index.template.php therefore how and where am I going to put after the first code?
the change to index.template.php must be applyed to the normal themes, not to iphone theme! so dont even try to do that! ^^
I did that to normal themes, not on the iPhone theme. The forum went down and had to restore load.php
Parse error: syntax error, unexpected ')' in /home/user/public_html/myforum.com/Sources/Load.php on line 1610
"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

Fabius85 I sent you a PM with a link to some of my bug fixes and etc for your review.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Fabius85

Quote from: Dismal Shadow on December 28, 2009, 06:17:22 PM
Quote from: Fabius85 on December 28, 2009, 05:53:18 PM
Quote from: Dismal Shadow on December 28, 2009, 01:12:03 PM
The first code does not appear in index.template.php therefore how and where am I going to put after the first code?
the change to index.template.php must be applyed to the normal themes, not to iphone theme! so dont even try to do that! ^^
I did that to normal themes, not on the iPhone theme. The forum went down and had to restore load.php
Parse error: syntax error, unexpected ')' in /home/user/public_html/myforum.com/Sources/Load.php on line 1610
you're right, i made a bracket error in the code, gonna fix it immediately

Fabius85

New release!
http://www.2shared.com/file/10309446/ecca7722/smf4iphone_20rc2.html

QuoteCHANGELOG
======================================
29/12/2009
¯¯¯¯¯¯¯¯¯¯
- 2.0 RC2
FIX: bracket error in Load.php mod
ADD: mod2.zip containing an
     alternative mod to load iPhone
     Theme via ?action=iphone
     credits go to butchs

about the mod...
before installing it:
1) you must first be sure to delete the changes done to the previous mod
2) you should be sure that your database parameters (login and password) are set in ADMIN PANEL > Server Settings > Database and Paths, even the ones needed to use SSI mode. if they're not set, then the stanard SMF4iPhone theme ID is used (4) and you will need to open your Load.php and set the right ID manually.

about the theme...
the only file changed is style.css, so just replace that if you already installed my previous release.

about mod2.zip...
this is an alternative mod to use instead of mod.zip (DO NOT INSTALL BOTH!) made by butchs. differences between mod.zip and mod2.zip are that the first one is just a porting of the original mod by farfromperfection to RC2, the second one is a little bit improved version, here it is what it does (written by butchs):
Quote1. Fixed the install path errors.  (IE:  <file name="$boarddir/index.php">)
2. Fixed a crash in Load.php (deleted extra closing bracket).
3. Added Mod Settings so you can adjust the theme number.
4.  Installed default mod setting to 4 in database.  I use 5.
5.  Deleted the index.template.php button.
6.  Added standard smf menu.
7.  Made the install SMF 2 RC2 specific.

~DS~

Thanks, downloading and installing. What about Curve Mobile Mod? It override SMF4iPhone.
"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

I made an error in mod2:

In the "install.xml"  file please change:
<file name="$languagedir/Modifications.english.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Begin iphone
$txt['iphone_title'] = 'iphone';
$txt['iphone_desc'] = 'Adjust SMF for iPhone settings';
$txt['id_theme'] = 'Enter the theme ID for iphone (usually 4 or 5):'
// End iphone
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Begin iphone
$txt['iphone_title'] = 'iphone';
$txt['iphone_desc'] = 'Adjust SMF for iPhone settings';
$txt['id_theme'] = 'Enter the theme ID for iphone (usually 4 or 5):'
// End iphone
]]></add>
</operation>
</file>


to:
<file name="$languagedir/Modifications.english.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Begin iphone
$txt['iphone_title'] = 'iphone';
$txt['iphone_desc'] = 'Adjust SMF for iPhone settings';
$txt['id_theme'] = 'Enter the theme ID for iphone (usually 4 or 5):';
// End iphone
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Begin iphone
$txt['iphone_title'] = 'iphone';
$txt['iphone_desc'] = 'Adjust SMF for iPhone settings';
$txt['id_theme'] = 'Enter the theme ID for iphone (usually 4 or 5):';
// End iphone
]]></add>
</operation>
</file>


Sorry I made a last second change and missed the bracket.  Sorry.
:(
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

~DS~

Is that the bug on the iphone when I am in the homepage it's in iPhone theme then the next I click anything it goes to full version?
"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

Fabius85

New release! (yes, again! ;D)
http://www.2shared.com/file/10315629/5e1d8f53/smf4iphone_20rc2.html

QuoteCHANGELOG
======================================
29/12/2009 (again)
¯¯¯¯¯¯¯¯¯¯
- 2.0 RC2
FIX: bug in mod2.zip
ADD: Italian Language support for
     mod2.zip

I also added the description of mod2.zip to the readme.

~DS~

 ???
The mod2 works but I can only see the iPhone theme in the homepage only, when clicking anything like "login" "message" it takes me to normal site? How to make it a full 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

The Mod2 had an error as I described above.  Attached is the fix.  Could be redundant. Sorry I could not post it last night but my computer crashed.

As far as your question I do not know.  I do not have an iphone and only helped.  All I did was clean up some things.  If it does not load try changing the theme ID.

This is Fabius85's mod and he can edit mod2 however he desires.
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

Fabius85

Quote from: butchs on December 29, 2009, 11:43:31 AM
The Mod2 had an error as I described above.  Attached is the fix.  Could be redundant. Sorry I could not post it last night but my computer crashed.

As far as your question I do not know.  I do not have an iphone and only helped.  All I did was clean up some things.  If it does not load try changing the theme ID.

This is Fabius85's mod and he can edit mod2 however he desires.
gonna attach it in next release
ps: use a user agent faker ;)

Quote from: Dismal Shadow on December 29, 2009, 11:52:57 AM
The mods does not work.
Have a test here: http://test.nathan-source.com/index.php?action=iphone
for me it's working

~DS~

Quote from: Fabius85 on December 29, 2009, 03:11:51 PM
Quote from: butchs on December 29, 2009, 11:43:31 AM
The Mod2 had an error as I described above.  Attached is the fix.  Could be redundant. Sorry I could not post it last night but my computer crashed.

As far as your question I do not know.  I do not have an iphone and only helped.  All I did was clean up some things.  If it does not load try changing the theme ID.

This is Fabius85's mod and he can edit mod2 however he desires.
gonna attach it in next release
ps: use a user agent faker ;)

Quote from: Dismal Shadow on December 29, 2009, 11:52:57 AM
The mods does not work.
Have a test here: http://test.nathan-source.com/index.php?action=iphone
for me it's working
Did you click, "message", "login"?
"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: Fabius85 on December 29, 2009, 03:11:51 PM
gonna attach it in next release

Yea, otherwise it give the white screen of death if the admin uploads another mod that creates mod settings that are defined in "Modifications.english.php".  Bad bad me...  :0

Quote from: Fabius85 on December 29, 2009, 03:11:51 PM
ps: use a user agent faker

Ooooooooo... :)  Now I have to find one.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Fabius85

Quote from: Dismal Shadow on December 29, 2009, 03:27:47 PM
Quote from: Fabius85 on December 29, 2009, 03:11:51 PM
Quote from: butchs on December 29, 2009, 11:43:31 AM
The Mod2 had an error as I described above.  Attached is the fix.  Could be redundant. Sorry I could not post it last night but my computer crashed.

As far as your question I do not know.  I do not have an iphone and only helped.  All I did was clean up some things.  If it does not load try changing the theme ID.

This is Fabius85's mod and he can edit mod2 however he desires.
gonna attach it in next release
ps: use a user agent faker ;)

Quote from: Dismal Shadow on December 29, 2009, 11:52:57 AM
The mods does not work.
Have a test here: http://test.nathan-source.com/index.php?action=iphone
for me it's working
Did you click, "message", "login"?
sorry i didnt faked my u.a. from safari mobile.
well, did you tried both mod.zip and mod2.zip? none works?

butchs

I get the same result with the fakers I tried.  But, If you change the latest "Mod 2.zip" code as shown below it seems to change the entire session on my computer when manually selected by the menu for guests and members alike?

In Subs.php change from:
'iPhone' => array(
'title' => 'iPhone',
'href' => $scripturl . '?action=iphone',
'show' => true,
'sub_buttons' => array(
),


to:
'iPhone' => array(
'title' => 'iPhone',
'href' => $scripturl . '?theme=' . $modSettings['id_theme'],
'show' => true,
'sub_buttons' => array(
),


I am not sure but I assume the "?action=theme" is for an actual iphone?

The back button does nothing with the above when the theme is manually selected but if you delete the cookie or log out the theme goes back to default.  Does that work?

I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

fivex

I can't seem to make it work. I installed a older version(as I didn't t relise that there was a new version), which caused a load.php error. So I replaced load.php, which broke SMFShop. Anyways, it dissipeared from the mod list for some reason, and the switch to Iphone button was still there  ???
So I  installed a newer version. Even with me using a user agent switcher, it reverts from the new theme if I move from the index page.

Fabius85

i'm gonna post it here, but obviously not including it in the mod. i have only 2 themes in my forum: the default one, and smf4iphone.
so i use this code in Load.php

elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== false) {
if((!empty($_GET['action'])) && ($_GET['action']=='noiphone')) {
setcookie("noiphone", "1");
setcookie ("iphone", "", time() - 3600);
    $id_theme = 6;
}
elseif((!empty($_GET['action'])) && ($_GET['action']=='iphone')) {
setcookie("iphone", "1");
setcookie ("noiphone", "", time() - 3600);
    $id_theme = 7;
}
else {
if ((isset($_COOKIE['noiphone'])))
$id_theme = 6;
else
$id_theme = 7;
}
  }
  elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') == false && strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') == false) {
if((!empty($_GET['action'])) && ($_GET['action']=='noiphone')) {
setcookie("noiphone", "1");
setcookie ("iphone", "", time() - 3600);
    $id_theme = 6;
}
elseif((!empty($_GET['action'])) && ($_GET['action']=='iphone')) {
setcookie("iphone", "1");
setcookie ("noiphone", "", time() - 3600);
    $id_theme = 7;
}
else {
if ((isset($_COOKIE['iphone'])))
$id_theme = 7;
else
$id_theme = 6;
}
  }

where 6 is my default theme id, and 7 is my smf4iphone theme id.

if you want to use it, in Load.php, search for:
// The theme was specified by parameter.
if (!empty($id_theme))
$id_theme = (int) $id_theme;

and copy that code after (obviously replacing smf4iphone mod code if you already installed it

butchs

Interesting, So you are doing it on a limited cookie session?

If you want to make it permanent and work with you may want to look at a javascript that will force the change no matter what.  Something like "simple_theme_changer_1-0-2"?  I am sure there are many other ways to skin a cat.   :o

The interesting part is where they search the theme list in the database:
Quoteforeach ($context['themes'] as $id => $theme)
                        echo '
                     <option value="', $id, '"', (($settings['theme_id'] == $id) ? ' selected="selected"' : ''), '>', $theme, '</option>';

Then they compare it against the theme in the list.  It will be cool if you can store them in the cookie and then use the script to force it.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

butchs

The attached is a stop gap hack until the mod author does his thing.  This has been on my site for a week and seems to work ok.  It includes the fix I mentioned on the 28th and 29th.

This is not an official mod so use with caution.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Advertisement: