From: Stan L. <sc...@in...> - 2003-10-03 04:28:46
|
I posted a bug yesterday regarding the current plugin system. If in config.php I change the default css style sheet into the following pattern: ../themes/css/sans-10.css or just sans-10.css I receive an error on any of the plugins page (a 404 error) and the style sheet is not included. The reason is because it needs to look for it one directory behind the one it starts in. The issue is on page_header.php in the "functions" directory starting on line 31. The current code reads: if ( !isset( $custom_css ) || $custom_css == 'none' ) { echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme_css\" />"; } I'd like to suggest that the following code be used instead: if ( !isset( $custom_css ) || $custom_css == 'none' ) { $file = pathinfo($theme_css); if ($theme_css != '') { $a = dirname($theme_css); if (!realpath($a)) { $path = "../" . $a; } else { $path = $a; } $css = $path . "/" . $file['basename']; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$css\" />"; } Reason, this first grabs the directory from where the css file is located, and then check to see if the file exists (realpath()) and chooses how many dirs to go back. Right now this seems to work, there may be other instances and I'd be more then happy to mod this code, but for now this covers the issues I was facing. Let me know what you all think. Thanks. - Stan Lemon |