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

kaamaru

I can't get the theme to show child boards inside their parent boards (above the topics). Found a way to do this?

Fabius85

Quote from: Calumks on December 04, 2009, 05:16:56 AM
I can't get the theme to show child boards inside their parent boards (above the topics). Found a way to do this?
is it just a bug with RC2? or is that a function you want me to add?

Mr. Jinx

Thank you Fabius85 for this update! It's working great with RC2 now!
I only had a small undefined error in BoardIndex.Template.php.

I just replaced:
foreach ($context['latest_posts'] as $post){
with:
if (!empty($context['latest_posts']))
foreach ($context['latest_posts'] as $post){

Fabius85

you're welcome :)

well, i'm gonna work on the childboards matter this weekend, i will post the code when done

doughboy99

Hi

Thanks for this. I had one problem, the index.template.php file was different from what was expected.
instead of
echo '
<li id="button_', $act, '"', !empty($classes) ? ' class="' . $classes . '"' : '', '>
<a title="', $act, '" href="', $button['href'], '">
<span>', ($button['active_button'] ? '<em>' : ''), $button['title'], ($button['active_button'] ? '</em>' : ''), '</span>
</a>
</li>';


I have
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';
if (!empty($button['sub_buttons']))
{
echo '
<ul>';

foreach ($button['sub_buttons'] as $childbutton)
{
echo '
<li>
<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
<span', isset($childbutton['is_last']) ? ' class="last"' : '', '>', $childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' : '', '</span>
</a>';
// 3rd level menus :)
if (!empty($childbutton['sub_buttons']))
{
echo '
<ul>';

foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a', $grandchildbutton['active_button'] ? ' class="active"' : '', ' href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
</a>
</li>';

echo '
</ul>';
}

echo '
</li>';
}
echo '
</ul>';


So I added

/* Begin SMF4iPhone Mod */
$i++;
if($i==count($context['menu_buttons'])&&(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false ||
strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== false))

echo '
<li>
<a title="Switch to iPhone Mode" href="index.php?action=iphone">
<span>Switch to iPhone</span>
</a>
</li>';

/* End SMF4iPhone Mod */


after. This seems to have worked.

I'll do some testing later. I don't have an iPhone here but will try with another smartphone.



Fabius85

i have too many buttons on my forum menubar so in my default theme i just added a "Switch to iPhone View" link after theme_copyright() in the function template_body_below() of index.template.php, it works fine :)

/*if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== false) {*/
    echo '<br /><br /><li class="last"><a id="button_mobile" href="', $scripturl , '?action=iphone" class="new_win"><strong>[ <small>Switch to iPhone View</small> ]</strong></a></li>';
/*}*/


remove the /* and */ from the first and third line if you want the link being displayed only to iPhone/iPod users and not to everyone

kaamaru

Quote from: Fabius85 on December 04, 2009, 05:29:48 AM
Quote from: Calumks on December 04, 2009, 05:16:56 AM
I can't get the theme to show child boards inside their parent boards (above the topics). Found a way to do this?
is it just a bug with RC2? or is that a function you want me to add?

A function. I failed to do it. If you do that for me I will give you the code so that you can modify and delete posts.

BxK

I've done almost a complete re-write of this . It's no longer a theme but actually implemented into SMF just like wap is ... more info soon on my blog if anyone is interested. It makes it much easier to switch between iPhone mode and normal mode.
I will be updating my blog will the info in the next few days about it. Thanks!
http://mattcworld.com

Fabius85

Quote from: BxK on December 04, 2009, 04:43:57 PM
I've done almost a complete re-write of this . It's no longer a theme but actually implemented into SMF just like wap is ... more info soon on my blog if anyone is interested. It makes it much easier to switch between iPhone mode and normal mode.
I will be updating my blog will the info in the next few days about it. Thanks!
http://mattcworld.com
what do you mean with "complete re-write"?
waiting for screenies! :D

BxK

http://mattcworld.com/?page_id=2
added it to the projects page to give more insight on what I'm doing. It's really nothing "new" but their will be in the later versions as it seems the SMF4iPhone creator has kind of well  ditched it?

Nibogo

I have installed this theme and it's great, but I have some issues:

1. I got this error "Unable to load the 'main_above' template." well it happends when the SMF4iPhone try to load the 4 Theme as you can see in the Load.php file, so you just have to modify the "$id_theme = 4;" with the ID of the iPhone Theme on your SMF, in my case it's 12 so I replace it with "$id_theme = 12;" (If you don't know the ID of the iPhone Theme you can see on the Themes Settings or just adding to your website: index.php?theme=4 and try replacing this 4 with other numbers).

2. I had an issue with SimplePortal in case that someone has SPortal installed you can see that the portal appear in the iPhone version so to disable this open your Subs-SimplePortal.php and:

Search For:
if (WIRELESS || ($standalone && (isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']))) || !empty($settings['disable_sp']) || empty($modSettings['sp_portal_mode']) || (!empty($maintenance) && !allowedTo('admin_forum')) || isset($_GET['debug']) || (empty($modSettings['allow_guestAccess']) && $context['user']['is_guest']))

Replace With:
if (WIRELESS || ((isset($_REQUEST['action']) && ($_REQUEST['action'] == 'iphone')) || ($context['browser']['is_iphone'] && ($_REQUEST['action'] !== 'noiphone'))) || ($standalone && (isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']))) || !empty($settings['disable_sp']) || empty($modSettings['sp_portal_mode']) || (!empty($maintenance) && !allowedTo('admin_forum')) || isset($_GET['debug']) || (empty($modSettings['allow_guestAccess']) && $context['user']['is_guest']))

Thanks for this useful Theme! :)

Fabius85

@NIBOGO: man if you installed my version of smf4iphone and you have a default language different from english you MUST create an iPnone.language.YOURLANGUAGE.php or theme wont load. I'm gonna fix it by loading english language template in next release (i'll work on it this weekend)

Nibogo

Quote from: Fabius85 on December 05, 2009, 06:59:46 AM
@NIBOGO: man if you installed my version of smf4iphone and you have a default language different from english you MUST create an iPnone.language.YOURLANGUAGE.php or theme wont load. I'm gonna fix it by loading english language template in next release (i'll work on it this weekend)


Yes, I know, I already did it:

www.mundo-se.com/index.php?action=iphone

Fabius85

i made some changes and this is my new release available for download :)
http://www.2shared.com/file/9745992/5136fd54/smf4iphone_20rc2.html

QuoteCHANGELOG
======================================
06/12/2009
¯¯¯¯¯¯¯¯¯¯
- 2.0 RC2
FIX: if no language file is available
     english language is used.
FIX: undifined index error in boards.
ADD: displaying childboards in boards.

if you already installed my version of SMF4iPhone, just extract these files from theme.zip archive:
- BoardIndex.template.php
- index.template.php
- MessageIndex.template.php

and replace the older ones in theme's folder

dembow

i installed this on my forum but when i go on my iPhone to my site i don't see the theme, is there a file that i should edit?



Quote from: Fabius85 on December 06, 2009, 07:55:47 AM
i made some changes and this is my new release available for download :)
http://www.2shared.com/file/9745992/5136fd54/smf4iphone_20rc2.html

QuoteCHANGELOG
======================================
06/12/2009
¯¯¯¯¯¯¯¯¯¯
- 2.0 RC2
FIX: if no language file is available
     english language is used.
FIX: undifined index error in boards.
ADD: displaying childboards in boards.

if you already installed my version of SMF4iPhone, just extract these files from theme.zip archive:
- BoardIndex.template.php
- index.template.php
- MessageIndex.template.php

and replace the older ones in theme's folder

does this ^^^ work for 1.1.11?  the author of the theme said on twitter that it does

Fabius85

Quote from: dembow on December 06, 2009, 08:02:10 AM
i installed this on my forum but when i go on my iPhone to my site i don't see the theme, is there a file that i should edit?


does this ^^^ work for 1.1.11?  the author of the theme said on twitter that it does

well, i didn't try that on 1.1.11 but i really dont think it works cause it is a template made for 2.0
FFPerfection said that he would have worked on a theme for 1.1.x but he released nothing ATM.
that's probabily why you cant see the theme...

dembow

Quote from: Fabius85 on December 06, 2009, 08:30:25 AM
well, i didn't try that on 1.1.11 but i really dont think it works cause it is a template made for 2.0
FFPerfection said that he would have worked on a theme for 1.1.x but he released nothing ATM.
that's probabily why you cant see the theme...

well i've tried it on 2.0 as well and i still can't see it on my iPhone

i installed the theme threw the admin panel no problems

when i installed the mod i got this



although after clicking install now it said it installed successfully

am i doing something wrong?

rd

Haven't read all the posts so I don't know if any one mentioned it. There seems too be a lot of errors with the first SMF 4 Iphone for Rc 1. Got my database to 100 MB :( I had my PHP guy fix it, he says the mod is a result of "poor coding" but I disagree, even if it has the errors, it's great for me to access the forum from my IPhone. I just wish that I could access the admin control page too.

Fabius85

Quote from: dembow on December 06, 2009, 05:15:20 PM
am i doing something wrong?
try to use add
?action=iphone
at the end of the link of your index.php
example:
http://www.yoursite.com/forum/index.php?action=iphone
and tell me if you can see you forum with the iphone theme or not

Quote from: mohd7590 on December 06, 2009, 06:07:32 PM
Haven't read all the posts so I don't know if any one mentioned it. There seems too be a lot of errors with the first SMF 4 Iphone for Rc 1. Got my database to 100 MB :( I had my PHP guy fix it, he says the mod is a result of "poor coding" but I disagree, even if it has the errors, it's great for me to access the forum from my IPhone. I just wish that I could access the admin control page too.
as you can see in my changelog i fixed all that undefined index errors ;)

dembow

Quote from: Fabius85 on December 07, 2009, 12:14:04 AM

try to use add
?action=iphone
at the end of the link of your index.php
example:
http://www.yoursite.com/forum/index.php?action=iphone
and tell me if you can see you forum with the iphone theme or not

no :(

Advertisement: