Enabled turning off left and right column in portal.php
This commit is contained in:
@@ -40,6 +40,19 @@ if (!isset($config['board3_enable']) || !$config['board3_enable'] || !$auth->acl
|
||||
|
||||
$portal_config = obtain_portal_config();
|
||||
|
||||
/*
|
||||
* set up column_count array
|
||||
*/
|
||||
$module_count = array(
|
||||
'total' => 0,
|
||||
'top' => 0,
|
||||
'left' => 0,
|
||||
'center' => 0,
|
||||
'right' => 0,
|
||||
'bottom' => 0,
|
||||
);
|
||||
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
ORDER BY module_order ASC';
|
||||
@@ -70,30 +83,35 @@ while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user->add_lang('mods/portal/' . $module->language);
|
||||
}
|
||||
if ($row['module_column'] == 1)
|
||||
if ($row['module_column'] == 1 && $config['board3_left_column'])
|
||||
{
|
||||
$template_module = $module->get_template_side($row['module_id']);
|
||||
$template_column = 'left';
|
||||
++$module_count['left'];
|
||||
}
|
||||
if ($row['module_column'] == 2)
|
||||
{
|
||||
$template_module = $module->get_template_center($row['module_id']);
|
||||
$template_column = 'center';
|
||||
++$module_count['center'];
|
||||
}
|
||||
if ($row['module_column'] == 3)
|
||||
if ($row['module_column'] == 3 && $config['board3_right_column'])
|
||||
{
|
||||
$template_module = $module->get_template_side($row['module_id']);
|
||||
$template_column = 'right';
|
||||
++$module_count['right'];
|
||||
}
|
||||
if ($row['module_column'] == 4)
|
||||
{
|
||||
$template_module = $module->get_template_center($row['module_id']);
|
||||
++$module_count['top'];
|
||||
}
|
||||
if ($row['module_column'] == 5)
|
||||
{
|
||||
$template_module = $module->get_template_center($row['module_id']);
|
||||
++$module_count['bottom'];
|
||||
}
|
||||
if (!$template_module)
|
||||
if (!isset($template_module))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -119,11 +137,11 @@ while ($row = $db->sql_fetchrow($result))
|
||||
}
|
||||
unset($template_module);
|
||||
}
|
||||
$module_count = $db->sql_affectedrows();
|
||||
$module_count['total'] = $db->sql_affectedrows();
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Redirect to index if there are currently no active modules
|
||||
if($module_count < 1)
|
||||
if($module_count['total'] < 1)
|
||||
{
|
||||
redirect(reapply_sid($phpbb_root_path . 'index.' . $phpEx));
|
||||
}
|
||||
@@ -133,6 +151,11 @@ $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) ? true : false,
|
||||
'S_CENTER_COLUMN' => ($module_count['center'] > 0) ? true : false,
|
||||
'S_RIGHT_COLUMN' => ($module_count['right'] > 0) ? true : false,
|
||||
'S_TOP_COLUMN' => ($module_count['top'] > 0) ? true : false,
|
||||
'S_BOTTOM_COLUMN' => ($module_count['bottom'] > 0) ? true : false,
|
||||
));
|
||||
|
||||
// Output page
|
||||
@@ -146,4 +169,4 @@ make_jumpbox(append_sid("{$phpbb_root_path}viewforum . $phpEx"));
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<!-- ENDIF -->
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<!-- IF S_TOP_COLUMN -->
|
||||
<tr>
|
||||
<!-- [+] top module area -->
|
||||
<td colspan="3">
|
||||
@@ -25,8 +26,10 @@
|
||||
</td>
|
||||
<!-- [-] top module area -->
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<tr>
|
||||
<!-- [+] left module area -->
|
||||
<!-- IF S_LEFT_COLUMN -->
|
||||
<td valign="top" style="width: {S_PORTAL_LEFT_COLUMN}px; padding-right: {$BLOCK_DISTANCE};">
|
||||
<!-- BEGIN modules_left -->
|
||||
<!-- DEFINE $TEMPLATE_FILE = '{modules_left.TEMPLATE_FILE}' -->
|
||||
@@ -37,9 +40,11 @@
|
||||
<!-- 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}' -->
|
||||
@@ -54,9 +59,11 @@
|
||||
<!-- 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}px; padding-left: {$BLOCK_DISTANCE};">
|
||||
<!-- BEGIN modules_right -->
|
||||
<!-- DEFINE $TEMPLATE_FILE = '{modules_right.TEMPLATE_FILE}' -->
|
||||
@@ -67,8 +74,10 @@
|
||||
<!-- INCLUDE {$TEMPLATE_FILE} -->
|
||||
<!-- END modules_right -->
|
||||
</td>
|
||||
<!-- ENDIF -->
|
||||
<!-- [-] right module area -->
|
||||
</tr>
|
||||
<!-- IF S_BOTTOM_COLUMN -->
|
||||
<tr>
|
||||
<!-- [+] bottom module area -->
|
||||
<td colspan="3">
|
||||
@@ -83,9 +92,10 @@
|
||||
</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 - 2010 Board3 Group</div>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
|
||||
Reference in New Issue
Block a user