Что я зделал не так?: portal:
Код: Выделить всё
<?php
/**
*
* @package Board3 Portal v2
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
define('IN_PORTAL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'portal/includes/constants.' . $phpEx);
$portal_root_path = PORTAL_ROOT_PATH;
include($phpbb_root_path . $portal_root_path . 'includes/functions_modules.' . $phpEx);
include($phpbb_root_path . $portal_root_path . 'includes/functions.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/portal');
if ($config['bb3topics_enable'])
{
include($phpbb_root_path . 'includes/bb3topics.'.$phpEx);
}
if (!class_exists('CGP') && $config['cgp_enabled'])
{
include($phpbb_root_path . 'includes/cache_guests_pages.' . $phpEx);
}
if (defined('CGP_ENABLED'))
{
if (CGP::is_cacheable_user($user) &&
!request_var('ap', 0) && !request_var('np', 0) && !request_var('tp', 0) && !request_var('lr', 0))
{
define('CGP_KEY', '_portal' . CGP::user_type_suffix($user));
CGP::display_if_cached(CGP_KEY);
}
}
$user_tracker_options=my_split_config($user->data['user_tracker_options'], 3, 'my_int_val');
/**
* Make sure we do an isset first,
* else we will get errors if someone uninstalls the portal and forgets to remove portal.php
*/
if (!isset($config['board3_enable']) || !$config['board3_enable'] || !$auth->acl_get('u_view_portal') || $user_tracker_options[0])
{
redirect(append_sid($phpbb_root_path . 'index.' . $phpEx));
}
/**
* get initial data
*/
$portal_config = obtain_portal_config();
$portal_modules = obtain_portal_modules();
/**
* set up column_count array
* with this we can hide unneeded parts of the portal
*/
$module_count = array(
'total' => 0,
'top' => 0,
'left' => 0,
'center' => 0,
'right' => 0,
'bottom' => 0,
);
/**
* start assigning block vars
*/
foreach ($portal_modules as $row)
{
if($row['module_status'] == B3_MODULE_DISABLED)
{
continue;
}
$class_name = 'portal_' . $row['module_classname'] . '_module';
if (!class_exists($class_name))
{
include("{$phpbb_root_path}{$portal_root_path}modules/portal_{$row['module_classname']}.$phpEx");
}
if (!class_exists($class_name))
{
trigger_error(sprintf($user->lang['CLASS_NOT_FOUND'], $class_name, 'portal_' . $row['module_classname']), E_USER_ERROR);
}
$module = new $class_name();
/**
* Check for permissions before loading anything
* the default group of a user always defines his/her permission (KISS)
*/
$group_ary = (!empty($row['module_group_ids'])) ? explode(',', $row['module_group_ids']) : '';
if ((is_array($group_ary) && !in_array($user->data['group_id'], $group_ary)))
{
continue;
}
if ($module->language)
{
$user->add_lang('mods/portal/' . $module->language);
}
if ($row['module_column'] == column_string_num('left') && $config['board3_left_column'])
{
$template_module = $module->get_template_side($row['module_id']);
$template_column = 'left';
++$module_count['left'];
}
if ($row['module_column'] == column_string_num('center'))
{
$template_module = $module->get_template_center($row['module_id']);
$template_column = 'center';
++$module_count['center'];
}
if ($row['module_column'] == column_string_num('right') && $config['board3_right_column'])
{
$template_module = $module->get_template_side($row['module_id']);
$template_column = 'right';
++$module_count['right'];
}
if ($row['module_column'] == column_string_num('top'))
{
$template_module = $module->get_template_center($row['module_id']);
++$module_count['top'];
}
if ($row['module_column'] == column_string_num('bottom'))
{
$template_module = $module->get_template_center($row['module_id']);
++$module_count['bottom'];
}
if (!isset($template_module) || $template_module===false)
{
continue;
}
// Custom Blocks that have been defined in the ACP will return an array instead of just the name of the template file
if (is_array($template_module))
{
$template->assign_block_vars('modules_' . column_num_string($row['module_column']), array(
'TEMPLATE_FILE' => 'portal/modules/' . $template_module['template'],
'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $template_module['image_src'],
'TITLE' => $template_module['title'],
'CODE' => $template_module['code'],
'MODULE_ID' => $row['module_id'],
'IMAGE_WIDTH' => $row['module_image_width'],
'IMAGE_HEIGHT' => $row['module_image_height'],
));
}
else
{
$template->assign_block_vars('modules_' . column_num_string($row['module_column']), array(
'TEMPLATE_FILE' => 'portal/modules/' . $template_module,
'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $row['module_image_src'],
'IMAGE_WIDTH' => $row['module_image_width'],
'IMAGE_HEIGHT' => $row['module_image_height'],
'MODULE_ID' => $row['module_id'],
'TITLE' => (isset($user->lang[$row['module_name']])) ? $user->lang[$row['module_name']] : utf8_normalize_nfc($row['module_name']),
));
}
unset($template_module);
}
$module_count['total'] = sizeof($portal_modules);
// Redirect to index if there are currently no active modules
if($module_count['total'] < 1)
{
redirect(append_sid($phpbb_root_path . 'index.' . $phpEx));
}
// Assign specific vars
$template->assign_vars(array(
// 'S_SMALL_BLOCK' => true,
'S_PORTAL_LEFT_COLUMN' => $config['board3_left_column_width'],
'S_PORTAL_RIGHT_COLUMN' => $config['board3_right_column_width'],
'S_LEFT_COLUMN' => ($module_count['left'] > 0 && $config['board3_left_column']) ? true : false,
'S_CENTER_COLUMN' => ($module_count['center'] > 0) ? true : false,
'S_RIGHT_COLUMN' => ($module_count['right'] > 0 && $config['board3_right_column']) ? true : false,
'S_TOP_COLUMN' => ($module_count['top'] > 0) ? true : false,
'S_BOTTOM_COLUMN' => ($module_count['bottom'] > 0) ? true : false,
'S_DISPLAY_PHPBB_MENU' => $config['board3_phpbb_menu'],
'B3P_DISPLAY_JUMPBOX' => $config['board3_display_jumpbox'],
));
// Output page
page_header($user->lang['PORTAL']);
$template->set_filenames(array(
'body' => 'portal/portal_body.html')
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
, portal_body:
Код: Выделить всё
<!-- DEFINE $S_IN_PORTAL = 1 -->
<!-- INCLUDE overall_header.html -->
<!-- IF S_DISPLAY_BB3TOPICS -->
<!-- INCLUDE bb3topics.html -->
<!-- ENDIF -->
<!-- INCLUDE portal/_block_config.html -->
<!-- IF PORTAL_VERSION_CHECK and U_ACP -->
<div id="portal_version_check" class="rules">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_INFORMATION}:</strong> {PORTAL_VERSION_CHECK}
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<table id="portal-body" cellpadding="0" cellspacing="0" border="0" width="100%">
<!-- IF S_TOP_COLUMN -->
<tr>
<!-- [+] top module area -->
<td colspan="3">
<!-- BEGIN modules_top -->
<!-- DEFINE $TEMPLATE_FILE = '{modules_top.TEMPLATE_FILE}' -->
<!-- DEFINE $IMAGE_SRC = '{modules_top.IMAGE_SRC}' -->
<!-- DEFINE $IMAGE_WIDTH = '{modules_top.IMAGE_WIDTH}' -->
<!-- DEFINE $IMAGE_HEIGHT = '{modules_top.IMAGE_HEIGHT}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_top.CODE}' -->
<!-- DEFINE $TITLE = '{modules_top.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_top.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_top -->
</td>
<!-- [-] top module area -->
</tr>
<!-- ENDIF -->
<tr>
<!-- [+] left module area -->
<!-- IF S_LEFT_COLUMN -->
<td valign="top" style="width: {S_PORTAL_LEFT_COLUMN}; padding-<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->left<!-- ELSE -->right<!-- ENDIF -->: {$BLOCK_DISTANCE};">
<!-- BEGIN modules_left -->
<!-- DEFINE $TEMPLATE_FILE = '{modules_left.TEMPLATE_FILE}' -->
<!-- DEFINE $IMAGE_SRC = '{modules_left.IMAGE_SRC}' -->
<!-- DEFINE $IMAGE_WIDTH = '{modules_left.IMAGE_WIDTH}' -->
<!-- DEFINE $IMAGE_HEIGHT = '{modules_left.IMAGE_HEIGHT}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_left.CODE}' -->
<!-- DEFINE $TITLE = '{modules_left.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_left.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_left -->
</td>
<!-- ENDIF -->
<!-- [-] left module area -->
<!-- [+] center module area -->
<!-- IF S_CENTER_COLUMN -->
<td valign="top">
<!-- BEGIN modules_center -->
<!-- DEFINE $TEMPLATE_FILE = '{modules_center.TEMPLATE_FILE}' -->
<!-- DEFINE $IMAGE_SRC = '{modules_center.IMAGE_SRC}' -->
<!-- DEFINE $IMAGE_WIDTH = '{modules_center.IMAGE_WIDTH}' -->
<!-- DEFINE $IMAGE_HEIGHT = '{modules_center.IMAGE_HEIGHT}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_center.CODE}' -->
<!-- DEFINE $TITLE = '{modules_center.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_center.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_center -->
<!-- IF S_DISPLAY_JUMPBOX and B3P_DISPLAY_JUMPBOX -->
<br />
<!-- INCLUDE portal/modules/jumpbox.html -->
<!-- ENDIF -->
</td>
<!-- ENDIF -->
<!-- [-] center module area -->
<!-- [+] right module area -->
<!-- IF S_RIGHT_COLUMN -->
<td valign="top" style="width: {S_PORTAL_RIGHT_COLUMN}; padding-<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->: {$BLOCK_DISTANCE};">
<!-- BEGIN modules_right -->
<!-- DEFINE $TEMPLATE_FILE = '{modules_right.TEMPLATE_FILE}' -->
<!-- DEFINE $IMAGE_SRC = '{modules_right.IMAGE_SRC}' -->
<!-- DEFINE $IMAGE_WIDTH = '{modules_right.IMAGE_WIDTH}' -->
<!-- DEFINE $IMAGE_HEIGHT = '{modules_right.IMAGE_HEIGHT}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_right.CODE}' -->
<!-- DEFINE $TITLE = '{modules_right.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_right.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_right -->
</td>
<!-- ENDIF -->
<!-- [-] right module area -->
</tr>
<!-- IF S_BOTTOM_COLUMN -->
<tr>
<!-- [+] bottom module area -->
<td colspan="3">
<!-- BEGIN modules_bottom -->
<!-- DEFINE $TEMPLATE_FILE = '{modules_bottom.TEMPLATE_FILE}' -->
<!-- DEFINE $IMAGE_SRC = '{modules_bottom.IMAGE_SRC}' -->
<!-- DEFINE $IMAGE_WIDTH = '{modules_bottom.IMAGE_WIDTH}' -->
<!-- DEFINE $IMAGE_HEIGHT = '{modules_bottom.IMAGE_HEIGHT}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_bottom.CODE}' -->
<!-- DEFINE $TITLE = '{modules_bottom.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_bottom.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_bottom -->
</td>
<!-- [-] bottom module area -->
</tr>
<!-- ENDIF -->
</table>
<!--// board3 Portal by www.board3.de //-->
<div class="copyright">Powered by <a href="http://www.board3.de/">Board3 Portal</a> © 2009 - 2011 Board3 Group</div>
<!-- INCLUDE overall_footer.html -->