Post # of # posts?

Started by Mark S, October 27, 2015, 10:34:50 PM

Previous topic - Next topic

Mark S

Is there mod that will show the post number and total posts in a topic?

What I mean would be similar to a written article that has  Page 1 of 10 pages, Pg 2 of 10, Pg 3 if 10, etc, except it would be Post 1 of 20, 2 of 20, etc., where the total number of posts changes when new replies are added, of course.

Thaknks


margarett

It should be a simple tweak, all variables already exist ;)

In "topic display mode" you have a general $context['total_visible_posts'] which tells you how many... errmmmm, visible posts :P the topic has.
And each message has a $message['counter'] which is the order number of the post in the topic (starts with 0 so you need to increment it + 1 to display)

So all it should take is to
echo 'Post ' . $message['counter'] + 1 . ' of ' . $context['total_visible_posts'];
In a proper location of Display.template.php (before or after the subject, maybe?)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Mark S

Well, it does show, "reply #2, reply #3, etc." under the topic already, so I think that's good enough for referencing when desired.  Showing the total number of post in the topic isn't really of big importance and I don't want to code hack.  I stopped doing that when 2.0 came out because I hated having to redo all my custom hacks every time an update came around.

At least it's an easy one and I appreciate the reply!  Would make a good packaged mod.

Kindred

you do realize that - by using the PATCH (like any other mod) - you will not lose your personal customized/hacked code changes...

the only reason that you would lose changes is if you use the "large upgrade" every time.
That is only required if jumping versions (1.1.x to 2.0.x) or jumping multiple sub-versions but not single sub-version updates (2.0.x to 2.0.x+1)

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Mark S


Advertisement: