MyBB Community Forums

Full Version: changing theme from URL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everybody,Wink

I was interested if it's possible to change theme with url, not with quick theme plugin?
The plugin should be edited to do that because it accepts datas only sent by post method.
Any idea how to do it? Could you help please?


(2010-01-09, 01:08 PM)DragonFever Wrote: [ -> ]The plugin should be edited to do that because it accepts datas only sent by post method.
Open plugin file find following:
if(isset($mybb->input['style']) && $mybb->request_method == "post")

Replace with following:
if(isset($mybb->input['style']) && $mybb->request_method == "post" || $mybb->request_method == "get")

Find following:
redirect($_SERVER['HTTP_REFERER'], $lang->redirect_optionsupdated);

Replace with following:
redirect("index.php", $lang->redirect_optionsupdated);

Now you can change themes by making a link like "index.php?action=quicktheme&style=themeid"

P.S: themeid part is the id of the theme which will be selected.
thank for the tips Smile
Don't mention itSmile
WOW! Thank you! This is great! Works well!! Angel

Which part of the code I should delete or put in to <span style="display:none"> in order not to show the menu at the bottom of the screen? I need only url?


(2010-01-09, 01:20 PM)DragonFever Wrote: [ -> ]Open plugin file find following:
if(isset($mybb->input['style']) && $mybb->request_method == "post")

Replace with following:
if(isset($mybb->input['style']) && $mybb->request_method == "post" || $mybb->request_method == "get")

Find following:
redirect($_SERVER['HTTP_REFERER'], $lang->redirect_optionsupdated);

Replace with following:
redirect("index.php", $lang->redirect_optionsupdated);

Now you can change themes by making a link like "index.php?action=quicktheme&style=themeid"

P.S: themeid part is the id of the theme which will be selected.

i replaced

<span class=\"trow2\" style=\"float: right; border: 1px solid #000000; padding: 1px;\">

with

<span style=\"display: none;\">

BUT

it adds blank space a bit,

how to edit display none in to this part:Huh

$theme_select = build_theme_select("style", $mybb->user['style']);

Well, solved it css way, don't know if it's correct way from php view?

just added to the form tag:

<form method=\"post\" action=\"./index.php?action=quicktheme\" style=\"margin-top:-32px;\">
(2010-01-09, 01:20 PM)DragonFever Wrote: [ -> ]Open plugin file find following:
if(isset($mybb->input['style']) && $mybb->request_method == "post")

Replace with following:
if(isset($mybb->input['style']) && $mybb->request_method == "post" || $mybb->request_method == "get")

Find following:
redirect($_SERVER['HTTP_REFERER'], $lang->redirect_optionsupdated);

Replace with following:
redirect("index.php", $lang->redirect_optionsupdated);

Now you can change themes by making a link like "index.php?action=quicktheme&style=themeid"

P.S: themeid part is the id of the theme which will be selected.

Thank you Dragon for the tips! Much better with themeid.