Re-added module IDs to config names
This commit is contained in:
@@ -133,7 +133,8 @@ class acp_portal
|
|||||||
if ($submit && $null['type'] == 'custom')
|
if ($submit && $null['type'] == 'custom')
|
||||||
{
|
{
|
||||||
$func = array($c_class, $null['submit']);
|
$func = array($c_class, $null['submit']);
|
||||||
call_user_func_array($func, $config_name);
|
$args = ($module_id != 0) ? array($config_name, $module_id) : $config_name;
|
||||||
|
call_user_func_array($func, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -225,7 +226,7 @@ class acp_portal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$args = array($this->new_config[$config_key], $config_key);
|
$args = array($this->new_config[$config_key], $config_key, $module_id);
|
||||||
$func = array($c_class, $vars['method']);
|
$func = array($c_class, $vars['method']);
|
||||||
$content = call_user_func_array($func, $args);
|
$content = call_user_func_array($func, $args);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,13 +51,13 @@ class portal_announcements_module
|
|||||||
global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path;
|
global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path;
|
||||||
|
|
||||||
$announcement = request_var('announcement', -1);
|
$announcement = request_var('announcement', -1);
|
||||||
$announcement = ($announcement > $config['board3_announcements_length'] -1) ? -1 : $announcement;
|
$announcement = ($announcement > $config['board3_announcements_length_' . $module_id] -1) ? -1 : $announcement;
|
||||||
$start = request_var('ap', 0);
|
$start = request_var('ap', 0);
|
||||||
$start = ($start < 0) ? 0 : $start;
|
$start = ($start < 0) ? 0 : $start;
|
||||||
|
|
||||||
// Fetch announcements from portal/includes/functions.php with check if "read full" is requested.
|
// Fetch announcements from portal/includes/functions.php with check if "read full" is requested.
|
||||||
$portal_announcement_length = ($announcement < 0) ? $config['board3_announcements_length'] : 0;
|
$portal_announcement_length = ($announcement < 0) ? $config['board3_announcements_length_' . $module_id] : 0;
|
||||||
$fetch_news = phpbb_fetch_posts($config['board3_global_announcements_forum'], $config['board3_announcements_permissions'], $config['board3_number_of_announcements'], $portal_announcement_length, $config['board3_announcements_day'], 'announcements', $start, $config['board3_announcements_forum_exclude']);
|
$fetch_news = phpbb_fetch_posts($config['board3_global_announcements_forum_' . $module_id], $config['board3_announcements_permissions_' . $module_id], $config['board3_number_of_announcements_' . $module_id], $portal_announcement_length, $config['board3_announcements_day_' . $module_id], 'announcements', $start, $config['board3_announcements_forum_exclude_' . $module_id]);
|
||||||
|
|
||||||
// Any announcements present? If not terminate it here.
|
// Any announcements present? If not terminate it here.
|
||||||
if (sizeof($fetch_news) == 0)
|
if (sizeof($fetch_news) == 0)
|
||||||
@@ -72,13 +72,13 @@ class portal_announcements_module
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Count number of posts for announcements archive, considering if permission check is dis- or enabled.
|
// Count number of posts for announcements archive, considering if permission check is dis- or enabled.
|
||||||
if ($config['board3_announcements_archive'])
|
if ($config['board3_announcements_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$permissions = $config['board3_announcements_permissions'];
|
$permissions = $config['board3_announcements_permissions_' . $module_id];
|
||||||
$forum_from = $config['board3_global_announcements_forum'];
|
$forum_from = $config['board3_global_announcements_forum_' . $module_id];
|
||||||
$forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
|
$forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
|
||||||
|
|
||||||
$time = ($config['board3_announcements_day'] == 0) ? 0 : $config['board3_announcements_day'];
|
$time = ($config['board3_announcements_day_' . $module_id] == 0) ? 0 : $config['board3_announcements_day_' . $module_id];
|
||||||
$post_time = ($time == 0) ? '' : 'AND topic_time > ' . (time() - $time * 86400);
|
$post_time = ($time == 0) ? '' : 'AND topic_time > ' . (time() - $time * 86400);
|
||||||
|
|
||||||
$str_where = '';
|
$str_where = '';
|
||||||
@@ -92,7 +92,7 @@ class portal_announcements_module
|
|||||||
$disallow_access = array();
|
$disallow_access = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['board3_announcements_forum_exclude'] == true)
|
if($config['board3_announcements_forum_exclude_' . $module_id] == true)
|
||||||
{
|
{
|
||||||
$disallow_access = array_merge($disallow_access, $forum_from);
|
$disallow_access = array_merge($disallow_access, $forum_from);
|
||||||
$forum_from = array();
|
$forum_from = array();
|
||||||
@@ -171,9 +171,9 @@ class portal_announcements_module
|
|||||||
$read_full_url = (isset($_GET['ap'])) ? 'ap='. $start . '&announcement=' . $i . '#a' . $i : 'announcement=' . $i . '#a' . $i;
|
$read_full_url = (isset($_GET['ap'])) ? 'ap='. $start . '&announcement=' . $i . '#a' . $i : 'announcement=' . $i . '#a' . $i;
|
||||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||||
|
|
||||||
if ($config['board3_announcements_archive'])
|
if ($config['board3_announcements_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_announcements, $config['board3_number_of_announcements'], $start, 'announcements');
|
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_announcements, $config['board3_number_of_announcements_' . $module_id], $start, 'announcements');
|
||||||
}
|
}
|
||||||
|
|
||||||
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
|
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
|
||||||
@@ -265,12 +265,12 @@ class portal_announcements_module
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($config['board3_number_of_announcements'] != 0 && $config['board3_announcements_archive'])
|
if ($config['board3_number_of_announcements_' . $module_id] != 0 && $config['board3_announcements_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'AP_PAGINATION' => $pagination,
|
'AP_PAGINATION' => $pagination,
|
||||||
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
|
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
|
||||||
'AP_PAGE_NUMBER' => on_page($total_announcements, $config['board3_number_of_announcements'], $start))
|
'AP_PAGE_NUMBER' => on_page($total_announcements, $config['board3_number_of_announcements_' . $module_id], $start))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,9 +290,9 @@ class portal_announcements_module
|
|||||||
|
|
||||||
$read_full_url = (isset($_GET['ap'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "ap=$start#a$i") : append_sid("{$phpbb_root_path}portal.$phpEx#a$i");
|
$read_full_url = (isset($_GET['ap'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "ap=$start#a$i") : append_sid("{$phpbb_root_path}portal.$phpEx#a$i");
|
||||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||||
if ($config['board3_announcements_archive'])
|
if ($config['board3_announcements_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_announcements, $config['board3_number_of_announcements'], $start, 'announcements');
|
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_announcements, $config['board3_number_of_announcements_' . $module_id], $start, 'announcements');
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('announcements_row', array(
|
$template->assign_block_vars('announcements_row', array(
|
||||||
@@ -330,12 +330,12 @@ class portal_announcements_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['board3_number_of_announcements'] <> 0 && $config['board3_announcements_archive'])
|
if ($config['board3_number_of_announcements_' . $module_id] <> 0 && $config['board3_announcements_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'AP_PAGINATION' => $pagination,
|
'AP_PAGINATION' => $pagination,
|
||||||
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
|
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
|
||||||
'AP_PAGE_NUMBER' => on_page($total_announcements, $config['board3_number_of_announcements'], $start))
|
'AP_PAGE_NUMBER' => on_page($total_announcements, $config['board3_number_of_announcements_' . $module_id], $start))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,11 +352,11 @@ class portal_announcements_module
|
|||||||
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
|
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
|
||||||
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
||||||
'S_DISPLAY_ANNOUNCEMENTS' => true,
|
'S_DISPLAY_ANNOUNCEMENTS' => true,
|
||||||
'S_DISPLAY_ANNOUNCEMENTS_RVS' => ($config['board3_show_announcements_replies_views']) ? true : false,
|
'S_DISPLAY_ANNOUNCEMENTS_RVS' => ($config['board3_show_announcements_replies_views_' . $module_id]) ? true : false,
|
||||||
'S_TOPIC_ICONS' => $topic_icons,
|
'S_TOPIC_ICONS' => $topic_icons,
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($config['board3_announcements_style'])
|
if ($config['board3_announcements_style_' . $module_id])
|
||||||
{
|
{
|
||||||
return 'announcements_compact.html';
|
return 'announcements_compact.html';
|
||||||
}
|
}
|
||||||
@@ -372,15 +372,15 @@ class portal_announcements_module
|
|||||||
'title' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
|
'title' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
|
'legend1' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
|
||||||
'board3_announcements_style' => array('lang' => 'PORTAL_ANNOUNCEMENTS_STYLE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_announcements_style_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_STYLE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_number_of_announcements' => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_number_of_announcements_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'board3_announcements_day' => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_announcements_day_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'board3_announcements_length' => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_announcements_length_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'board3_global_announcements_forum' => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
|
'board3_global_announcements_forum_' . $module_id => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
|
||||||
'board3_announcements_forum_exclude' => array('lang' => 'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE', 'validate' => 'string', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_announcements_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE', 'validate' => 'string', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_announcements_archive' => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_announcements_archive_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_announcements_permissions' => array('lang' => 'PORTAL_ANNOUNCEMENTS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_announcements_permissions_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_show_announcements_replies_views' => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_show_announcements_replies_views_' . $module_id => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -390,15 +390,15 @@ class portal_announcements_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_announcements_style', 0);
|
set_config('board3_announcements_style_' . $module_id, 0);
|
||||||
set_config('board3_number_of_announcements', 1);
|
set_config('board3_number_of_announcements_' . $module_id, 1);
|
||||||
set_config('board3_announcements_day', 0);
|
set_config('board3_announcements_day_' . $module_id, 0);
|
||||||
set_config('board3_announcements_length', 200);
|
set_config('board3_announcements_length_' . $module_id, 200);
|
||||||
set_config('board3_global_announcements_forum', '');
|
set_config('board3_global_announcements_forum_' . $module_id, '');
|
||||||
set_config('board3_announcements_forum_exclude', 0);
|
set_config('board3_announcements_forum_exclude_' . $module_id, 0);
|
||||||
set_config('board3_announcements_archive', 1);
|
set_config('board3_announcements_archive_' . $module_id, 1);
|
||||||
set_config('board3_announcements_permissions', 1);
|
set_config('board3_announcements_permissions_' . $module_id, 1);
|
||||||
set_config('board3_show_announcements_replies_views', 1);
|
set_config('board3_show_announcements_replies_views_' . $module_id, 1);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -408,15 +408,15 @@ class portal_announcements_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_announcements_style',
|
'board3_announcements_style_' . $module_id,
|
||||||
'board3_number_of_announcements',
|
'board3_number_of_announcements_' . $module_id,
|
||||||
'board3_announcements_day',
|
'board3_announcements_day_' . $module_id,
|
||||||
'board3_announcements_length',
|
'board3_announcements_length_' . $module_id,
|
||||||
'board3_global_announcements_forum',
|
'board3_global_announcements_forum_' . $module_id,
|
||||||
'board3_announcements_forum_exclude',
|
'board3_announcements_forum_exclude_' . $module_id,
|
||||||
'board3_announcements_archive',
|
'board3_announcements_archive_' . $module_id,
|
||||||
'board3_announcements_permissions',
|
'board3_announcements_permissions_' . $module_id,
|
||||||
'board3_show_announcements_replies_views',
|
'board3_show_announcements_replies_views_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
@@ -424,7 +424,7 @@ class portal_announcements_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create forum select box
|
// Create forum select box
|
||||||
function select_forums($value, $key)
|
function select_forums($value, $key, $module_id)
|
||||||
{
|
{
|
||||||
global $user, $config;
|
global $user, $config;
|
||||||
|
|
||||||
@@ -448,11 +448,11 @@ class portal_announcements_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store selected forums
|
// Store selected forums
|
||||||
function store_selected_forums($key)
|
function store_selected_forums($key, $module_id)
|
||||||
{
|
{
|
||||||
global $db, $cache;
|
global $db, $cache;
|
||||||
|
|
||||||
// Get selected extensions
|
// Get selected forums
|
||||||
$values = request_var($key, array(0 => ''));
|
$values = request_var($key, array(0 => ''));
|
||||||
|
|
||||||
$news = implode(',', $values);
|
$news = implode(',', $values);
|
||||||
|
|||||||
@@ -55,17 +55,17 @@ class portal_attachments_module
|
|||||||
$filetypes = array();
|
$filetypes = array();
|
||||||
|
|
||||||
// Get filetypes and put them into an array
|
// Get filetypes and put them into an array
|
||||||
if(isset($config['board3_attachments_filetype']) && strlen($config['board3_attachments_filetype']) > 0)
|
if(isset($config['board3_attachments_filetype_' . $module_id]) && strlen($config['board3_attachments_filetype_' . $module_id]) > 0)
|
||||||
{
|
{
|
||||||
$filetypes = explode(',', $config['board3_attachments_filetype']);
|
$filetypes = explode(',', $config['board3_attachments_filetype_' . $module_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['board3_attachments_forum_ids'] !== '')
|
if($config['board3_attachments_forum_ids_' . $module_id] !== '')
|
||||||
{
|
{
|
||||||
$attach_forums_config = (strpos($config['board3_attachments_forum_ids'], ',') !== false) ? explode(',', $config['board3_attachments_forum_ids']) : array($config['board3_attachments_forum_ids']);
|
$attach_forums_config = (strpos($config['board3_attachments_forum_ids_' . $module_id], ',') !== false) ? explode(',', $config['board3_attachments_forum_ids_' . $module_id]) : array($config['board3_attachments_forum_ids_' . $module_id]);
|
||||||
$forum_list = array_unique(array_keys($auth->acl_getf('f_read', true)));
|
$forum_list = array_unique(array_keys($auth->acl_getf('f_read', true)));
|
||||||
|
|
||||||
if($config['board3_attachments_forum_exclude'])
|
if($config['board3_attachments_forum_exclude_' . $module_id])
|
||||||
{
|
{
|
||||||
$forum_list = array_unique(array_diff($forum_list, $attach_forums_config));
|
$forum_list = array_unique(array_diff($forum_list, $attach_forums_config));
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ class portal_attachments_module
|
|||||||
|
|
||||||
if(sizeof($filetypes))
|
if(sizeof($filetypes))
|
||||||
{
|
{
|
||||||
if($config['board3_attachments_exclude'])
|
if($config['board3_attachments_exclude_' . $module_id])
|
||||||
{
|
{
|
||||||
$where .= ' AND ' . $db->sql_in_set('a.extension', $filetypes, true);
|
$where .= ' AND ' . $db->sql_in_set('a.extension', $filetypes, true);
|
||||||
}
|
}
|
||||||
@@ -112,14 +112,14 @@ class portal_attachments_module
|
|||||||
' . $where . '
|
' . $where . '
|
||||||
ORDER BY
|
ORDER BY
|
||||||
filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
|
filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
|
||||||
$result = $db->sql_query_limit($sql, $config['board3_attachments_number']);
|
$result = $db->sql_query_limit($sql, $config['board3_attachments_number_' . $module_id]);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MIB'] : (($row['filesize'] >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
|
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MIB'] : (($row['filesize'] >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
|
||||||
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
|
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
|
||||||
|
|
||||||
$replace = character_limit(utf8_substr($row['real_filename'], 0, strrpos($row['real_filename'], '.')), $config['board3_attach_max_length']);
|
$replace = character_limit(utf8_substr($row['real_filename'], 0, strrpos($row['real_filename'], '.')), $config['board3_attach_max_length_' . $module_id]);
|
||||||
|
|
||||||
$template->assign_block_vars('attach', array(
|
$template->assign_block_vars('attach', array(
|
||||||
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
|
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
|
||||||
@@ -156,17 +156,17 @@ class portal_attachments_module
|
|||||||
$filetypes = array();
|
$filetypes = array();
|
||||||
|
|
||||||
// Get filetypes and put them into an array
|
// Get filetypes and put them into an array
|
||||||
if(isset($config['board3_attachments_filetype']) && strlen($config['board3_attachments_filetype']) > 0)
|
if(isset($config['board3_attachments_filetype_' . $module_id]) && strlen($config['board3_attachments_filetype_' . $module_id]) > 0)
|
||||||
{
|
{
|
||||||
$filetypes = explode(',', $config['board3_attachments_filetype']);
|
$filetypes = explode(',', $config['board3_attachments_filetype_' . $module_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['board3_attachments_forum_ids'] !== '')
|
if($config['board3_attachments_forum_ids_' . $module_id] !== '')
|
||||||
{
|
{
|
||||||
$attach_forums_config = (strpos($config['board3_attachments_forum_ids'], ',') !== false) ? explode(',', $config['board3_attachments_forum_ids']) : array($config['board3_attachments_forum_ids']);
|
$attach_forums_config = (strpos($config['board3_attachments_forum_ids_' . $module_id], ',') !== false) ? explode(',', $config['board3_attachments_forum_ids_' . $module_id]) : array($config['board3_attachments_forum_ids_' . $module_id]);
|
||||||
$forum_list = array_unique(array_keys($auth->acl_getf('f_read', true)));
|
$forum_list = array_unique(array_keys($auth->acl_getf('f_read', true)));
|
||||||
|
|
||||||
if($config['board3_attachments_forum_exclude'])
|
if($config['board3_attachments_forum_exclude_' . $module_id])
|
||||||
{
|
{
|
||||||
$forum_list = array_unique(array_diff($forum_list, $attach_forums_config));
|
$forum_list = array_unique(array_diff($forum_list, $attach_forums_config));
|
||||||
}
|
}
|
||||||
@@ -188,7 +188,7 @@ class portal_attachments_module
|
|||||||
|
|
||||||
if(sizeof($filetypes))
|
if(sizeof($filetypes))
|
||||||
{
|
{
|
||||||
if($config['board3_attachments_exclude'])
|
if($config['board3_attachments_exclude_' . $module_id])
|
||||||
{
|
{
|
||||||
$where .= ' AND ' . $db->sql_in_set('a.extension', $filetypes, true);
|
$where .= ' AND ' . $db->sql_in_set('a.extension', $filetypes, true);
|
||||||
}
|
}
|
||||||
@@ -213,14 +213,14 @@ class portal_attachments_module
|
|||||||
' . $where . '
|
' . $where . '
|
||||||
ORDER BY
|
ORDER BY
|
||||||
filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
|
filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
|
||||||
$result = $db->sql_query_limit($sql, $config['board3_attachments_number']);
|
$result = $db->sql_query_limit($sql, $config['board3_attachments_number_' . $module_id]);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MIB'] : (($row['filesize'] >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
|
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MIB'] : (($row['filesize'] >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
|
||||||
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
|
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
|
||||||
|
|
||||||
$replace = character_limit(utf8_substr($row['real_filename'], 0, strrpos($row['real_filename'], '.')), $config['board3_attach_max_length']);
|
$replace = character_limit(utf8_substr($row['real_filename'], 0, strrpos($row['real_filename'], '.')), $config['board3_attach_max_length_' . $module_id]);
|
||||||
|
|
||||||
$template->assign_block_vars('attach', array(
|
$template->assign_block_vars('attach', array(
|
||||||
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
|
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
|
||||||
@@ -254,12 +254,12 @@ class portal_attachments_module
|
|||||||
'title' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
|
'title' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
|
'legend1' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
|
||||||
'board3_attachments_number' => array('lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_attachments_number_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'board3_attach_max_length' => array('lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_attach_max_length_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'board3_attachments_forum_ids' => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
|
'board3_attachments_forum_ids_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
|
||||||
'board3_attachments_forum_exclude' => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_attachments_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_attachments_filetype' => array('lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'),
|
'board3_attachments_filetype_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'),
|
||||||
'board3_attachments_exclude' => array('lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_attachments_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -269,12 +269,12 @@ class portal_attachments_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_attachments_number', 8);
|
set_config('board3_attachments_number_' . $module_id, 8);
|
||||||
set_config('board3_attach_max_length', 15);
|
set_config('board3_attach_max_length_' . $module_id, 15);
|
||||||
set_config('board3_attachments_forum_ids', '');
|
set_config('board3_attachments_forum_ids_' . $module_id, '');
|
||||||
set_config('board3_attachments_forum_exclude', 0);
|
set_config('board3_attachments_forum_exclude_' . $module_id, 0);
|
||||||
set_config('board3_attachments_filetype', '');
|
set_config('board3_attachments_filetype_' . $module_id, '');
|
||||||
set_config('board3_attachments_exclude', 0);
|
set_config('board3_attachments_exclude_' . $module_id, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,12 +283,12 @@ class portal_attachments_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_attachments_number',
|
'board3_attachments_number_' . $module_id,
|
||||||
'board3_attach_max_length',
|
'board3_attach_max_length_' . $module_id,
|
||||||
'board3_attachments_forum_ids',
|
'board3_attachments_forum_ids_' . $module_id,
|
||||||
'board3_attachments_forum_exclude',
|
'board3_attachments_forum_exclude_' . $module_id,
|
||||||
'board3_attachments_filetype',
|
'board3_attachments_filetype_' . $module_id,
|
||||||
'board3_attachments_exclude',
|
'board3_attachments_exclude_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
@@ -296,7 +296,7 @@ class portal_attachments_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create select box for attachment filetype
|
// Create select box for attachment filetype
|
||||||
function select_filetype($value, $key)
|
function select_filetype($value, $key, $module_id)
|
||||||
{
|
{
|
||||||
global $db, $user, $config;
|
global $db, $user, $config;
|
||||||
|
|
||||||
@@ -312,9 +312,9 @@ class portal_attachments_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
$selected = array();
|
$selected = array();
|
||||||
if(isset($config['board3_attachments_filetype']) && strlen($config['board3_attachments_filetype']) > 0)
|
if(isset($config['board3_attachments_filetype_' . $module_id]) && strlen($config['board3_attachments_filetype_' . $module_id]) > 0)
|
||||||
{
|
{
|
||||||
$selected = explode(',', $config['board3_attachments_filetype']);
|
$selected = explode(',', $config['board3_attachments_filetype_' . $module_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build options
|
// Build options
|
||||||
@@ -329,7 +329,7 @@ class portal_attachments_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store selected filetypes
|
// Store selected filetypes
|
||||||
function store_filetypes($key)
|
function store_filetypes($key, $module_id)
|
||||||
{
|
{
|
||||||
global $db, $cache;
|
global $db, $cache;
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ class portal_attachments_module
|
|||||||
|
|
||||||
$filetypes = implode(',', $values);
|
$filetypes = implode(',', $values);
|
||||||
|
|
||||||
set_config('board3_attachments_filetype', $filetypes);
|
set_config('board3_attachments_filetype_' . $module_id, $filetypes);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class portal_birthday_list_module
|
|||||||
if ($config['load_birthdays'] && $config['allow_birthdays'])
|
if ($config['load_birthdays'] && $config['allow_birthdays'])
|
||||||
{
|
{
|
||||||
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
|
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
|
||||||
$cache_days = $config['board3_birthdays_ahead'];
|
$cache_days = $config['board3_birthdays_ahead_' . $module_id];
|
||||||
$sql_days = '';
|
$sql_days = '';
|
||||||
while ($cache_days > 0)
|
while ($cache_days > 0)
|
||||||
{
|
{
|
||||||
@@ -98,7 +98,7 @@ class portal_birthday_list_module
|
|||||||
}
|
}
|
||||||
$birthday_list .= '</span><br style="clear: both" />';
|
$birthday_list .= '</span><br style="clear: both" />';
|
||||||
}
|
}
|
||||||
elseif ($config['board3_birthdays_ahead'] > 0)
|
elseif ($config['board3_birthdays_ahead_' . $module_id] > 0)
|
||||||
{
|
{
|
||||||
$birthday_ahead_list .= '<span style="float:left;"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="float:left; padding-left:5px; padding-top:2px;"><span title="' . format_birthday($row['user_birthday'], 'd M') . '">' . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . '</span></span><span style="float: right;">';
|
$birthday_ahead_list .= '<span style="float:left;"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="float:left; padding-left:5px; padding-top:2px;"><span title="' . format_birthday($row['user_birthday'], 'd M') . '">' . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . '</span></span><span style="float: right;">';
|
||||||
if ($age = (int) substr($row['user_birthday'], -4))
|
if ($age = (int) substr($row['user_birthday'], -4))
|
||||||
@@ -114,10 +114,10 @@ class portal_birthday_list_module
|
|||||||
// Assign index specific vars
|
// Assign index specific vars
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'BIRTHDAY_LIST' => $birthday_list,
|
'BIRTHDAY_LIST' => $birthday_list,
|
||||||
'BIRTHDAYS_AHEAD_LIST' => ($config['board3_birthdays_ahead']) ? $birthday_ahead_list : '',
|
'BIRTHDAYS_AHEAD_LIST' => ($config['board3_birthdays_ahead_' . $module_id]) ? $birthday_ahead_list : '',
|
||||||
'L_BIRTHDAYS_AHEAD' => sprintf($user->lang['BIRTHDAYS_AHEAD'], $config['board3_birthdays_ahead']),
|
'L_BIRTHDAYS_AHEAD' => sprintf($user->lang['BIRTHDAYS_AHEAD'], $config['board3_birthdays_ahead_' . $module_id]),
|
||||||
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
|
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
|
||||||
'S_DISPLAY_BIRTHDAY_AHEAD_LIST' => ($config['board3_birthdays_ahead'] > 0) ? true : false,
|
'S_DISPLAY_BIRTHDAY_AHEAD_LIST' => ($config['board3_birthdays_ahead_' . $module_id] > 0) ? true : false,
|
||||||
));
|
));
|
||||||
|
|
||||||
return 'birthdays_side.html';
|
return 'birthdays_side.html';
|
||||||
@@ -129,7 +129,7 @@ class portal_birthday_list_module
|
|||||||
'title' => 'ACP_PORTAL_BIRTHDAYS_SETTINGS',
|
'title' => 'ACP_PORTAL_BIRTHDAYS_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_BIRTHDAYS_SETTINGS',
|
'legend1' => 'ACP_PORTAL_BIRTHDAYS_SETTINGS',
|
||||||
'board3_birthdays_ahead' => array('lang' => 'PORTAL_BIRTHDAYS_AHEAD', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_birthdays_ahead_' . $module_id => array('lang' => 'PORTAL_BIRTHDAYS_AHEAD', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ class portal_birthday_list_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_birthdays_ahead', 30);
|
set_config('board3_birthdays_ahead_' . $module_id, 30);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class portal_birthday_list_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_birthdays_ahead',
|
'board3_birthdays_ahead_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class portal_clock_module
|
|||||||
global $config, $template;
|
global $config, $template;
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'CLOCK_SRC' => $config['board3_clock_src'],
|
'CLOCK_SRC' => $config['board3_clock_src_' . $module_id],
|
||||||
));
|
));
|
||||||
|
|
||||||
return 'clock_side.html';
|
return 'clock_side.html';
|
||||||
@@ -63,7 +63,7 @@ class portal_clock_module
|
|||||||
'title' => 'ACP_PORTAL_CLOCK_SETTINGS',
|
'title' => 'ACP_PORTAL_CLOCK_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_CLOCK_SETTINGS',
|
'legend1' => 'ACP_PORTAL_CLOCK_SETTINGS',
|
||||||
'board3_clock_src' => array('lang' => 'ACP_PORTAL_CLOCK_SRC', 'validate' => 'string', 'type' => 'text:50:200', 'explain' => false),
|
'board3_clock_src_' . $module_id => array('lang' => 'ACP_PORTAL_CLOCK_SRC', 'validate' => 'string', 'type' => 'text:50:200', 'explain' => false),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ class portal_clock_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_clock_src', 'board3clock.swf');
|
set_config('board3_clock_src_' . $module_id, 'board3clock.swf');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ class portal_clock_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_clock_src',
|
'board3_clock_src_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class portal_donation_module
|
|||||||
{
|
{
|
||||||
global $config, $template;
|
global $config, $template;
|
||||||
|
|
||||||
$template->assign_var('PAY_ACC', $config['board3_pay_acc']);
|
$template->assign_var('PAY_ACC', $config['board3_pay_acc_' . $module_id]);
|
||||||
|
|
||||||
return 'donation_center.html';
|
return 'donation_center.html';
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ class portal_donation_module
|
|||||||
{
|
{
|
||||||
global $config, $template;
|
global $config, $template;
|
||||||
|
|
||||||
$template->assign_var('PAY_ACC', $config['board3_pay_acc']);
|
$template->assign_var('PAY_ACC', $config['board3_pay_acc_' . $module_id]);
|
||||||
|
|
||||||
return 'donation_side.html';
|
return 'donation_side.html';
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ class portal_donation_module
|
|||||||
'title' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
'title' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
'legend1' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
||||||
'board3_pay_acc' => array('lang' => 'PORTAL_PAY_ACC' , 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
|
'board3_pay_acc_' . $module_id => array('lang' => 'PORTAL_PAY_ACC' , 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ class portal_donation_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_pay_acc', 'your@paypal.com');
|
set_config('board3_pay_acc_' . $module_id, 'your@paypal.com');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ class portal_donation_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_pay_acc',
|
'board3_pay_acc_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class portal_friends_module
|
|||||||
'ORDER_BY' => 'u.username_clean ASC',
|
'ORDER_BY' => 'u.username_clean ASC',
|
||||||
));
|
));
|
||||||
|
|
||||||
$result = $db->sql_query_limit($sql, $config['board3_max_online_friends']);
|
$result = $db->sql_query_limit($sql, $config['board3_max_online_friends_' . $module_id]);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
@@ -108,7 +108,7 @@ class portal_friends_module
|
|||||||
'title' => 'ACP_PORTAL_FRIENDS_SETTINGS',
|
'title' => 'ACP_PORTAL_FRIENDS_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_FRIENDS_SETTINGS',
|
'legend1' => 'ACP_PORTAL_FRIENDS_SETTINGS',
|
||||||
'board3_max_online_friends' => array('lang' => 'PORTAL_MAX_ONLINE_FRIENDS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_max_online_friends_' . $module_id => array('lang' => 'PORTAL_MAX_ONLINE_FRIENDS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ class portal_friends_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_max_online_friends', 8);
|
set_config('board3_max_online_friends_' . $module_id, 8);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ class portal_friends_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_max_online_friends',
|
'board3_max_online_friends_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class portal_latest_bots_module
|
|||||||
FROM ' . USERS_TABLE . '
|
FROM ' . USERS_TABLE . '
|
||||||
WHERE user_type = ' . USER_IGNORE . '
|
WHERE user_type = ' . USER_IGNORE . '
|
||||||
ORDER BY user_lastvisit DESC';
|
ORDER BY user_lastvisit DESC';
|
||||||
$result = $db->sql_query_limit($sql, $config['board3_last_visited_bots_number']);
|
$result = $db->sql_query_limit($sql, $config['board3_last_visited_bots_number_' . $module_id]);
|
||||||
$first = true;
|
$first = true;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
@@ -83,7 +83,7 @@ class portal_latest_bots_module
|
|||||||
|
|
||||||
// Assign specific vars
|
// Assign specific vars
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $config['board3_last_visited_bots_number']),
|
'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $config['board3_last_visited_bots_number_' . $module_id]),
|
||||||
));
|
));
|
||||||
|
|
||||||
return 'latest_bots_side.html';
|
return 'latest_bots_side.html';
|
||||||
@@ -95,7 +95,7 @@ class portal_latest_bots_module
|
|||||||
'title' => 'ACP_PORTAL_BOTS_SETTINGS',
|
'title' => 'ACP_PORTAL_BOTS_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_BOTS_SETTINGS',
|
'legend1' => 'ACP_PORTAL_BOTS_SETTINGS',
|
||||||
'board3_last_visited_bots_number' => array('lang' => 'PORTAL_LAST_VISITED_BOTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_last_visited_bots_number_' . $module_id => array('lang' => 'PORTAL_LAST_VISITED_BOTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ class portal_latest_bots_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_last_visited_bots_number', 1);
|
set_config('board3_last_visited_bots_number_' . $module_id, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ class portal_latest_bots_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_last_visited_bots_number',
|
'board3_last_visited_bots_number_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class portal_latest_members_module
|
|||||||
WHERE user_type <> ' . USER_IGNORE . '
|
WHERE user_type <> ' . USER_IGNORE . '
|
||||||
AND user_inactive_time = 0
|
AND user_inactive_time = 0
|
||||||
ORDER BY user_regdate DESC';
|
ORDER BY user_regdate DESC';
|
||||||
$result = $db->sql_query_limit($sql, $config['board3_max_last_member']);
|
$result = $db->sql_query_limit($sql, $config['board3_max_last_member_' . $module_id]);
|
||||||
|
|
||||||
while(($row = $db->sql_fetchrow($result)) && ($row['username']))
|
while(($row = $db->sql_fetchrow($result)) && ($row['username']))
|
||||||
{
|
{
|
||||||
@@ -75,7 +75,7 @@ class portal_latest_members_module
|
|||||||
'title' => 'ACP_PORTAL_MEMBERS_SETTINGS',
|
'title' => 'ACP_PORTAL_MEMBERS_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_MEMBERS_SETTINGS',
|
'legend1' => 'ACP_PORTAL_MEMBERS_SETTINGS',
|
||||||
'board3_max_last_member' => array('lang' => 'PORTAL_MAX_LAST_MEMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_max_last_member_' . $module_id => array('lang' => 'PORTAL_MAX_LAST_MEMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ class portal_latest_members_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_max_last_member', 8);
|
set_config('board3_max_last_member_' . $module_id, 8);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class portal_latest_members_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_max_last_member',
|
'board3_max_last_member_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class portal_leaders_module
|
|||||||
// Display a listing of board admins, moderators
|
// Display a listing of board admins, moderators
|
||||||
$user->add_lang('groups');
|
$user->add_lang('groups');
|
||||||
|
|
||||||
if($config['board3_leaders_ext'])
|
if($config['board3_leaders_ext_' . $module_id])
|
||||||
{
|
{
|
||||||
$legends = array();
|
$legends = array();
|
||||||
$groups = array();
|
$groups = array();
|
||||||
@@ -209,7 +209,7 @@ class portal_leaders_module
|
|||||||
'title' => 'ACP_PORTAL_LEADERS',
|
'title' => 'ACP_PORTAL_LEADERS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_LEADERS',
|
'legend1' => 'ACP_PORTAL_LEADERS',
|
||||||
'board3_leaders_ext' => array('lang' => 'PORTAL_LEADERS_EXT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_leaders_ext_' . $module_id => array('lang' => 'PORTAL_LEADERS_EXT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ class portal_leaders_module
|
|||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
// Show normal team block by default
|
// Show normal team block by default
|
||||||
set_config('board3_leaders_ext', 0);
|
set_config('board3_leaders_ext_' . $module_id, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ class portal_leaders_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_leaders_ext',
|
'board3_leaders_ext_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ class portal_main_menu_module
|
|||||||
|
|
||||||
$links_urls = $links_options = $links_titles = $groups_ary = array();
|
$links_urls = $links_options = $links_titles = $groups_ary = array();
|
||||||
|
|
||||||
$links_urls = explode(';', $config['board3_links_urls']);
|
$links_urls = explode(';', $config['board3_links_urls_' . $module_id]);
|
||||||
$links_options = explode(';', $config['board3_links_options']);
|
$links_options = explode(';', $config['board3_links_options_' . $module_id]);
|
||||||
$links_titles = explode(';', $config['board3_links_titles']);
|
$links_titles = explode(';', $config['board3_links_titles_' . $module_id]);
|
||||||
$links_permissions = explode(';', $config['board3_links_permissions']);
|
$links_permissions = explode(';', $config['board3_links_permissions_' . $module_id]);
|
||||||
|
|
||||||
// get user's groups
|
// get user's groups
|
||||||
$sql = 'SELECT group_id
|
$sql = 'SELECT group_id
|
||||||
@@ -119,7 +119,7 @@ class portal_main_menu_module
|
|||||||
'title' => 'ACP_PORTAL_MENU',
|
'title' => 'ACP_PORTAL_MENU',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_MENU',
|
'legend1' => 'ACP_PORTAL_MENU',
|
||||||
'board3_links_urls' => array('lang' => 'ACP_PORTAL_MENU_MANAGE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'manage_links', 'submit' => 'update_links'),
|
'board3_links_urls_' . $module_id => array('lang' => 'ACP_PORTAL_MENU_MANAGE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'manage_links', 'submit' => 'update_links'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -197,10 +197,10 @@ class portal_main_menu_module
|
|||||||
'',
|
'',
|
||||||
);
|
);
|
||||||
|
|
||||||
set_config('board3_links_urls', implode(';', $links_urls));
|
set_config('board3_links_urls_' . $module_id, implode(';', $links_urls));
|
||||||
set_config('board3_links_options', implode(';', $links_options));
|
set_config('board3_links_options_' . $module_id, implode(';', $links_options));
|
||||||
set_config('board3_links_titles', implode(';', $links_titles));
|
set_config('board3_links_titles_' . $module_id, implode(';', $links_titles));
|
||||||
set_config('board3_links_permissions', implode(';', $links_permissions));
|
set_config('board3_links_permissions_' . $module_id, implode(';', $links_permissions));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,17 +209,17 @@ class portal_main_menu_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_links_urls',
|
'board3_links_urls_' . $module_id,
|
||||||
'board3_links_options',
|
'board3_links_options_' . $module_id,
|
||||||
'board3_links_titles',
|
'board3_links_titles_' . $module_id,
|
||||||
'board3_links_permissions',
|
'board3_links_permissions_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
return $db->sql_query($sql);
|
return $db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function manage_links($key)
|
function manage_links($value, $key, $module_id)
|
||||||
{
|
{
|
||||||
global $config, $phpbb_admin_path, $user, $phpEx, $db, $template;
|
global $config, $phpbb_admin_path, $user, $phpEx, $db, $template;
|
||||||
|
|
||||||
@@ -235,10 +235,10 @@ class portal_main_menu_module
|
|||||||
|
|
||||||
$links_urls = $links_options = $links_titles = array();
|
$links_urls = $links_options = $links_titles = array();
|
||||||
|
|
||||||
$links_urls = explode(';', $config['board3_links_urls']);
|
$links_urls = explode(';', $config['board3_links_urls_' . $module_id]);
|
||||||
$links_options = explode(';', $config['board3_links_options']);
|
$links_options = explode(';', $config['board3_links_options_' . $module_id]);
|
||||||
$links_titles = explode(';', $config['board3_links_titles']);
|
$links_titles = explode(';', $config['board3_links_titles_' . $module_id]);
|
||||||
$links_permissions = explode(';', $config['board3_links_permissions']);
|
$links_permissions = explode(';', $config['board3_links_permissions_' . $module_id]);
|
||||||
|
|
||||||
$u_action = append_sid($phpbb_admin_path . 'index.' . $phpEx, 'i=portal&mode=config&module_id=' . $module_id);
|
$u_action = append_sid($phpbb_admin_path . 'index.' . $phpEx, 'i=portal&mode=config&module_id=' . $module_id);
|
||||||
|
|
||||||
@@ -335,10 +335,10 @@ class portal_main_menu_module
|
|||||||
add_log('admin', 'LOG_PORTAL_LINK_ADDED', $link_title);
|
add_log('admin', 'LOG_PORTAL_LINK_ADDED', $link_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_config('board3_links_urls', implode(';', $links_urls));
|
set_config('board3_links_urls_' . $module_id, implode(';', $links_urls));
|
||||||
set_config('board3_links_options', implode(';', $links_options));
|
set_config('board3_links_options_' . $module_id, implode(';', $links_options));
|
||||||
set_config('board3_links_titles', implode(';', $links_titles));
|
set_config('board3_links_titles_' . $module_id, implode(';', $links_titles));
|
||||||
set_config('board3_links_permissions', implode(';', $links_permissions));
|
set_config('board3_links_permissions_' . $module_id, implode(';', $links_permissions));
|
||||||
|
|
||||||
trigger_error($message . adm_back_link($u_action));
|
trigger_error($message . adm_back_link($u_action));
|
||||||
|
|
||||||
@@ -370,10 +370,10 @@ class portal_main_menu_module
|
|||||||
$links_options = array_diff($links_options, $url_ary);
|
$links_options = array_diff($links_options, $url_ary);
|
||||||
$links_permissions = array_diff($links_permissions, $permission_ary);
|
$links_permissions = array_diff($links_permissions, $permission_ary);
|
||||||
|
|
||||||
set_config('board3_links_urls', implode(';', $links_urls));
|
set_config('board3_links_urls_' . $module_id, implode(';', $links_urls));
|
||||||
set_config('board3_links_options', implode(';', $links_options));
|
set_config('board3_links_options_' . $module_id, implode(';', $links_options));
|
||||||
set_config('board3_links_titles', implode(';', $links_titles));
|
set_config('board3_links_titles_' . $module_id, implode(';', $links_titles));
|
||||||
set_config('board3_links_permissions', implode(';', $links_permissions));
|
set_config('board3_links_permissions_' . $module_id, implode(';', $links_permissions));
|
||||||
|
|
||||||
add_log('admin', 'LOG_PORTAL_LINK_REMOVED', $cur_link_title);
|
add_log('admin', 'LOG_PORTAL_LINK_REMOVED', $cur_link_title);
|
||||||
}
|
}
|
||||||
@@ -427,10 +427,10 @@ class portal_main_menu_module
|
|||||||
$links_options[$switch_order_id] = $cur_option;
|
$links_options[$switch_order_id] = $cur_option;
|
||||||
$links_permissions[$switch_order_id] = $cur_permission;
|
$links_permissions[$switch_order_id] = $cur_permission;
|
||||||
|
|
||||||
set_config('board3_links_urls', implode(';', $links_urls));
|
set_config('board3_links_urls_' . $module_id, implode(';', $links_urls));
|
||||||
set_config('board3_links_options', implode(';', $links_options));
|
set_config('board3_links_options_' . $module_id, implode(';', $links_options));
|
||||||
set_config('board3_links_titles', implode(';', $links_titles));
|
set_config('board3_links_titles_' . $module_id, implode(';', $links_titles));
|
||||||
set_config('board3_links_permissions', implode(';', $links_permissions));
|
set_config('board3_links_permissions_' . $module_id, implode(';', $links_permissions));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -487,9 +487,9 @@ class portal_main_menu_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_links($key)
|
function update_links($key, $module_id)
|
||||||
{
|
{
|
||||||
$this->manage_links($key);
|
$this->manage_links('', $key, $module_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,14 @@ class portal_news_module
|
|||||||
global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path;
|
global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path;
|
||||||
|
|
||||||
$news = request_var('news', -1);
|
$news = request_var('news', -1);
|
||||||
$news = ($news > $config['board3_news_length'] -1) ? -1 : $news;
|
$news = ($news > $config['board3_news_length_' . $module_id] -1) ? -1 : $news;
|
||||||
$user->add_lang('viewforum');
|
$user->add_lang('viewforum');
|
||||||
$start = request_var('np', 0);
|
$start = request_var('np', 0);
|
||||||
$start = ($start < 0) ? 0 : $start;
|
$start = ($start < 0) ? 0 : $start;
|
||||||
|
|
||||||
// Fetch news from portal/includes/functions.php with check if "read full" is requested.
|
// Fetch news from portal/includes/functions.php with check if "read full" is requested.
|
||||||
$portal_news_length = ($news < 0) ? $config['board3_news_length'] : 0;
|
$portal_news_length = ($news < 0) ? $config['board3_news_length_' . $module_id] : 0;
|
||||||
$fetch_news = phpbb_fetch_posts($config['board3_news_forum'], $config['board3_news_permissions'], $config['board3_number_of_news'], $portal_news_length, 0, ($config['board3_show_all_news']) ? 'news_all' : 'news', $start, $config['board3_news_exclude']);
|
$fetch_news = phpbb_fetch_posts($config['board3_news_forum_' . $module_id], $config['board3_news_permissions_' . $module_id], $config['board3_number_of_news_' . $module_id], $portal_news_length, 0, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news', $start, $config['board3_news_exclude_' . $module_id]);
|
||||||
|
|
||||||
|
|
||||||
// Any news present? If not terminate it here.
|
// Any news present? If not terminate it here.
|
||||||
@@ -72,10 +72,10 @@ class portal_news_module
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Count number of posts for news archive, considering if permission check is dis- or enabled.
|
// Count number of posts for news archive, considering if permission check is dis- or enabled.
|
||||||
if ($config['board3_news_archive'])
|
if ($config['board3_news_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$permissions = $config['board3_news_permissions'];
|
$permissions = $config['board3_news_permissions_' . $module_id];
|
||||||
$forum_from = $config['board3_news_forum'];
|
$forum_from = $config['board3_news_forum_' . $module_id];
|
||||||
|
|
||||||
$forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
|
$forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ class portal_news_module
|
|||||||
$disallow_access = array();
|
$disallow_access = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['board3_news_exclude'] == true)
|
if($config['board3_news_exclude_' . $module_id] == true)
|
||||||
{
|
{
|
||||||
$disallow_access = array_merge($disallow_access, $forum_from);
|
$disallow_access = array_merge($disallow_access, $forum_from);
|
||||||
$forum_from = array();
|
$forum_from = array();
|
||||||
@@ -121,7 +121,7 @@ class portal_news_module
|
|||||||
|
|
||||||
$str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
$str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
|
||||||
|
|
||||||
$topic_type = ($config['board3_show_all_news']) ? '(topic_type <> ' . POST_ANNOUNCE . ') AND (topic_type <> ' . POST_GLOBAL . ')' : 'topic_type = ' . POST_NORMAL;
|
$topic_type = ($config['board3_show_all_news_' . $module_id]) ? '(topic_type <> ' . POST_ANNOUNCE . ') AND (topic_type <> ' . POST_GLOBAL . ')' : 'topic_type = ' . POST_NORMAL;
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(topic_id) AS num_topics
|
$sql = 'SELECT COUNT(topic_id) AS num_topics
|
||||||
FROM ' . TOPICS_TABLE . '
|
FROM ' . TOPICS_TABLE . '
|
||||||
@@ -161,9 +161,9 @@ class portal_news_module
|
|||||||
|
|
||||||
$read_full_url = (isset($_GET['np'])) ? 'np='. $start . '&news=' . $i . '#n' . $i : 'news=' . $i . '#n' . $i;
|
$read_full_url = (isset($_GET['np'])) ? 'np='. $start . '&news=' . $i . '#n' . $i : 'news=' . $i . '#n' . $i;
|
||||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||||
if ($config['board3_news_archive'])
|
if ($config['board3_news_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news'], $start, ($config['board3_show_all_news']) ? 'news_all' : 'news');
|
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news_' . $module_id], $start, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news');
|
||||||
}
|
}
|
||||||
|
|
||||||
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
|
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
|
||||||
@@ -253,12 +253,12 @@ class portal_news_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['board3_number_of_news'] <> 0 && $config['board3_news_archive'])
|
if ($config['board3_number_of_news_' . $module_id] <> 0 && $config['board3_news_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'NP_PAGINATION' => $pagination,
|
'NP_PAGINATION' => $pagination,
|
||||||
'TOTAL_NEWS' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
|
'TOTAL_NEWS' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
|
||||||
'NP_PAGE_NUMBER' => on_page($total_news, $config['board3_number_of_news'], $start))
|
'NP_PAGE_NUMBER' => on_page($total_news, $config['board3_number_of_news_' . $module_id], $start))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,9 +276,9 @@ class portal_news_module
|
|||||||
|
|
||||||
$read_full_url = (isset($_GET['np'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "np=$start#n$i") : append_sid("{$phpbb_root_path}portal.$phpEx#n$i");
|
$read_full_url = (isset($_GET['np'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "np=$start#n$i") : append_sid("{$phpbb_root_path}portal.$phpEx#n$i");
|
||||||
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
|
||||||
if ($config['board3_news_archive'])
|
if ($config['board3_news_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news'], $start, ($config['board3_show_all_news']) ? 'news_all' : 'news');
|
$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news_' . $module_id], $start, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news');
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('news_row', array(
|
$template->assign_block_vars('news_row', array(
|
||||||
@@ -316,12 +316,12 @@ class portal_news_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['board3_number_of_news'] <> 0 && $config['board3_news_archive'])
|
if ($config['board3_number_of_news_' . $module_id] <> 0 && $config['board3_news_archive_' . $module_id])
|
||||||
{
|
{
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'NP_PAGINATION' => $pagination,
|
'NP_PAGINATION' => $pagination,
|
||||||
'TOTAL_NEWS' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
|
'TOTAL_NEWS' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
|
||||||
'NP_PAGE_NUMBER' => on_page($total_news, $config['board3_number_of_news'], $start))
|
'NP_PAGE_NUMBER' => on_page($total_news, $config['board3_number_of_news_' . $module_id], $start))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -337,14 +337,14 @@ class portal_news_module
|
|||||||
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
|
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
|
||||||
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
|
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
|
||||||
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
||||||
'S_NEWEST_OR_FIRST' => ($config['board3_news_show_last']) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'],
|
'S_NEWEST_OR_FIRST' => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'],
|
||||||
'POSTED_BY_TEXT' => ($config['board3_news_show_last']) ? $user->lang['LAST_POST'] : $user->lang['POSTED'],
|
'POSTED_BY_TEXT' => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['LAST_POST'] : $user->lang['POSTED'],
|
||||||
'S_DISPLAY_NEWS' => true,
|
'S_DISPLAY_NEWS' => true,
|
||||||
'S_DISPLAY_NEWS_RVS' => ($config['board3_show_news_replies_views']) ? true : false,
|
'S_DISPLAY_NEWS_RVS' => ($config['board3_show_news_replies_views_' . $module_id]) ? true : false,
|
||||||
'S_TOPIC_ICONS' => $topic_icons,
|
'S_TOPIC_ICONS' => $topic_icons,
|
||||||
));
|
));
|
||||||
|
|
||||||
if($config['board3_news_style'])
|
if($config['board3_news_style_' . $module_id])
|
||||||
{
|
{
|
||||||
return 'news_compact_center.html';
|
return 'news_compact_center.html';
|
||||||
}
|
}
|
||||||
@@ -360,16 +360,16 @@ class portal_news_module
|
|||||||
'title' => 'ACP_PORTAL_NEWS_SETTINGS',
|
'title' => 'ACP_PORTAL_NEWS_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_NEWS_SETTINGS',
|
'legend1' => 'ACP_PORTAL_NEWS_SETTINGS',
|
||||||
'board3_news_style' => array('lang' => 'PORTAL_NEWS_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_news_style_' . $module_id => array('lang' => 'PORTAL_NEWS_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_show_all_news' => array('lang' => 'PORTAL_SHOW_ALL_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_show_all_news_' . $module_id => array('lang' => 'PORTAL_SHOW_ALL_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_number_of_news' => array('lang' => 'PORTAL_NUMBER_OF_NEWS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_number_of_news_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_NEWS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'board3_news_length' => array('lang' => 'PORTAL_NEWS_LENGTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'board3_news_length_' . $module_id => array('lang' => 'PORTAL_NEWS_LENGTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'board3_news_forum' => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
|
'board3_news_forum_' . $module_id => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
|
||||||
'board3_news_exclude' => array('lang' => 'PORTAL_NEWS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_news_exclude_' . $module_id => array('lang' => 'PORTAL_NEWS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_news_show_last' => array('lang' => 'PORTAL_NEWS_SHOW_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_news_show_last_' . $module_id => array('lang' => 'PORTAL_NEWS_SHOW_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_news_archive' => array('lang' => 'PORTAL_NEWS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_news_archive_' . $module_id => array('lang' => 'PORTAL_NEWS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_news_permissions' => array('lang' => 'PORTAL_NEWS_PERMISSIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_news_permissions_' . $module_id => array('lang' => 'PORTAL_NEWS_PERMISSIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_show_news_replies_views' => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_show_news_replies_views_' . $module_id => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -379,16 +379,16 @@ class portal_news_module
|
|||||||
*/
|
*/
|
||||||
function install($module_id)
|
function install($module_id)
|
||||||
{
|
{
|
||||||
set_config('board3_news_length', 250);
|
set_config('board3_news_length_' . $module_id, 250);
|
||||||
set_config('board3_news_forum', '');
|
set_config('board3_news_forum_' . $module_id, '');
|
||||||
set_config('board3_news_permissions', 1);
|
set_config('board3_news_permissions_' . $module_id, 1);
|
||||||
set_config('board3_number_of_news', 5);
|
set_config('board3_number_of_news_' . $module_id, 5);
|
||||||
set_config('board3_show_all_news', 1);
|
set_config('board3_show_all_news_' . $module_id, 1);
|
||||||
set_config('board3_news_exclude', 0);
|
set_config('board3_news_exclude_' . $module_id, 0);
|
||||||
set_config('board3_news_archive', 1);
|
set_config('board3_news_archive_' . $module_id, 1);
|
||||||
set_config('board3_news_show_last', 0);
|
set_config('board3_news_show_last_' . $module_id, 0);
|
||||||
set_config('board3_show_news_replies_views', 1);
|
set_config('board3_show_news_replies_views_' . $module_id, 1);
|
||||||
set_config('board3_news_style', 1);
|
set_config('board3_news_style_' . $module_id, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,16 +397,16 @@ class portal_news_module
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$del_config = array(
|
$del_config = array(
|
||||||
'board3_news_length',
|
'board3_news_length_' . $module_id,
|
||||||
'board3_news_forum',
|
'board3_news_forum_' . $module_id,
|
||||||
'board3_news_permissions',
|
'board3_news_permissions_' . $module_id,
|
||||||
'board3_number_of_news',
|
'board3_number_of_news_' . $module_id,
|
||||||
'board3_show_all_news',
|
'board3_show_all_news_' . $module_id,
|
||||||
'board3_news_exclude',
|
'board3_news_exclude_' . $module_id,
|
||||||
'board3_news_archive',
|
'board3_news_archive_' . $module_id,
|
||||||
'board3_news_show_last',
|
'board3_news_show_last_' . $module_id,
|
||||||
'board3_show_news_replies_views',
|
'board3_show_news_replies_views_' . $module_id,
|
||||||
'board3_news_style',
|
'board3_news_style_' . $module_id,
|
||||||
);
|
);
|
||||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
@@ -414,7 +414,7 @@ class portal_news_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create forum select box
|
// Create forum select box
|
||||||
function select_forums($value, $key)
|
function select_forums($value, $key, $module_id)
|
||||||
{
|
{
|
||||||
global $user, $config;
|
global $user, $config;
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ class portal_news_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store selected forums
|
// Store selected forums
|
||||||
function store_selected_forums($key)
|
function store_selected_forums($key, $module_id)
|
||||||
{
|
{
|
||||||
global $db, $cache;
|
global $db, $cache;
|
||||||
|
|
||||||
|
|||||||
@@ -157,14 +157,7 @@ class portal_user_menu_module
|
|||||||
|
|
||||||
function get_template_acp($module_id)
|
function get_template_acp($module_id)
|
||||||
{
|
{
|
||||||
return array(
|
return false
|
||||||
'title' => 'ACP_CONFIG_MODULENAME',
|
|
||||||
'vars' => array(
|
|
||||||
/*'legend1' => 'ACP_MODULENAME_CONFIGLEGEND',
|
|
||||||
'portal_configname' => array('lang' => 'MODULENAME_CONFIGNAME', 'validate' => 'string', 'type' => 'text:10:200', 'explain' => false),
|
|
||||||
'portal_configname2' => array('lang' => 'MODULENAME_CONFIGNAME2', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),*/
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user