Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mod to see KB articles in a category by clicking the category in admin area
#1
Hey, I made a mod to add links to the KB area. This mod makes the names of the categories and the names of the articles, into a link. They use the same template, so I had to make it compatible with both places and I thought that having the article names' link, open the edit box. When you go to the categories section, the links on the category names will link you to the articles area and show only the articles listed under that category. This way it isn't a guessing game as to what categories are where. You can click the categories link on the left still and it will show you all of the articles still.

Here's how to do it.

In /includes/tpl/support/acpbox.tpl

FIND:
PHP Code:
<td width="94%"><strong>%NAME%</strong><br />%DESCRIPTION%</td

REPLACE IT WITH:
PHP Code:
<td width="94%"><a href="%SHOWLINK%" style="text-decoration:none;"><strong>%NAME%</strong></a><br />%DESCRIPTION%</td


In: /admin/pages/kb.php

FIND:
PHP Code:
$array2['NAME'] = $data['name'];
                                                
$array2['DESCRIPTION'] = $data['description'];
                                                
$array2['ID'] = $data['id'];
                                                
$array2['LINK'] = "cat"


ADD BELOW IT:
PHP Code:
$array2['SHOWLINK'] = "?page=kb&sub=art&catid=".$data['id']; 


FIND:
PHP Code:
if($main->getvar['del']) {
                                        
$db->query("DELETE FROM `<PRE>articles` WHERE `id` = '{$main->getvar['del']}'");
                                        
$main->errors("Article Deleted!");
                                        
//$main->done();
                                



ADD BELOW IT:
PHP Code:
if($main->getvar['catid']) {
                                        
$show_cat " WHERE catid = '".$main->getvar['catid']."'";
                                } 


FIND:
PHP Code:
$query $db->query("SELECT * FROM `<PRE>articles`"); 

REPLACE IT WITH:
PHP Code:
$query $db->query("SELECT * FROM `<PRE>articles`".$show_cat); 


FIND:
PHP Code:
$array2['NAME'] = $data['name'];
                                                
$array2['DESCRIPTION'] = "";
                                                
$array2['ID'] = $data['id'];
                                                
$array2['LINK'] = "art"


ADD BELOW IT:
PHP Code:
$array2['SHOWLINK'] = "Javascript:editme('".$data['id']."')"
---
See my GitHub at https://github.com/cozylife
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)