diff --git a/admin/knowledgebase_private.php b/admin/knowledgebase_private.php index 5aa3769a..c675f387 100644 --- a/admin/knowledgebase_private.php +++ b/admin/knowledgebase_private.php @@ -37,6 +37,7 @@ require(HESK_PATH . 'hesk_settings.inc.php'); require(HESK_PATH . 'inc/common.inc.php'); require(HESK_PATH . 'inc/admin_functions.inc.php'); require(HESK_PATH . 'inc/knowledgebase_functions.inc.php'); +require(HESK_PATH . 'inc/mail_functions.inc.php'); hesk_load_database_functions(); hesk_session_start(); @@ -56,6 +57,7 @@ $can_man_kb = hesk_checkPermission('can_man_kb',0); $catid = intval( hesk_GET('category', 1) ); $artid = intval( hesk_GET('article', 0) ); + if (isset($_GET['search'])) { $query = hesk_input( hesk_GET('search') ); @@ -69,7 +71,9 @@ $hesk_settings['kb_link'] = ($artid || $catid != 1 || $query) ? '
  • - - - - -
    - - - +
    + +
    -

    ()

    -
    +
    + +
    '.$article['subject'].' -
    +?> +
    +
    +
    +

    + +

    +
    + +
    +
    +
    + +
    + + + +
    + '.$hesklang['as'].' - '. $article['content']; - - if ( ! empty($article['attachments'])) - { - echo '

    '.$hesklang['attachments'].':
    '; - $att=explode(',',substr($article['attachments'], 0, -1)); - foreach ($att as $myatt) - { - list($att_id, $att_name) = explode('#', $myatt); - echo ' '.$att_name.'
    '; + if ($article['catid']==1) + { + $link = 'knowledgebase_private.php'; } - echo '

    '; - } + else + { + $link = 'knowledgebase_private.php?category='.$article['catid']; + } + ?> +

    +
    + -

    -
    - +
    +
    +
    +

    + +

    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    +
    +
    +
    + +
    +
    +
    +

    + +

    +
    + +
    +
    +
    + $subject) + { + echo ' '.$subject.'
    '; + } + ?> +
    +
    +
    + +
    - // 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; - } - ?> -
    -

    -
    - - - - - - - - - - - - - - - - - -
    :
    :
    :
    :
    -
    - -
    -

    -
    - $subject) - { - echo ' '.$subject.'
    '; - } - ?> -
    - -
    - - -


     

    - -

     

    - +


     

    + +
    +'.$hesklang['kb_cat'].': '.$thiscat['name'].' -

    '.$hesklang['back'].'

    -
    '; - } - - $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) - { - ?> - -

    -
    - - - -
    - - - +?> +
    + +

    +

    + + +

    '; - } + if (hesk_dbNumRows($result) > 0) { + ?> +
    +
    +

    + +

    +
    + +
    +
    +
    +
    + '; + } + + $private = ($cat['type'] == 1) ? ' *' : ''; + + echo ' '; - if ($i == $per_col) - { - echo ''; - $i = 0; - } - $i++; - } - /* Finish the table if needed */ - if ($i != 1) - { - for ($j=1;$j<=$per_col;$j++) - { - echo ''; - if ($i == $per_col) - { - echo ''; - break; - } - $i++; - } - } + if ($i == $per_col) + { + echo ''; + $i = 0; + } + $i++; + } + /* Finish the table if needed */ + if ($i != 1) + { + for ($j=1;$j<=$per_col;$j++) + { + echo ''; + if ($i == $per_col) + { + echo ''; + break; + } + $i++; + } + } - ?> -
    '; - /* Print most popular/sticky 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) ); - $num = 1; - while ($art = hesk_dbFetchAssoc($res)) - { - $private = ($art['type'] == 1) ? ' *' : ''; - echo ' + /* Print most popular/sticky 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) ); + $num = 1; + while ($art = hesk_dbFetchAssoc($res)) + { + $private = ($art['type'] == 1) ? ' *' : ''; + echo ' '; - if ($num == $hesk_settings['kb_numshow']) - { - break; - } - else - { - $num++; - } - } - if (hesk_dbNumRows($res) > $hesk_settings['kb_numshow']) - { - echo ''; - } - } + if ($num == $hesk_settings['kb_numshow']) + { + break; + } + else + { + $num++; + } + } + if (hesk_dbNumRows($res) > $hesk_settings['kb_numshow']) + { + echo ''; + } + } - echo ' + echo '
     '.$cat['name'].''.$private.'
           '.$art['subject'].''.$private.'
    » '.$hesklang['m'].'
    » '.$hesklang['m'].'
     
     
    + ?> +
    +
    + + + +
    +
    +

    + +

    +
    + +
    +
    +
    + '.$hesklang['noac'].''; + } + else + { + echo ''; + while ($article = hesk_dbFetchAssoc($res)) + { + $private = ($article['type'] == 1) ? ' *' : ''; - - -
    + $txt = hesk_kbArticleContentPreview($article['content']); - 0 - ?> -
    -

    -
    - - - - - -
    - - '.$hesklang['noac'].'

    '; - } - else - { - echo '
    '; - while ($article = hesk_dbFetchAssoc($res)) - { - $private = ($article['type'] == 1) ? ' *' : ''; - - $txt = hesk_kbArticleContentPreview($article['content']); - - echo ' + echo ' '; - } - echo '
    @@ -528,14 +556,16 @@ function hesk_show_kb_category($catid, $is_search = 0) {
    '; - } - ?> - -
    + } + echo ''; + } + ?> +
    + +
    +