também eu gostaria de remover os seguintes ítens:
...
2) Artigos relacionados (plugin).
3) Avalie este artigo (plugin).
Bem, os arquivos respectivos aos itens supracitados são:
-
includes/kb_plugins/kb_related_articles.php
-
includes/kb_plugins/kb_rating.php
A ideia é tentar copiar a condição no
ACP de "
ativar" e "
desativar" de outros módulos, como o
kb_random_article.php, o
kb_latest_article.php e o
kb_categories.php, e incluir nestes 2 módulos.
Como não sou programador, não sei se dará certo, mas também se não der certo não irá provocar nenhum incêndio.

Então, vamos lá.
Substitua o conteúdo dos arquivos citados abaixo pelo respectivo conteúdo dentro do BBcode
Code:
-
includes/kb_plugins/kb_related_articles.php
Código: Selecionar todos
<?php
/**
*
* @package phpBB Knowledge Base Mod (KB)
* @version $Id: kb_related_articles.php 420 2010-01-13 14:36:10Z softphp $
* @copyright (c) 2009 Andreas Nexmann, Tom Martin
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
// Only add these options if in acp
if (defined('IN_KB_PLUGIN'))
{
$acp_options['legend1'] = 'RELATED_ARTICLES';
$acp_options['kb_related_articles_enable'] = array('lang' => 'ENABLE_RELATED_ARTICLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false);
$acp_options['kb_related_articles'] = array('lang' => 'KB_SHOW_RELART', 'validate' => 'int', 'type' => 'text:3:5', 'explain' => true);
$acp_options['kb_related_articles_menu'] = array('lang' => 'WHICH_MENU', 'validate' => 'int', 'type' => 'custom', 'function' => 'select_menu_check', 'explain' => false);
$details = array(
'PLUGIN_NAME' => 'PLUGIN_RELATED',
'PLUGIN_DESC' => 'PLUGIN_RELATED_DESC',
'PLUGIN_COPY' => 'PLUGIN_COPY',
'PLUGIN_VERSION' => '1.0.1',
'PLUGIN_MENU' => RIGHT_MENU,
'PLUGIN_PERM' => true,
'PLUGIN_PAGES' => array('view_article'),
);
}
// Get latest article
function related_articles($cat_id = 0)
{
global $template;
if (!$config['kb_related_articles_enable'])
{
return;
}
// Everything parsed through kb.php and kb_functions.php
$content = kb_parse_template('related_articles', 'related_articles.html');
return $content;
}
function related_articles_versions()
{
$versions = array(
'1.0.0' => array(
'config_add' => array(
//array('kb_related_articles', 5),
array('kb_related_menu', RIGHT_MENU),
),
),
'1.0.1' => array(
'config_remove' => array(
array('kb_related_menu'),
),
'config_add' => array(
array('kb_related_articles_enable', 1),
array('kb_related_articles_menu', RIGHT_MENU),
),
),
);
return $versions;
}
?>
-
includes/kb_plugins/kb_rating.php
Código: Selecionar todos
<?php
/**
*
* @package phpBB Knowledge Base Mod (KB)
* @version $Id: kb_rating.php 420 2010-01-13 14:36:10Z softphp $
* @copyright (c) 2009 Andreas Nexmann, Tom Martin
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
// Only add these options if in acp
if (defined('IN_KB_PLUGIN'))
{
$acp_options['legend1'] = 'KB_SORT_RATING';
$acp_options['kb_rating_enable'] = array('lang' => 'ENABLE_RATING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false);
$acp_options['kb_rating_menu'] = array('lang' => 'WHICH_MENU', 'validate' => 'int', 'type' => 'custom', 'function' => 'select_menu_check', 'explain' => false);
$details = array(
'PLUGIN_NAME' => 'PLUGIN_RATE',
'PLUGIN_DESC' => 'PLUGIN_RATE_DESC',
'PLUGIN_COPY' => 'PLUGIN_COPY',
'PLUGIN_VERSION' => '1.0.0',
'PLUGIN_MENU' => LEFT_MENU,
'PLUGIN_PERM' => true,
'PLUGIN_PAGES' => array('view_article'),
);
}
// Get latest article
function rating()
{
global $template;
if (!$config['kb_rating_enable'])
{
return;
}
// Everything parsed in kb.php
$content = kb_parse_template('rating', 'rating.html');
return $content;
}
function rating_versions()
{
$versions = array(
'1.0.0' => array(
'config_add' => array(
array('kb_rating_enable', 1),
array('kb_rating_menu', LEFT_MENU),
),
),
);
return $versions;
}
?>
- Abra o
arquivo /language/pt_br/mods/kb.php, ache a linha...
'ENABLE_RANDOM_ARTICLES' => 'Ativar artigo aleatório',... e
adicione após, em nova linha:
Código: Selecionar todos
'ENABLE_RATING' => 'Ativar a avaliação do artigo',
'ENABLE_RELATED_ARTICLES' => 'Ativar artigos relacionados',
Abraço.
