| User | Post |
|
4:27 pm 31 May 2008
| infected
Member
| | Germany | |
|
| posts 30 |
|
|
Hi!
I just wanted to add the avatars from the forum to my blogs comments. For this i used the template tag “sf_show_avatar()”. Now i got a problem…
If i logged in as admin all avatars in the commentlist become to admins default avatar.
If i logged out and visit the post as “guest” all avatars become to guests default avatar.
The good thing: If i am not logged in there´s an error message above every avatar. Maybe someone have an idea what this means: Warning: Invalid argument supplied for foreach() in /www/htdocs/w0057646/test2/wp-content/plugins/simple-forum/sf-permissions.php on line 25
Link to site
|
|
|
|
|
There are a few problems with both those avatar functions. I will send you an updated sf-tags file with a new function - sf_show_forum_avatar() - which needs the amail address as an argument. The email address is available in the comments for both registered users and guests. Emailing you…
|
|
|
5:02 pm 31 May 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
Thats the wrong tag to use for what you are trying to do… that tag is meant to show the avatar for a current user in the forum… it wont show others avatars…
you should try using
<?php sf_show_members_avatar($user_id); ?>
you must pass in the user id… use comment author id…
this function is getting an upgrade and new one in next version
|
|
|
5:03 pm 31 May 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
or just use andy's new file 
|
|
|
|
|
|
6:21 pm 31 May 2008
| infected
Member
| | Germany | |
|
| posts 30 |
|
|
Hm… I can´t get it working with sf_show_forum_avatar(). Sorry but I don´t understand which parameters i should put into the brackets. Everything i tried always brings the same avatar for all comments… Could you please give me more informations?
|
|
|
6:33 pm 31 May 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
where did you put the template tag call? should be in your comments.php in the comment loop…
for the parameter, pass it $comment->user_id
|
|
|
|
|
Nooooo… it needs commenters email as in:
<?php sf_show_forum_avatar($comment->comment_author_email); ?>
|
|
|
6:49 pm 31 May 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
oh, I use the other one with id… sorry…
|
|
|
6:57 pm 31 May 2008
| infected
Member
| | Germany | |
|
| posts 30 |
|
|
Thanks a lot! That´s it! Works fine.
|
|
|
11:02 am 17 Jun 2008
| Sparkiller
Member
| | | |
|
| posts 13 |
|
|
I setup the Forum-Avatars to make Gravatar the standard, even if there is both. And it works fine so far.
But while using sf_show_forum_avatar for the comments, it displays the userdefault.png even if they have a Gravatar. Is there a way to give the Gravatar priority, like in the forum? Or did i miss something?
Thanks in advance!
|
|
|
1:50 pm 17 Jun 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
it should display the gravatar if they have one… are you sure you are passing it the proper email address for a user? the template tag calls the same avatar display routine as the forum display… just had a quick look at the code and should be working… that said, I havent personally tested it… will try to do that tonight… anyone else notice this issue?
|
|
|
2:15 pm 17 Jun 2008
| Sparkiller
Member
| | | |
|
| posts 13 |
|
|
I replaced “get_avatar( $comment, 75 )” with “sf_show_forum_avatar($comment->comment_author_email)” in the Comments template.
As an example, the user “Hiramas” in the first comment normally has a Gravatar displayed while using get_avatar, but while using sf_show_forum_avatar the default-picture is shown:
http://www.zukunftia.de/artikel/936/werbung-fur-millionen-fox-experimentiert-mit-gesundem-menschenverstand/#comments
But the problem with the unwanted userdefault.png appears only if the user has no own forum avatar. My test-user “spark_test” (last comment) has both and everything works fine. Meaning the Gravatar is displayed.
|
|
|
2:24 pm 17 Jun 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
like I said, will try testing tonight… about to head off to work… but a couple more questions… you are sure that when Hiramas left the comment (might check the DB), he was logged in? and you have gravatars enabled in the forum options? assume so, but just checking…
|
|
|
2:36 pm 17 Jun 2008
| Sparkiller
Member
| | | |
|
| posts 13 |
|
|
Looks like he wasn't logged in, since while he has an account, his user_id in the database for this entry is “0″. (Gravatars are enabled, btw.)
But shouldn't the display-function prefer an existing Gravatar instead of the default-image anyway? Even if the user is not registered?
|
|
|
|
|
What about bis email address? If he commented without loggin in he must have entered an email address. Is that EXACTLY the same as his registered email address?
|
|
|
3:35 pm 17 Jun 2008
| Sparkiller
Member
| | | |
|
| posts 13 |
|
|
I checked. In his comment he used the exact same email-adress as in his account.
|
|
|
2:34 am 18 Jun 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
I dont seem to be able to duplicate this issue at all…
need to check one more time on this… you save gravatars are enabled… you do mean in the forum, correct? on the forum, manage options page, global tab, avatars section, you have the Use Gravatars by Default box checked?
Only way I can duplicate this behavior thus far is to not check that box… but it must be checked for forum gravatars to work correctly…
|
|
|
|
|
|
11:45 am 18 Jun 2008
| Sparkiller
Member
| | | |
|
| posts 13 |
|
|
The box is checked.
Just to clarify: The problem only occurs when there is a guest-comment in Wordpress. It then displays the forum-default-user-image (userdefault.png) even if there is a Gravatar for the used e-mail-adress.
No problems with users which are logged in, it seems.
|
|
|
12:17 pm 18 Jun 2008
| infected
Member
| | Germany | |
|
| posts 30 |
|
|
I can confirm this issue for the forum, too. Users gravatars are not shown if there´s a default guest avatar. I registered a new email address at gravatar.com with a new picture. After i wrote a new post as guest (with exact the same email address used for gravatar.com) the default guest avatar is shown instead of gravatar.
EDIT: Now i tested it on different computers. First I added a post as guest with an email, that i using for a long time with gravatars.com. The gravatar is shown. After that i used an email that i registered today at gravatars.com and added a post as guest too. This gravatar is not shown instead the default users avatar is displayed. Very strange…
EDIT2: HAHAHA that´s soooo funny I got it. I actually should be ashamed… Sparkiller, did you confirmed your gravatar at gravatar.com? Please check this or tell your users to do so. Login to your gravatar account. If your gravatar only is displayed once under the sentence “Choose a an image (below) to use for the selected email (above) or add a new one” please click on the image. Then a popup will be displayed where you have to confirm the gravatar. After confirmation the image should be displayed twice and work within your comments and forums. Mine now works fine, too
|
|
|
2:43 pm 18 Jun 2008
| Sparkiller
Member
| | | |
|
| posts 13 |
|
|
Well, if i use the official get_avatar-function the users Gravatar is displayed as it should, so i guess he has confirmed it.
|
|
|
3:02 pm 18 Jun 2008
| Michael aka infected
Guest
| | | |
|
| |
|
|
Hm…I had to write another post with the guests email address. After that, the default guest avatar was replaced by the gravatar. Try this.
I tested it at the above mentioned website. Works well. I posted as guest and i can see my gravatar. So it works…
|
|
|
8:35 pm 18 Jun 2008
| Sparkiller
Member
| | | |
|
| posts 13 |
|
|
Beats me.
I now replaced sf_show_forum_avatar with get_avatar again, and… *poof*… Hiramas has his Gravatar instead of userdefault.png.
|
|
|
1:38 am 19 Jun 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1602 |
|
|
still playing, but I cannot get this kind of behavior to occur…
|
|