Difference between revisions of "Drupal color.module"
Jump to navigation
Jump to search
(New page: __notoc__ This module allows for the altering of the color theme of the site. The module was altered as follows: ==Drupal 5.6== All changes made are in /modules/color/color.module. ==...) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__notoc__ | __notoc__ | ||
+ | This module allows for the altering of the color theme of the site. The module was altered as follows: | ||
− | + | ==Drupal 6.1== | |
+ | |||
+ | ===STEP 1=== | ||
+ | In /includes/file.inc, replace (line 756): | ||
+ | <pre> | ||
+ | $file = tempnam(realpath($temp), 'file'); | ||
+ | </pre> | ||
+ | With: | ||
+ | <pre> | ||
+ | $file = tempnam($temp, 'file'); //tempnam(realpath($temp), 'file'); //WOLFTECH CHANGES MADE HERE | ||
+ | </pre> | ||
+ | |||
+ | ===STEP 2=== | ||
+ | In /includes/common.inc, comment out all calls to the '''chdir()''' function; | ||
+ | |||
+ | ===STEP 3=== | ||
+ | In /includes/common.inc, replace (line 1880): | ||
+ | <pre> | ||
+ | return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file); | ||
+ | </pre> | ||
+ | With: | ||
+ | <pre> | ||
+ | return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. drupal_get_path('theme', $theme) . dirname($filename) .'/', drupal_get_path('theme', $theme) . $file); //WOLFTECH CHANGES MADE | ||
+ | </pre> | ||
+ | ===STEP 4=== | ||
+ | Fix the theme screenshot display. In /modules/color/color.module, replace (line 54): | ||
+ | <pre> | ||
+ | if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') { | ||
+ | </pre> | ||
+ | With: | ||
+ | <pre> | ||
+ | //if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') { | ||
+ | if(preg_match("#system_theme.+form$#", $form_id)) { //WOLFTECH CHANGES MADE | ||
+ | </pre> | ||
+ | ===STEP 5=== | ||
+ | Comment out all lines in the .htaccess file located in the [drupal_install_root]/sites/default/files/ directory | ||
==Drupal 5.6== | ==Drupal 5.6== | ||
Line 39: | Line 75: | ||
===STEP 3=== | ===STEP 3=== | ||
Comment out all lines in the .htaccess file located in the [drupal_install_root]/files/ directory | Comment out all lines in the .htaccess file located in the [drupal_install_root]/files/ directory | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 14:41, 11 December 2008
This module allows for the altering of the color theme of the site. The module was altered as follows:
Drupal 6.1
STEP 1
In /includes/file.inc, replace (line 756):
$file = tempnam(realpath($temp), 'file');
With:
$file = tempnam($temp, 'file'); //tempnam(realpath($temp), 'file'); //WOLFTECH CHANGES MADE HERE
STEP 2
In /includes/common.inc, comment out all calls to the chdir() function;
STEP 3
In /includes/common.inc, replace (line 1880):
return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file);
With:
return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. drupal_get_path('theme', $theme) . dirname($filename) .'/', drupal_get_path('theme', $theme) . $file); //WOLFTECH CHANGES MADE
STEP 4
Fix the theme screenshot display. In /modules/color/color.module, replace (line 54):
if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') {
With:
//if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') { if(preg_match("#system_theme.+form$#", $form_id)) { //WOLFTECH CHANGES MADE
STEP 5
Comment out all lines in the .htaccess file located in the [drupal_install_root]/sites/default/files/ directory
Drupal 5.6
All changes made are in /modules/color/color.module.
STEP 1
Replace (line 296-300):
// Look for @import commands and insert the referenced stylesheets. $cwd = getcwd(); chdir(drupal_get_path('theme', $theme)); $style = preg_replace_callback('/@import\s*["\']([^"\']+)["\'];/', '_color_import_stylesheet', $style); chdir($cwd);
With:
// Look for @import commands and insert the referenced stylesheets. $cwd = getcwd(); //chdir(drupal_get_path('theme', $theme)); //WOLFTECH CHANGES MADE $style = preg_replace_callback('/@import\s*["\']([^"\']+)["\'];/', '_color_import_stylesheet', $style); //chdir($cwd); //WOLFTECH CHANGES MADE
STEP 2
Replace (line 361-363):
function _color_import_stylesheet($matches) { return preg_replace('/url\(([\'"]?)(?![a-z]+:)/i', 'url(\1'. dirname($matches[1]) .'/', file_get_contents($matches[1])); }
With:
function _color_import_stylesheet($matches) { return preg_replace('/url\(([\'"]?)(?![a-z]+:)/i', 'url(\1'. drupal_get_path('theme', $theme) . dirname($matches[1]) .'/', drupal_get_path('theme', $theme) . file_get_contents($matches[1])); //WOLFTECH CHANGES MADE }
STEP 3
Comment out all lines in the .htaccess file located in the [drupal_install_root]/files/ directory