Advertisement
divinosilva

FotosTickets.php

Oct 26th, 2018
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.79 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Mostrar Foto Do Administrador
  4.  *
  5.  *
  6.  * @author     SENTQ <development@sentq.com>
  7.  * @copyright  Copyright (c) SENTQ 2018
  8.  * @link       http://www.sentq.com/
  9.  *
  10.  * @desc    Adicione no arquivo /templates/{active-template}/viewticket.tpl, procure o seguinte codigo:
  11.  *          <i class="fa fa-user"></i>
  12.  *          Subistitua Por:
  13.  *          {if $reply.avatar}
  14.             <img src="{$reply.avatar}" alt="{$reply.name}">
  15.             {else}
  16.             <i class="fa fa-user"></i>
  17.             {/if}
  18.  */
  19.  
  20. if (!defined("WHMCS")){
  21.     die("This file cannot be accessed directly");
  22. }
  23.  
  24. function supportStaffPhotos(){
  25.    
  26.     # Nome Do Administrador => Link da Imagem Que Será Apresentada Para o Cliente
  27.    return [
  28.         "Richardson Douglas" => "https://www.sphospedagens.com.br/img/richardson.jpg",
  29.         "Victor Contrucci" => "https://www.sphospedagens.com.br/img/victor.jpg",
  30.     ];
  31.    
  32. }
  33.  
  34. add_hook("ClientAreaPageViewTicket", 1, function($vars){
  35.    
  36.     $avatars = supportStaffPhotos();
  37.    
  38.     foreach ($vars['descreplies'] as $index => $reply){
  39.        
  40.         $vars['descreplies'][ $index ]['avatar'] = false;
  41.        
  42.         if ($reply['admin'] === true && isset($avatars[ $reply['name'] ]) && strlen(trim($avatars[ $reply['name'] ])) > 0){
  43.             $vars['descreplies'][ $index ]['avatar'] = trim($avatars[ $reply['name'] ]);
  44.         }
  45.        
  46.     }
  47.    
  48.     return ["descreplies" => $vars['descreplies']];
  49.    
  50. });
  51.  
  52. add_hook("ClientAreaHeadOutput", 1, function($vars){
  53.    
  54.     if ($vars['filename'] !== "viewticket"){
  55.         return;
  56.     }
  57.    
  58.     return <<<EOF
  59. <style type="text/css">
  60. .ticket-reply .user img {
  61.     width: 35px;
  62.     height: 35px;
  63.     float: left;
  64.     margin: 0 10px;
  65.     border-radius: 5px;
  66. }
  67. </style>
  68. EOF;
  69. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement