Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by bira bira is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

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) { 
and ABOVE it put:

PHP Code:
$countposts = ($pagenumber-1)*$perpage

Find

PHP Code:
eval("\$postbits .= \"".gettemplate("postbit")."\";"); 
and ABOVE it put:

PHP Code:
$countposts $countposts+1
save and upload.

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.

---------------------------------------

You can see it on my BB, on any of the threads (near the date/time of the post, to the right of the small folder icon). Example: http://www.atlasf1.com/bb/showthread...threadid=24656

Cheers,

Bira

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 04-21-2002, 11:57 PM
freeshares1 freeshares1 is offline
 
Join Date: Mar 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by 69-FLy-gUy
I can't get this to install. it just says post # and doesn't have a number....
I had this problem until i changed it to

<a href="showthread.php?postid=$post[postid]#post$post[postid]"><smallfont>Post No</smallfont><smallfont>$post[postcount]</smallfont></a>

i have installed mine where the profiles and pm buttons are.

www.gamblingforums.net

Hope that helps a little

Phil
Reply With Quote
  #73  
Old 04-27-2002, 04:51 PM
Orlandu's Avatar
Orlandu Orlandu is offline
 
Join Date: Apr 2002
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't get this to work with 2.2.5 Got any ideas? I see it's running here...

EDIT:
I got it working, nevermind.
Reply With Quote
  #74  
Old 04-29-2002, 09:53 AM
Ordovicium's Avatar
Ordovicium Ordovicium is offline
 
Join Date: Oct 2001
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have some Problems with the position of the hack, in the postbit templat. I would like make it the same as here on vbulletin.org, but the problem is, when I add it after $post[title], it disapear only in the right corner, when there is no title. If there is a title, it is in next line. -> not parallel.
I hope you have some ideas.
PHP Code:
        <td bgcolor="$post[backcolor]width="100%" valign="top">
        <
smallfont>$post[icon] <b>$post[title]</b></smallfont>

<!-- 
POSTCOUNTER-->
<
a href="showthread.php?postid=$post[postid]#post$post[postid]">
<
div align="right"><smallfont>(post#: $post[postcount])</smallfont></div><a>
<!-- /POSTCOUNTER--> 



Thanks Ordo
Reply With Quote
  #75  
Old 04-30-2002, 03:26 AM
Crazy Mofo Crazy Mofo is offline
 
Join Date: Nov 2001
Location: Newcastle,UK
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

look what mine has done u can see it on page like 8 and number 1 shows up at the top of every page and starts again !! some1 plz help me
Reply With Quote
  #76  
Old 04-30-2002, 10:40 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you let us in on the code to position it in the spot you have it (like it is here on this site)?
Reply With Quote
  #77  
Old 04-30-2002, 11:26 PM
Ordovicium's Avatar
Ordovicium Ordovicium is offline
 
Join Date: Oct 2001
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can somebody help me?
I posted my problem 2 postings before.
Reply With Quote
  #78  
Old 05-02-2002, 12:59 AM
RDX1 RDX1 is offline
 
Join Date: Apr 2002
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by Ordovicium
Can somebody help me?
I posted my problem 2 postings before.
Reply With Quote
  #79  
Old 05-02-2002, 05:34 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, that works great except now when you click on the Post #1, it contracts all of the messages back into a list (I'm using Expand All, Contract All also) instead of going to the beginning of the message like it does here.

Also, where in postbit_ignore do I place it and what is postnit_ignore actually for?
Reply With Quote
  #80  
Old 05-02-2002, 04:25 PM
Ordovicium's Avatar
Ordovicium Ordovicium is offline
 
Join Date: Oct 2001
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@NerdNations: Thanks a lot. I didn't saw. I was searching after a Code/Php-Box in this thread.
Reply With Quote
  #81  
Old 05-06-2002, 04:23 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just re-installed vb and the post counter works great except that I am still having problems that if the messages are contracted (I am also using the great Expand and Contract Hack), when I click on the post counter link, it does not open up the message like it does here. Does anyone here have any idea what might be causing this? I have been through the code at least 10 times and everything is where it should be and LIKE it should be. Please fellas (and females, too), can someone lend a hand on this one? This one really has me stumped.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:31 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05310 seconds
  • Memory Usage 2,326KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete