[ticket/208] Move includes files out of portal folder into includes
The includes files were inside a portal folder until now. This is no longer needed with the extension. B3P-208
This commit is contained in:
@@ -694,129 +694,6 @@ function get_portal_tracking_info($fetch_news)
|
||||
return $last_read;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will install the basic set of portal modules
|
||||
*
|
||||
* only set $purge_modules to false if you already know that the table is empty
|
||||
* set $u_action to where the user should be redirected after this
|
||||
* note that already existing data won't be deleted from the config and portal_config
|
||||
* just to make sure we don't overwrite anything, the IDs won't be reset
|
||||
* !! this function should usually only be executed once upon installing the portal !!
|
||||
* DO NOT set $purge_modules to false unless you want to auto-add all modules again after deleting them (i.e. if your database was corrupted)
|
||||
*/
|
||||
function board3_basic_install($mode = 'install', $purge_modules = true, $u_action = '')
|
||||
{
|
||||
global $db, $phpbb_root_path, $phpEx, $cache, $user, $table_prefix, $config;
|
||||
|
||||
// Shouldn't happen but we should check this nonetheless
|
||||
if (!defined('PORTAL_MODULES_TABLE'))
|
||||
{
|
||||
include($phpbb_root_path . 'portal/includes/constants.' . $phpEx);
|
||||
}
|
||||
|
||||
if ($mode == 'install')
|
||||
{
|
||||
$directory = $phpbb_root_path . 'portal/modules/';
|
||||
|
||||
if ($purge_modules)
|
||||
{
|
||||
$sql = 'DELETE FROM ' . PORTAL_MODULES_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
/*
|
||||
* this is a list of the basic modules that will be installed
|
||||
* module_name => array(module_column, module_order)
|
||||
*/
|
||||
$modules_ary = array(
|
||||
// left column
|
||||
'portal_main_menu' => array(1, 1),
|
||||
'portal_stylechanger' => array(1, 2),
|
||||
'portal_birthday_list' => array(1, 3),
|
||||
'portal_clock' => array(1, 4),
|
||||
'portal_search' => array(1, 5),
|
||||
'portal_attachments' => array(1, 7),
|
||||
'portal_topposters' => array(1, 8),
|
||||
'portal_latest_members' => array(1, 9),
|
||||
'portal_link_us' => array(1, 10),
|
||||
|
||||
// center column
|
||||
'portal_welcome' => array(2, 1),
|
||||
'portal_recent' => array(2, 2),
|
||||
'portal_announcements' => array(2, 3),
|
||||
'portal_news' => array(2, 4),
|
||||
'portal_poll' => array(2, 5),
|
||||
'portal_whois_online' => array(2, 6),
|
||||
|
||||
// right column
|
||||
'portal_user_menu' => array(3, 1),
|
||||
'portal_statistics' => array(3, 2),
|
||||
'portal_calendar' => array(3, 3),
|
||||
'portal_leaders' => array(3, 4),
|
||||
'portal_latest_bots' => array(3, 5),
|
||||
'portal_links' => array(3, 6),
|
||||
);
|
||||
|
||||
foreach ($modules_ary as $module_name => $module_data)
|
||||
{
|
||||
$class_name = $module_name . '_module';
|
||||
if (!class_exists($class_name))
|
||||
{
|
||||
include($directory . $module_name . '.' . $phpEx);
|
||||
}
|
||||
if (!class_exists($class_name))
|
||||
{
|
||||
trigger_error('CLASS_NOT_FOUND', E_USER_ERROR);
|
||||
}
|
||||
|
||||
$c_class = new $class_name();
|
||||
|
||||
$sql_ary = array(
|
||||
'module_classname' => substr($module_name, 7),
|
||||
'module_column' => $module_data[0],
|
||||
'module_order' => $module_data[1],
|
||||
'module_name' => $c_class->name,
|
||||
'module_image_src' => $c_class->image_src,
|
||||
'module_group_ids' => '',
|
||||
'module_image_width' => 16,
|
||||
'module_image_height' => 16,
|
||||
'module_status' => B3_MODULE_ENABLED,
|
||||
);
|
||||
$sql = 'INSERT INTO ' . PORTAL_MODULES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
$db->sql_query($sql);
|
||||
|
||||
$c_class->install($db->sql_nextid());
|
||||
}
|
||||
|
||||
// Make sure we get rid of old data
|
||||
$cache->destroy('portal_modules');
|
||||
|
||||
return $user->lang['PORTAL_BASIC_INSTALL'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$skip_entries = array(
|
||||
'board3_right_column_width',
|
||||
'board3_left_column_width',
|
||||
'board3_forum_index',
|
||||
'board3_version_check',
|
||||
'board3_right_column',
|
||||
'board3_left_column',
|
||||
'board3_enable',
|
||||
'board3_portal_version',
|
||||
'board3_phpbb_menu',
|
||||
'board3_display_jumpbox',
|
||||
);
|
||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE config_name ' . $db->sql_like_expression(utf8_clean_string('board3_') . $db->any_char) . '
|
||||
AND ' . $db->sql_in_set('config_name', $skip_entries, true);
|
||||
$db->sql_query($sql);
|
||||
|
||||
return $user->lang['PORTAL_BASIC_UNINSTALL'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check if the entered source file actually exists
|
||||
*/
|
||||
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user