diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php
index 0ffc556241..5bc7441978 100644
--- a/phpBB/adm/admin_attachments.php
+++ b/phpBB/adm/admin_attachments.php
@@ -302,7 +302,7 @@ if ($submit && $mode == 'ext_groups')
$group_ary = array(
'group_name' => $group_name,
- 'cat_id' => request_var('special_category', NONE_CAT),
+ 'cat_id' => request_var('special_category', ATTACHMENT_CATEGORY_NONE),
'allow_group' => (isset($_REQUEST['allow_group'])) ? 1 : 0,
'download_mode' => request_var('download_mode', INLINE_LINK),
'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon,
@@ -570,7 +570,7 @@ if ($mode == 'attach')
lang['SETTINGS_CAT_IMAGES']; ?> |
- lang['ASSIGNED_GROUP']; ?>: lang['NONE']); ?> |
+ lang['ASSIGNED_GROUP']; ?>: lang['NONE']); ?> |
lang['DISPLAY_INLINED']; ?>: lang['DISPLAY_INLINED_EXPLAIN']; ?> |
@@ -710,10 +710,10 @@ if ($mode == 'attach')
if ($mode == 'ext_groups')
{
$cat_lang = array(
- NONE_CAT => $user->lang['NONE'],
- IMAGE_CAT => $user->lang['CAT_IMAGES'],
- WM_CAT => $user->lang['CAT_WM_FILES'],
- RM_CAT => $user->lang['CAT_RM_FILES']
+ ATTACHMENT_CATEGORY_NONE => $user->lang['NONE'],
+ ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
+ ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
+ ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES']
);
@@ -1281,10 +1281,10 @@ function category_select($select_name, $group_id = FALSE)
global $db, $user;
$types = array(
- NONE_CAT => $user->lang['NONE'],
- IMAGE_CAT => $user->lang['CAT_IMAGES'],
- WM_CAT => $user->lang['CAT_WM_FILES'],
- RM_CAT => $user->lang['CAT_RM_FILES']
+ ATTACHMENT_CATEGORY_NONE => $user->lang['NONE'],
+ ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
+ ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
+ ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES']
);
if ($group_id)
@@ -1294,13 +1294,13 @@ function category_select($select_name, $group_id = FALSE)
WHERE group_id = ' . intval($group_id);
$result = $db->sql_query($sql);
- $cat_type = (!($row = $db->sql_fetchrow($result))) ? NONE_CAT : $row['cat_id'];
+ $cat_type = (!($row = $db->sql_fetchrow($result))) ? ATTACHMENT_CATEGORY_NONE : $row['cat_id'];
$db->sql_freeresult($result);
}
else
{
- $cat_type = NONE_CAT;
+ $cat_type = ATTACHMENT_CATEGORY_NONE;
}
$group_select = '
+
+
+ {PROFILE_FIELD_1_NAME}: |
+ {PROFILE_FIELD_1_VALUE} |
+
+
diff --git a/phpBB/styles/subSilver/template/posting_preview.html b/phpBB/styles/subSilver/template/posting_preview.html
index 813ba21875..6679187b73 100644
--- a/phpBB/styles/subSilver/template/posting_preview.html
+++ b/phpBB/styles/subSilver/template/posting_preview.html
@@ -42,7 +42,7 @@
- {PREVIEW_MESSAGE}
+ | {PREVIEW_MESSAGE}
diff --git a/phpBB/styles/subSilver/template/search_results_posts.html b/phpBB/styles/subSilver/template/search_results_posts.html
index c85a718bd3..f1b193aec6 100644
--- a/phpBB/styles/subSilver/template/search_results_posts.html
+++ b/phpBB/styles/subSilver/template/search_results_posts.html
@@ -55,7 +55,7 @@
|
-{PAGE_NUMBER} [ {TOTAL_TOPICS} ] {PAGINATION}
+{PAGE_NUMBER} [ {TOTAL_TOPICS} ]
diff --git a/phpBB/styles/subSilver/template/search_results_topics.html b/phpBB/styles/subSilver/template/search_results_topics.html
index 61c53d0c3e..39c24e4b55 100644
--- a/phpBB/styles/subSilver/template/search_results_topics.html
+++ b/phpBB/styles/subSilver/template/search_results_topics.html
@@ -49,7 +49,7 @@
|
-{PAGE_NUMBER} [ {TOTAL_TOPICS} ]
{PAGINATION}
+{PAGE_NUMBER} [ {TOTAL_TOPICS} ]
diff --git a/phpBB/styles/subSilver/template/ucp_attachments.html b/phpBB/styles/subSilver/template/ucp_attachments.html
index 463b4b468b..d2a68f508e 100644
--- a/phpBB/styles/subSilver/template/ucp_attachments.html
+++ b/phpBB/styles/subSilver/template/ucp_attachments.html
@@ -32,7 +32,7 @@
-{PAGE_NUMBER}
+{PAGE_NUMBER}
diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_footer.html b/phpBB/styles/subSilver/template/ucp_pm_message_footer.html
index 90f48fc112..5301e75531 100644
--- a/phpBB/styles/subSilver/template/ucp_pm_message_footer.html
+++ b/phpBB/styles/subSilver/template/ucp_pm_message_footer.html
@@ -9,7 +9,7 @@
{PAGE_NUMBER}
|
[ {TOTAL_MESSAGES} ] |
- {PAGINATION} |
+ {L_GOTO_PAGE} {L_PREVIOUS} {PAGINATION} {L_NEXT} |
diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_header.html b/phpBB/styles/subSilver/template/ucp_pm_message_header.html
index e3209bb767..24476f3770 100644
--- a/phpBB/styles/subSilver/template/ucp_pm_message_header.html
+++ b/phpBB/styles/subSilver/template/ucp_pm_message_header.html
@@ -29,7 +29,7 @@ function marklist(form_name, status)
{PAGE_NUMBER}
|
[ {TOTAL_MESSAGES} ] |
- {PAGINATION} |
+ {L_GOTO_PAGE} {L_PREVIOUS} {PAGINATION} {L_NEXT} |
diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html
index 0040ad6464..d47cfe7d41 100644
--- a/phpBB/styles/subSilver/template/viewforum_body.html
+++ b/phpBB/styles/subSilver/template/viewforum_body.html
@@ -47,7 +47,11 @@
{REPORTED_IMG}
- {topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} {topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE}
+ {topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} {topicrow.TOPIC_TITLE}
+
+ [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ]
+
+
{topicrow.TOPIC_AUTHOR} |
{topicrow.REPLIES} |
{topicrow.VIEWS} |
@@ -109,7 +113,7 @@
{PAGE_NUMBER}
|
[ {TOTAL_TOPICS} ] |
- {PAGINATION} |
+ {L_GOTO_PAGE} {L_PREVIOUS} {PAGINATION} {L_NEXT} |
@@ -162,7 +166,11 @@
{REPORTED_IMG}
- {topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} {topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE}
+ {topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} {topicrow.TOPIC_TITLE}
+
+ [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ]
+
+
{topicrow.TOPIC_AUTHOR} |
{topicrow.REPLIES} |
{topicrow.VIEWS} |
@@ -200,7 +208,7 @@
{POST_IMG} |
{PAGE_NUMBER} |
[ {TOTAL_TOPICS} ] |
- {PAGINATION} |
+ {L_GOTO_PAGE} {L_PREVIOUS} {PAGINATION} {L_NEXT} |
diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html
index 9c383feae7..8b4ee1d40b 100644
--- a/phpBB/styles/subSilver/template/viewtopic_body.html
+++ b/phpBB/styles/subSilver/template/viewtopic_body.html
@@ -36,7 +36,7 @@
{PAGE_NUMBER}
|
[ {TOTAL_POSTS} ] |
- {PAGINATION} |
+ {L_GOTO_PAGE} {L_PREVIOUS} {PAGINATION} {L_NEXT} |
@@ -171,6 +171,7 @@
{L_JOINED}: {postrow.POSTER_JOINED}
{L_POSTS}: {postrow.POSTER_POSTS}
{L_LOCATION}: {postrow.POSTER_FROM}
+
{postrow.PROFILE_FIELD_1_NAME}: {postrow.PROFILE_FIELD_1_VALUE}
@@ -275,7 +276,7 @@
{PAGE_NUMBER}
|
[ {TOTAL_POSTS} ] |
- {PAGINATION} |
+ {L_GOTO_PAGE} {L_PREVIOUS} {PAGINATION} {L_NEXT} |
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 761bc41c9c..a9ab3bbf5b 100755
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -312,7 +312,7 @@ switch ($mode)
foreach ($_COOKIE as $cookie_name => $cookie_data)
{
$cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
- if (!strstr($cookie_name, '_poll'))
+ if (strpos($cookie_name, '_poll') === false)
{
$user->set_cookie($cookie_name, '', $set_time);
}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index afafb1d457..1b03061a2e 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -277,6 +277,8 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
'REPORTED_IMG' => $user->img('icon_reported', 'TOPIC_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'TOPIC_UNAPPROVED'),
+ 'GOTO_PAGE_IMG' => $user->img('icon_post', 'GOTO_PAGE'),
+
'L_NO_TOPICS' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['POST_FORUM_LOCKED'] : $user->lang['NO_TOPICS'],
'S_IS_POSTABLE' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
@@ -503,29 +505,28 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
if (($replies + 1) > $config['posts_per_page'])
{
$total_pages = ceil(($replies + 1) / $config['posts_per_page']);
- $goto_page = ' [ ' . $user->img('icon_post', 'GOTO_PAGE') . $user->lang['GOTO_PAGE'] . ': ';
+ $pagination = '';
$times = 1;
for($j = 0; $j < $replies + 1; $j += $config['posts_per_page'])
{
- $goto_page .= "$times";
+ $pagination .= "$times";
if ($times == 1 && $total_pages > 4)
{
- $goto_page .= ' ... ';
+ $pagination .= ' ... ';
$times = $total_pages - 3;
$j += ($total_pages - 4) * $config['posts_per_page'];
}
else if ($times < $total_pages)
{
- $goto_page .= $user->theme['primary']['pagination_sep'];
+ $pagination .= $user->theme['primary']['pagination_sep'];
}
$times++;
}
- $goto_page .= ' ] ';
}
else
{
- $goto_page = '';
+ $pagination = '';
}
// Generate all the URIs ...
@@ -549,7 +550,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'],
- 'GOTO_PAGE' => $goto_page,
+ 'PAGINATION' => $pagination,
'REPLIES' => ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'],
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 0b5fac444b..1f927b99e8 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -639,7 +639,7 @@ if (!empty($poll_start))
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$poll_bbcode = new bbcode();
- for ($i = 0, $j = sizeof($poll_info); $i < $j; $i++)
+ for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
{
$poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
$poll_info[$i]['poll_option_text'] = smilie_text($poll_info[$i]['poll_option_text']);
@@ -953,14 +953,15 @@ while ($row = $db->sql_fetchrow($result))
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
-/*
-if ($config['load_cp_viewtopic'])
+// Load custom profile fields
+if ($config['load_cpf_viewtopic'])
{
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$cp = new custom_profile();
+
+ // Grab all profile fields from users in id cache for later use - similar to the poster cache
$profile_fields_cache = $cp->generate_profile_fields_template('grab', $id_cache);
}
-*/
// Generate online information for user
if ($config['load_onlinetrack'] && sizeof($id_cache))
@@ -1119,12 +1120,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$message = $row['post_text'];
// If the board has HTML off but the post has HTML on then we process it, else leave it alone
- if (!$auth->acl_get('f_html', $forum_id))
+ if (!$auth->acl_get('f_html', $forum_id) && $row['enable_html'])
{
- if ($row['enable_html'] && $auth->acl_get('f_bbcode', $forum_id))
- {
- $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message);
- }
+ $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message);
}
// Second parse bbcode here
@@ -1136,6 +1134,17 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
// Always process smilies after parsing bbcodes
$message = smilie_text($message);
+ if (isset($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]))
+ {
+ $unset_attachments = parse_inline_attachments($message, $attachments[$row['post_id']], $update_count, $forum_id);
+
+ // Needed to let not display the inlined attachments at the end of the post again
+ foreach ($unset_attachments as $index)
+ {
+ unset($attachments[$row['post_id']][$index]);
+ }
+ }
+
// Highlight active words (primarily for search)
if ($highlight_match)
{
@@ -1144,6 +1153,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $highlight_match . ")\b#i', '\\\\1', '\\0')", '>' . $message . '<'), 1, -1));
}
+ if ($row['enable_html'] && $auth->acl_get('f_html', $forum_id))
+ {
+ // Remove Comments from post content?
+ $message = preg_replace('##is', '', $message);
+ }
+
// Replace naughty words such as farty pants
$row['post_subject'] = censor_text($row['post_subject']);
$message = str_replace("\n", '
', censor_text($message));
@@ -1196,47 +1211,15 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$l_bumped_by = '';
}
- if (isset($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]))
- {
- $tpl = &$attachments[$row['post_id']];
- $tpl = display_attachments($forum_id, NULL, $tpl, $update_count, false, true);
- $tpl_size = sizeof($tpl);
+ $cp_row = array();
- $unset_tpl = array();
-
- preg_match_all('#(.*?)#', $message, $matches);
-
- $replace = array();
- foreach ($matches[0] as $num => $capture)
- {
- // Flip index if we are displaying the reverse way
- $index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num];
-
- $replace['from'][] = $matches[0][$index];
- $replace['to'][] = (isset($tpl[$index])) ? $tpl[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][$num]);
-
- $unset_tpl[] = $index;
- }
- unset($tpl, $tpl_size);
-
- if (isset($replace['from']))
- {
- $message = str_replace($replace['from'], $replace['to'], $message);
-
- foreach (array_unique($unset_tpl) as $index)
- {
- unset($attachments[$row['post_id']][$index]);
- }
- }
- }
-
- /* Dump vars into template
- if ($config['load_cp_viewtopic'])
+ //
+ if ($config['load_cpf_viewtopic'])
{
$cp_row = (isset($profile_fields_cache[$poster_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields_cache[$poster_id]) : array();
}
- */
+ //
$postrow = array(
'POSTER_NAME' => $row['poster'],
'POSTER_RANK' => $user_cache[$poster_id]['rank_title'],
@@ -1290,14 +1273,16 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'],
'S_FRIEND' => ($row['friend']) ? true : false,
'S_UNREAD' => ($user->data['user_id'] != ANONYMOUS && $row['post_time'] > $user->data['user_lastvisit'] && $row['post_time'] > $topic_last_read) ? true : false,
- 'S_FIRST_UNREAD' => ($unread_post_id == $row['post_id']) ? true : false
+ 'S_FIRST_UNREAD' => ($unread_post_id == $row['post_id']) ? true : false,
+ 'S_CUSTOM_FIELDS' => (sizeof($cp_row)) ? true : false
);
-/* if (sizeof($cp_row))
+ if (sizeof($cp_row))
{
$postrow = array_merge($postrow, $cp_row);
- }*/
+ }
+ // Dump vars into template
$template->assign_block_vars('postrow', $postrow);
// Display not already displayed Attachments for this post, we already parsed them. ;)