In advf-forum-post.tpl.php, the $name variable will only correctly show a username for the first post/node, and not in the proceeding comments. $user_info_pane's $name works in comments though. See example:
http://sourdough.com.au/forum/topic/183

Comments

michelle’s picture

Title: $name variable not working in comments » Variable list for advf-forum-post out of date
Component: Code » Documentation
Status: Active » Fixed

Ah, yeah, the documentation didn't keep up with the move to a separate user theme function. Thanks for pointing that out. I updated the docs at the top.

Michelle

maedi’s picture

Status: Fixed » Active

I've upgraded to alpha6 and I'm still getting no usernames (or last posts on the forum index). Update done by replacing existing module and theme files and running update.php.

michelle’s picture

Status: Active » Fixed

This was a documentation error. The $name variable was a leftover from the previous way of doing things and the comment wasn't removed when it was moved to the advf-forum-user.tpl.php.

Michelle

maedi’s picture

Is it now $user_title? I'm using $name outside of advf-forum-user.tpl.php. Is there still a variable to show a username?

maedi’s picture

Status: Fixed » Active
michelle’s picture

Status: Active » Fixed

$comment holds the whole comment object so you can make use of what's in there. Looking at comment.tpl.php, the normal method is using theme('username', $comment). There isn't anything provided by advforum outside of that function because it doesn't load the user object.

Michelle

maedi’s picture

Status: Fixed » Active

Before Alpha5's theme changes, I used $name to print a username per post which would be on a node or comment.
"theme('username', $comment)" only works across comments, "theme('username', $comment, $node)" ?. I'm not proficient with php but now it looks like I can only use $name inside advf-forum-user.tpl.php. I still need to use a variable similar to $name outside of advf-forum-user.tpl.php. Why is $name now dependent on advf-forum-user.tpl.php?

Michelle, thanks for your consistent level of support.

BTW, once I've ironed out the kinks, I'd like to submit my forum theme to an Advanced Forum theme section. Could we set something like this up? I'd be happy to manage it.

michelle’s picture

Title: Variable list for advf-forum-post out of date » Make user object available outside of advf-forum-user.tpl
Component: Documentation » Code
Category: bug » feature

Hmm... Weird... That shouldn't have worked since I moved all the user stuff into its own function, which was a while ago.

I changed this over to a feature request. I'll need to do some restructuring to make the user object available earlier.

Michelle

maedi’s picture

That would much appreciated. In the mean time "theme('username', $comment)" works well except leaves an 'Anonymous' mark for the node poster instead of their username. How can I fix this?

And would you like me to start a new thread about an AF theme section?

michelle’s picture

In the mean time, you can do:

if ($top_post) {
  print $name;
} else {
  print theme('username', $comment);
}

Sorry I forgot to comment on the theme part. Sure, when you have something ready to contribute, just make an issue for it. I have a "themes" directory in the project that was meant to hold more themes but I haven't gotten any, yet. The only other forum theme I know of is part of the Sky theme and we decided it made more sense for her to maintain it there rather than be added to the module.

Michelle

michelle’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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