@ -90,13 +90,14 @@ function hesk_kbTopArticles($how_many, $index = 1)
}
?>
< h4 class = "text-left" > <?php echo $hesklang [ 'popart' ]; ?> </ h4 >
< div class = "footerWithBorder blankSpace" > < / div >
< table border = "0" width = "100%" >
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h4 class = "text-left" > <?php echo $hesklang [ 'popart_no_colon' ]; ?> </ h4 >
< / div >
< table border = "0" width = "100%" class = "table table-striped table-fixed" >
< thead >
< tr >
< th class = "col-xs-8 col-sm-9" > < / th >
<?php
/* Get list of articles from the database */
$res = hesk_dbQuery("SELECT `t1`.`id`,`t1`.`subject`,`t1`.`views` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
@ -107,16 +108,15 @@ function hesk_kbTopArticles($how_many, $index = 1)
/* Show number of views? */
if ($hesk_settings['kb_views'] & & hesk_dbNumRows($res) != 0)
{
echo '< td class = "text-right "> < i > ' . $hesklang['views'] . '< / i > < / t d > ';
echo '< th class = "col-xs-4 col-sm-3 "> < i > ' . $hesklang['views'] . '< / i > < / t h > ';
}
?>
< / tr >
< / table >
< / thead >
< tbody >
<?php
/* Get list of articles from the database */
$res = hesk_dbQuery("SELECT `t1`.`id`,`t1`.`subject`,`t1`.`dt` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
$res = hesk_dbQuery("SELECT `t1`.`id`,`t1`.`subject`,`t1`.`dt`, `t1`.`views ` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` AS `t2` ON `t1`.`catid` = `t2`.`id`
WHERE `t1`.`type`='0' AND `t2`.`type`='0'
ORDER BY `t1`.`sticky` DESC, `t1`.`views` DESC, `t1`.`art_order` ASC LIMIT ".intval($how_many));
@ -124,44 +124,36 @@ function hesk_kbTopArticles($how_many, $index = 1)
/* If no results found end here */
if (hesk_dbNumRows($res) == 0)
{
echo '< p class = "text-left" > < i > '.$hesklang['noa'].'< / i > < br / > < / p > ';
$colspan = '';
if (!$hesk_settings['kb_views']) {
$colspan = 'colspan="2"';
}
echo '< tr > < td ' . $ colspan . ' > < i > '.$hesklang['noa'].'< / i > < / td > < / tr > ';
return true;
}
/* We have some results, print them out */
?>
< div align = "left" >
< table border = "0" cellspacing = "1" cellpadding = "3" width = "100%" >
<?php
$colspan = '';
if (!$hesk_settings['kb_views']) {
$colspan = 'colspan="2"';
}
while ($article = hesk_dbFetchAssoc($res))
{
echo '
< tr >
< td >
< table border = "0" width = "100%" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "1" valign = "top" > < span class = "glyphicon glyphicon-file" > < / span > < / td >
< td valign = "top" > < a href = "knowledgebase.php?article=' . $article['id'] . '" > ' . $article['subject'] . '< / a > < / td >
';
if ($hesk_settings['kb_views'])
{
echo '< td valign = "top" class = "text-right" width = "200" > ' . $article['views'] . '< / td > ';
}
echo '
< / tr >
< / table >
< td class = "col-xs-8 col-sm-9" ' . $ colspan . ' >
< i class = "fa fa-file" > < / i > < a href = "knowledgebase.php?article='.$article['id'].'" > '.$article['subject'].'< / a >
< / td >
< / tr >
';
if ($hesk_settings['kb_views']) {
echo '< td class = "col-xs-4 col-sm-3" > '.$article['views'].'< / td > ';
}
echo '< / tr > ';
}
?>
< / tbody >
< / table >
< / div >
< br / >
<?php
} // END hesk_kbTopArticles()
@ -201,12 +193,18 @@ function hesk_kbLatestArticles($how_many, $index = 1)
}
?>
< h4 class = "text-left" > <?php echo $hesklang [ 'latart' ]; ?> </ h4 >
< div class = "footerWithBorder blankSpace" > < / div >
< table border = "0" width = "100%" >
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h4 class = "text-left" > <?php echo $hesklang [ 'latart_no_colon' ]; ?> </ h4 >
< / div >
< table class = "table table-striped table-fixed" >
< thead >
< tr >
<?php
$colspan = '';
if (!$hesk_settings['kb_date']) {
$colspan = 'colspan="2"';
}
/* Get list of articles from the database */
$res = hesk_dbQuery("SELECT `t1`.* FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` AS `t2` ON `t1`.`catid` = `t2`.`id`
@ -214,15 +212,18 @@ function hesk_kbLatestArticles($how_many, $index = 1)
ORDER BY `t1`.`dt` DESC LIMIT ".intval($how_many));
/* Show number of views? */
if ($hesk_settings['kb_date'] & & hesk_dbNumRows($res) != 0)
if (hesk_dbNumRows($res) != 0)
{
echo '< th class = "col-xs-9" ' . $ colspan . ' > < / th > ';
if ($hesk_settings['kb_date'])
{
echo '< td class = "text-right" > < i > ' . $hesklang['dta'] . '< / i > < / td > ';
echo '< th class = "col-xs-3" > < i > ' . $hesklang['dta'] . '< / i > < / th > ';
}
}
?>
< / tr >
< / table >
< / thead >
< tbody >
<?php
/* Get list of articles from the database */
$res = hesk_dbQuery("SELECT `t1`.* FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
@ -233,46 +234,32 @@ function hesk_kbLatestArticles($how_many, $index = 1)
/* If no results found end here */
if (hesk_dbNumRows($res) == 0)
{
echo '< p class = "text-left" > < i > '.$hesklang['noa'].'< / i > < br / > < / p > ';
$colspan = '';
if ($hesk_settings['kb_date']) {
$colspan = 'colspan="2"';
}
echo '< td ' . $ colspan . ' > < i > '.$hesklang['noa'].'< / i > < / td > ';
return true;
}
/* We have some results, print them out */
?>
< div align = "center" >
< table border = "0" cellspacing = "1" cellpadding = "3" width = "100%" >
<?php
$colspan = $hesk_settings['kb_date'] ? '' : 'colspan="2"';
while ($article = hesk_dbFetchAssoc($res))
{
echo '
< tr >
< td >
< table border = "0" width = "100%" cellspacing = "0" cellpadding = "0" >
< tr >
< td width = "1" valign = "top" > < span class = "glyphicon glyphicon-file" > < / span > < / td >
< td valign = "top" > < a href = "knowledgebase.php?article=' . $article['id'] . '" > ' . $article['subject'] . '< / a > < / td >
';
if ($hesk_settings['kb_date'])
{
echo '< td valign = "top" class = "text-right" width = "200" > ' . hesk_date($article['dt'], true) . '< / td > ';
< td class = "col-xs-9" ' . $ colspan . ' >
< i class = "fa fa-file" > < / i > < a href = "knowledgebase.php?article='.$article['id'].'" > '.$article['subject'].'< / a >
< / td > ';
if ($hesk_settings['kb_date']) {
echo '< td class = "col-xs-3" > ' . hesk_date($article['dt'], true) . '< / td > ';
}
echo '
< / tr >
< / table >
< / td >
< / tr >
';
}
?>
echo '< / tr > ';
} ?>
< / tbody >
< / table >
< / div >
<?php
} // END hesk_kbLatestArticles()