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 & phpbb3 : Display post numbers

View previous topic View next topic Go down

phpbb2 & phpbb3 : Display post numbers

Post by Ange Tuteur on January 16th 2015, 7:43 am

Display post numbers for phpbb2 and phpbb3

This tutorial will help you display the number on posts for versions phpbb2 and phpbb3 of yourForumotion forum.



Modification of viewtopic_body

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

Exclamation Follow the instructions for your forum version !

Phpbb3

Find :
Code:
<div style="position: relative; top: -30px; width: 1px;" id="{postrow.displayed.U_POST_ID}"></div>

Replace by :
Code:
<div style="position: relative; top: -30px; width: 1px;" id="{postrow.displayed.U_POST_ID}"></div>
<div class="postNumberContainer"><a href="{postrow.displayed.POST_URL}" class="postNumber">#{postrow.displayed.COUNT_POSTS}</a></div>

Phpbb2

Find :
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}&nbsp; &nbsp;<img src="{postrow.displayed.MINI_TIME_IMG}" alt="" border="0" />{postrow.displayed.POST_DATE}</span></td>

Replace by :
Code:
<td><span class="postdetails"><a class="postNumber" href="{postrow.displayed.POST_URL}">#{postrow.displayed.COUNT_POSTS}</a><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}&nbsp; &nbsp;<img src="{postrow.displayed.MINI_TIME_IMG}" alt="" border="0" />{postrow.displayed.POST_DATE}</span></td>

Modifications :
To change the # next to the post number. Find #{postrow.displayed.COUNT_POSTS} and replace the # with whatever you want.

Don't forget to save and publish the template ! Add

Afterwards you should now see the numbers on posts. See the next section for style modifications. Wink


Modifying the style

To change the style go to Administration Panel > Display > Colors > CSS stylesheet. Paste any of the codes below that are for your forum version.

If you want to align the number to the right on phpbb3 :
Code:
.postNumberContainer { text-align:right }
You can change the alignment with these values : left || center || right


To change the display of the number like this : , use the example below and modify it to your liking.
Code:
a.postNumber {
 font-size:10px; /* size of the number */
 color:#666; /* color of the link */
 background:#EEE; /* background color */
 border:1px solid #CCC; /* border size, type, and color */
 border-radius:3px; /* border roundness */
 display:inline-block; /* display state */
 padding:2px; /* inner spacing */
}


Information :
The classname .postNumber is used to style the post number link. e.g. #1, #2, #3

The classname .postNumberContainer is used only in phpbb3, and refers to the container that holds the post number.




Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
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