| User | Post |
|
|
|
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
| | | |
|
| |
|
|
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
| | | |
|
| |
|
|
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 =
|
|
|
|
|
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
| | | |
|
| |
|
|
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.
|
|
|
|
|
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
| | | |
|
| |
|
|
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.
|
|
|
|
|
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
| | | |
|
| |
|
|
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 |
|
|
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 |
|
|
for comments, you can use $comment->user_id; inside our comments.php file
|
|
|
3:15 pm 26 May 2008
| Tirwin
Guest
| | | |
|
| |
|
|
but how do I apply that to the avatar?
|
|
|
3:17 pm 26 May 2008
| Mr Papa
Moderator
| | Arizona, USA | |
|
| posts 1277 |
|
|
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
| | | |
|
| |
|
|
<?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.
|
|
|
|
|
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
| | | |
|
| |
|
|
<?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 |
|
|
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…
|
|
|
|
|
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
| | | |
|
| |
|
|
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 |
|
|
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
| | | |
|
| |
|
|
<?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 |
|
|
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…
|
|
|
|
|
I have just sent you a replacement tags file to try with instructions.
|
|
|
9:02 am 27 May 2008
| Tirwin
Guest
| | | |
|
| |
|
|
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.
|
|
|
|
|
Glad to hear it's working for you. It's already in the source code for the next update.
|
|