Hello Guys, thanks for view my thread.
Can we make select themes without Theme Selector in Footer, but we just Click the link to use that themes.
Help Please!
I dont know how the Theme Selector in MyBB Work
I'm sure this could be done with a plugin, I don't believe it can be done without JS otherwise though.
With jQuery you'd want to hide the original list, then when a link in your custom list is clicked you'd change the hidden select item and submit the form.
(2015-04-10, 06:37 PM)Eric J. Wrote: [ -> ]I'm sure this could be done with a plugin, I don't believe it can be done without JS otherwise though.
With jQuery you'd want to hide the original list, then when a link in your custom list is clicked you'd change the hidden select item and submit the form.
but, what is the logic?
can you give me the link?
(2015-04-11, 03:53 AM)AndreSyahidu Wrote: [ -> ] (2015-04-10, 06:37 PM)Eric J. Wrote: [ -> ]I'm sure this could be done with a plugin, I don't believe it can be done without JS otherwise though.
With jQuery you'd want to hide the original list, then when a link in your custom list is clicked you'd change the hidden select item and submit the form.
but, what is the logic?
can you give me the link?
Well there's no tutorial on it specifically but something
like this is the same idea.
Theme change is a GET request so doing anything with jQuery here would be an overkill. You can globally use a link like this:
<a href="{$theme_redirect_url['location']}?my_post_key={$mybb->post_code}&theme=5&{$_SERVER['QUERY_STRING']}">Test</a>
where 5 is the theme ID. Even redirection will work, but I'd be careful with leaving pure {$_SERVER['QUERY_STRING']} due to possible (?) self-XSS attacks, you should htmlspecialchars_uni() it with help of the Template Conditionals plugin:
http://mybbhacks.zingaburga.com/showthread.php?tid=464
(2015-04-12, 01:32 PM)Destroy666 Wrote: [ -> ]Theme change is a GET request so doing anything with jQuery here would be an overkill. You can globally use a link like this:
<a href="{$theme_redirect_url['location']}?my_post_key={$mybb->post_code}&theme=5&{$_SERVER['QUERY_STRING']}">Test</a>
where 5 is the theme ID. Even redirection will work, but I'd be careful with leaving pure {$_SERVER['QUERY_STRING']} due to possible (?) self-XSS attacks, you should htmlspecialchars_uni() it with help of the Template Conditionals plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=464
The jQuery wouldn't do anything but simulate a click so the fact that the theme request uses GET shouldn't affect anything.
The code you provided looks like a better option though, definitely.
(2015-04-12, 04:10 PM)Eric J. Wrote: [ -> ]The jQuery wouldn't do anything but simulate a click so the fact that the theme request uses GET shouldn't affect anything.
Anything but optimisation as mentioned in my post. jQuery is slower than a simple HTML link. I don't understand why it's chosen so often as a solution for everything - for example for displaying latest threads from portal, which is unfortunately quite common in themes lately. At cost of ~10 portal.php queries (more with plugins), while a PHP solution would require only 1-2.
(2015-04-16, 10:19 PM)Destroy666 Wrote: [ -> ] (2015-04-12, 04:10 PM)Eric J. Wrote: [ -> ]The jQuery wouldn't do anything but simulate a click so the fact that the theme request uses GET shouldn't affect anything.
Anything but optimisation as mentioned in my post. jQuery is slower than a simple HTML link. I don't understand why it's chosen so often as a solution for everything - for example for displaying latest threads from portal, which is unfortunately quite common in themes lately. At cost of ~10 portal.php queries (more with plugins), while a PHP solution would require only 1-2.
I agree completely, though in some situations MyBB is limited and I think if the difference is negligible it's better to add a script than edit core files.
Thanks all , it's worked,
I setting the link to mobile theme in my footer forum , and also setting in my mobile theme version,but why it's not worked from mobile theme back to desktop the again?