The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

phpBB2 : Display the permalink of messages

View previous topic View next topic Go down

phpBB2 : Display the permalink of messages

Post by Ange Tuteur on June 30th 2014, 7:49 am

phpBB2 : Display the permalink of messages


Forumotion

The following tutorial will allow you to display the Permalink of each message in your Forumotion forum, as in the following Versions :

phpBB3
punBB
Invision
Before making any changes, make sure that your forum meets the following conditions :
- You must be the founder of the forum and have access to the templates,
- Your forum version must be phpBB2.


Editing the viewtopic_body template

Go to Administration Panel > Display > Templates > General and open the template entitled viewtopic_body.

Locate this part of the template, which is displaying the message title and the date / time which it was posted :
Code:
<td><span class="postdetails"><img src="{postrow.displayed.MINI_POST_IMG}" alt="{postrow.displayed.L_MINI_POST_ALT}" title="{postrow.displayed.L_MINI_POST_ALT}" border="0" />{L_POST_SUBJECT}: {postrow.displayed.POST_SUBJECT} <img src="{postrow.displayed.MINI_TIME_IMG}" alt="" border="0" />{postrow.displayed.POST_DATE}</span></td>


1. If you want to display the permalink in the message title :


Replace the part above with :
Code:
<td><span class="postdetails"><img src="{postrow.displayed.MINI_POST_IMG}" alt="{postrow.displayed.L_MINI_POST_ALT}" title="{postrow.displayed.L_MINI_POST_ALT}" border="0" />{L_POST_SUBJECT}: <a href="#{postrow.displayed.U_POST_ID}">{postrow.displayed.POST_SUBJECT}</a> <img src="{postrow.displayed.MINI_TIME_IMG}" alt="" border="0" />{postrow.displayed.POST_DATE}</span></td>


2. If you want to display the permalink of the message in a separate link :


Replace the part above with :
Code:
<td><span class="postdetails"><img src="{postrow.displayed.MINI_POST_IMG}" alt="{postrow.displayed.L_MINI_POST_ALT}" title="{postrow.displayed.L_MINI_POST_ALT}" border="0" />(<a href="#{postrow.displayed.U_POST_ID}">#</a>) {L_POST_SUBJECT}: {postrow.displayed.POST_SUBJECT} <img src="{postrow.displayed.MINI_TIME_IMG}" alt="" border="0" />{postrow.displayed.POST_DATE}</span></td>

Do not forget to save your changes, and publish the template by clicking the green plus "Add". Wink


Explanation

The purpose of our modification is simple : To make a link of the message ID and location to which it refers. This is what's commonly referred to as an Anchor. In the template, {postrow.displayed.U_POST_ID} is the message ID ; so it is inserted into the link :
Code:
<a href="#{postrow.displayed.U_POST_ID}"></a>

This allows us to know and use the exact URL of a specific message.






Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum