![]() |
How do I make my forum categories display threads and posts?
Hi,
I came accross this site and was wondering how I can make just my forum categories display all threads and posts in the category bar instead of the sub forum? HTML Code:
http://www.webtalkforums.com/ Thanks! |
It isn't a default vbulletin thing. I don't know that I've seen a modification to do it either. But, the code to grab the posts and threads from the forum cache is on the bottom of the index.php page, so it's easy enough to copy and code it yourself.
|
What exactly is the code I would need (I can't find it), and would that code display all threads and posts of the categories sub forums?
|
have you even looked or just have no idea and trying to get the code without having to do anything
|
I see this.. yes..
HTML Code:
$totalthreads = vb_number_format($totalthreads); Do you know what template i would edit to have it placed into the category bar? |
This is the full code used to get the total post and thread count. You need to modify it for your own purposes.
PHP Code:
|
Quote:
Do you know what template I would edit to have it placed into the category bar? (I am assuming I can edit the template via the admin panel in style manager?) |
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. Sometimes the template is the one mentioned at the very top of the page source.
|
So far no luck :(
After lots of research I see that "forumhome_forumbit_level1_nopost" seems to be the template to edit so that i can make my category bar display total threads and posts of its sub-forums. (just to the left of the category collaps image) but when I added the PHP code into the template (forumhome_forumbit_level1_nopost) it gave me an error and didn't work.. PHP Code:
NOTE: (Here is an example of what I would like my category bar(s) to look like...) __________________________________________________ ______________________ [__Category_Title___________________________Threads : X,XXX, Posts: XX,XXX__[^]_] ** Threads: X,XXX, Posts: XX,XXX = Total amount of Threads and Post from all sub-forums of the category. ** [^] = category collapse image |
You cannot put php in a template. You need to put the php into a plugin and then put the results from the plugin into your template.
|
Quote:
Thanks :) |
Look in the forumdisplay.php page to see some hook locations and pick one that is evaled before those templates are evaled. I run my test site in debug mode which puts a list of all hook locations available on the page at the bottom. That helps a lot when trying to figure out which hook location to use.
|
I'm just not haveing any luck with this at all. :|
I know the template to edit i just do not know what hook to choose nor how to add the hook into that template where I want it displayed. I am sure if I had the experience you had it would be more simple... but I don't. Isn't there an easier an easier way of doing this? maybe doing it something like seen here... http://www.vbulletin.com/forum/showthread.php?t=113870 but obiousely displaying total threads and posts instead of a sponsor link. Quote:
I see that this is the PHP code I need to add.. (That displays total threads and posts) PHP Code:
And this is the template I need to edit... (forumhome_forumbit_level1_nopost) HTML Code:
<if condition="!$show['collapsable_forums']"> From my understanding.... all I need to do now is create the plugin... 1. I DO NOT KNOW what hook to choose when creating the plugin, "Do you know?" 2. After the plugin is created what code snippet to I add into forumhome_forumbit_level1_nopost template to make the plugin work? Quote:
|
Actually, that is not the php code you need to add. I simply copied the code from index.php that shows how to get the posts and threads from the forumcache. You will need to modify that to get just the posts and threads from specific forum ids. As for plugin location, you can try forumhome_start. Like I said, look at the index page and find one that is eval before the template gets evaled.
Sorry I can't be more specific than that but I really don't know any specifics myself. |
Thanks :)
One question though... After I create the plugin what line of plugin call code do I add to that template? Thanks |
In the plugin, you will do some code and then assign the results to a variable, like $totalposts and $totalthreads. Then you would use those variables in the template.
|
All times are GMT. The time now is 12:50 PM. |
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:
|