vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Post Counter & Direct Link (https://vborg.vbsupport.ru/showthread.php?t=22083)

JJR512 08-01-2001 12:08 AM

I think this needs to be updated for 2.0.3...I couldn't find this code at all:
PHP Code:

eval("\$postbits .= \"".gettemplate("postbit")."\";"); 

I looked in my older showthread.php and found where this code is, and searched for some of the lines in its vicinity in the new showthread.php, but couldn't find any of them, either.

Please update this!

dwh 08-01-2001 04:38 AM

It's more complicated now, I'll try to be brief.

In showthread.php
after

Code:

$counter=0;
but before

Code:

while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {
add

Code:

$countposts = ($pagenumber-1)*$perpage;
about 8 lines down

BEFORE
Code:

  $postbits .= getpostbit($post);
add

Code:

  $countposts = $countposts+1;
Close showthread.php.

Open admin/functions.php

Find

Code:

function getpostbit($post) {
// sorts through all the stuff to return the postbit template

        // user
        global $bbuserinfo,$ignore;
        // showthread //added $countposts
        global $counter,$firstnew,$sigcache,$highlight,$postid,$forum;

Now add countposts variable to the end like so

Code:

function getpostbit($post) {
// sorts through all the stuff to return the postbit template

        // user
        global $bbuserinfo,$ignore;
        // showthread //added $countposts
        global $counter,$firstnew,$sigcache,$highlight,$postid,$forum,$countposts;

Done.

FWC 08-01-2001 05:59 AM

Quote:

It's more complicated now, I'll try to be brief.
It is more complicated now. But, your suggestion worked. Thanks, dwh!

dxb 08-01-2001 09:05 PM

thanks dwh you just made it so simple :) and it worked great

Sarge 08-04-2001 09:17 AM

Thanks
IT works great!
Sarge

Admin 08-05-2001 11:32 AM

For some reason, the first post in the thread is labeled 0.
I'm using v2.0.3, so I did what dwh said, and the code for the template is from bira.
Help?

dwh 08-05-2001 11:37 PM

not sure. do you have a url to look at?

Admin 08-06-2001 02:53 AM

Ok I fixed it, just put
PHP Code:

$countposts = (($pagenumber-1)*$perpage)+1

instead of
PHP Code:

$countposts = ($pagenumber-1)*$perpage

Good hack! :D

SirSteve 11-05-2001 07:39 PM

This working for vb 2.2.0 ?

FWC 11-05-2001 07:56 PM

Quote:

Originally posted by SirSteve
This working for vb 2.2.0 ?
Yep, it works fine in 2.2.0. I love this hack. I wish it was built in to vB. It's nice to know where you are in a thread.


All times are GMT. The time now is 07:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01118 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete