$hesk_settings['kb_substrart']) {
// The quick but not 100% accurate way (number of chars displayed may be lower than the limit)
return substr($txt, 0, $hesk_settings['kb_substrart']) . '...';
// If you want a more accurate, but also slower way, use this instead
// return hesk_htmlentities( substr( hesk_html_entity_decode($txt), 0, $hesk_settings['kb_substrart'] ) ) . '...';
}
return $txt;
} // END hesk_kbArticleContentPreview()
function hesk_kbTopArticles($how_many, $index = 1)
{
global $hesk_settings, $hesklang;
// Index page or KB main page?
if ($index) {
// Disabled?
if (!$hesk_settings['kb_index_popart']) {
return true;
}
// Show title in italics
$font_weight = 'i';
} else {
// Disabled?
if (!$hesk_settings['kb_popart']) {
return true;
}
// Show title in bold
$font_weight = 'b';
// Print a line for spacing
echo '
';
}
?>
';
echo '' . $hesklang['views'] . ' | ';
}
?>
' . $hesklang['noa'] . ' | ';
}
/* We have some results, print them out */
$colspan = '';
if (!$hesk_settings['kb_views']) {
$colspan = 'colspan="2"';
}
// Remember what articles are printed for "Top" so we don't print them again in "Latest"
$hesk_settings['kb_top_articles_printed'] = array();
while ($article = hesk_dbFetchAssoc($res)) {
$hesk_settings['kb_top_articles_printed'][] = $article['id'];
$icon = 'fa fa-file';
$style = '';
if ($article['sticky']) {
$icon = 'glyphicon glyphicon-pushpin';
$style = 'style="color: #FF0000"';
}
echo '
' . $article['subject'] . '
|
';
if ($hesk_settings['kb_views']) {
echo '' . $article['views'] . ' | ';
}
echo '
';
}
?>
';
}
}
?>
';
if ($hesk_settings['kb_date']) {
echo '' . $hesklang['dta'] . ' | ';
}
}
?>
' . $hesklang['noa'] . '';
}
/* We have some results, print them out */
$colspan = $hesk_settings['kb_date'] ? '' : 'colspan="2"';
while ($article = hesk_dbFetchAssoc($res)) {
$icon = 'fa fa-file';
$style = '';
if ($article['sticky']) {
$icon = 'glyphicon glyphicon-pushpin';
$style = 'style="color: #FF0000"';
}
echo '
' . $article['subject'] . '
| ';
if ($hesk_settings['kb_date']) {
echo '' . hesk_date($article['dt'], true) . ' | ';
}
echo '
';
} ?>
|