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
  #162  
Old 11-23-2002, 03:12 PM
Dynamic One's Avatar
Dynamic One Dynamic One is offline
 
Join Date: Nov 2001
Location: Somewhere on the net
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this hack m8.
Reply With Quote
  #163  
Old 11-28-2002, 12:22 AM
Austone Austone is offline
 
Join Date: Nov 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Littlebit
Is it an impossible thing to make it so if you have your forums threads post order set to 'newest first' in your adminCP, the post count for the newest post will be post# 99 (for example) or whatever it is instead of 1? post# 1 still being the original first post...
What would be the best way to go about trying this?
I did this... because I have it where each user can select the post order... (that is where $bbuserinfo[postorder]==0 comes from.. I don't know what the variable would be for the whole BBS.. but the structure would be similar)
PHP Code:
 if($bbuserinfo[postorder]==0) {
   
$post[postcount] = ++$postcount;
 } else {
   
$postrev $totalposts $postcount;
   ++
$postcount;
   
$post[postcount] = $postrev;

 }

$post[totalposts] = $totalposts
..also I added the $post[totalposts] = $totalposts; line so that I can show Post # x of y

..just change the postbit template to have...
PHP Code:
<smallfont>Post #$post[postcount] of $post[totalposts]</smallfont> 
..wherever you want it.

Hope that helps,
Kyle
Reply With Quote
  #164  
Old 11-28-2002, 01:44 PM
Littlebit's Avatar
Littlebit Littlebit is offline
 
Join Date: Nov 2001
Posts: 313
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kyle, thank you :bunny:
Reply With Quote
  #165  
Old 12-22-2002, 03:01 AM
agfisdn agfisdn is offline
 
Join Date: Nov 2001
Location: Athens, Greece
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Rating: 5/5 !

Great Hack irate:

Installed nice and easy on 2.2.9

Used (Posts in this Thread):
1) Instructions Post (2.0.3 and UP )
2) Crinos' postbit Edit
3) postbit_ignore Edit Attached... (Same way as Crino's Edit)

Thanx bira !

Ps: What I cannot find is why the Post # does not show when you click on the ingored Post (java script popup window that shows on demand an ignored user's Post). I get the Post# Link but there is no $post[postcount]... no biggy )
Reply With Quote
  #166  
Old 01-05-2003, 05:54 AM
Dan_UPC Dan_UPC is offline
 
Join Date: Dec 2002
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack.

*installs*
Reply With Quote
  #167  
Old 01-05-2003, 04:44 PM
BfB BfB is offline
 
Join Date: Jul 2002
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NO SUPPORT GIVEN/OFFERED
(you won't need it anyway, as it's super easy, heh)


Alright everyone, I took the liberty of putting this altogether again, using bira's original idea, xug and crinos' link code, freddie's simple code, and Austone's "post of total posts" code/link code. Everything works great on v2.2.9 so I assume this will work perfectly for previous versions of 2.0.3 and up.

This version of the hack will display "Post #x of x" (post of total posts), as well as the link to that post.

Working example can be found at http://www.lightningforums.com running vBulletin v2.2.9

Taken from:

https://vborg.vbsupport.ru/showthrea...threadid=22083

Credit to bira, xug, crinos, freddie, and Austone, from which the following hack was prepared.

Sincerely,

James
Reply With Quote
  #168  
Old 01-22-2003, 01:40 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by freddie

$postbits .= getpostbit($post);

Put this before it:

$post[postcount] = ++$postcount;

Then put $post[postcount] in your postbit template.
i know it says no support given but i'm baffled, i can't find that in my showthread.php i can find it without the dot but even then the hack don't work

running 2.2.9

i installed it on a 2.2.6 and it worked tho :-S
Reply With Quote
  #169  
Old 01-22-2003, 02:18 PM
BfB BfB is offline
 
Join Date: Jul 2002
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use my text file above your post and that should help you install it correctly.
Reply With Quote
  #170  
Old 01-23-2003, 03:23 AM
Littlebit's Avatar
Littlebit Littlebit is offline
 
Join Date: Nov 2001
Posts: 313
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BfB,
hey, thanks for doing that for us!
Reply With Quote
  #171  
Old 01-25-2003, 07:05 AM
subu1 subu1 is offline
 
Join Date: Sep 2002
Location: Germany
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by dwh
It's more complicated now, I'll try to be brief.


BEFORE
Code:
  $postbits .= getpostbit($post);

moin, sorry but i don't find this, what can i do. *snief*

greetz subu1
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 04:54 AM.


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.05856 seconds
  • Memory Usage 2,331KB
  • 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
  • (1)bbcode_code
  • (6)bbcode_php
  • (4)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