Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
User post count from current forum Details »»
User post count from current forum
Version: 1.0.0, by calorie calorie is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 01-15-2006 Last Update: 01-19-2006 Installs: 14
Uses Plugins Template Edits
 
No support by the author.

This mod makes it so you can display the number of posts a user has from the current forum. Said another way, when you view a thread, that thread is in a forum, so this mod shows the number of posts a user has in that forum. See screenshot.
  • 1 product
    • 3 plugins
    • 1 phrase
  • 2 queries in showthread
  • 1 query in showpost
  • 1 postbit(_legacy) edit
It has been reported that one of the queries used in showthread takes too much time on a big board, so if you have a big board, you've been warned. :ermm:

18 Jan 2006: updated to use two queries in showthread
20 Jan 2006: instance of $postids var replaced with $ids

Show Your Support

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

Comments
  #22  
Old 01-19-2006, 05:41 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It counts posts in forum X where /forum/forumdisplay.php?f=X and forum X contains threads.
Reply With Quote
  #23  
Old 01-20-2006, 02:12 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds like a good attempt at reducing the queries. I'll give it a whirl, though I am still very weary of having the entire post table scanned in each thread (this time only once instead of 10 times, but it's still a very big query). I'll let you know how the load changes with the mods you've done. Thanks!

-vissa


Quote:
Originally Posted by calorie
I'm all for honesty, but that post, maybe I just took it wrong, so I apologize too. Personally I think the utilization of a separate table wouldn't be hard, for me or anyone really, though I do agree that it'd be tedious to find all the spots for updates. That tedium, and the part about inserting the initial counts on a board of your size, got me to thinking. What I came up with is two queries in showthread, one should be negligible on any board, and for the other, I simply don't know how it'd be on a board with a 1M posts and 11K members. I believed you when you initially said that your load time doubled; I just don't have a board of that size for tests. If you saw a ten percent load time increase per post, maybe now you'll see a ten percent load time increase overall, but I really can't say for sure. Maybe you'll let me know?
Reply With Quote
  #24  
Old 01-20-2006, 02:15 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

By the way, It might be a good idea to have some type of version number associated with your mod changes so we can be sure what we are downloading (like this could be v1.1, etc).. This last change was a pretty big one.

-vissa
Reply With Quote
  #25  
Old 01-20-2006, 10:04 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK I tested the new version.

While it does reduce the number of queries, it still appears to at least double (or in some cases triple) the load created per thread page view. Now if the page is cached, the load increase is much smaller. However, if the page is not cached, the load increase is 2-3X. (mine went from about .35 sec per uncached page to about 1.0 sec per uncached page.) This was while almost no one was on the forum.

When testing, you have to try loading up old threads that are likely not in the cache. You also have to try a different thread each time, because once you load an old thread, it goes right into the cache. That is why testing load time increases can be difficult/confusing.

Thanks for the effort, but I had to remove it due to the load. As I mentioned earlier, I think the only way this could work for large forums is to create a table which would be a lot of work. It's a shame becase I think this is sorely needed (would also be nice to see posts per forum in the member profile, etc).

Thanks again.

-vissa
Reply With Quote
  #26  
Old 01-20-2006, 01:44 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, thanks for the update. Not sure if you know, but the forum posts count isn't a piece of information that gets cached. If page text is cached, the load can be smaller because the page text wouldn't have to be HTMLized. For uncached page text, the text gets HTMLized and that can increase load, but the forum posts query happens regardless, page text cached or not. Not sure if you are using debug mode, but if not, maybe try sticking the following in the config.php file, load a page, and follow the explain link. It'll show you stats on how the forum posts query performs, but it's subject to response variability. If you're up for it, try comparing several cached and uncached pages with explain, picking pages with about the same number of BB codes and images. It'd be interesting to see how the forum posts query performs on a board of your size.
Code:
// change xxx.xxx.xxx.xxx to your IP address

if ($_SERVER['REMOTE_ADDR'] == 'xxx.xxx.xxx.xxx')
{
        $config['Misc']['debug'] = true;
}
Reply With Quote
  #27  
Old 01-21-2006, 07:32 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Although VB is not caching the per forum post counts, the MYSQL database engine surely is during my testing (I have 4GB ram and set up mysql to cache quite a bit). It caches recently executed queries and when you reload the page, it will come up much quicker because of that. That is why I try to isolate it by going to old pages that likely haven't been viewed for a while. I did that both with and without the plugin turned on. I just don't think there is any way of getting around a large load placed by a query that scans the entire post table, though small improvements may be possible. It really makes perfect sense. I'm not sure if I'll be able to try out what you wrote above, but I'll let you know if I do. If you ever decide to try the storing of post counts in a separate table, let me know and I will definitely try that.

Thanks Again
-vissa
Reply With Quote
  #28  
Old 01-21-2006, 07:39 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, didn't know you were referring to query cache and not vB cache. Not sure what you mean by 'scans the entire post table' though, as the query shouldn't be examining all the rows, but on a board of your size, it seems it's too many rows anyway. I think a separate table could have userid, forumid, and count, perhaps with forumid and count serialized, so at a minimum that'd be one row per user, which then could be a column in the user table instead, but there's still the updating to do. Not clear it's really worth it.
Reply With Quote
  #29  
Old 01-22-2006, 09:42 AM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The big difference in a separate table would be you would only be doing a single quick lookup based on user ID and forum (the adding would be done at post time) -- no scans or counting. With the current method, it has to scan each table entry and add them up (in my case, 1,000,000). So 1 vs 1,000,000 is quite a difference. Another way of looking at is with a separate table, in my case, there would be at most 11K entries (one for each user) with one row as a result. Currently there are 1M posts with possibly thousands of results needing to be counted on the fly.

Of course the current method is available now, and a separate table is more like an addon to the software than just a quick mod.

Thanks for your help in any case and I'm sure some users will find it useful!

-vissa
Reply With Quote
  #30  
Old 01-27-2006, 11:43 AM
roleplaycity roleplaycity is offline
 
Join Date: Jan 2006
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hiya, this is a great mod and I really love it, only I got a weird problem with it on my board and was forced to disable it.

(Doing nothing other than disabling this mod fixed my problem, so I know it relates back to this particular plugin).

If I wanted to use the Moderator options to move a thread from one forum to the other, in the drop-down list for Destination Forum, I was unable to see (and therefore unable to select) the forums beyond the main forum. Every other Mod Option worked correctly, only the 'Move' option was affected.

I don't know if it was just my board, but maybe you can see if it does the same thing on yours? Thought I'd make you aware of it.

Cheers ^^
Dee.
Reply With Quote
  #31  
Old 01-27-2006, 03:07 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using inline moderation or thread tools, I see all my forums listed under Destination Forum when going to move a thread. Maybe this mod conflicts with some other mod?
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 06:51 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.04875 seconds
  • Memory Usage 2,307KB
  • 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
  • (1)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
  • (3)pagenav_pagelink
  • (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