Hi,
I am making a new Mod and added a new function in include\class.ticket.php
PHP Code:
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.= '
';
} else {
$attachstr.= ' ';
}
}
}
return ($attachstr);
}
I want to call this function from include\staff\tickets.inc.php
PHP Code:
class="Icon <?=$flag?>Ticket" title="<?=ucfirst($flag)?> Ticket" <?}?>
href="tickets.php?id=<?=$row?>"><?=$subject?>
<?=$row?" ":''?>
<?=Format:($row,30)?>
Exactly in this row:
PHP Code:
<?=$row?" ":''?>
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 ?
