The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Thread Reply Count on NONvb page
Hey all,
I have searched and searched these forums for a solution to no avail. Hopefully someone can help me. I don't think it is a hard mod and I feel like I'm close because I know PHP to a small extent. I just want to post the reply count of a desingated thread. For instance, I would have a news story on my front page and then have a simple phrase at the bottom that would link the user to that news article (thread xxxx) on the forums and then also show a reply count. So is there an easy way to do this? something like this: $replycount = "SELECT replycount FROM thread WHERE threadid = 715925"; Obviously, I know the above statement is wrong, but it gives a better clarification on what I need. Any help would be much appreciated. Thanks in advance. (I'm running VB 3.0.7) steve |
#2
|
|||
|
|||
I have been playing with this for hours now, still not luck. Can anyone please give me a knock in the right direction. This is the code I'm using now, but I"m still getting nothing to display. Please help
Code:
require_once("./global.php"); $threadWanted = 715925; $replies = $DB_site->query_first("SELECT replycount FROM " . TABLE_PREFIX . "thread WHERE threadid = " . intval($threadWanted)); echo "$replies['replycount']"; |
#3
|
||||
|
||||
PHP Code:
|
#4
|
|||
|
|||
Thanks for the reply Cing -
Unfortunately, I tried your code and I'm still getting nothing. I just recieve a blank page, no errors, just a blank page. I'm still playing around with the code. It seems so easy, but it remains so hard. If you get any alternative ideas, please share them. I'm still in a rut. \=( |
#5
|
||||
|
||||
What does running this
Code:
SELECT replycount FROM thread WHERE threadid = 715925 |
#6
|
||||
|
||||
Quote:
PHP Code:
PHP Code:
PHP Code:
|
#7
|
|||
|
|||
Thanks again for the quick replies, much appreciated...
Quote:
Code:
Your SQL-query has been executed successfully (Query took 0.0002 sec) SQL-query: SELECT replycount FROM thread WHERE threadid =715925 LIMIT 0 , 30 Link - Thanks for the reply. Unfortunately I tried your corrections and still get a blank page. Not sure what the problem is but thanks for the effort. I'm not getting any parse errors or anything, just a blank page. |
#8
|
||||
|
||||
There you go, the sql query returned 0 results in the first place, which is why echo $replies['replycount']; gives you nothing.
Are you sure there is a thread with threadid 715925 present ? Seems like an awefully large number, you must have a huge board [edit] : ok checked your site ( assuming this is the site you are using the code for ). Seems this thread id is not valid, could have been a deleted thread : http://www.thefinalfantasy.com/forum...d.php?t=715925 |
#9
|
|||
|
|||
Quote:
For some reason if you change that .php?t to a .php?p, the URL will work... odd, but hey, the SQL query still wont work even if I try threadid that i KNOW exist. One interesting I just found was when I went to EXPLAIN query, I got this message: Impossible WHERE noticed after reading const table... Maybe we are declaring the const. table wrong, it makes no sense though... everything appears to be fine in the query. ugh Thanks again for your ongoing help man, I feel like I"m getting real close to a solution |
#10
|
|||
|
|||
Just 1 advice, try your query first in phpMySQL and when it works like expected, copy it to your script.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|