Hi there,
I have written a simple block, that accuires article titles from PhpBB Knowledge Base Mod.
Board3 Portal v. 1.0.5
PhpBB Knowledge Base Mod v. 1.0.2RC3
Demo: http://busomania.pl/ (find block titled "Baza wiedzy") on left side column.
Files to be copied:
./root/portal/block/articles.php
./root/styles/prosilver/template/portal/block/articles.html
Files to be edited:
./root/portal.php
./root/styles/prosilver/template/portal/portal_left.html
EDITS:
Open: ./root/portal.php
Find:
Code: Select all
if($portal_config['portal_left_column'])
{
$template->assign_var('S_LEFT_COLUMN', true);
Code: Select all
include($phpbb_root_path . 'portal/block/articles.' . $phpEx);
Find:
Code: Select all
<!-- IF S_DISPLAY_MAINMENU -->
<!-- INCLUDE portal/block/main_menu.html -->
<!-- ENDIF -->
Code: Select all
<!-- IF CAT_LIST -->
<!-- INCLUDE portal/block/articles.html -->
<!-- ENDIF -->
Copy files from attachment, logon to ACP, purge cache. It's done.
Ok, since I can not add any attachments, here is a code for articles.php and articles.html.
Create file "articles.php" on location ./root/portal/block/ of your phpBB3 instalation:
Code: Select all
<?php
/**
*
* @package - Board3portal
* @version $Id: articles.php 001 2010-07-23 10:50:43Z t90 $
* @copyright (c) t90 (busomania.pl)
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
{
exit;
}
$sql = "SELECT * FROM `phpbb_articles` ORDER BY `phpbb_articles`.`article_id` ASC";
$result = mysql_query($sql);
$i = 0;
while($row = mysql_fetch_assoc($result))
{
$i++;
$template->assign_block_vars('articles', array(
'U_TITLE' => append_sid("{$phpbb_root_path}kb.$phpEx", 'a=' .$row['article_id']),
'TITLE' => $row['article_title'],
));
}
$cat_list = ($i > 0) ? true : false; //check if there is anything to show
// Assign index specific vars
$template->assign_vars(array(
'CAT_LIST' => $cat_list,
));
?>
Code: Select all
{$LR_BLOCK_H_L}<img src="{T_THEME_PATH}/images/icon_kb.gif" width="27" height="22" alt="{L_KB_EXPLAIN}">{L_KB}{$LR_BLOCK_H_R}
<div class="portal-navigation">
<div class="menutitle">{ILE}</div>
<ul>
<!-- BEGIN articles -->
<li><a href="{articles.U_TITLE}" title="{articles.TITLE}" title="{articles.TITLE}" alt="{articles.TITLE}">{articles.TITLE}</a></li>
<!-- END articles -->
</ul>
</div>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}