The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

phpBB2 : Display the permalink of messages

Go down

Tutorial phpBB2 : Display the permalink of messages

Post by Ange Tuteur Sun 29 Jun - 23:49

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
phpbb2 - phpBB2 : Display the permalink of messages Captur26
punBB
phpbb2 - phpBB2 : Display the permalink of messages Captur27
Invision
phpbb2 - phpBB2 : Display the permalink of messages Captur28
phpbb2 - phpBB2 : Display the permalink of messages 209609infoBefore 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 :
phpbb2 - phpBB2 : Display the permalink of messages Captur29

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 :
phpbb2 - phpBB2 : Display the permalink of messages Captur30

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
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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