Jump to content

Add team gravatar in project management client area


jerect

Recommended Posts

hi!, im new and i want to add a gravatar image to the assigned admin in the client area projejct view

i have this

<img class="gravatar" src="http://www.gravatar.com/avatar.php?gravatar_id={$email|md5}&size=100" alt="Avatar" title="Avatar for {$name}" width="100" height="100" />

it works if i edit the "$email" and add manually a email adress, but i do not how to obtain the email of the admin assigned to the project, so please can you help me?

Link to comment
Share on other sites

hi, thank you so much, the variable is not available so i have found in the the documentation and i don't know if i am doing right.

 

the hook contain this:

<?php

 

use Illuminate\Database\Capsule\Manager as Capsule;

 

# get admin data

add_hook('ClientAreaPage', 1, function(){

 

$getAdmin = Capsule::table('tbladmins')->where('id', '=', $project.adminid)->get();

 

});

 

and the tpl includes this:

<img class="gravatar" src="http://www.gravatar.com/avatar.php?gravatar_id={$getAdmin->email|md5}&size=100" alt="Avatar" title="Avatar for {$name}" width="100" height="100" />

 

but is not working. am i right?

Link to comment
Share on other sites

add {debug} command in that file you are editing, then open/reload it again in browser, separate browser with list of all available variables can be found there, if admin email isn't in this list you may use ActionHook:ClientAreaPage to query "tbladmins" DB table and get the information you need, then return it to Smarty

 

I have tried almost all the forms I have found in this forum, but none has worked, can you help me please?

Link to comment
Share on other sites

OMG I MADE IT!

 

this is the php:

<?php

 

use Illuminate\Database\Capsule\Manager as Capsule;

add_hook('ClientAreaPage', 1, function($vars){

global $smarty;

$product = $smarty->get_template_vars('project');

$getemail = Capsule::table('tbladmins')->where('id', '=',$product['adminid'])->select('email')->get();

 

return array("adminemail" => $getemail[0]->email);

 

});

 

and the tpl

<img class="gravatar" src="http://www.gravatar.com/avatar.php?gravatar_id={"{$adminemail}"|md5}&size=150" alt="Avatar" title="Avatar for {$name}" width="150" height="150" />
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated