Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: valentino86 on March 24, 2011, 07:15:06 PM

Title: Pretty urls & smf4iphone
Post by: valentino86 on March 24, 2011, 07:15:06 PM
I have a problem with the buttons of the smf4iphone's menu because with the prettyurls mod they don't work well. How can I fix it?
Title: Re: Pretty urls & smf4iphone
Post by: Arantor on March 24, 2011, 07:15:30 PM
Which mod, exactly? There's several iPhone mods out there.
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 24, 2011, 07:47:15 PM
This mod http://custom.simplemachines.org/mods/index.php?mod=636

You can try by yourself www.meccanicaweb.it/forum/index.php?theme=34
Title: Re: Pretty urls & smf4iphone
Post by: Arantor on March 24, 2011, 07:48:56 PM
Yes, I know which Pretty URLs mod you meant. I meant which *theme* since there are several floating about.
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 25, 2011, 04:10:39 AM
This theme http://custom.simplemachines.org/themes/index.php?lemma=2089
Title: Re: Pretty urls & smf4iphone
Post by: Arantor on March 25, 2011, 04:24:48 AM
And what exactly is the problem with the URLs? Everything looks alright to me.
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 25, 2011, 04:51:05 AM
Try to go in one board or topic and then push whatever buttons you want, it will not work.
Title: Re: Pretty urls & smf4iphone
Post by: Arantor on March 25, 2011, 05:12:49 AM
Well, I used the link given, which didn't really look like an iPhone theme, and it worked absolutely fine for me but I don't have an iPhone...
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 25, 2011, 05:23:24 AM
I'm sorry :) the right link is this http://www.meccanicaweb.it/forum/index.php?theme=35

Title: Re: Pretty urls & smf4iphone
Post by: Arantor on March 25, 2011, 05:33:24 AM
In which case it's a bug with the theme and should be reported to the theme author in the dedicated theme support thread (http://www.simplemachines.org/community/index.php?topic=376475.0)

I'd also note the theme doesn't have the SMF copyright in it (which it should)
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 25, 2011, 05:45:55 AM
Ok I got it.

Quote from: Arantor on March 25, 2011, 05:33:24 AM
I'd also note the theme doesn't have the SMF copyright in it (which it should)

Yes it has
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 25, 2011, 07:53:17 AM
Quote from: Arantor on March 25, 2011, 05:33:24 AM
In which case it's a bug with the theme

But it works without prettyurls mod, are you sure that's a bug? I just need to change this links

<li class="active" id="tabhome" onclick="go('home');">
<li id="tabmessages" onclick="go('pm');">
<li id="tabprofile" onclick="go('profile');">
Title: Re: Pretty urls & smf4iphone
Post by: Arantor on March 25, 2011, 11:20:04 AM
OK, so it is, in VERY SMALL letters, which is bending the rules of the licence.

Oh, it's a bug, but it's one that the theme author would have to fix. You see, those onclick calls aren't anything that Pretty URLs would touch...
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 25, 2011, 11:28:31 AM
Inside li tag can I insert a href?
Title: Re: Pretty urls & smf4iphone
Post by: Arantor on March 25, 2011, 11:32:08 AM
That's the thing, you're not supposed to because it is a Javascript link itself!
Title: Re: Pretty urls & smf4iphone
Post by: valentino86 on March 25, 2011, 01:21:11 PM
ok I found a way, on the index.template.php look for this

<div id="tabbar">';
echo '
<ul>

<li onclick="go(\'home\');" id="tabhome"', $ishome ,'>
<a href="http://www.meccanicaweb.it/forum">', $txt['iHome'] ,'</a>
</li>

<li onclick="if(document.getElementById(\'searchbar\').style.display==\'block\'){document.getElementById(\'searchbar\').style.display=\'none\';}else{document.getElementById(\'searchbar\').style.display=\'block\';document.searchform.search.focus();}" id="tabsearch"', $issearch ,'>
<a href="#">', $txt['iSearch'] ,'</a>
</li>

<li onclick="go(\'pm\');" id="tabmessages"', $ispm ,'>';
if (($context['user']['unread_messages'] > 0) && ($context['user']['unread_messages'] < 10))
echo '
<div id="count">',$context['user']['unread_messages'],'<span style="font-size:15px;">&nbsp;&nbsp;<span><br id="miobr" /><br id="miobr" /></div>';
elseif ($context['user']['unread_messages'] > 10)
echo '
<div id="count">',$context['user']['unread_messages'],'<span style="font-size:12px;">&nbsp;&nbsp;<span><br id="miobr" /><br id="miobr" /></div>';
echo '
<a href="#">', $txt['iMessages'] ,'</a>
</li>

<li onclick="go(\'profile\');" id="tabprofile"', $isprofile ,'>
<a href="#">', $txt['iProfile'] ,'</a>
</li>

<li onclick="go(\'logout;sesc=', $context['session_id'] ,'\');" id="tablogout">
<a href="#">', $txt['iLogout'] ,'</a>
</li>

</ul>

</div>';}


and replace with

<div id="tabbar">';
echo '
<ul>

<li id="tabhome"', $ishome ,'>
<a href="http://www.meccanicaweb.it/forum">', $txt['iHome'] ,'</a>
</li>

<li onclick="if(document.getElementById(\'searchbar\').style.display==\'block\'){document.getElementById(\'searchbar\').style.display=\'none\';}else{document.getElementById(\'searchbar\').style.display=\'block\';document.searchform.search.focus();}" id="tabsearch"', $issearch ,'>
<a href="#">', $txt['iSearch'] ,'</a>
</li>

<li id="tabmessages"', $ispm ,'>';
if (($context['user']['unread_messages'] > 0) && ($context['user']['unread_messages'] < 10))
echo '
<div id="count">',$context['user']['unread_messages'],'<span style="font-size:15px;">&nbsp;&nbsp;<span><br id="miobr" /><br id="miobr" /></div>';
elseif ($context['user']['unread_messages'] > 10)
echo '
<div id="count">',$context['user']['unread_messages'],'<span style="font-size:12px;">&nbsp;&nbsp;<span><br id="miobr" /><br id="miobr" /></div>';
echo '
<a href="http://www.meccanicaweb.it/forum/index.php?action=pm">', $txt['iMessages'] ,'</a>
</li>

<li id="tabprofile"', $isprofile ,'>
<a href="http://www.meccanicaweb.it/forum/index.php?action=profile">', $txt['iProfile'] ,'</a>
</li>

<li id="tablogout">
<a href="http://www.meccanicaweb.it/forum/index.php">', $txt['iLogout'] ,'</a>
</li>

</ul>

</div>';}


and on style.css look for this

#tabbar li a{

display: block;
height: 14px;

}


and replace with

#tabbar li a{

display: block;
height: 17px;
padding-top: 32px;

}


I don't know how can I fix the logout link