aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php43
1 files changed, 31 insertions, 12 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 7405bed645..14040176cb 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -483,11 +483,21 @@ if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('b
AND topic_id = $topic_id";
$db->sql_query($sql);
}
- $message = (($topic_data['bookmarked']) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']) . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
+ $message = (($topic_data['bookmarked']) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']);
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $viewtopic_url . '">', '</a>');
+ }
}
else
{
- $message = $user->lang['BOOKMARK_ERR'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
+ $message = $user->lang['BOOKMARK_ERR'];
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $viewtopic_url . '">', '</a>');
+ }
}
meta_refresh(3, $viewtopic_url);
@@ -1370,16 +1380,17 @@ if (sizeof($attach_list))
}
}
-$template->assign_vars(array(
- 'S_HAS_ATTACHMENTS' => $topic_data['topic_attachment'],
-));
-
$methods = phpbb_gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx);
foreach ($methods as $method)
{
$template->assign_block_vars('dl_method', $method);
}
+$template->assign_vars(array(
+ 'S_HAS_ATTACHMENTS' => $topic_data['topic_attachment'],
+ 'U_DOWNLOAD_ALL_ATTACHMENTS' => $methods[0]['LINK'],
+));
+
// Instantiate BBCode if need be
if ($bbcode_bitfield !== '')
{
@@ -1685,12 +1696,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$user_poster_data = $user_cache[$poster_id];
+ $current_row_number = $i;
+
/**
* Modify the posts template block
*
* @event core.viewtopic_modify_post_row
* @var int start Start item of this page
- * @var int i Number of the post on this page
+ * @var int current_row_number Number of the post on this page
* @var int end Number of posts on this page
* @var array row Array with original post and user data
* @var array cp_row Custom profile field data of the poster
@@ -1698,11 +1711,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
* @var array user_poster_data Poster's data from user cache
* @var array post_row Template block array of the post
* @since 3.1-A1
- * @change 3.1.0-a2 Added vars start, i, end, and attachments
+ * @change 3.1.0-a3 Added vars start, current_row_number, end, attachments
*/
- $vars = array('start', 'i', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars)));
+ $i = $current_row_number;
+
if (isset($cp_row['row']) && sizeof($cp_row['row']))
{
$post_row = array_merge($post_row, $cp_row['row']);
@@ -1736,23 +1751,27 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
}
}
+ $current_row_number = $i;
+
/**
* Event after the post data has been assigned to the template
*
* @event core.viewtopic_post_row_after
* @var int start Start item of this page
- * @var int i Number of the post on this page
+ * @var int current_row_number Number of the post on this page
* @var int end Number of posts on this page
* @var array row Array with original post and user data
* @var array cp_row Custom profile field data of the poster
* @var array attachments List of attachments
* @var array user_poster_data Poster's data from user cache
* @var array post_row Template block array of the post
- * @since 3.1.0-a2
+ * @since 3.1.0-a3
*/
- $vars = array('start', 'i', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars)));
+ $i = $current_row_number;
+
$prev_post_id = $row['post_id'];
unset($rowset[$post_list[$i]]);