Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by apfeifer apfeifer is offline
Developer Last Online: Jan 2007 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 11-03-2001 Last Update: Never Installs: 4
 
No support by the author.

Hack: Number of Posts in Current Forum Only
Version of vB: 2.2.0, although may work on earlier versions but not tested
Current Version: 1.0.0
Description: This hack shows how many posts a user has in the forum that the post you are viewing is in


Requested by Bald Bouncer.

Show Your Support

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

Comments
  #2  
Old 11-04-2001, 09:26 PM
MarkB's Avatar
MarkB MarkB is offline
 
Join Date: Oct 2001
Location: London, UK
Posts: 324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this override the current post count display? Or is it displayed seperately?
Reply With Quote
  #3  
Old 11-04-2001, 09:33 PM
MarkB's Avatar
MarkB MarkB is offline
 
Join Date: Oct 2001
Location: London, UK
Posts: 324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I tried it, and the following error came up when viewing a thread:

Fatal error: Call to a member function on a non-object in /home/ultimatm/public_html/forum/admin/functions.php on line 275
Reply With Quote
  #4  
Old 11-04-2001, 09:34 PM
apfeifer apfeifer is offline
 
Join Date: Oct 2001
Location: Sioux Falls, South Dakota, USA
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is displayed below it, I'll attach a screenshot of it.

Screenshot:
Reply With Quote
  #5  
Old 11-04-2001, 09:38 PM
apfeifer apfeifer is offline
 
Join Date: Oct 2001
Location: Sioux Falls, South Dakota, USA
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh! Thank you! I forgot to add a step:

Find:

PHP Code:
global $showdeficon,$displayemails,$enablepms,$allowsignatures,$wordwrap,$dateformat,$timeformat,$logip,$replacewords,$postsperday,$avatarenabled,$registereddateformat,$viewattachedimages
After that add:

PHP Code:
global $DB_site
Sorry about that! I'll add it into the documentation right away.

Reply With Quote
  #6  
Old 11-04-2001, 09:40 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

could kinda be bad, if a user has made 300 posts in the forums then thats 300 extra queries per post, you should cache it.

PHP Code:
if (!isset($posttotal[$post[userid]])) {
    
$grabthreadids=$DB_site->query("SELECT threadid FROM post WHERE post.userid='$post[userid]' AND post.visible=1");
    
    
$post[thisforumonly] = "0";

    while (
$getcount=$DB_site->fetch_array($grabthreadids)) {
        
$checkforumid=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$getcount[threadid] AND thread.visible=1");
        if (
$checkforumid[forumid] == $forum[0]) {
            
$post[thisforumonly]++;
        }
    }
             
$posttotal[$post[userid]] = $post[thisforumonly];
}
else {
  
$post[thisforumonly] = $posttotal[$post[userid]];

Reply With Quote
  #7  
Old 11-04-2001, 09:44 PM
apfeifer apfeifer is offline
 
Join Date: Oct 2001
Location: Sioux Falls, South Dakota, USA
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, in the other thread (the request) I mentioned how this had a lot of queries in it. I actually had tried something almost identical to what you did, but it wasn't working so I decided to release it so people had something to use and play with that later. Is that chunk of code you posted 100% sure to work? If so I'll add it in, with your permission, of course.

Reply With Quote
  #8  
Old 11-04-2001, 09:46 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I never tested it, just off the top of my head. You should test it first and see if it works.
Reply With Quote
  #9  
Old 11-04-2001, 09:47 PM
apfeifer apfeifer is offline
 
Join Date: Oct 2001
Location: Sioux Falls, South Dakota, USA
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will do, let me finish documenting this other hack and I will do it ASAP.

Reply With Quote
  #10  
Old 11-04-2001, 09:49 PM
MarkB's Avatar
MarkB MarkB is offline
 
Join Date: Oct 2001
Location: London, UK
Posts: 324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The hack works for me now, and I await to see if this caching bizzo works too
Reply With Quote
Reply

Thread Tools

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 05:36 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.04253 seconds
  • Memory Usage 2,292KB
  • Queries Executed 23 (?)
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
  • (3)bbcode_php
  • (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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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