session_begin(); $auth->acl($user->data); $user->setup('mods/portal'); if (!$config['board3_enable']) { redirect(reapply_sid($phpbb_root_path . 'index.' . $phpEx)); } $portal_config = obtain_portal_config(); $sql = 'SELECT * FROM ' . PORTAL_MODULES_TABLE . ' ORDER BY module_order ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $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(); if ($module->language) { $user->add_lang('mods/portal/' . $module->language); } if ($row['module_column'] == 1) { $template_module = $module->get_template_side($row['module_id']); $template_column = 'left'; } if ($row['module_column'] == 2) { $template_module = $module->get_template_center($row['module_id']); $template_column = 'center'; } if ($row['module_column'] == 3) { $template_module = $module->get_template_side($row['module_id']); $template_column = 'right'; } if ($row['module_column'] == 4) { $template_module = $module->get_template_center($row['module_id']); } if ($row['module_column'] == 5) { $template_module = $module->get_template_center($row['module_id']); } if (!$template_module) { 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'], )); } 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'], )); } unset($template_module); } $db->sql_freeresult($result); // 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'], )); // 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(); ?>