$_kbCategoryContainer = $_knowledgebaseCategory['category'][0]; } //Retrieve and process comments $_searchParameters = array('ListAll'); $_commentContainer_Complete = $_restClient->get($_commentController, $_searchParameters); $_commentContainer_Complete = $_commentContainer_Complete['kbarticlecomment']; $_itemIDKey = 'kbarticleid'; $_itemID = $_GET['articleid']; include 'comments.php'; //Process article attachments $_searchParameters = array('ListAll', $_GET['articleid']); $_attachmentContainer = $_restClient->get($_attachmentController, $_searchParameters); $_attachmentContainer = $_attachmentContainer['kbattachment']; foreach ($_attachmentContainer as $_key => $_attachment) { $_attachmentContainer[$_key]['name'] = $_attachment['filename']; $_attachmentContainer[$_key]['size'] = FormattedSize($_attachment['filesize']); $_fileExtension = mb_strtolower(substr($_attachment['filename'], strrpos($_attachment['filename'], '.') + 1)); $_mimeData = GetMimeData($_fileExtension); $_attachmentIcon = 'icon_file.gif'; if (isset($_mimeData[1])) { $_attachmentIcon = $_mimeData[1]; } $_attachmentContainer[$_key]['icon'] = $_attachmentIcon; $_attachmentContainer[$_key]['link'] = WHMCS_URL . 'knowledgebase.php?articleid=' . $_GET['articleid'] . '&aid=' . $_attachment['id']; } $smarty->assign('_knowledgebaseArticle', $_knowledgebaseArticle); $smarty->assign('_kbCategoryContainer', $_kbCategoryContainer); $smarty->assign('_attachmentContainer', $_attachmentContainer); $smarty->assign('_imageURL', IMAGE_URL); $smarty->assign('_commentSubmitURL', WHMCS_URL . 'knowledgebase.php?articleid=' . $_GET['articleid'] . '&action=savecomment'); $templatefile = 'knowledgebasearticle';
} } $_ticketPost['creatorlabel'] = $_creatorLabel; $_postTitle = 'Posted on: ' . $_ticketPost['dateline']; $_ticketPost['posttitle'] = $_postTitle; $_ticketPost['badgeclass'] = $_badgeClass; $_ticketPost['badgetext'] = $_badgeText; $_ticketPostMinimumHeight = 300; $_ticketPost['minimumheight'] = $_ticketPostMinimumHeight; $_attachmentObjectContainer = $_ticketPostObject->getAttachments(); //Process ticket post attachments $_ticketAttachmentContainer = array(); foreach ($_attachmentObjectContainer as $_attachmentObject) { $_ticketAttachment = array(); $_ticketAttachment['name'] = $_attachmentObject->getFileName(); $_ticketAttachment['size'] = FormattedSize($_attachmentObject->getFileSize()); $_fileExtension = mb_strtolower(substr($_ticketAttachment['name'], strrpos($_ticketAttachment['name'], '.') + 1)); $_mimeData = GetMimeData($_fileExtension); $_attachmentIcon = 'icon_file.gif'; if (isset($_mimeData[1])) { $_attachmentIcon = $_mimeData[1]; } $_ticketAttachment['icon'] = $_attachmentIcon; $_ticketAttachment['link'] = WHMCS_URL . 'viewticket.php?tid=' . $_GET['ticketid'] . '&aid=' . $_attachmentObject->getId(); $_ticketAttachmentContainer[] = $_ticketAttachment; } $_ticketPost['attachments'] = $_ticketAttachmentContainer; $_ticketPostContainer[$_ticketPost['ticketpostid']] = $_ticketPost; } //Process customfields $_customFieldGroupContainer = array();