any plans on that? Would like to see one for my community site

Comments

sergeant-1’s picture

Category: feature » support
parrottvision’s picture

yeah - would be dead keen to have this module go into 6 - any one still support it?

BakerQ’s picture

Also interested in a D6 version.

tonnyl’s picture

Anything new about this or is there another module that we can use for 6.2?

Fayna’s picture

I don't think there is another module like this one.

psicomante’s picture

StatusFileSize
new13.72 KB

First 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.

luisfeng’s picture

What about your version of user_titles? Works fine or not?

psicomante’s picture

NOTE: this module DOES NOT WORK.

agileware’s picture

Status: Active » Needs work

Just to let you know that we will be porting this module to D6. We'll happily accept any patches to help the process along :)

Steven Merrill’s picture

Status: Needs work » Needs review
StatusFileSize
new31.96 KB

Hey - 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.

quicksketch’s picture

Could you also provide a patch version? It's difficult to tell what changes were necessary.

agileware’s picture

StatusFileSize
new12.89 KB

Patch file for user_titles-6.x-1.x-dev against user_titles-5.x-1.x-dev attached.

agileware’s picture

Title: version 6? » Drupal 6 Version of User Titles module
Steven Merrill’s picture

There'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.

agileware’s picture

Agreed, 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.

batbug2’s picture

subscribing

Lucretia9’s picture

I'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):

function user_titles_preprocess(&$variables) {
  if (module_exists('user_titles')) {
    $variables['user_title'] = user_titles_get_user_title($variables['node']->uid);
  }
}

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.

Shyin’s picture

Would love to see this also.

Shyin

batbug2’s picture

I 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.

Lucretia9’s picture

Is this included in CVS or something?

Steven Merrill’s picture

StatusFileSize
new13.94 KB

Here's a newer version of the patch with some improved validation. (This patch is again against CVS HEAD.)

Lucretia9’s picture

Ok, 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.

michelle’s picture

Displayed 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

Lucretia9’s picture

Ok, 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.

michelle’s picture

Well, 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

Lucretia9’s picture

Ok, 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.

michelle’s picture

Well, 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

Lucretia9’s picture

1) 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.

michelle’s picture

Status: Needs review » Needs work

The 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

Steven Merrill’s picture

Assigned: Unassigned » Steven Merrill

Yep - 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.

michelle’s picture

@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

Steven Merrill’s picture

Status: Needs work » Needs review
StatusFileSize
new16.53 KB

Okay. 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!

agileware’s picture

Great work Steven (without having tested it yet)

logicbug’s picture

Can we get a fully patched module uploaded, my attempts at applying the patches arn't working out very well...

agileware’s picture

Status: Needs review » Fixed

Thanks 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.

logicbug’s picture

Thanks, 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; ?>

agileware’s picture

There 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.