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

Current User: Guest
Please consider registering

 
Search Forums:


 




Feature request: integration with cmdavatar

UserPost

2:04 pm
26 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
26

For members there is yes (see Template Tags online help). But then you are back to using what the forum uses - uploaded avatars or Gravatars.com and I thought the point here was you wanted to use this other avatar source.

2:10 pm
26 May 2008


Tirwin

Guest

 
27

all i want is the option for the user to log in ( to either the site or to the forum ) and for that to also log them into the other. Then, when they put a post onto either the site or the forum it will show the same avatar. if I can do this withouth CMD-Avatar and by ONLY using Simple Forum then I would prefer that yes.

2:15 pm
26 May 2008


Tirwin

Guest

 
28

I tried using sf_show_members_avatar($userID) but now get an error:

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
SELECT user_email FROM wp_users WHERE ID =

2:19 pm
26 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
29

Well like your code above, you only should call it with a valid user ID.

Admittedly it looks like we may not be trapping that but like your line of code before (the one I suggested you change) you need to check that for the user id and only then pass it into the tag function.

2:22 pm
26 May 2008


Tirwin

Guest

 
30

I hadn't made any changes to the simple: press forum… that was another user I was quoting. I still have the standard simple:press forum code installed ( which I'm playing with and really like) all I wanted was for these avatars to show on my wp site when a user posted a message there instead of on the forum.

2:50 pm
26 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
31

Which is what that template tag will do but your do need to pass it a valid user id.

Something like….

global $current_user;

if($current_user->ID != 0) sf_show_members_avatar($current_user->ID);

Well - it might work…!


2:56 pm
26 May 2008


Tirwin

Guest

 
32

Do you know of anyone who has WP and Simple:Press Forum installed and has the same avatars on both WP and SF? I'll check with them and try and complete a walkthrough.

I understand that it is looking for the ID of the person who wrote the post, I just don't know how to tell it who that person was.

3:03 pm
26 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
33

Can I just say that I am now 100% confused about exactly what you are trying to do. I thought you were talking about commenters but now you seem to be talking about post authors. if they are logged in they all have a user id.

But yes - the code I just rattled off is for the current user who is logged on to show them their own avatar. So this is not what you want? Any User? comments? What?

3:10 pm
26 May 2008


Tirwin

Guest

 
34

I'm sorry, I am obviously not very good at explaining (though I did just do a post in here: http://www.stuff.yellowswordfish.com/support-forum/simple-forum-next-version/feature-request-new-avatar-feature/page-1/post-10072/#p10072 )

Basically. I have a wordpress site which people can sign up to and leave post or comments. I also have Simple:Press Forum installed too which they can comment on.

Now, what i am trying to do is make it so that if a user (any user) posts on my wordpress site, comments on my wordpress site or posts in the forum their Simple:Press Forum avatar will show up.

So I would like the users avatar to display for WP Posts, WP Comments and for Forum Posts/Comments.


3:13 pm
26 May 2008


Mr Papa

Moderator

Arizona, USA

posts 1277

 
35

if you are inside the loop, the wp function call the_author_ID() will return the current id of the author of the post…

3:14 pm
26 May 2008


Mr Papa

Moderator

Arizona, USA

posts 1277

 
36

for comments, you can use $comment->user_id;  inside our comments.php file

3:15 pm
26 May 2008


Tirwin

Guest

 
37

but how do I apply that to the avatar?

3:17 pm
26 May 2008


Mr Papa

Moderator

Arizona, USA

posts 1277

 
38

apply to avatar?????  dont understand…

where you want the avatar to be displayed for posts use

sf_show_members_avatar(the_author_ID());

and for comments use

sf_show_members_avatar($comment->user_id);

you will need to remove any other avatar stuff or you will get more than one…

3:19 pm
26 May 2008


Tirwin

Guest

 
39

<?php sf_show_members_avatar($comment->user_id); ?> this seems to work… I'll try another couple of things to make sure there are no problems then confirm this for you.

3:21 pm
26 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
40

Well we have now come full circle.

You DO need to check that the current person is a USER with an account.

So:

if($comment->user_id)  sf_show_members_avatar($comment->user_id);

3:26 pm
26 May 2008


Tirwin

Guest

 
41

<?php sf_show_members_avatar($comment->user_id); ?>

This works for the comments. Perfect. But how would it be scripted for the posts on the main page?

3:28 pm
26 May 2008


Mr Papa

Moderator

Arizona, USA

posts 1277

 
42

you know, we need to spruce up that tag routine…  it should handle the case for an invalid user id… in fact, if its not a user, to be consistent with the forum, shouldnt it display the default guest avatar?

I will open a trac ticket and we can discuss it there…

3:31 pm
26 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
43

I was just about to open a ticket. I have one or two others as well but the server has been down…

3:36 pm
26 May 2008


Tirwin

Guest

 
44

At the moment (on the comments) if the user has no profile (is a guest) it doesn't display anything. A default 'Guest' avatar would be cool. I also cannot work out what the tag would be to put on the main posts.

3:39 pm
26 May 2008


Mr Papa

Moderator

Arizona, USA

posts 1277

 
45

look back, I posted it…

sf_show_members_avatar(the_author_ID());

It must be inside the loop, but I suspect thats where you are…

3:43 pm
26 May 2008


Tirwin

Guest

 
46

<?php sf_show_members_avatar(the_author_ID()); ?>

Like this? (that's right… Im not a programmer lol)

5:18 pm
26 May 2008


Mr Papa

Moderator

Arizona, USA

posts 1277

 
47

yes…  no need to do the check on this one like Andy showed on the comments, because a post has to have a user id for the poster…

5:20 pm
26 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
48

I have just sent you  a replacement tags file to try with instructions.

9:02 am
27 May 2008


Tirwin

Guest

 
49

Ok, changed the sf-tags.php over and changed the <?php sf_show_forum_avatar($comment->comment_author_email); ?> etc and everything seems to be working perfectly now. I'll keep an eye on it and let you know if I come across any problems at any point but I would recommend rolling this out with the next update as I think you would be the first guys to do it.


9:09 am
27 May 2008


Yellow Swordfish

Admin

Peterborough, England

posts 4667

 
50

Glad to hear it's working for you. It's already in the source code for the next update.



Reply to Topic: Feature request: integration with cmdavatar

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: 5 + 1        (Required)

Topic Reply:


 
 

About the Stuff at Yellow Swordfish forum

Currently Online:

14 Guests

Maximum Online: 71

Forums:

Groups: 3

Forums: 15

Topics: 1791

Posts: 12090

Members:

There are 831 members

There are 756 guests


Yellow Swordfish has made 4667 posts

Top Posters:

Mr Papa - 1277

-Radio- - 482

ovizii - 94

jfv - 80

angelic007 - 66

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


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