[feature/controller] Fix missing issues that prevented portal from working
The portal still requires the fix to PHPBB3-11323 in order to work. B3P-114
This commit is contained in:
@@ -404,16 +404,16 @@ function character_limit(&$title, $limit = 0)
|
||||
*/
|
||||
function get_sub_taged_string($message, $bbcode_uid, $length)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
global $portal_root_path, $phpEx;
|
||||
|
||||
if(!class_exists('phpbb_trim_message'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/trim_message/trim_message.' . $phpEx);
|
||||
include($portal_root_path . '../includes/trim_message/trim_message.' . $phpEx);
|
||||
}
|
||||
|
||||
if(!class_exists('phpbb_trim_message_bbcodes'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/trim_message/bbcodes.' . $phpEx);
|
||||
include($portal_root_path . '../includes/trim_message/bbcodes.' . $phpEx);
|
||||
}
|
||||
|
||||
$object = new phpbb_trim_message($message, $bbcode_uid, $length);
|
||||
|
||||
@@ -53,14 +53,16 @@ class portal_birthday_list_module
|
||||
|
||||
// Generate birthday list if required ... / borrowed from index.php 3.0.6
|
||||
$birthday_list = $birthday_ahead_list = '';
|
||||
|
||||
if ($config['load_birthdays'] && $config['allow_birthdays'])
|
||||
{
|
||||
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
|
||||
$time = $user->create_datetime();
|
||||
$now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset());
|
||||
$cache_days = $config['board3_birthdays_ahead_' . $module_id];
|
||||
$sql_days = '';
|
||||
while ($cache_days > 0)
|
||||
{
|
||||
$day = getdate(time() + 86400 * $cache_days + $user->timezone + $user->dst - date('Z'));
|
||||
$day = phpbb_gmgetdate($time->getTimestamp() + 86400 * $cache_days + $time->getOffset());
|
||||
$sql_days .= " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $day['mday'], $day['mon'])) . "%'";
|
||||
$cache_days--;
|
||||
}
|
||||
@@ -76,7 +78,7 @@ class portal_birthday_list_module
|
||||
$order_by = 'SUBSTRING(u.user_birthday FROM 4 FOR 2) ASC, SUBSTRING(u.user_birthday FROM 1 FOR 2) ASC, u.username_clean ASC';
|
||||
break;
|
||||
}
|
||||
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
|
||||
|
||||
$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
|
||||
FROM ' . USERS_TABLE . ' u
|
||||
LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
|
||||
|
||||
@@ -89,8 +89,11 @@ class portal_calendar_module
|
||||
}
|
||||
|
||||
// initialise some variables
|
||||
$today_timestamp = time() + $user->timezone + $user->dst;
|
||||
$mini_cal_today = date('Ymd', time() + $user->timezone + $user->dst - date('Z'));
|
||||
$time = $user->create_datetime();
|
||||
$now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset());
|
||||
$today_timestamp = $now[0];
|
||||
$mini_cal_today = date('Ymd', $today_timestamp - date('Z'));
|
||||
$this->stamp = $today_timestamp;
|
||||
$s_cal_month = ($this->mini_cal_month != 0) ? $this->mini_cal_month . ' month' : $mini_cal_today;
|
||||
$this->getMonth($s_cal_month);
|
||||
$mini_cal_count = $this->mini_cal_fdow;
|
||||
@@ -102,8 +105,8 @@ class portal_calendar_module
|
||||
// output our general calendar bits
|
||||
$down = $this->mini_cal_month - 1;
|
||||
$up = $this->mini_cal_month + 1;
|
||||
$prev_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m$module_id=$down#minical$module_id") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/cal_icon_left_arrow.png' . '" title="' . $user->lang['VIEW_PREVIOUS_MONTH'] . '" height="16" width="16" alt="<<" /></a>';
|
||||
$next_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m$module_id=$up#minical$module_id") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/cal_icon_right_arrow.png' . '" title="' . $user->lang['VIEW_NEXT_MONTH'] . '" height="16" width="16" alt=">>" /></a>';
|
||||
$prev_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m$module_id=$down#minical$module_id") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->style['style_path'] . '/theme/images/portal/cal_icon_left_arrow.png' . '" title="' . $user->lang['VIEW_PREVIOUS_MONTH'] . '" height="16" width="16" alt="<<" /></a>';
|
||||
$next_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m$module_id=$up#minical$module_id") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->style['style_path'] . '/theme/images/portal/cal_icon_right_arrow.png' . '" title="' . $user->lang['VIEW_NEXT_MONTH'] . '" height="16" width="16" alt=">>" /></a>';
|
||||
|
||||
$template->assign_block_vars('minical', array(
|
||||
'S_SUNDAY_FIRST' => ($config['board3_sunday_first_' . $module_id]) ? true : false,
|
||||
@@ -576,7 +579,7 @@ class portal_calendar_module
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->stamp = strtotime($date) + $user->timezone + $user->dst;
|
||||
$this->stamp = (empty($this->stamp)) ? strtotime($date) + $user->timezone + $user->dst : $this->stamp;
|
||||
return ($this->stamp);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,8 @@ class portal_news_module
|
||||
// Grab icons
|
||||
$icons = $cache->obtain_icons();
|
||||
|
||||
phpbb_generate_template_pagination($template, $view_topic_url, 'pagination', 'np', $fetch_news[$i]['topic_replies'], $config['board3_number_of_news_' . $module_id], $start);
|
||||
|
||||
$template->assign_block_vars('news_row', array(
|
||||
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||
'FORUM_NAME' => ($forum_id) ? $fetch_news[$i]['forum_name'] : '',
|
||||
@@ -240,7 +242,6 @@ class portal_news_module
|
||||
'S_NOT_LAST' => ($i < sizeof($fetch_news) - 1) ? true : false,
|
||||
'S_POLL' => $fetch_news[$i]['poll'],
|
||||
'S_UNREAD_INFO' => $unread_topic,
|
||||
'PAGINATION' => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
|
||||
'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
|
||||
));
|
||||
|
||||
@@ -258,8 +259,8 @@ class portal_news_module
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'NP_PAGINATION' => $pagination,
|
||||
'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_' . $module_id], $start))
|
||||
'TOTAL_NEWS' => ($total_news == 1) ? sprintf($user->lang['VIEW_FORUM_TOPICS'][1], $total_news) : sprintf($user->lang['VIEW_FORUM_TOPICS'][2], $total_news),
|
||||
'NP_PAGE_NUMBER' => phpbb_on_page($template, $user, $view_topic_url, $total_news, $config['board3_number_of_news_' . $module_id], $start))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ class portal_statistics_module
|
||||
$total_users = $config['num_users'];
|
||||
$total_files = $config['num_files'];
|
||||
|
||||
$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
|
||||
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
|
||||
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
|
||||
$l_total_user_s = ($total_users == 0) ? sprintf($user->lang['TOTAL_USERS_ZERO'], $total_users) : sprintf($user->lang['TOTAL_USERS'][2], $total_users);
|
||||
$l_total_post_s = ($total_posts == 0) ? sprintf($user->lang['TOTAL_POSTS_ZERO'], $total_posts) : sprintf($user->lang['TOTAL_POSTS_COUNT'][2], $total_posts);
|
||||
$l_total_topic_s = ($total_topics == 0) ? sprintf($user->lang['TOTAL_TOPICS_ZERO'], $total_topics) : sprintf($user->lang['TOTAL_TOPICS'][2], $total_topics);
|
||||
|
||||
// avarage stat
|
||||
$board_days = (time() - $config['board_startdate']) / 86400;
|
||||
@@ -116,12 +116,11 @@ class portal_statistics_module
|
||||
|
||||
$topics_count = $this->get_topics_count();
|
||||
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'B3_TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
|
||||
'B3_TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
|
||||
'B3_TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
|
||||
'B3_TOTAL_POSTS' => $l_total_post_s,
|
||||
'B3_TOTAL_TOPICS' => $l_total_topic_s,
|
||||
'B3_TOTAL_USERS' => $l_total_user_s,
|
||||
'B3_NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
|
||||
'B3_ANNOUNCE_COUNT' => $topics_count[POST_ANNOUNCE],
|
||||
'B3_STICKY_COUNT' => $topics_count[POST_STICKY],
|
||||
|
||||
@@ -70,7 +70,7 @@ class portal_stylechanger_module
|
||||
$url = append_sid("{$phpbb_root_path}portal.$phpEx", 'style=' . $row['style_id']);
|
||||
}
|
||||
++$style_count;
|
||||
$style_select .= '<option value="' . $url . '"' . ($row['style_id'] == $user->theme['style_id'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($row['style_name']) . '</option>';
|
||||
$style_select .= '<option value="' . $url . '"' . ($row['style_id'] == $user->style['style_id'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($row['style_name']) . '</option>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
if(strlen($style_select))
|
||||
|
||||
@@ -51,7 +51,7 @@ class portal_user_menu_module
|
||||
{
|
||||
global $config, $template, $user, $auth, $db, $phpEx, $phpbb_root_path;
|
||||
|
||||
if (!function_exists('display_forums'))
|
||||
if (!function_exists('get_user_avatar'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user