diff --git a/controller/category.php b/controller/category.php index 74815d1..b889c33 100644 --- a/controller/category.php +++ b/controller/category.php @@ -52,7 +52,7 @@ public function cat() $kb_config = $this->kb->obtain_kb_config(); $per_page = $kb_config['articles_per_page']; - $sql = 'SELECT category_id + $sql = 'SELECT category_id, category_name FROM '. KB_CAT_TABLE .' WHERE category_id = '.$cat_id.''; $result = $this->db->sql_query($sql); @@ -64,6 +64,8 @@ public function cat() trigger_error ('CAT_NO_EXISTS'); } + $this->template->assign_block_vars('par_cat_row', array( 'PAR_CAT_NAME' => $row['category_name']) ); + $sql = 'SELECT COUNT(article_id) as article_count FROM '. ARTICLES_TABLE .' WHERE article_category_id = '.$cat_id.' @@ -113,6 +115,7 @@ public function cat() $this->template->assign_block_vars('cat_row', array( 'CAT_ID' => $cat_row['category_id'], 'CAT_NAME' => $cat_row['category_name'], + 'CAT_DESCRIPTION' => $cat_row['category_details'], 'U_CAT' => append_sid("{$this->phpbb_root_path}knowlegebase/category", "id=$cat_row[category_id]"), 'ARTICLES' => $cat_row['number_articles'], 'SUBCATS' => $this->kb->get_cat_list ($cat_row['parent_id'], $exclude_cats), diff --git a/controller/edit.php b/controller/edit.php index 360a690..1f2ae10 100644 --- a/controller/edit.php +++ b/controller/edit.php @@ -172,6 +172,11 @@ public function edit_article() } } + if ($cancel) + { + redirect(append_sid("{$this->phpbb_root_path}knowlegebase/category",'id=' . $cat_id . '')); + } + if ($submit and !sizeof($error)) { $uid = $bitfield = $options = ''; diff --git a/inc/functions_kb.php b/inc/functions_kb.php index 1f2bd4b..84e53f1 100644 --- a/inc/functions_kb.php +++ b/inc/functions_kb.php @@ -261,7 +261,8 @@ public function get_cat_info($category_id) { $sql = 'SELECT * FROM ' . KB_CAT_TABLE . " - WHERE category_id = $category_id"; + WHERE category_id = $category_id" . ' + ORDER BY left_id ASC'; $result = $this->db->sql_query($sql); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); diff --git a/styles/prosilver/template/kb_cat_body.html b/styles/prosilver/template/kb_cat_body.html index caa8724..26b0bc1 100644 --- a/styles/prosilver/template/kb_cat_body.html +++ b/styles/prosilver/template/kb_cat_body.html @@ -10,8 +10,10 @@

@@ -20,9 +22,11 @@

  • +
    {cat_row.CAT_NAME} -
    {cat_row.CAT_DESCRIPTION} +
    {cat_row.CAT_DESCRIPTION}
    {cat_row.SUBCATS} +
    {cat_row.ARTICLES}
    @@ -79,7 +83,7 @@

    - {art_row.ARTICLE}
    • {L_NEED_APPROOVE}
    + {art_row.ARTICLE}
    {art_row.ARTICLE_DESCRIPTION}
    • {L_NEED_APPROOVE}
    {art_row.ARTICLE_AUTHOR} {art_row.ARTICLE_DATE} diff --git a/styles/prosilver/template/kb_post_body.html b/styles/prosilver/template/kb_post_body.html index 786d0cc..76fa9b0 100644 --- a/styles/prosilver/template/kb_post_body.html +++ b/styles/prosilver/template/kb_post_body.html @@ -31,7 +31,7 @@

    {L_POST_A}

    -
    +