Hi,
I am making a new Mod and added a new function in include\class.ticket.php
function getScreenshot($tktid,$subject,$type){
global $cfg;
$helpdesk_url=$cfg->getUrl();
$dir=$cfg->getUploadDir();
$dir = preg_replace("/\\\\/","/",$dir);
$dir = explode('/', $dir);
$arrDir = array_reverse($dir);
$dir = $arrDir;
$sql ='SELECT attach_id,file_size,file_name,file_key FROM '.TICKET_ATTACHMENT_TABLE.
' WHERE deleted=0 AND ticket_id='.db_input($tktid).' AND ref_type='.db_input($type);
$res=db_query($sql);
if($res && db_num_rows($res)){
while(list($id,$name,$key)=db_fetch_row($res)){
$hash=MD5($this->getId()*$refid.session_id());
$ext = strtolower(substr(strrchr($name, '.'), 1));
$fullfilename = $helpdesk_url.$dir.'/'.$key.'_'.$name;
if (in_array($ext,array('jpg', 'png', 'gif', 'bmp'))) {
$attachstr.= '<a href="tickets.php?id='.db_input($tktid).'" class="screenshot" rel="'.$fullfilename.'"><IMG alt="blank" src="../images/icons/file.gif"></IMG></a>';
} else {
$attachstr.= '<span class="Icon file"> </span>';
}
}
}
return ($attachstr);
}
I want to call this function from include\staff\tickets.inc.php
<td><a <?if($flag) { ?> class="Icon <?=$flag?>Ticket" title="<?=ucfirst($flag)?> Ticket" <?}?>
href="tickets.php?id=<?=$row?>"><?=$subject?></a>
<?=$row?"<span class='Icon file'> </span>":''?></td>
<td nowrap><?=Format:($row,30)?></td>
Exactly in this row:<?=$row?"<span class='Icon file'> </span>":''?>
I already tried a lot of things and really not knowing what I am missing :( I want to share this new fancy Mod and I am stuck with this stage...
Anyone ?