![]() |
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. |
Does this override the current post count display? Or is it displayed seperately? :)
|
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 |
It is displayed below it, I'll attach a screenshot of it.
Screenshot: |
Ahh! Thank you! I forgot to add a step:
Find: PHP Code:
PHP Code:
:cool: |
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:
|
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.
:cool: |
I never tested it, just off the top of my head. You should test it first and see if it works.
|
Will do, let me finish documenting this other hack and I will do it ASAP.
:cool: |
The hack works for me now, and I await to see if this caching bizzo works too :cool:
|
OK, I tried this hack. While it does work, it also adds a very noticable amount of extra time to open a thread. The more posts in a thread (or I guess more accurately, the more unique people to post in a thread), the worse it gets. Quite noticably.
Please let us know if that cacheing bit works good, after its tested. :) |
you made me very happy matey :D
|
Quote:
:cool: |
Code:
SELECT COUNT(postid) AS posts FROM post LEFT JOIN thread USING (threadid) WHERE thread.forumid='1' AND post.userid='xx' (btw, this is for one forum only, not from sub forums as well) But still this is another query for each post, so in a thread with 30 posts per page you will have another 30 queries. |
is there a way for this hack to count posts made in more than one forum?
|
bump
|
Did anyone ever get this cache thing working?
|
yeah?
|
All times are GMT. The time now is 04:10 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|