Page 1 of 1

view last post link in pagination

Posted: 19 Aug 2010, 21:07
by Steve
As per requested here : viewtopic.php?f=19&t=1083&start=0
Description: Adds a last post link to take you to the last post in the topic,could be handy.

Open viewtopic.php
find:

Code: Select all

// Replace naughty words in title
$topic_data['topic_title'] = censor_text($topic_data['topic_title']);
add after:

Code: Select all

$view_topic_url_params = 't=' . '&t=' . $topic_id;
find:

Code: Select all

	'U_EMAIL_TOPIC'			=> ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&t=$topic_id") : '',
   
add after:

Code: Select all

    // begin last post
	'U_LAST_POST'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $topic_data['topic_last_post_id']) . '#p' . $topic_data['topic_last_post_id'],	
    'LASTPOST_IMG'          => $user->img('button_last_post', 'LAST_POST'),
	// end last post
Open language/en/viewtopic.php
find:

Code: Select all

	'LINKAGE_FORBIDDEN'		=> 'You are not authorised to view, download or link from/to this site.',
add before:

Code: Select all

	'LAST_POST'            => 'Last post',
Open styles/prosilver/template/viewtopic_body.html
find:

Code: Select all

<!-- IF PAGE_NUMBER --><!-- IF PAGINATION -->
in line add after:

Code: Select all

&bull; <a href="{U_LAST_POST}">{L_LAST_POST}</a>
find:

Code: Select all

<!-- IF PAGE_NUMBER --><!-- IF PAGINATION -->
in line add after:

Code: Select all

&bull; <a href="{U_LAST_POST}">{L_LAST_POST}</a>
Open styles/subsilver2/template/viewtopic_body.html
find:

Code: Select all

<td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
replace with:

Code: Select all

<td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- IF not S_IS_BOT && PAGINATION --><b> | <a href="{U_LAST_POST}">{L_LAST_POST}</a> |</b><!-- ENDIF --><!-- INCLUDE pagination.html --></td>
find:

Code: Select all

<td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
replace with:

Code: Select all

<td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- IF not S_IS_BOT && PAGINATION --><b> | <a href="{U_LAST_POST}">{L_LAST_POST}</a> |</b><!-- ENDIF --><!-- INCLUDE pagination.html --></td>
Refresh template for both prosilver and subsilver2 styles.
pics:
last1.PNG
last.PNG

Re: view last post link in pagination

Posted: 20 Aug 2010, 00:29
by kevinviet
Thanks Steve, Look very interesting. ;)