vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to display the number of posts on a thread to your homepage (https://vborg.vbsupport.ru/showthread.php?t=312678)

The slime 07-04-2014 06:15 PM

How to display the number of posts on a thread to your homepage
 
Is this possible ? Example a thread named "A" has 6 posts . Can I have 6 display on my home page ? Any help is much appreciated.

Lynne 07-04-2014 06:21 PM

Is your homepage some custom coded page? Do you have a link to show us this on someone else's site or else an image to explain what you want?

The slime 07-05-2014 01:46 AM

No however I have seen it . Mostly for positive and negative comments of a company . So in the forum it would have a "positive thread " and a "negative" thread . So let's say 5 people posted under the positive thread and 2 people posted on the negative thread .
On the home page it would show positive (5) negative (2) for the company .

Lynne 07-05-2014 03:09 PM

You can just do a query on the thread table to get the number of posts in that thread - thread.replycount.

Simon Lloyd 07-05-2014 05:15 PM

Quote:

Originally Posted by The slime (Post 2505248)
No however I have seen it . Mostly for positive and negative comments of a company . So in the forum it would have a "positive thread " and a "negative" thread . So let's say 5 people posted under the positive thread and 2 people posted on the negative thread .
On the home page it would show positive (5) negative (2) for the company .

What do you mean "Home page"? forumhome or forumdisplay?

The slime 07-05-2014 06:08 PM

A non forum php page .

Lynne 07-05-2014 09:34 PM

Then yes, you may just query the vbulletin database to get the number of replies and then put that information on your page.

The slime 07-05-2014 09:47 PM

Thanks Lynne for your time . I usterstand how to query the database . I just dont know what php code to put at my homepage to get fetch this info .

Lynne 07-06-2014 01:21 AM

Well, I don't know how you have written your queries in the home page, so I really can't help you with the exact code. All I can tell you is that you want to get thread.replycount WHERE thread.threadid = the id of the thread you want.

The slime 07-06-2014 02:37 PM

this is the php in mysql
$sql = "SELECT replycount FROM thread WHERE threadid = 84\n"
. " LIMIT 0, 30 ";

I just want it the reply # to populate on my blank .php test page .

here is my query
SELECT replycount FROM thread WHERE threadid = 84


All times are GMT. The time now is 01:13 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
  • Page Generation 0.01015 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete