Version: , by bira
Developer Last Online: Jun 2013
Version: 2.2.x
Rating:
Released: 07-05-2001
Last Update: Never
Installs: 168
No support by the author.
This is a small hack I have on my BB that I posted some 2 months ago in reply to a thread in the hacks request forum. Since then, a couple of people contacting me asking me this hack, so I'm posting it here in the release forum.
It numbers your posts in a thread - the first one has the number 1 written on it, the second 2 etc. This will accurately count the post number irrespective of the page you are on, and tt helps orientation on long threads (and our threads are long).
The post number on my BB is also a hyperlink, so people can copy the direct URL to that specific post.
Installation is simple:
INSTALLATION INSTRUCTIONS FOR VERSIONS BEFORE 2.0.3 scroll down for installation in version 2.0.3 and later
Open showthread.php
Find
PHP Code:
while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
Edit template postbit and place the variable $countposts where you want the post # to show.
For example, place <smallfont>Post #$countposts</smallfont> somewhere at the bottom or <a href="showthread.php?postid=$post[postid]#post$post[postid]"><smallfont>$countposts</smallfont></a> if you want the numebr to also be a hyperlink directly to that post.
INSTALLATION INSTRUCTION FOR VERSIONS 2.0.3 AND UP
ok, how 'postbit' is parsed has changed since 2.0.3 so here's what you need to do to install this:
Quote:
Originally posted by freddie
If you want a one file hack for this than do this:
find in showthread.php:
while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
Put this before it:
$postcount = ($pagenumber - 1 ) * $perpage;
Find in showthread.php:
$postbits .= getpostbit($post);
Put this before it:
$post[postcount] = ++$postcount;
Then put $post[postcount] in your postbit template.
save and upload.
Edit template postbit AND postbit_ignore and place the variable $countposts where you want the post # to show.
For example, place <smallfont>Post #$post[postcount]</smallfont> somewhere at the bottom or <a href="showthread.php?postid=$post[postid]#post$post[postid]"><smallfont>$post[postcount]</smallfont></a> if you want the numebr to also be a hyperlink directly to that post.
Posibly a template issue. If you hav ethe #postXX (where XX is the id) in the URL then the hack is working fine, you would have removed code in the default templates this points to.
Originally posted by ZiRu$ I'm using 2.2.6 and i cant get this hack to work perfectly...it counts and displays the posts but the link dosent work right...it always goes to the TOP of the page
my forum is 2.2.7 and fine working.
tell what about your problem.. maybe i can helped.
I'm pretty sure this is a template problem and nothing to do with this hack, you should allways go to the correct post using the URL you posted even if you haven't installed this hack.
Do you get returned to the correct post after you reply to a thread?
Originally posted by Raptor Open showthread.php
Find
$postdone = array();
and ABOVE it put:
// Hack post count and link
$postcount = ($pagenumber - 1 ) * $perpage;
// Hack post count and link end
Find
$postbits .= getpostbit($post);
and ABOVE it put:
// Hack post count and link
$post[postcount] = ++$postcount;
// Hack post count and link end
Save and upload.
Edit template postbit and place the following text where you want the post # to show.
(<a href="showthread.php?postid=$post[postid]#post$post[postid]">Post #$post[postcount]</a>)