@@ -24,35 +24,17 @@ if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
|
||||
{
|
||||
trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if (!function_exists('board3_basic_install'))
|
||||
{
|
||||
include($phpbb_root_path . 'portal/includes/functions.' . $phpEx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if we need to convert from Board3 Portal 1.0.6
|
||||
*/
|
||||
global $config;
|
||||
|
||||
if (!defined('PORTAL_CONFIG_TABLE'))
|
||||
{
|
||||
include($phpbb_root_path . 'portal/includes/constants.' . $phpEx);
|
||||
}
|
||||
|
||||
if (sql_table_exists(PORTAL_CONFIG_TABLE) && !isset($config['board3_portal_version']))
|
||||
{
|
||||
$portal_config = obtain_portal_config();
|
||||
|
||||
/**
|
||||
* We only allow conversions from Board3 Portal 1.0.6
|
||||
*/
|
||||
if (isset($portal_config['portal_version']) && $portal_config['portal_version'] == '1.0.6')
|
||||
{
|
||||
set_config('board3_portal_version', '1.0.6');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// The name of the mod to be displayed during installation.
|
||||
$mod_name = 'Board3 Portal';
|
||||
|
||||
@@ -84,174 +66,7 @@ $language_file = 'mods/info_acp_portal';
|
||||
* The version numbering must otherwise be compatible with the version_compare function - http://php.net/manual/en/function.version-compare.php
|
||||
*/
|
||||
$versions = array(
|
||||
'1.0.6' => array(
|
||||
'permission_add' => array(
|
||||
array('a_portal_manage', 1),
|
||||
),
|
||||
|
||||
'permission_set' => array(
|
||||
array('ADMINISTRATORS', 'a_manage_portal', 'group'),
|
||||
),
|
||||
|
||||
'table_add' => array(
|
||||
array(PORTAL_CONFIG_TABLE, array(
|
||||
'COLUMNS' => array(
|
||||
'config_name' => array('VCHAR:255', ''),
|
||||
'config_value'=> array('MTEXT', ''),
|
||||
),
|
||||
|
||||
'PRIMARY_KEY' => 'config_name',
|
||||
)),
|
||||
|
||||
),
|
||||
|
||||
'module_add' => array(
|
||||
array('acp', 'ACP_CAT_DOT_MODS', 'ACP_PORTAL_INFO'),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_GENERAL_INFO',
|
||||
'module_mode' => 'config',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_NEWS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_ANNOUNCEMENTS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_WELCOME_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_RECENT_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_WORDGRAPH_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_PAYPAL_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_ATTACHMENTS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_MEMBERS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_POLLS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_BOTS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_POSTER_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_MINICALENDAR_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_CUSTOMBLOCK_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_LINKS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_FRIENDS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
|
||||
array('acp', 'ACP_PORTAL_INFO', array(
|
||||
'module_basename' => 'portal',
|
||||
'module_langname' => 'ACP_PORTAL_BIRTHDAYS_INFO',
|
||||
'module_mode' => 'modules',
|
||||
'module_auth' => 'acl_a_manage_portal',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'2.0.0-a1' => array(
|
||||
'permission_remove' => array(
|
||||
'a_portal_manage',
|
||||
),
|
||||
|
||||
'permission_add' => array(
|
||||
array('u_view_portal', 1),
|
||||
array('a_manage_portal', 1),
|
||||
@@ -283,6 +98,14 @@ $versions = array(
|
||||
|
||||
'PRIMARY_KEY' => 'module_id',
|
||||
)),
|
||||
array(PORTAL_CONFIG_TABLE, array(
|
||||
'COLUMNS' => array(
|
||||
'config_name' => array('VCHAR:255', ''),
|
||||
'config_value'=> array('MTEXT', ''),
|
||||
),
|
||||
|
||||
'PRIMARY_KEY' => 'config_name',
|
||||
)),
|
||||
),
|
||||
|
||||
'config_add' => array(
|
||||
@@ -297,26 +120,6 @@ $versions = array(
|
||||
array('board3_display_jumpbox', 1, 0),
|
||||
),
|
||||
|
||||
'module_remove' => array(
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_GENERAL_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_NEWS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_ANNOUNCEMENTS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_WELCOME_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_RECENT_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_WORDGRAPH_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_PAYPAL_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_ATTACHMENTS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_MEMBERS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_POLLS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_BOTS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_POSTER_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_MINICALENDAR_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_CUSTOMBLOCK_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_LINKS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_FRIENDS_INFO'),
|
||||
array('acp', 'ACP_PORTAL_INFO', 'ACP_PORTAL_BIRTHDAYS_INFO'),
|
||||
),
|
||||
|
||||
'module_add' => array(
|
||||
array('acp', 'ACP_CAT_DOT_MODS', 'ACP_PORTAL'),
|
||||
|
||||
@@ -354,6 +157,10 @@ $versions = array(
|
||||
),
|
||||
|
||||
'2.0.0' => array(
|
||||
// no changes
|
||||
),
|
||||
|
||||
'2.0.1' => array(
|
||||
// no changes ... purge caches anyways
|
||||
'cache_purge' => array(
|
||||
'imageset',
|
||||
|
||||
@@ -126,7 +126,6 @@ $lang = array_merge($lang, array(
|
||||
// Install
|
||||
'PORTAL_BASIC_INSTALL' => 'Füge Basismodule hinzu',
|
||||
'PORTAL_BASIC_UNINSTALL' => 'Entferne Module von Datenbank',
|
||||
'PORTAL_CONVERT_SUCCESS' => 'Konvertiere von Board3 Portal 1.0.6 & füge Basismodule hinzu',
|
||||
|
||||
// Logs
|
||||
'LOG_PORTAL_CONFIG' => '<strong>Portal-Einstellungen geändert</strong><br />» %s',
|
||||
|
||||
@@ -125,7 +125,6 @@ $lang = array_merge($lang, array(
|
||||
// Install
|
||||
'PORTAL_BASIC_INSTALL' => 'Adding basic set of modules',
|
||||
'PORTAL_BASIC_UNINSTALL' => 'Removing modules from database',
|
||||
'PORTAL_CONVERT_SUCCESS' => 'Converting from Board3 Portal 1.0.6 & adding basic set of modules',
|
||||
|
||||
// Logs
|
||||
'LOG_PORTAL_CONFIG' => '<strong>Altered Portal settings</strong><br />» %s',
|
||||
|
||||
@@ -715,7 +715,7 @@ function board3_basic_install($mode = 'install', $purge_modules = true, $u_actio
|
||||
include($phpbb_root_path . 'portal/includes/constants.' . $phpEx);
|
||||
}
|
||||
|
||||
if ($mode == 'install' || $mode == 'update')
|
||||
if ($mode == 'install')
|
||||
{
|
||||
$directory = $phpbb_root_path . 'portal/modules/';
|
||||
|
||||
@@ -793,135 +793,7 @@ function board3_basic_install($mode = 'install', $purge_modules = true, $u_actio
|
||||
// Make sure we get rid of old data
|
||||
$cache->destroy('portal_modules');
|
||||
|
||||
if ($mode == 'update')
|
||||
{
|
||||
/**
|
||||
* Check if we need to convert from Board3 Portal 1.0.6
|
||||
*/
|
||||
global $config;
|
||||
|
||||
if ($config['board3_portal_version'] == '1.0.6')
|
||||
{
|
||||
$convert = true;
|
||||
$portal_config = obtain_portal_config();
|
||||
}
|
||||
else
|
||||
{
|
||||
$convert = false;
|
||||
}
|
||||
|
||||
if ($convert)
|
||||
{
|
||||
$portal_modules = obtain_portal_modules();
|
||||
|
||||
foreach ($portal_modules as $row)
|
||||
{
|
||||
switch($row['module_classname'])
|
||||
{
|
||||
case 'announcements':
|
||||
set_config('board3_announcements_style_' . $row['module_id'], $portal_config['portal_announcements_style']);
|
||||
set_config('board3_number_of_announcements_' . $row['module_id'], $portal_config['portal_number_of_announcements']);
|
||||
set_config('board3_announcements_day_' . $row['module_id'], $portal_config['portal_announcements_day']);
|
||||
set_config('board3_announcements_length_' . $row['module_id'], $portal_config['portal_announcements_length']);
|
||||
set_config('board3_global_announcements_forum_' . $row['module_id'], $portal_config['portal_global_announcements_forum']);
|
||||
set_config('board3_announcements_forum_exclude_' . $row['module_id'], $portal_config['portal_announcements_forum_exclude']);
|
||||
set_config('board3_announcements_archive_' . $row['module_id'], $portal_config['portal_announcements_archive']);
|
||||
set_config('board3_announcements_permissions_' . $row['module_id'], $portal_config['portal_announcements_permissions']);
|
||||
set_config('board3_show_announcements_replies_views_' . $row['module_id'], $portal_config['portal_show_announcements_replies_views']);
|
||||
break;
|
||||
|
||||
case 'attachments':
|
||||
set_config('board3_attachments_number_' . $row['module_id'], $portal_config['portal_attachments_number']);
|
||||
set_config('board3_attach_max_length_' . $row['module_id'], $portal_config['portal_attach_max_length']);
|
||||
set_config('board3_attachments_forum_ids_' . $row['module_id'], $portal_config['portal_attachments_forum_ids']);
|
||||
set_config('board3_attachments_forum_exclude_' . $row['module_id'], $portal_config['portal_attachments_forum_exclude']);
|
||||
set_config('board3_attachments_filetype_' . $row['module_id'], $portal_config['portal_attachments_filetype']);
|
||||
set_config('board3_attachments_exclude_' . $row['module_id'], $portal_config['portal_attachments_exclude']);
|
||||
break;
|
||||
|
||||
case 'birthday_list':
|
||||
set_config('board3_birthdays_ahead_' . $row['module_id'], 'portal_birthdays_ahead');
|
||||
break;
|
||||
|
||||
case 'calendar':
|
||||
set_config('board3_sunday_first_' . $row['module_id'], $portal_config['portal_sunday_first']);
|
||||
set_config('board3_calendar_today_color_' . $row['module_id'], $portal_config['portal_minicalendar_today_color']);
|
||||
set_config('board3_calendar_sunday_color_' . $row['module_id'], $portal_config['portal_minicalendar_sunday_color']);
|
||||
set_config('board3_long_month_' . $row['module_id'], $portal_config['portal_long_month']);
|
||||
break;
|
||||
|
||||
case 'donation':
|
||||
set_config('board3_pay_acc_' . $row['module_id'], $portal_config['portal_pay_acc']);
|
||||
break;
|
||||
|
||||
case 'friends':
|
||||
set_config('board3_max_online_friends_' . $row['module_id'], $portal_config['portal_max_online_friends']);
|
||||
break;
|
||||
|
||||
case 'latest_bots':
|
||||
set_config('board3_last_visited_bots_number_' . $row['module_id'], $portal_config['portal_last_visited_bots_number']);
|
||||
break;
|
||||
|
||||
case 'latest_members':
|
||||
set_config('board3_max_last_member_' . $row['module_id'], $portal_config['portal_max_last_member']);
|
||||
break;
|
||||
|
||||
case 'leaders':
|
||||
set_config('board3_leaders_ext_' . $row['module_id'], $portal_config['portal_leaders_ext']);
|
||||
break;
|
||||
|
||||
case 'news':
|
||||
set_config('board3_news_length_' . $row['module_id'], $portal_config['portal_news_length']);
|
||||
set_config('board3_news_forum_' . $row['module_id'], $portal_config['portal_news_forum']);
|
||||
set_config('board3_news_permissions_' . $row['module_id'], $portal_config['portal_news_permissions']);
|
||||
set_config('board3_number_of_news_' . $row['module_id'], $portal_config['portal_number_of_news']);
|
||||
set_config('board3_show_all_news_' . $row['module_id'], $portal_config['portal_show_all_news']);
|
||||
set_config('board3_news_exclude_' . $row['module_id'], $portal_config['portal_news_exclude']);
|
||||
set_config('board3_news_archive_' . $row['module_id'], $portal_config['portal_news_archive']);
|
||||
set_config('board3_news_show_last_' . $row['module_id'], $portal_config['portal_news_show_last']);
|
||||
set_config('board3_show_news_replies_views_' . $row['module_id'], $portal_config['portal_show_news_replies_views']);
|
||||
set_config('board3_news_style_' . $row['module_id'], $portal_config['portal_news_style']);
|
||||
break;
|
||||
|
||||
case 'poll':
|
||||
set_config('board3_poll_allow_vote_' . $row['module_id'], $portal_config['portal_poll_allow_vote']);
|
||||
set_config('board3_poll_topic_id_' . $row['module_id'], $portal_config['portal_poll_topic_id']);
|
||||
set_config('board3_poll_exclude_id_' . $row['module_id'], $portal_config['portal_poll_exclude_id']);
|
||||
set_config('board3_poll_hide_' . $row['module_id'], $portal_config['portal_poll_hide']);
|
||||
set_config('board3_poll_limit_' . $row['module_id'], $portal_config['portal_poll_limit']);
|
||||
break;
|
||||
|
||||
case 'recent':
|
||||
set_config('board3_max_topics_' . $row['module_id'], $portal_config['portal_max_topics']);
|
||||
set_config('board3_recent_title_limit_' . $row['module_id'], $portal_config['portal_recent_title_limit']);
|
||||
set_config('board3_recent_forum_' . $row['module_id'], $portal_config['portal_recent_forum']);
|
||||
set_config('board3_recent_exclude_forums_' . $row['module_id'], $portal_config['portal_exclude_forums']);
|
||||
break;
|
||||
|
||||
case 'topposters':
|
||||
set_config('board3_topposters_' . $row['module_id'], $portal_config['portal_max_most_poster']);
|
||||
break;
|
||||
|
||||
case 'welcome':
|
||||
set_portal_config('board3_welcome_message_' . $row['module_id'], $portal_config['portal_welcome_intro']);
|
||||
break;
|
||||
|
||||
default:
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
// Now that we are done, delete all data that seems useless to us
|
||||
$sql = 'DELETE FROM ' . PORTAL_CONFIG_TABLE . '
|
||||
WHERE config_name ' . $db->sql_like_expression(utf8_clean_string('portal_') . $db->any_char);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
return $user->lang['PORTAL_CONVERT_SUCCESS'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $user->lang['PORTAL_BASIC_INSTALL'];
|
||||
}
|
||||
return $user->lang['PORTAL_BASIC_INSTALL'];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user