@ -139,7 +139,7 @@ else
{
{
hesk_show_kb_category($catid);
hesk_show_kb_category($catid);
}
}
echo '< / div > ';
require_once(HESK_PATH . 'inc/footer.inc.php');
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
exit();
@ -276,8 +276,15 @@ function hesk_show_kb_article($artid)
{
{
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` SET `views`=`views`+1 WHERE `id`={$artid} LIMIT 1");
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` SET `views`=`views`+1 WHERE `id`={$artid} LIMIT 1");
}
}
if (!isset($_GET['suggest'])) {
$historyNumber = isset($_GET['rated']) ? '-2' : '-1';
$goBackText = '< a href = "javascript:history.go('.$historyNumber.')" >
< i class = "fa fa-arrow-circle-left" data-toggle = "tooltip" data-placement = "top" title = "'.$hesklang['back'].'" > < / i > < / a > ';
} else {
$goBackText = '';
}
echo '< h3 class = "text-left" > '.$article['subject'].'< / h3 >
echo '< h3 class = "text-left" > '.$goBackText.' '.$ article['subject'].'< / h3 >
< div class = "footerWithBorder blankSpace" > < / div >
< div class = "footerWithBorder blankSpace" > < / div >
< h4 class = "text-left" > '.$hesklang['as'].'< / h4 >
< h4 class = "text-left" > '.$hesklang['as'].'< / h4 >
< div class = "kbContent" > '
< div class = "kbContent" > '
@ -409,22 +416,7 @@ function hesk_show_kb_article($artid)
< / div >
< / div >
<?php } ?>
<?php } ?>
< / div >
< / div >
<?php
<?php
if (!isset($_GET['suggest']))
{
?>
< p >< a href = "javascript:history.go( <?php echo isset ( $_GET [ 'rated' ]) ? '-2' : '-1' ; ?> )" >< span class = "glyphicon glyphicon-circle-arrow-left" ></ span > <?php echo $hesklang [ 'back' ]; ?> </ a ></ p >
<?php
}
else
{
?>
< p > < / p >
<?php
}
} // END hesk_show_kb_article()
} // END hesk_show_kb_article()
@ -456,8 +448,7 @@ function hesk_show_kb_category($catid, $is_search = 0) {
if ($thiscat['parent'])
if ($thiscat['parent'])
{
{
$link = ($thiscat['parent'] == 1) ? 'knowledgebase.php' : 'knowledgebase.php?category='.$thiscat['parent'];
$link = ($thiscat['parent'] == 1) ? 'knowledgebase.php' : 'knowledgebase.php?category='.$thiscat['parent'];
echo '< h3 class = "text-left" > '.$hesklang['kb_cat'].': '.$thiscat['name'].' < / h3 >
echo '< h3 class = "text-left" > < a href = "javascript:history.go(-1)" > < i class = "fa fa-arrow-circle-left" data-toggle = "tooltip" data-placement = "top" title = "'.$hesklang['back'].'" > < / i > < / a > '.$hesklang['kb_cat'].': '.$thiscat['name'].' < / h3 >
< p class = "text-left" > < a href = "javascript:history.go(-1)" title = "'.$hesklang['back'].'" > < span class = "glyphicon glyphicon-circle-arrow-left" > < / span > '.$hesklang['back'].'< / a > < / p >
< div class = "footerWithBorder blankSpace" > < / div >
< div class = "footerWithBorder blankSpace" > < / div >
< div class = "blankSpace" > < / div >
< div class = "blankSpace" > < / div >
';
';
@ -468,10 +459,11 @@ function hesk_show_kb_category($catid, $is_search = 0) {
{
{
?>
?>
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h4 class = "text-left" > <?php echo $hesklang [ 'kb_cat_sub' ]; ?> </ h4 >
< h4 class = "text-left" > <?php echo $hesklang [ 'kb_cat_sub' ]; ?> </ h4 >
< div class = "footerWithBorder blankSpace" > < / div >
< / div >
< table class = "table table-striped" >
< table border = "0" cellspacing = "1" cellpadding = "3" width = "100%" >
<?php
<?php
$per_col = $hesk_settings['kb_cols'];
$per_col = $hesk_settings['kb_cols'];
@ -488,7 +480,7 @@ function hesk_show_kb_category($catid, $is_search = 0) {
echo '
echo '
< td width = "50%" valign = "top" >
< td width = "50%" valign = "top" >
< table border = "0" >
< table border = "0" >
< tr > < td > < span class = "glyphicon glyphicon-folder-close" > < / span > < a href = "knowledgebase.php?category='.$cat['id'].'" > '.$cat['name'].'< / a > < / td > < / tr >
< tr > < td > < i class = "fa fa-folder" > < / i > < a href = "knowledgebase.php?category='.$cat['id'].'" > '.$cat['name'].'< / a > < / td > < / tr >
';
';
/* Print most popular/sticky articles */
/* Print most popular/sticky articles */
@ -548,33 +540,26 @@ function hesk_show_kb_category($catid, $is_search = 0) {
?>
?>
< / table >
< / table >
< / div >
< / td >
< td class = "roundcornersright" > < / td >
< / tr >
< / table >
<?php
<?php
} // END if NumRows > 0
} // END if NumRows > 0
?>
?>
< h4 class = "text-left" > <?php echo $hesklang [ 'ac' ]; ?> </ h4 >
< div class = "panel panel-default" >
< div class = "footerWithBorder blankSpace" > < / div >
< div class = "panel-heading" >
< h4 class = "text-left" > <?php echo $hesklang [ 'ac_no_colon' ]; ?> </ h4 >
< table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
< / div >
< table class = "table table-striped" >
< tr >
< tbody >
< td >
<?php
<?php
$res = hesk_dbQuery("SELECT `id`, `subject`, LEFT(`content`, ".max(200, $hesk_settings['kb_substrart'] * 2).") AS `content`, `rating` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='{$catid}' AND `type`='0' ORDER BY `sticky` DESC, `art_order` ASC");
$res = hesk_dbQuery("SELECT `id`, `subject`, LEFT(`content`, ".max(200, $hesk_settings['kb_substrart'] * 2).") AS `content`, `rating` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='{$catid}' AND `type`='0' ORDER BY `sticky` DESC, `art_order` ASC");
if (hesk_dbNumRows($res) == 0)
if (hesk_dbNumRows($res) == 0)
{
{
echo '< p > < i > '.$hesklang['noac'].'< / i > < / p > ';
echo '< tr > < td > < i > '.$hesklang['noac'].'< / i > < / td> < / tr > ';
}
}
else
else
{
{
echo '< div align = "center" > < table border = "0" cellspacing = "1" cellpadding = "3" width = "100%" > ';
while ($article = hesk_dbFetchAssoc($res))
while ($article = hesk_dbFetchAssoc($res))
{
{
$txt = hesk_kbArticleContentPreview($article['content']);
$txt = hesk_kbArticleContentPreview($article['content']);
@ -582,7 +567,7 @@ function hesk_show_kb_category($catid, $is_search = 0) {
if ($hesk_settings['kb_rating'])
if ($hesk_settings['kb_rating'])
{
{
$alt = $article['rating'] ? sprintf($hesklang['kb_rated'], sprintf("%01.1f", $article['rating'])) : $hesklang['kb_not_rated'];
$alt = $article['rating'] ? sprintf($hesklang['kb_rated'], sprintf("%01.1f", $article['rating'])) : $hesklang['kb_not_rated'];
$rat = '< td width = "1" valign = "top" > < img src = "img/star_'.(hesk_round_to_half($article['rating'])*10).'.png" width = "85" height = "16" alt = "'.$alt.'" title = "'.$alt.'" border = "0" style = "vertical-align:text-bottom" / > < / td > ';
$rat = '< td > < img src = "img/star_'.(hesk_round_to_half($article['rating'])*10).'.png" width = "85" height = "16" alt = "'.$alt.'" title = "'.$alt.'" border = "0" style = "vertical-align:text-bottom" / > < / td > ';
}
}
else
else
{
{
@ -592,29 +577,19 @@ function hesk_show_kb_category($catid, $is_search = 0) {
echo '
echo '
< tr >
< tr >
< td >
< td >
< table border = "0" width = "100%" cellspacing = "0" cellpadding = "1" >
< i class = "fa fa-file" > < / i >
< tr >
< a href = "knowledgebase.php?article='.$article['id'].'" > '.$article['subject'].'< / a >
< td width = "1" valign = "top" > < span class = "glyphicon glyphicon-file" > < / span > < / td >
< br >
< td valign = "top" > < a href = "knowledgebase.php?article='.$article['id'].'" > '.$article['subject'].'< / a > < / td >
< span class = "indent-15" > '.$txt.'< / span >
'.$rat.'
< / tr >
< / table >
< table border = "0" width = "100%" cellspacing = "0" cellpadding = "1" >
< tr >
< td width = "1" valign = "top" > < img src = "img/blank.gif" width = "16" height = "10" style = "vertical-align:middle" alt = "" / > < / td >
< td > < span class = "article_list" > '.$txt.'< / span > < / td >
< / tr >
< / table >
< / td >
< / td >
'.$rat.'
< / tr > ';
< / tr > ';
}
}
echo '< / table > < / div > ';
}
}
?>
?>
< / tbody >
< / td >
< / table >
< / tr >
< / div >
< / table >
<?php
<?php
/* On the main KB page print out top and latest articles if needed */
/* On the main KB page print out top and latest articles if needed */
@ -626,6 +601,5 @@ function hesk_show_kb_category($catid, $is_search = 0) {
/* Get list of latest articles */
/* Get list of latest articles */
hesk_kbLatestArticles($hesk_settings['kb_latest'], 0);
hesk_kbLatestArticles($hesk_settings['kb_latest'], 0);
}
}
} // END hesk_show_kb_category()
} // END hesk_show_kb_category()
?>
?>