I'd like to use glx_gravatar with txphorum

1 view
Skip to first unread message

rsskga

unread,
Jan 29, 2008, 5:47:56 PM1/29/08
to textpattern-plugins
I'm using glx_gravatar with my comments. I was hoping to also use it
with authors in txphorum (a Ben Bruce TXP plugin). I couldn't get it
to work by using the standard glx_gravatar tag even if I used an email
address for every field author field (name, user name and email
address). It seems like it should be quite possible, but I don't
really understand how glx_gravatar is working behind the scenes. Any
thoughts?

Patrick Kollitsch

unread,
Jan 29, 2008, 10:36:15 PM1/29/08
to textpatte...@googlegroups.com
hi rsskga,

i don't know which version you use. it could be, that you use an older
version that did some caching of the results which is more than buggy.

please load the actual version from here:
http://textpattern-plugins.googlecode.com/svn/trunk/current/glx_gravatar.txt

if it still does not work i need more information about txphorum.

greetings
patrick

--
Patrick Kollitsch
Thailand, Samui, Ban Thai

"*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.http://samui-samui.de
(¸.·``··*

rsskga

unread,
Jan 30, 2008, 1:13:57 PM1/30/08
to textpattern-plugins
hi patrick,

thank you for your quick response!

i am using version 2007.1

i think that glx_gravatar works by using the <txp:comment_email />
tag. txphorum does not use this. instead, it employs the
mem_self_register plugin. (by the way - going to manfre's site i just
found out about xpattern... interesting...) anyway, it's here:
http://manfre.net/project/627/mem-self-register. i think the
<txp:mem_profile var="email" /> tag is what would need to mesh with
glx_gravatar to recognize the user's email address and then output the
gravatar.

it seems like it might be fairly straightforward - getting the email
in the right place to be recognized.

i appreciate your input.

best,
raina



On Jan 29, 9:36 pm, "Patrick Kollitsch" <patr...@kollitsch.de> wrote:
> hi rsskga,
>
> i don't know which version you use. it could be, that you use an older
> version that did some caching of the results which is more than buggy.
>
> please load the actual version from here:http://textpattern-plugins.googlecode.com/svn/trunk/current/glx_grava...

rsskga

unread,
Jan 30, 2008, 1:44:03 PM1/30/08
to textpattern-plugins
fyi... i added this in the mem_self_register forum thread.

"I've also been in discussion with Patrick about glx_gravatar. I think
it works with the <txp:comment_email /> tag, but I'd like to get it to
work with users in Txphorum, too. Because Txphorum posts are actually
articles, and not comments, it won't work out of the box. Still, I'm
sure there's a way to call the users email (probably through your
<txp:mem_profile /> tag) and have the gravatar show up. Any thoughts?

I really don't know php, but here's the portion of Patrick's code that
I think is making the call:

$url = 'http://www.gravatar.com/avatar.php?gravatar_id='; $url .=
md5($thiscomment['email']); if (!empty($atts['rating'])){ $url .=
'&amp;rating='.$atts['rating'];

Maybe altering or adding to ($thiscomment['email']); will do the
trick?

Ok. Off to lynda.com. It's high time I try to learn a little bit of
this myself."

Patrick Kollitsch

unread,
Jan 30, 2008, 11:10:53 PM1/30/08
to textpatte...@googlegroups.com
hi raina,

i think its exactly that: what this plugin needs is an attribute where
you define the email address. if its empty $thiscomment['email'] will
be taken.

around line 9 there is something like this:

$url .= md5($thiscomment['email']);

please exchange it with this:

$url .= (!empty($atts['email'])) ? md5(parse($atts['email'])) :
md5($thiscomment['email']);

(no linebreak in this line and its untested)

this will allow you to put a tag into the template like this
<txp:glx_gravatar email="<some tag or some emailaddress/>"/> and
should be able to parse everything another tag produces.

greetings
patrick

gravatar.php

rsskga

unread,
Feb 4, 2008, 1:01:21 PM2/4/08
to textpattern-plugins
Hi Patrick,

Yes, making that change and using it in conjunction with another
plugin that I created by adapting rss_author_email worked. I'd like to
make these items available to the community. I'm not sure if it's best
to do so as new plugins, or if the functions should be fed back into
the original plugins. I will email my files to both you and Rob and go
from there.

Best,
Raina
> gravatar.php
> 1KDownload
Reply all
Reply to author
Forward
0 new messages