Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mod to change the category for the KB article when editing it
#1
OK, so I found it was rather strange that when you edit a KB article, you can't change the category, so I decided to mod it so that it would be able to change it. lol Let's take a gander:

In /admin/pages/kb.php

FIND:
PHP Code:
$db->query("UPDATE `<PRE>articles` SET `name` = '{$main->postvar['editname']}', `content` = '{$main->postvar['editdescription']}' WHERE `id` = '{$main->postvar['id']}'"); 

REPLACE IT WITH:
PHP Code:
$db->query("UPDATE `<PRE>articles` SET `name` = '{$main->postvar['editname']}', `content` = '{$main->postvar['editdescription']}', catid = '{$main->postvar['catid']}' WHERE `id` = '{$main->postvar['id']}'"); 


In /includes/tpl/support/acp.tpl

FIND:
PHP Code:
<form action="" method="post" name="edit%NAME%">
    <
div class="subborder" id="editbox" style="display:none;">
        <
div class="sub">
          <
table width="100%" border="0" cellspacing="2" cellpadding="0">
            <
tr>
                <
td colspan="2"><strong>Edit %NAME%</strong></td>
            </
tr>
            <
tr>
                <
td width="20%">%SUB%:</td>
                <
td><input name="editname" type="text" id="editname" size="40" /></td>
            </
tr

REPLACE IT WITH:
PHP Code:
<form action="" method="post" name="edit%NAME%">
    <
div class="subborder" id="editbox" style="display:none;">
        <
div class="sub">
          <
table width="100%" border="0" cellspacing="2" cellpadding="0">
            <
tr>
                <
td colspan="2"><strong>Edit %NAME%</strong></td>
            </
tr>
            %
CATID%
            <
tr>
                <
td width="20%">%SUB%:</td>
                <
td><input name="editname" type="text" id="editname" size="40" /></td>
            </
tr>
[
php
---
See my GitHub at https://github.com/cozylife
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)