Jump to:
| Project: | Blog Theme |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
You have a great module here but combined with another great module by Davy Van Den Bremt, the User Profile Theme module at http://drupal.org/project/user_profile_theme it would be a match made in heaven (at least I hope it works fine, I have not tested this extensively)
First, edit the current release (5.x-1.x-dev as of writing) to resolve the bug http://drupal.org/node/211212 and you can optionally remove the part where the css file is added on view at around line 155, I say optional because it doesn't seem to add a duplicate css file even with the next few changes.
Now in that part of the file (line 155 of the user profile theme module) you copy this:
// We add the CSS file to the header.
if(user_access('view theme') && user_access('have theme', $user)) {
drupal_add_css(_user_profile_theme_get_filename($user->uid), 'module', 'screen');
}Add just before the break in case comment, case node and case shoutbook of the function blog_theme_menu() in the Blog Theme module:
if (module_exists('user_profile_theme')) {
// We add the CSS file to the header.
if(user_access('view theme') && user_access('have theme', $user)) {
drupal_add_css(_user_profile_theme_get_filename($user->uid), 'module', 'screen');
}
}***** I do not know case image is for which display so I did not add it in, anyone can enlighten me on this as I can't seem to find the page which uses that case *****
Next, remember to add
if (module_exists('user_profile_theme')) {
global $user;
}Set the appropriate permissions for both modules and you should see a css option in the user account edit page.
Comments
#1
mm.. sorry, I think some other part needs to be changed, doesn't quite work as expected yet...
Change
if(user_access('view theme') && user_access('have theme', $user)) {drupal_add_css(_user_profile_theme_get_filename($user->uid), 'module', 'screen');
}
if(user_access('view theme')) {drupal_add_css(_user_profile_theme_get_filename($uid), 'module', 'screen');
}
But to prevent it showing when user does not have theme, I am unsure how user_access('have theme', $user) can be done if we only have the uid of the account to check, as in $user should be replaced by what value?
In the meantime, I have used this:
if(file_exists(_user_profile_theme_get_filename($uid))){drupal_add_css(_user_profile_theme_get_filename($uid), 'module', 'screen');
}
#2
#3
so which situation does case 'image' actually apply?
#4
I am not sure about the case image myself. I think it handles a special path implemented by another module. It was already there when I took over the module.
Can you create a patch following the guidelines here?
http://drupal.org/patch/create
Anyway, I would not implement this feature for D5. New features will go to the head / D6 version of the module. However, the other module does not seem to be actively maintained. There is no commit after the initial commit. There's no official D6 release (see #287361: Port to D6 )