Closed (fixed)
Project:
User titles
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
8 Apr 2008 at 12:10 UTC
Updated:
22 Dec 2008 at 23:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
sergeant-1 commentedComment #2
parrottvision commentedyeah - would be dead keen to have this module go into 6 - any one still support it?
Comment #3
BakerQ commentedAlso interested in a D6 version.
Comment #4
tonnyl commentedAnything new about this or is there another module that we can use for 6.2?
Comment #5
Fayna commentedI don't think there is another module like this one.
Comment #6
psicomante commentedFirst Step.
updated .info
updated .install
updated .module (for now only hook_help, hook_perm, hook_menu)
NOTE: this module DOES NOT WORK. Please DO NOT USE it if you're not a developer.
INFO: release for 6.x uses User_stats module, because it creates a profile value that counts posts. If you use this on a forum, with advanced forum, i think it will be useful and do not duplicate a value/table.
Comment #7
luisfeng commentedWhat about your version of user_titles? Works fine or not?
Comment #8
psicomante commentedNOTE: this module DOES NOT WORK.
Comment #9
agileware commentedJust to let you know that we will be porting this module to D6. We'll happily accept any patches to help the process along :)
Comment #10
Steven Merrill commentedHey - here's a complete module directory .zip, upgraded for Drupal 6 with schema support and recalculating of titles when the types change, rather than truncation, as in Drupal 5.
Comment #11
quicksketchCould you also provide a patch version? It's difficult to tell what changes were necessary.
Comment #12
agileware commentedPatch file for user_titles-6.x-1.x-dev against user_titles-5.x-1.x-dev attached.
Comment #13
agileware commentedComment #14
Steven Merrill commentedThere's still two more bits to fix - db_last_insert_id() in 6 is NOT a proper analog to 5's db_next_id(), and I can remove a bit of code from the rebuild function. We can probably also add in that recalculate functionality to the 5 version. I'll issue a patch once I truly slay db_last_insert_id(), or what used to be db_next_id() in the 5 version.
Comment #15
agileware commentedAgreed, I tested this last night and there are quite a few things still to iron out. I am working on an updated patch but its not likely to be finished till mid-next week due to other commitments.
Comment #16
batbug2 commentedsubscribing
Comment #17
Lucretia9 commentedI've tried to get this to work, but it fails. I tried adding the _phptemplate_variables from the README.txt, but then found out it was deprecated in 6. So, I tried adding the following file user-titles-preprocess.tpl.php to my current theme (the root of themes/pixture):
I also tried naming the file user_titles-preprocess.tpl.php but this still didn't work. I'm not sure if it should be a hyphen or underscore, eithe way, this didn't display anything in the advanced_forum.
I also set up a block to be displayed in the profile using the code from the README.txt, this doesn't display either.
Luke.
Comment #18
Shyin commentedWould love to see this also.
Shyin
Comment #19
batbug2 commentedI made User Titles work in D6 by modifying one of its functions. Now UT depends on UserStats module. My mod was to grab number of posts from UserStats and to not count them by itself. And after that User Titles are working again and stuff like "user_titles_get_user_title($variables['node']->uid);" work again, too.
Comment #20
Lucretia9 commentedIs this included in CVS or something?
Comment #21
Steven Merrill commentedHere's a newer version of the patch with some improved validation. (This patch is again against CVS HEAD.)
Comment #22
Lucretia9 commentedOk, the patch does apply to HEAD ok, but why has no-one updated the instructions for D6? Doesn't the variable preprocess have to go into a separate file now?
Why the hell can't this be some sort of element that gets displayed automatically like all the other modules?
Luke.
Comment #23
michelleDisplayed automatically where?
Looking at the patch, it appears to still be using _phptemplate_variables, which is wrong for D6. The variable should be added using preprocess_node. Then there's nothing for the end user to add to template.php. But, it would still be up to the end user to decide where in the node template to place the variable.
Michelle
Comment #24
Lucretia9 commentedOk, I seriously must be missing something here. I'm a complete newbie to Drupal, I've not gone into the code (yet) and at this point, I don't feel comfortable doing that either. I've opened up user_titles.module and added this to the end:
function user_titles_preprocess_node(&$vars) {
$vars['user_title'] = user_titles_get_user_title($vars['node']->uid);
}
There wasn't a function called preprocess_node or user_titles_preprocess_node (I've tried them both). Nothing appears in the advanced_forum. Unless this needs to go somewhere else? Where does this function need to go? What does this function need to be called?
And when I say displayed by default, I mean for example in the profile, the profile displays the user's points why not the user's title as well? I didn't have to set that up, it's done for me.
Luke.
Comment #25
michelleWell, sure, the module could dump it on the user page like so many others do. It's not terribly useful there, though. Most people want it on the nodes and for that you need to add it to the node template.
That function you have there should get you a $user_title variable in your node template. Then you just need to print it.
Michelle
Comment #26
Lucretia9 commentedOk, so that's the correct name for the function and the correct place to put it? Yes?
Why then does it not get printed in the advanced_forum? The code is there to print it out, but I see nothing.
Luke.
Comment #27
michelleWell, it's hard to guess where you may be going wrong... Just to confirm:
1) You've confirmed that user_titles_get_user_title($vars['node']->uid); actually returns the proper title?
2) Somewhere in advf-forum-post.tpl.php you added the line
<?php print $user_title; ?>?Michelle
Comment #28
Lucretia9 commented1) Have no idea.
2) Inside advf-author-pane.tpl.php there is:
if (!empty($user_title)):print $user_title;endif;This is not being added into the final result. I've enabled the module in the settings.
Thanks,
Luke.
Comment #29
michelleThe author pane is a completely different issue. That has nothing with changing the patch to use the node preprocess, which is what we were talking about here. I thought you were testing the change by adding the variable print to the forum node template. If that's not what you're doing, let's not derail this issue.
Setting this back to code needs work because it needs to be rerolled to use the node preprocess.
Michelle
Comment #30
Steven Merrill commentedYep - sorry about that. I ported this for a project that we're currently working on, so I was only concerned at the time with getting it working for our sites in specific.
As for getting this value somewhere more accessible to end users, since you have to choose what nodes to count, do you think it would make sense to include the user's title in a node preprocess only for the chosen node types, or for all of them?
I suppose that could be dealt with in a preference screen. Then from there we could look at an option to display this information in the user profile page or the advforum's author pane.
Comment #31
michelle@Steven - I don't think it's a good idea to just tack it onto the node via this module. The best thing, IMO, is to make the variable available to the node template via the node preprocess. Then it's just a matter of printing the variable. For Advanced Forum, see the other issue I linked to. Once that code is in place, AF users won't need to do anything special for user titles to work.
Michelle
Comment #32
Steven Merrill commentedOkay. Here's a new patch. Improved in this one:
1) Better recalculation of user titles.
2) Updated README.txt which is useful to humans, not referencing _phptemplate_variables().
3) Implementation of a node and comment preprocess to provide the $user_title var.
4) Bugfix for comments such that only comments on the nodes of the selected types will be counted. (Should probably get backported.)
Please test and enjoy so we can get a release out there!
Comment #33
agileware commentedGreat work Steven (without having tested it yet)
Comment #34
logicbug commentedCan we get a fully patched module uploaded, my attempts at applying the patches arn't working out very well...
Comment #35
agileware commentedThanks for the patch Steven.
I have created a 6.x-1.x-dev version from the patch plus a couple of other minor changes regarding the D5 - D6 change. So the 6 dev version should be up in the next 12 hours sometime.
Also, HEAD is now the D6 version.
Comment #36
logicbug commentedThanks, its almost working great. but I think it's a coding error on my end. When I try to print the $user_title it only prints if I have overridden the default title...
i.e.
<?php print $account->user_title; ?>Comment #37
agileware commentedThere was a bit of a mix up in CVS with branching so the 5.x-1.x-dev version is currently actually the D6 version.
All the branches have now been sorted out though so when the update script next runs the dev versions will all be correct.