Giving the permission to change themes by user/guest/student in moodle.

Very Simple close your eyes and open your eyes after few seconds when you fill relax.

Then
Step 1. Open your moodle directory

In my pc like :D :jaywampwwwmoodle4

Step2. Open here a file name is “moodle4/lib/setup.php”
In this file search “allowthemechangeonurl” near to line number 638
you have look like this

{code type=codetype}
if (isset($_GET['theme'])) {
if ($CFG->allowthemechangeonurl || confirm_sesskey()) {
$themename = clean_param($_GET['theme'], PARAM_SAFEDIR);
if (($themename != ”) and file_exists($CFG->themedir.’/’.$themename)) {
$SESSION->theme = $themename;
}
unset($themename);
}

}

{/code}

Replace above code to like this

{code type=codetype}
if (isset($_GET['theme'])) {
/*if ($CFG->allowthemechangeonurl || confirm_sesskey()) {
$themename = clean_param($_GET['theme'], PARAM_SAFEDIR);
if (($themename != ”) and file_exists($CFG->themedir.’/’.$themename)) {
$SESSION->theme = $themename;
}
unset($themename);
}*/
$themename = clean_param($_GET['theme'], PARAM_SAFEDIR);$SESSION->theme = $themename;
}
{/code}

Step3. open your browesr and give this type parameter
here i m using like my pc path like this :

http://localhost/moodle4/?theme=metal

http://localhost/moodle4/?theme=formal_white

Step4. Now enjoy its done.

Note I m writing with concept of moodle version 1.9.5+ (but most possible no difference my this tutorial on other moodle version)

http://www.themeswiki.org/Theming_Moodle here you search “Jay Bharat” Im giving same tutorial here also.

Share on Facebook