On these pages are my WordPress plugins, the odd article and my Support Forum.

For my random rantings on everything else please visit my blog at Yellow Swordfish

WP Plugins


Articles

If you find any of my plugins useful, please comsider a donation towards my running costs.

Thank you

In preparation for the release of Simple:Press Version 4.0, the Support Forum has moved to a new site dedicated to the plugin. This will also be the future home for Simple:Press Forum.


Version 3.1.4 will still be available for download here in the short term.


For the support forum - and to visit our new site and to get details of version 4.0, click on the logo to take you to simplepressforum.com

This forum is currently locked - access is read only
Current User: Guest
Please consider registering

 
Search Forums:


 




Problems with avatars outside the forum

UserPost

4:27 pm
31 May 2008


infected

Member

Germany

posts 30

1

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

5:01 pm
31 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

2

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

3

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

4

or just use andy's new file  Tongue out

5:11 pm
31 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

5

Whoops!

6:21 pm
31 May 2008


infected

Member

Germany

posts 30

6

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

7

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


6:46 pm
31 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

8

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

9

oh, I use the other one with id… sorry…

6:57 pm
31 May 2008


infected

Member

Germany

posts 30

10

Thanks a lot! That´s it! Works fine.

11:02 am
17 Jun 2008


Sparkiller

Member

posts 13

11

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

12

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

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

14

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

15

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?

3:24 pm
17 Jun 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

16

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

17

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

18

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…

6:04 am
18 Jun 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

19

Works OK for me also….

11:45 am
18 Jun 2008


Sparkiller

Member

posts 13

20

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

21

I can confirm this issue for the forum, too. Users gravatars are not shown if there´s a default guest avatar. Frown 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 Smile 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. :-D 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

22

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

23

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

24

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

25

still playing, but I cannot get this kind of behavior to occur…



Reply to Topic: Problems with avatars outside the forum

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 6 + 12        (Required)

Topic Reply:


 
 

About the Stuff at Yellow Swordfish forum

Currently Online:

14 Guests

Maximum Online: 71

Forums:

Groups: 3

Forums: 16

Topics: 2068

Posts: 14091

Members:

There are 1003 members

There are 837 guests


Yellow Swordfish has made 5252 posts

Top Posters:

Mr Papa - 1602

-Radio- - 558

ovizii - 114

jfv - 82

angelic007 - 72

Administrator: Yellow Swordfish | Moderators: Yellow Swordfish, Mr Papa, -Radio-


© Simple:Press Forum - Version 3.1.4 (Build 357)