post number in post?

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
tjwuppert
Registered User
Posts: 4
Joined: Sat Jul 27, 2002 3:27 am
Location: Germany, Bremen
Contact:

post number in post?

Post by tjwuppert »

hullo!

i'm actually searching for a mod, which makes it possible to show the postnumber of a post in a thread. so you could see the number of your post and also copy the link to your post....

i saw that in other non-phpbb forums and searched uncounted hours ;) for something similar for phpbb.

here is what i saw: http://www.scifi-forum.de/showthread.ph ... genumber=2

there you can see in the upper-right corner of each post "Beitrag: xx" with an additional link...

i hope, there is a mod somewhere out there ^^
mitsubishi
Registered User
Posts: 527
Joined: Fri Aug 31, 2001 6:25 am
Location: UK
Contact:

Post by mitsubishi »

No mod needed,
{U_POST_ID}
is already sent to the template if want to use it, the little post icon iin the top left before "Posted:" is also a hyperlink to the post itself.
tjwuppert
Registered User
Posts: 4
Joined: Sat Jul 27, 2002 3:27 am
Location: Germany, Bremen
Contact:

Post by tjwuppert »

well, first thx for fast help :) .... but ^^

yay... ok that shows me the "overall" post id...

but i wanted something like the number inside a thread...
so that someone starts a thread the first post has somewhere the number 1... next reply 2 and so on and so on... :)
mitsubishi
Registered User
Posts: 527
Joined: Fri Aug 31, 2001 6:25 am
Location: UK
Contact:

Post by mitsubishi »

Right OK, I'm sure that's been done (might have been John Abela, or even me :roll: ). Not sure that it's in our DB though, think it got lost from mods.phpbb.com. I'll have a quick look around.
mitsubishi
Registered User
Posts: 527
Joined: Fri Aug 31, 2001 6:25 am
Location: UK
Contact:

Post by mitsubishi »

OK then, couldn't find anything, so here try this (in viewtopic.php)

Code: Select all

#
#---[ FIND ] -----
#  Line (614)


        'L_AUTHOR' => $lang['Author'],
        'L_MESSAGE' => $lang['Message'],
        'L_POSTED' => $lang['Posted'],
        

#
# ---- [ AFTER, ADD ] ----
#

                  'L_POST' => $lang['Post'],



#
#---[ FIND ] -----
#  Line (1329)

                'DELETE' => $delpost,

                'L_MINI_POST_ALT' => $mini_post_alt,
                
#
# ---- [ AFTER, ADD ] ----
#

                'POST_NUMBER' = $i + 1,
OK then you need to add:

Code: Select all

{L_POST} #{POST_NUMBER}
Wherever you want it in your viewtopic_body.tpl

*Note: if the post order is reversed the numbers still start at 1 for the first displayed post, is this not what you want?
tjwuppert
Registered User
Posts: 4
Joined: Sat Jul 27, 2002 3:27 am
Location: Germany, Bremen
Contact:

Post by tjwuppert »

we get closer ;)

that's the thing i wanted but the postcount counts new from #1 every page in the thread. it should go on... so if you have 30 posts per page it counts to 30 and the next page it is at #1... for me should be #31..

i think, that isn't so easy, hen? :(

well, it isn't so important that i couldn't exist without it ;)
thx again :)
mitsubishi
Registered User
Posts: 527
Joined: Fri Aug 31, 2001 6:25 am
Location: UK
Contact:

Post by mitsubishi »

tjwuppert wrote: that's the thing i wanted but the postcount counts new from #1 every page in the thread. it should go on... so if you have 30 posts per page it counts to 30 and the next page it is at #1... for me should be #31..

i think, that isn't so easy, hen? :(


Whoops, never thought of that!! No easy enough, just change:

Code: Select all

'POST_NUMBER' = $i + 1, 

// To

'POST_NUMBER' = $i + 1 + $start, 
Have I got it yet :lol: ?
tjwuppert
Registered User
Posts: 4
Joined: Sat Jul 27, 2002 3:27 am
Location: Germany, Bremen
Contact:

Post by tjwuppert »

woohoo! you got it!
seems to work fine :)

minor corrections so it works:

'POST_NUMBER' => $i + 1 + $start,

and in the template i had to set "postrow." to the var

;)


ok, now i'm happy ^^ thx
mitsubishi
Registered User
Posts: 527
Joined: Fri Aug 31, 2001 6:25 am
Location: UK
Contact:

Post by mitsubishi »

Yeah you're right, I forgot about all that :oops: , I must be doing around 20 things at once so I'm getting confused and cannot really afford the resources to start up apache to test so I missed the mistakes :P

Let me know if it wants anything else adding.
mgurain
Registered User
Posts: 89
Joined: Mon Jun 30, 2003 5:28 pm
Location: Al-Qatif - Al-Jarodiah

Post by mgurain »

hi,,

Is it validated and released ?

Or will it be ?

I need it soon,,

thanks in advance,,
vicky
Registered User
Posts: 52
Joined: Sat Aug 31, 2002 12:23 am

Post by vicky »

mgurain, it works.. however, can I see MOD to see post number in total not within a certain topic?
MarkS
Registered User
Posts: 613
Joined: Fri Jul 11, 2003 5:02 pm
Location: Sunshine State in the Good Ol' US of A
Contact:

Post by MarkS »

-EDIT-

Figured out my problem.

You need to change this:

Code: Select all

{L_POST} #{POST_NUMBER}
to this:

Code: Select all

{L_POST} #{postrow.POST_NUMBER}
mgurain
Registered User
Posts: 89
Joined: Mon Jun 30, 2003 5:28 pm
Location: Al-Qatif - Al-Jarodiah

Post by mgurain »

Hi,,

Can anybody roll it up in one MOD File and prepare it for download ? , instead of it being scattered here and there,,

thanks in advance,,
MarkS
Registered User
Posts: 613
Joined: Fri Jul 11, 2003 5:02 pm
Location: Sunshine State in the Good Ol' US of A
Contact:

Post by MarkS »

Not to take the glory away from the MOD author :wink: :
(BTW, GREAT job on this!) You can package it in a download file if you like, as you're the author.

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
#
viewtopic.php

# 
#-----[ FIND ]------------------------------------------ 
#
        'L_AUTHOR' => $lang['Author'], 
        'L_MESSAGE' => $lang['Message'], 
        'L_POSTED' => $lang['Posted'], 
        
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#  
        'L_POST' => $lang['Post'], 

# 
#-----[ FIND ]------------------------------------------ 
# 
                'DELETE' => $delpost, 

                'L_MINI_POST_ALT' => $mini_post_alt, 
                
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
                'POST_NUMBER' => $i + 1 + $start,

# 
#-----[ OPEN ]------------------------------------------ 
#
/templates/subSilver/viewtopic_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
#
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
{postrow.POSTER_FROM}

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
<br /><br />{L_POST} #{postrow.POST_NUMBER}

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
I positioned the location of the Post # to be two (2) spaces below the user's location. You can, of course, change where you want it to go. If you don't want any spaces, then just take out the <br />
Post Reply

Return to “[2.0.x] MOD Requests”