phpBB2 : Display the permalink of messages Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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

    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Tutorial phpBB2 : Display the permalink of messages

    Post by Ange Tuteur June 30th 2014, 12:49 pm

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