The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to Count number of replies from a thread id?
First off, thanks Lynne for this tutorial How to Create your own vBulletin 4 page because I could create my own best web hosting page on our hosting forum, but now I am wanting to enhance it by adding some new functions, for example, show number of reviews from a thread id on my forum to that page.
In my page, I have User comments ? I want to show number of replies from a thread which a web hosting company is having review on their own thread. i.e 6 User comments ? Is it possible to count number of replies from a thread id? I mean (on Lynne's tutorial page ) then the code to count that will be putted on test.php and I can push it into a variable to display on my vB template. Any ideas? Thanks in advance. |
#2
|
||||
|
||||
First of all, that is not a vBulletin4 page. Even clicking on the Forums tab doesn't go to a vBulletin forum. It goes to an ad page, one I'd thank you to stop spamming here.
Secondly, unless users are replying multiple times in the thread, the number of replies is the number of user comments. That is displayed by default unless you've removed it. |
#3
|
|||
|
|||
Why it is not a vBulletin 4 page?
As said, I created it from Lynne's guide. Quote:
Quote:
I only want to explain what I wanted to add to my page, you can visit it but you can not need to click on any links on the page, just have a look. Quote:
I mean I want to create a function to query number of replies in a thread (reviews) and showing it on each link on vB page. Just that. Seem I could find a solution for this by this thread https://vborg.vbsupport.ru/showthread.php?t=41235 but still needing better solutions if possible. Thanks |
#4
|
||||
|
||||
Suppose you have the threadid stored in the variable $threadid...then you can get an array containing information on the specified thread, using something like:
PHP Code:
PHP Code:
|
#5
|
|||
|
|||
Quote:
I am needing a query to show number of replies from 10 threads (for 10 hosting companies that I am listing on my page) for example: $id4895 = count_replies(4895); $id7894 = count_replies(7894); $id674 = count_replies(674); $id4563 = count_replies(4563); ... count_replies function will is a function that contained queries depends on thread id. and on test.php I will assign these $templater->register('id4895 ', $id4895 ); $templater->register('id7894 ', $id7894 ); $templater->register('id674 ', $id674); .... After that I can show {vb:raw id4895} {vb:raw id4895} {vb:raw id674} on my template and they will show number of replies for each thread id. The problem that I am caring is queries to get number of replies on each thread can make my forum or that page loads slowly or not. Thanks |
#6
|
||||
|
||||
When the title of the thread refers to a thread id, then I assume you are talking about a thread.
|
#7
|
|||
|
|||
Quote:
Quote:
Of course is number of reviews = replies. |
#8
|
||||
|
||||
Quote:
I would create an array to store the respective replycounts, where the keys are the thread ids and then simply pass this array to the template. |
Благодарность от: | ||
Mattwhf |
#9
|
|||
|
|||
Quote:
I can solve this but it can not be a professional way thus that's why I ask this question here. Thanks |
#10
|
||||
|
||||
Quote:
PHP Code:
{vb:raw replycounts.674} {vb:raw replycounts.4563} {vb:raw replycounts.4895} {vb:raw replycounts.7894} etc. Does this make sense? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|