Support Forum
Since simple press v5.0 the function sf_show_forum_avatar(); doesnt work anymore.
I used this function in my theme function.php to diplay the avatar next to the comment text in the wordpress front end.
e.g.: sf_show_forum_avatar($comment->comment_author_email);
Is there a new function to fix?
sp_UserAvatar(); is what you want...
see wp-content/simple-press/forum/content/sp-common-view-functions.php for all the details and arguments you can pass to the function.
but basically, you want:
sp_UserAvatar($args, $comment);
at a minimum, you will want to pass context=user in the args... ie
sp_UserAvatar('context=user', $comment);
of course, you can add more args if you want to change more from defaults...
Visit Cruise Talk Central and Mr Papa's World
Mh, I use the following code atm:
<?php sp_UserAvatar('context=user&size=40&imgClass=spAvatar', $comment); ?>
But, not the user/member specific avatar is shown in the comments-list:
http://www.miranda-fusion.de/s.....press2.jpg
Any ideas?
a bit confused... are you talking about two separate things?
showing an avatar someplace and then having avatars in comments replaced? cause that is two different things...
if all you want to do is show sp avatars in place of wp avatars, then just do like andy said in post 4... you dont need a template tag... you 'might' be creating circular reference of sorts... but not sure exactly what you are doing...
Visit Cruise Talk Central and Mr Papa's World
Well, I tried to explain into more detail:
I would like to have an avatar in front of each comment in the comments-list of wordpress (not the forum). An individually avatar should be shown, if a comment was written by a still exisiting user (means: registered in my blog and the simple press forum). If a guest (not registered) write a comment to a thread of my blog, a default avatar should be shown next to his name in the comments-list.
Therefore I used this funtion:
sp_UserAvatar('context=user&size=40&imgClass=spAvatar', $comment);
Edit: Now I found my mistake. I extended the function like the following:
sp_UserAvatar('context=user&size=40&imgClass=spAvatar', $comment->comment_author_email);
The result looks like this, like it should:
http://www.miranda-fusion.de/s.....press3.jpg
This function works now for comments in articles, BUT not in the comments-list of pages. It gives me an error:
Fatal error: Call to undefined function sp_UserAvatar() in the function.php.
But works for articles. Maybe you have an explanation for that. Why is this function not working on static pages?
1 Guest(s)