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();
|
$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 *
|
$sql = 'SELECT *
|
||||||
FROM ' . PORTAL_MODULES_TABLE . '
|
FROM ' . PORTAL_MODULES_TABLE . '
|
||||||
ORDER BY module_order ASC';
|
ORDER BY module_order ASC';
|
||||||
@@ -70,30 +83,35 @@ while ($row = $db->sql_fetchrow($result))
|
|||||||
{
|
{
|
||||||
$user->add_lang('mods/portal/' . $module->language);
|
$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_module = $module->get_template_side($row['module_id']);
|
||||||
$template_column = 'left';
|
$template_column = 'left';
|
||||||
|
++$module_count['left'];
|
||||||
}
|
}
|
||||||
if ($row['module_column'] == 2)
|
if ($row['module_column'] == 2)
|
||||||
{
|
{
|
||||||
$template_module = $module->get_template_center($row['module_id']);
|
$template_module = $module->get_template_center($row['module_id']);
|
||||||
$template_column = 'center';
|
$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_module = $module->get_template_side($row['module_id']);
|
||||||
$template_column = 'right';
|
$template_column = 'right';
|
||||||
|
++$module_count['right'];
|
||||||
}
|
}
|
||||||
if ($row['module_column'] == 4)
|
if ($row['module_column'] == 4)
|
||||||
{
|
{
|
||||||
$template_module = $module->get_template_center($row['module_id']);
|
$template_module = $module->get_template_center($row['module_id']);
|
||||||
|
++$module_count['top'];
|
||||||
}
|
}
|
||||||
if ($row['module_column'] == 5)
|
if ($row['module_column'] == 5)
|
||||||
{
|
{
|
||||||
$template_module = $module->get_template_center($row['module_id']);
|
$template_module = $module->get_template_center($row['module_id']);
|
||||||
|
++$module_count['bottom'];
|
||||||
}
|
}
|
||||||
if (!$template_module)
|
if (!isset($template_module))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -119,11 +137,11 @@ while ($row = $db->sql_fetchrow($result))
|
|||||||
}
|
}
|
||||||
unset($template_module);
|
unset($template_module);
|
||||||
}
|
}
|
||||||
$module_count = $db->sql_affectedrows();
|
$module_count['total'] = $db->sql_affectedrows();
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
// Redirect to index if there are currently no active modules
|
// 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));
|
redirect(reapply_sid($phpbb_root_path . 'index.' . $phpEx));
|
||||||
}
|
}
|
||||||
@@ -133,6 +151,11 @@ $template->assign_vars(array(
|
|||||||
'S_SMALL_BLOCK' => true,
|
'S_SMALL_BLOCK' => true,
|
||||||
'S_PORTAL_LEFT_COLUMN' => $config['board3_left_column_width'],
|
'S_PORTAL_LEFT_COLUMN' => $config['board3_left_column_width'],
|
||||||
'S_PORTAL_RIGHT_COLUMN' => $config['board3_right_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
|
// Output page
|
||||||
@@ -146,4 +169,4 @@ make_jumpbox(append_sid("{$phpbb_root_path}viewforum . $phpEx"));
|
|||||||
|
|
||||||
page_footer();
|
page_footer();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<!-- IF S_TOP_COLUMN -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- [+] top module area -->
|
<!-- [+] top module area -->
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
@@ -25,8 +26,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<!-- [-] top module area -->
|
<!-- [-] top module area -->
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- [+] left module area -->
|
<!-- [+] left module area -->
|
||||||
|
<!-- IF S_LEFT_COLUMN -->
|
||||||
<td valign="top" style="width: {S_PORTAL_LEFT_COLUMN}px; padding-right: {$BLOCK_DISTANCE};">
|
<td valign="top" style="width: {S_PORTAL_LEFT_COLUMN}px; padding-right: {$BLOCK_DISTANCE};">
|
||||||
<!-- BEGIN modules_left -->
|
<!-- BEGIN modules_left -->
|
||||||
<!-- DEFINE $TEMPLATE_FILE = '{modules_left.TEMPLATE_FILE}' -->
|
<!-- DEFINE $TEMPLATE_FILE = '{modules_left.TEMPLATE_FILE}' -->
|
||||||
@@ -37,9 +40,11 @@
|
|||||||
<!-- INCLUDE {$TEMPLATE_FILE} -->
|
<!-- INCLUDE {$TEMPLATE_FILE} -->
|
||||||
<!-- END modules_left -->
|
<!-- END modules_left -->
|
||||||
</td>
|
</td>
|
||||||
|
<!-- ENDIF -->
|
||||||
<!-- [-] left module area -->
|
<!-- [-] left module area -->
|
||||||
|
|
||||||
<!-- [+] center module area -->
|
<!-- [+] center module area -->
|
||||||
|
<!-- IF S_CENTER_COLUMN -->
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<!-- BEGIN modules_center -->
|
<!-- BEGIN modules_center -->
|
||||||
<!-- DEFINE $TEMPLATE_FILE = '{modules_center.TEMPLATE_FILE}' -->
|
<!-- DEFINE $TEMPLATE_FILE = '{modules_center.TEMPLATE_FILE}' -->
|
||||||
@@ -54,9 +59,11 @@
|
|||||||
<!-- INCLUDE portal/modules/jumpbox.html -->
|
<!-- INCLUDE portal/modules/jumpbox.html -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
|
<!-- ENDIF -->
|
||||||
<!-- [-] center module area -->
|
<!-- [-] center module area -->
|
||||||
|
|
||||||
<!-- [+] right module area -->
|
<!-- [+] right module area -->
|
||||||
|
<!-- IF S_RIGHT_COLUMN -->
|
||||||
<td valign="top" style="width: {S_PORTAL_RIGHT_COLUMN}px; padding-left: {$BLOCK_DISTANCE};">
|
<td valign="top" style="width: {S_PORTAL_RIGHT_COLUMN}px; padding-left: {$BLOCK_DISTANCE};">
|
||||||
<!-- BEGIN modules_right -->
|
<!-- BEGIN modules_right -->
|
||||||
<!-- DEFINE $TEMPLATE_FILE = '{modules_right.TEMPLATE_FILE}' -->
|
<!-- DEFINE $TEMPLATE_FILE = '{modules_right.TEMPLATE_FILE}' -->
|
||||||
@@ -67,8 +74,10 @@
|
|||||||
<!-- INCLUDE {$TEMPLATE_FILE} -->
|
<!-- INCLUDE {$TEMPLATE_FILE} -->
|
||||||
<!-- END modules_right -->
|
<!-- END modules_right -->
|
||||||
</td>
|
</td>
|
||||||
|
<!-- ENDIF -->
|
||||||
<!-- [-] right module area -->
|
<!-- [-] right module area -->
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- IF S_BOTTOM_COLUMN -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- [+] bottom module area -->
|
<!-- [+] bottom module area -->
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
@@ -83,9 +92,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<!-- [-] bottom module area -->
|
<!-- [-] bottom module area -->
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!--// board3 Portal by www.board3.de //-->
|
<!--// 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>
|
<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