Plugin

Developer
Supported

CE Gravatar

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

You must be logged in to post.

does not work with {email} global variable

General (Resolved)

pvledoux
pvledoux

Hi Aaron,

I’m trying the following code but I can’t make it works;

<img src="{exp:ce_gravatar:single size='15' email='{email}' default='mm'}" alt="{screen_name}" /> 

I’m in a very simple template. If I hard code my email address, it’s ok. When I output {email}, it outputs the current login user e-mail address correctly.

Regards,

Pv

Causing Effect - Aaron Waldon
# 1
Developer
Causing Effect - Aaron Waldon

Hi pvledoux!

Long time no talk. I hope you are doing well man.

So, I don’t think that is working because EE doesn’t parse the email variable until much after the tags. Take a look at Low’s handy parse order cheat sheet: http://loweblog.com/downloads/ee-parse-order.pdf . As you can see, the plugin is run at stage 5 and the user variables are run at stage 9.

I will add in the ability to parse that in the plugin as soon as I can get to it. Probably within the next week or so (I am super busy at the moment). If you want to take a stab at pulling in the member data and doing a simple string replace on that code in the meantime, please feel free to. I know you have some PHP skills that you have showed me in the past. ;)

I hope the parse order issue makes sense. The plugin works well, for example, in a channel loop of blog comments, but EE parses those member vars very late in the game!

pvledoux
# 2
pvledoux

Hi Aaron,

I’m fine, thanks! A lot of work too, actually.
I have to admit that I was lazy on that one ;) I didn’t even think about parsing order.

I inserted the following:

if ($email == '{email}'{
    $email 
$this->EE->session->userdata['email'];

on line 96, that does the job.

Thanks!

Pv

Causing Effect - Aaron Waldon
# 3
Developer
Causing Effect - Aaron Waldon

Awesome. I knew you would make short work of that one. ;)

Are you cool if I roll this into the code pvledoux?

pvledoux
# 4
pvledoux

Of course, no problem!

Pv

Causing Effect - Aaron Waldon
# 5
Developer
Causing Effect - Aaron Waldon

Thanks again for your fix Pv! I moved CE Gravatar to github today and added it in the dev branch.

Causing Effect - Aaron Waldon
# 6
Developer
Causing Effect - Aaron Waldon

This change has been included in the latest release with both EE1 and EE2 versions. ;)