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