Private KB follows new UI

merge-requests/27/head
Mike Koch 8 years ago
parent e62e6233a6
commit 822c35f2ce

@ -37,6 +37,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php'); require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php'); require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/knowledgebase_functions.inc.php'); require(HESK_PATH . 'inc/knowledgebase_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions(); hesk_load_database_functions();
hesk_session_start(); hesk_session_start();
@ -56,6 +57,7 @@ $can_man_kb = hesk_checkPermission('can_man_kb',0);
$catid = intval( hesk_GET('category', 1) ); $catid = intval( hesk_GET('category', 1) );
$artid = intval( hesk_GET('article', 0) ); $artid = intval( hesk_GET('article', 0) );
if (isset($_GET['search'])) if (isset($_GET['search']))
{ {
$query = hesk_input( hesk_GET('search') ); $query = hesk_input( hesk_GET('search') );
@ -69,7 +71,9 @@ $hesk_settings['kb_link'] = ($artid || $catid != 1 || $query) ? '<a href="knowle
if ($hesk_settings['kb_search'] && $query) if ($hesk_settings['kb_search'] && $query)
{ {
hesk_kb_search($query); if (hesk_kb_search($query)) {
hesk_show_kb_category(1,1);
}
} }
elseif ($artid) elseif ($artid)
{ {
@ -98,7 +102,7 @@ else
{ {
hesk_show_kb_category($catid); hesk_show_kb_category($catid);
} }
?> </div> <?php
require_once(HESK_PATH . 'inc/footer.inc.php'); require_once(HESK_PATH . 'inc/footer.inc.php');
exit(); exit();
@ -114,11 +118,6 @@ function hesk_kb_header($kb_link, $catid=1)
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?> ?>
</td>
</tr>
<tr>
<td>
<ol class="breadcrumb"> <ol class="breadcrumb">
<?php <?php
if ($can_man_kb) if ($can_man_kb)
@ -130,15 +129,10 @@ function hesk_kb_header($kb_link, $catid=1)
?> ?>
<li class="active"><?php echo $kb_link; ?></li> <li class="active"><?php echo $kb_link; ?></li>
</ol> </ol>
<!-- SUB NAVIGATION -->
<?php show_subnav('view', $catid); ?> <?php show_subnav('view', $catid); ?>
<!-- SUB NAVIGATION --> <section style="padding: 15px;">
<?php hesk_kbSearchLarge(1); ?>
<div style="margin-left:40px;margin-right:40px"> </section>
<?php hesk_kbSearchLarge(1); ?>
<?php <?php
} // END hesk_kb_header() } // END hesk_kb_header()
@ -154,41 +148,43 @@ function hesk_kb_search($query)
$res = hesk_dbQuery('SELECT t1.`id`, t1.`subject`, LEFT(`t1`.`content`, '.max(200, $hesk_settings['kb_substrart'] * 2).') AS `content`, t1.`rating` 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` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('".hesk_dbEscape($query)."') LIMIT ".intval($hesk_settings['kb_search_limit'])); $res = hesk_dbQuery('SELECT t1.`id`, t1.`subject`, LEFT(`t1`.`content`, '.max(200, $hesk_settings['kb_substrart'] * 2).') AS `content`, t1.`rating` 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` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('".hesk_dbEscape($query)."') LIMIT ".intval($hesk_settings['kb_search_limit']));
$num = hesk_dbNumRows($res); $num = hesk_dbNumRows($res);
$show_default_category = false;
?> ?>
<h4><?php echo $hesklang['sr']; ?> (<?php echo $num; ?>)</h4> <section style="padding: 15px">
<div class="footerWithBorder blankSpace"></div> <div class="box">
<div class="box-header with-border">
<?php <h1 class="box-title">
if ($num == 0) <?php echo $hesklang['sr']; ?> (<?php echo $num; ?>)
{ </h1>
echo '<p style="margin-left:20px"><i>'.$hesklang['nosr'].'</i></p>'; <div class="box-tools pull-right">
hesk_show_kb_category(1,1); <button type="button" class="btn btn-box-tool" data-widget="collapse">
} <i class="fa fa-minus"></i>
else </button>
{ </div>
?> </div>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <div class="box-body">
<tr> <?php
<td> if ($num == 0) {
<div align="center"> echo '<i>'.$hesklang['nosr'].'</i>';
<table border="0" cellspacing="1" cellpadding="3" width="100%"> $show_default_category = true;
<?php } else {
while ($article = hesk_dbFetchAssoc($res)) ?>
{ <table class="table table-striped">
$txt = hesk_kbArticleContentPreview($article['content']); <?php
while ($article = hesk_dbFetchAssoc($res))
if ($hesk_settings['kb_rating']) {
{ $txt = hesk_kbArticleContentPreview($article['content']);
$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.'" border="0" style="vertical-align:text-bottom" /></td>'; if ($hesk_settings['kb_rating'])
} {
else $rat = '<td width="1" valign="top">' . mfh_get_stars($article['rating']) . '</td>';
{ }
$rat = ''; else
} {
$rat = '';
echo ' }
echo '
<tr> <tr>
<td> <td>
<table border="0" width="100%" cellspacing="0" cellpadding="1"> <table border="0" width="100%" cellspacing="0" cellpadding="1">
@ -207,18 +203,16 @@ function hesk_kb_search($query)
</td> </td>
</tr>'; </tr>';
} }
?> ?>
</table> </table>
</div> <a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a>
</td> <?php } ?>
</tr> </div>
</table> </div>
</section>
<p><br /><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a></p>
<?php <?php
} // END else return $show_default_category;
} // END hesk_kb_search() } // END hesk_kb_search()
@ -233,132 +227,163 @@ function hesk_show_kb_article($artid)
// Update views by 1 // Update views by 1
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");
echo '<h3>'.$article['subject'].'</h3> ?>
<div class="footerWithBorder blankSpace"></div> <section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $article['subject']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php echo $article['content']; ?>
</div>
<?php if (!empty($article['attachments'])): ?>
<div class="box-footer">
<p><b><?php echo $hesklang['attachments']; ?></b></p>
<?php
$att=explode(',',substr($article['attachments'], 0, -1));
foreach ($att as $myatt)
{
list($att_id, $att_name) = explode('#', $myatt);
echo '<i class="fa fa-paperclip"></i> <a href="../download_attachment.php?kb_att='.$att_id.'" rel="nofollow">'.$att_name.'</a><br />';
}
?>
</div>
<?php endif; ?>
</div>
<?php
if ($article['catid']==1)
{
$link = 'knowledgebase_private.php';
}
else
{
$link = 'knowledgebase_private.php?category='.$article['catid'];
}
?>
<br><br>
<div class="row">
<?php
$showRelated = false;
$column = 'col-md-12';
require(HESK_PATH . 'inc/mail/email_parser.php');
$query = hesk_dbEscape( $article['subject'] . ' ' . convert_html_to_text($article['content']) );
<h4>'.$hesklang['as'].'</h4> // Get relevant articles from the database
'. $article['content']; $res = hesk_dbQuery("SELECT `id`, `subject`, MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') AS `score` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') LIMIT ".intval($hesk_settings['kb_related']+1));
if ( ! empty($article['attachments'])) // Array with related articles
{ $related_articles = array();
echo '<p><b>'.$hesklang['attachments'].':</b><br />';
$att=explode(',',substr($article['attachments'], 0, -1));
foreach ($att as $myatt)
{
list($att_id, $att_name) = explode('#', $myatt);
echo '<i class="fa fa-papercip"></i> <a href="../download_attachment.php?kb_att='.$att_id.'" rel="nofollow">'.$att_name.'</a><br />';
}
echo '</p>';
}
while ($related = hesk_dbFetchAssoc($res))
{
// Get base match score from the first (this) article
if ( ! isset($base_score) )
{
$base_score = $related['score'];
}
// Ignore this article
if ($related['id'] == $artid)
{
continue;
}
if ($article['catid']==1) // Stop when articles reach less than 10% of base score
{ if ($related['score'] / $base_score < 0.10)
$link = 'knowledgebase_private.php'; {
} break;
else }
{
$link = 'knowledgebase_private.php?category='.$article['catid'];
}
?>
<br><br>
<div class="row">
<?php
$showRelated = false;
$column = 'col-md-12';
require(HESK_PATH . 'inc/mail/email_parser.php');
$query = hesk_dbEscape( $article['subject'] . ' ' . convert_html_to_text($article['content']) );
// Get relevant articles from the database
$res = hesk_dbQuery("SELECT `id`, `subject`, MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') AS `score` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') LIMIT ".intval($hesk_settings['kb_related']+1));
// Array with related articles
$related_articles = array();
while ($related = hesk_dbFetchAssoc($res))
{
// Get base match score from the first (this) article
if ( ! isset($base_score) )
{
$base_score = $related['score'];
}
// Ignore this article
if ($related['id'] == $artid)
{
continue;
}
// Stop when articles reach less than 10% of base score
if ($related['score'] / $base_score < 0.10)
{
break;
}
// This is a valid related article
$related_articles[$related['id']] = $related['subject'];
}
// Print related articles if we have any valid matches
if ( count($related_articles) ) {
$column = 'col-md-6';
$showRelated = true;
}
?>
<div class="<?php echo $column; ?> col-sm-12">
<h4><?php echo $hesklang['ad']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<table border="0">
<tr>
<td><?php echo $hesklang['aid']; ?>: </td>
<td><?php echo $article['id']; ?></td>
</tr>
<tr>
<td><?php echo $hesklang['category']; ?>: </td>
<td><a href="<?php echo $link; ?>"><?php echo $article['cat_name']; ?></a></td>
</tr>
<tr>
<td><?php echo $hesklang['dta']; ?>: </td>
<td><?php echo hesk_date($article['dt'], true); ?></td>
</tr>
<tr>
<td><?php echo $hesklang['views']; ?>: </td>
<td><?php echo (isset($_GET['rated']) ? $article['views'] : $article['views']+1); ?></td>
</tr>
</table>
</div>
<?php if ($showRelated) { ?>
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['relart']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php
// Related articles
foreach ($related_articles as $id => $subject)
{
echo '<span class="glyphicon glyphicon-file" style="font-size: 16px;"></span> <a href="knowledgebase_private.php?article='.$id.'">'.$subject.'</a><br />';
}
?>
</div>
<?php } ?>
</div>
<?php // This is a valid related article
if (!isset($_GET['back'])) $related_articles[$related['id']] = $related['subject'];
{ }
?>
<p><br /><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a></p> // Print related articles if we have any valid matches
<?php if ( count($related_articles) ) {
} $column = 'col-md-6';
else $showRelated = true;
{ }
?> ?>
<p>&nbsp;</p> <div class="<?php echo $column; ?> col-sm-12">
<?php <div class="box">
} <div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['ad']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<table border="0">
<tr>
<td><?php echo $hesklang['aid']; ?>: </td>
<td><?php echo $article['id']; ?></td>
</tr>
<tr>
<td><?php echo $hesklang['category']; ?>: </td>
<td><a href="<?php echo $link; ?>"><?php echo $article['cat_name']; ?></a></td>
</tr>
<tr>
<td><?php echo $hesklang['dta']; ?>: </td>
<td><?php echo hesk_date($article['dt'], true); ?></td>
</tr>
<tr>
<td><?php echo $hesklang['views']; ?>: </td>
<td><?php echo (isset($_GET['rated']) ? $article['views'] : $article['views']+1); ?></td>
</tr>
</table>
</div>
</div>
</div>
<?php if ($showRelated) { ?>
<div class="col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['relart']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
// Related articles
foreach ($related_articles as $id => $subject)
{
echo '<span class="glyphicon glyphicon-file" style="font-size: 16px;"></span> <a href="knowledgebase_private.php?article='.$id.'">'.$subject.'</a><br />';
}
?>
</div>
</div>
</div>
<?php } ?>
</div>
<?php
if (!isset($_GET['back']))
{
?>
<p><br /><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a></p>
<?php
}
?>
</section>
<?php
} // END hesk_show_kb_article() } // END hesk_show_kb_article()
@ -370,148 +395,151 @@ function hesk_show_kb_category($catid, $is_search = 0) {
{ {
/* Print header */ /* Print header */
hesk_kb_header($hesk_settings['kb_link'], $catid); hesk_kb_header($hesk_settings['kb_link'], $catid);
if ($catid == 1)
{
echo $hesklang['priv'];
}
} }
$res = hesk_dbQuery("SELECT `name`,`parent` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `id`='".intval($catid)."' LIMIT 1"); $res = hesk_dbQuery("SELECT `name`,`parent` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `id`='".intval($catid)."' LIMIT 1");
$thiscat = hesk_dbFetchAssoc($res) or hesk_error($hesklang['kb_cat_inv']); $thiscat = hesk_dbFetchAssoc($res) or hesk_error($hesklang['kb_cat_inv']);
if ($thiscat['parent']) ?>
{ <section class="content">
$link = ($thiscat['parent'] == 1) ? 'knowledgebase_private.php' : 'knowledgebase_private.php?category='.$thiscat['parent']; <?php if ($thiscat['parent']): ?>
echo '<h3>'.$hesklang['kb_cat'].': '.$thiscat['name'].'</h3> <h3><?php echo $hesklang['kb_cat'].': '.$thiscat['name']; ?></h3>
<p align="left"><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>'.$hesklang['back'].'</a></p> <p align="left"><a href="javascript:history.go(-1)">
<div class="footerWithBorder blankSpace"></div>'; <span class="glyphicon glyphicon-circle-arrow-left"></span>
} <?php echo $hesklang['back']; ?>
</a></p>
$result = hesk_dbQuery("SELECT `id`,`name`,`articles`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `parent`='".intval($catid)."' ORDER BY `parent` ASC, `cat_order` ASC");
if (hesk_dbNumRows($result) > 0)
{
?>
<h4><?php echo $hesklang['kb_cat_sub']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" cellspacing="1" cellpadding="3" width="100%">
<?php <?php
$per_col = $hesk_settings['kb_cols']; endif;
$i = 1;
while ($cat = hesk_dbFetchAssoc($result))
{
if ($i == 1)
{
echo '<tr>';
}
$private = ($cat['type'] == 1) ? ' *' : ''; $result = hesk_dbQuery("SELECT `id`,`name`,`articles`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `parent`='".intval($catid)."' ORDER BY `parent` ASC, `cat_order` ASC");
echo ' if (hesk_dbNumRows($result) > 0) {
?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['kb_cat_sub']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<table class="table table-striped">
<?php
$per_col = $hesk_settings['kb_cols'];
$i = 1;
while ($cat = hesk_dbFetchAssoc($result))
{
if ($i == 1)
{
echo '<tr>';
}
$private = ($cat['type'] == 1) ? ' *' : '';
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>&nbsp;<a href="knowledgebase_private.php?category='.$cat['id'].'">'.$cat['name'].'</a>'.$private.'</td></tr> <tr><td><span class="glyphicon glyphicon-folder-close"></span>&nbsp;<a href="knowledgebase_private.php?category='.$cat['id'].'">'.$cat['name'].'</a>'.$private.'</td></tr>
'; ';
/* Print most popular/sticky articles */ /* Print most popular/sticky articles */
if ($hesk_settings['kb_numshow'] && $cat['articles']) if ($hesk_settings['kb_numshow'] && $cat['articles'])
{ {
$res = hesk_dbQuery("SELECT `id`,`subject`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($cat['id'])."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `views` DESC, `art_order` ASC LIMIT " . (intval($hesk_settings['kb_numshow']) + 1) ); $res = hesk_dbQuery("SELECT `id`,`subject`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($cat['id'])."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `views` DESC, `art_order` ASC LIMIT " . (intval($hesk_settings['kb_numshow']) + 1) );
$num = 1; $num = 1;
while ($art = hesk_dbFetchAssoc($res)) while ($art = hesk_dbFetchAssoc($res))
{ {
$private = ($art['type'] == 1) ? ' *' : ''; $private = ($art['type'] == 1) ? ' *' : '';
echo ' echo '
<tr> <tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-file"></span> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-file"></span>
<a href="knowledgebase_private.php?article='.$art['id'].'" class="article">'.$art['subject'].'</a>'.$private.'</td> <a href="knowledgebase_private.php?article='.$art['id'].'" class="article">'.$art['subject'].'</a>'.$private.'</td>
</tr>'; </tr>';
if ($num == $hesk_settings['kb_numshow']) if ($num == $hesk_settings['kb_numshow'])
{ {
break; break;
} }
else else
{ {
$num++; $num++;
} }
} }
if (hesk_dbNumRows($res) > $hesk_settings['kb_numshow']) if (hesk_dbNumRows($res) > $hesk_settings['kb_numshow'])
{ {
echo '<tr><td>&raquo; <a href="knowledgebase_private.php?category='.$cat['id'].'"><i>'.$hesklang['m'].'</i></a></td></tr>'; echo '<tr><td>&raquo; <a href="knowledgebase_private.php?category='.$cat['id'].'"><i>'.$hesklang['m'].'</i></a></td></tr>';
} }
} }
echo ' echo '
</table> </table>
</td> </td>
'; ';
if ($i == $per_col) if ($i == $per_col)
{ {
echo '</tr>'; echo '</tr>';
$i = 0; $i = 0;
} }
$i++; $i++;
} }
/* Finish the table if needed */ /* Finish the table if needed */
if ($i != 1) if ($i != 1)
{ {
for ($j=1;$j<=$per_col;$j++) for ($j=1;$j<=$per_col;$j++)
{ {
echo '<td width="50%">&nbsp;</td>'; echo '<td width="50%">&nbsp;</td>';
if ($i == $per_col) if ($i == $per_col)
{ {
echo '</tr>'; echo '</tr>';
break; break;
} }
$i++; $i++;
} }
} }
?> ?>
</table> </table>
</div>
</td> <div class="box-footer">
</tr> <?php echo $hesklang['private_category_star']; ?>
</table> </div>
</div>
<?php <?php } ?>
} // END if NumRows > 0 <div class="box">
?> <div class="box-header with-border">
<br> <h1 class="box-title">
<h4><?php echo $hesklang['ac']; ?></h4> <?php echo $hesklang['ac']; ?>
<div class="footerWithBorder blankSpace"></div> </h1>
<div class="box-tools pull-right">
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <button type="button" class="btn btn-box-tool" data-widget="collapse">
<tr> <i class="fa fa-minus"></i>
<td> </button>
</div>
<?php </div>
$res = hesk_dbQuery("SELECT `id`, `subject`, LEFT(`content`, ".max(200, $hesk_settings['kb_substrart'] * 2).") AS `content`, `rating`, `type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($catid)."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `art_order` ASC"); <div class="box-body">
if (hesk_dbNumRows($res) == 0) <?php
{ $res = hesk_dbQuery("SELECT `id`, `subject`, LEFT(`content`, ".max(200, $hesk_settings['kb_substrart'] * 2).") AS `content`, `rating`, `type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($catid)."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `art_order` ASC");
echo '<p><i>'.$hesklang['noac'].'</i></p>'; if (hesk_dbNumRows($res) == 0)
} {
else echo '<i>'.$hesklang['noac'].'</i>';
{ }
echo '<div align="center"><table border="0" cellspacing="1" cellpadding="3" width="100%">'; else
while ($article = hesk_dbFetchAssoc($res)) {
{ echo '<table border="0" cellspacing="1" cellpadding="3" width="100%">';
$private = ($article['type'] == 1) ? ' *' : ''; while ($article = hesk_dbFetchAssoc($res))
{
$private = ($article['type'] == 1) ? ' *' : '';
$txt = hesk_kbArticleContentPreview($article['content']); $txt = hesk_kbArticleContentPreview($article['content']);
echo ' echo '
<tr> <tr>
<td> <td>
<table border="0" width="100%" cellspacing="0" cellpadding="1"> <table border="0" width="100%" cellspacing="0" cellpadding="1">
@ -528,14 +556,16 @@ function hesk_show_kb_category($catid, $is_search = 0) {
</table> </table>
</td> </td>
</tr>'; </tr>';
} }
echo '</table></div>'; echo '</table>';
} }
?> ?>
</div>
</td> <div class="box-footer">
</tr> <?php echo $hesklang['private_article_star']; ?>
</table> </div>
</div>
</section>
<?php <?php
} // END hesk_show_kb_category() } // END hesk_show_kb_category()

@ -30,6 +30,8 @@ $hesklang['main_navigation_uppercase'] = 'MAIN NAVIGATION';
$hesklang['x_system_warnings'] = '%s System %s'; // %s: Number of warnings, $s: "Warning" or "Warnings", depending on # $hesklang['x_system_warnings'] = '%s System %s'; // %s: Number of warnings, $s: "Warning" or "Warnings", depending on #
$hesklang['warnings_title_case'] = 'Warnings'; $hesklang['warnings_title_case'] = 'Warnings';
$hesklang['articles_in_category_x'] = 'Articles in Category %s'; // %s: category name $hesklang['articles_in_category_x'] = 'Articles in Category %s'; // %s: category name
$hesklang['private_category_star'] = 'Private categories indicated by *';
$hesklang['private_article_star'] = 'Private articles indicated by *';
// ADDED OR MODIFIED IN Mods for HESK 2.6.0 // ADDED OR MODIFIED IN Mods for HESK 2.6.0
$hesklang['search_logs'] = 'Search Logs'; $hesklang['search_logs'] = 'Search Logs';

Loading…
Cancel
Save