Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion controller/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.'
Expand Down Expand Up @@ -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),
Expand Down
5 changes: 5 additions & 0 deletions controller/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
3 changes: 2 additions & 1 deletion inc/functions_kb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 7 additions & 3 deletions styles/prosilver/template/kb_cat_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ <h2>
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt>{L_CATEGORY}</dt>
<!-- BEGIN par_cat_row -->
<dt>{L_CATEGORY}<!-- IF par_cat_row.PAR_CAT_NAME --> - {par_cat_row.PAR_CAT_NAME}<!-- ENDIF --></dt>
<dd class="icons">{L_ARTICLES}</dd>
<!-- END par_cat_row -->
</dl>
</li>
</ul>
Expand All @@ -20,9 +22,11 @@ <h2>
<li class="row">
<dl>
<dt style="padding-left: 5px;">
<div class="list-inner">
<a href="{cat_row.U_CAT}" class="forumtitle">{cat_row.CAT_NAME}</a>
<!-- IF cat_row.CAT_DESCRIPTION --><br />{cat_row.CAT_DESCRIPTION}<!-- ENDIF -->
<!-- IF cat_row.CAT_DESCRIPTION --><br /><span>{cat_row.CAT_DESCRIPTION}</span><!-- ENDIF -->
<!-- IF cat_row.SUBCATS --><br /><span>{cat_row.SUBCATS}</span><!-- ENDIF -->
</div>
</dt>
<dd class="topics">{cat_row.ARTICLES}</dd>
</dl>
Expand Down Expand Up @@ -79,7 +83,7 @@ <h2>
<tbody>
<!-- BEGIN art_row -->
<tr class="bg1">
<td class="name">{art_row.ARTICLE}<!-- IF not art_row.S_APPROVED --><ul class="post-buttons" style="float: left; margin-top: -4px; margin-right: 4px;"><li><span style="cursor:default" title="{L_NEED_APPROOVE}" class="button icon-button info-icon"><span>{L_NEED_APPROOVE}</span></span></li></ul>
<td class="name">{art_row.ARTICLE}<br />{art_row.ARTICLE_DESCRIPTION}<!-- IF not art_row.S_APPROVED --><ul class="post-buttons" style="float: left; margin-top: -4px; margin-right: 4px;"><li><span style="cursor:default" title="{L_NEED_APPROOVE}" class="button icon-button info-icon"><span>{L_NEED_APPROOVE}</span></span></li></ul>
</a><!-- ENDIF --></td>
<td class="wievs">{art_row.ARTICLE_AUTHOR}</td>
<td class="joned">{art_row.ARTICLE_DATE}</td>
Expand Down
2 changes: 1 addition & 1 deletion styles/prosilver/template/kb_post_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3>{L_POST_A}</h3>
</dl>
<dl style="clear: left;">
<dt><label for="subject">{L_DESCR}:</label></dt>
<dd><input type="text" name="descr" id="subject" size="60" maxlength="60" tabindex="2" value="{DESCR}" class="inputbox autowidth" /></dd>
<dd><input type="text" name="descr" id="subject" size="60" maxlength="254" tabindex="2" value="{DESCR}" class="inputbox autowidth" /></dd>
</dl>
<!-- INCLUDE posting_buttons.html -->
<div id="smiley-box">
Expand Down