Jump to content

How To Get Email Staff/Admin & Client Viewticket Template


jawanet

Recommended Posts

Can you fix this script? and add to hook

 

$grav_size = '40';

$replies = $this->_tpl_vars['descreplies'];

$data = select_query('tbladmins', 'firstname, lastname, email', array());
$admins = array();
while ($admin = mysql_fetch_assoc($data)) {
   $adminname = $admin['firstname'].' '.$admin['lastname'];
   $d = array_search($adminname, $adminreplies);
   $admins[] = array('name' => $adminname, 'email' => $admin['email']);
}

foreach ($replies as $key => $val) {
   if ($val['admin'] !== false) {
       $d = multidimensional_search($admins, array('name'=>$val['name']));
       if (is_int($d)) {
           $hash = md5(strtolower(trim($admins[$d]['email'])));
           $replies[$key]['gravatar'] = 'https://secure.gravatar.com/avatar/'.$hash.'?'.$grav_size;
       }
   }
}

$this->_tpl_vars['descreplies'] = $replies;

function multidimensional_search($parents, $searched) { 
 if (empty($searched) || empty($parents)) { 
   return false;
 } 

 foreach ($parents as $key => $value) {
   $exists = true;
   foreach ($searched as $skey => $svalue) { 
     $exists = ($exists && IsSet($parents[$key][$skey]) && $parents[$key][$skey] == $svalue);
   } 
   if($exists){ return $key; }
 } 

 return false; 
}

Link to comment
Share on other sites

if it's only 4, then i'd be tempted to do this...

 

<img src="https://www.gravatar.com/avatar/{if $reply.name eq 'John Smith'}jsmith@domain.com{elseif $reply.name eq 'Donald Trump'}donald@trump.com{/if}?s=30&d=mm" class="menu-avatar" alt="">

and add further elseif for each of your other two staff.

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