Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 09-27-2000
Last Update: Never
Installs: 0
No support by the author.
I'm writing a hack (ha! If you can even call it that - I'm not that talented)...and basically, I'd like to use SQL queries in the same format as vBulletin - since that seems to be the most logical thing to do...however, I can't get it to display more than one entry...any advice? I'll obviously need a while loop, but I'm not sure how to format it...
Here's what I have (which produces an error):
Code:
$query2=$DB_site->query_first("SELECT * FROM savethreads WHERE saveuser='$username'");
$result = mysql_query($query2,$DB_site);
while ($row = mysql_fetch_array($result)) {
$savethreadid = $row["savethreadid"];
echo("$savethreadid");
Any thoughts?
Oh, also: I've created a custom template which is pulled onto a custom PHP page in my forums directory (thanks JimF! )...however the template displays first, with all my queries and their results below it all - how can I stick it in the middle of the template? I don't recall seeing actual queries used in any of the other templates...so I know there must be some other way.
Thanks!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
If you place "$query" and "$savethreadid" and "$othervars" in your template than they will appear as you expect. What are you doing now? Did you place the call to the template before your queries and assignments?
I see...you're right. I will call the variables later...the problem is, however, that I have a while loop in use - can I "call" the entire loop with a single variable?
So you have a while loop that will be outputting data to be displayed in the template?
You make a second template that would equal one line of the data. You then call that template at the end of the while loop. You need to look at the code to see what you need to do. Open search.php and see how the code uses "searhresultbit" as the template in a while loop. You will see the code assigns all the results of the while loop to one variable and then references that variable in the "searchresults" template.
$DB_site->query("INSERT INTO savethreads (savethreadid,threadlinkid,saveuser) VALUES (NULL,$threadid,'".addslashes($username)."')");
You actually only need to enclose $username in singlequotes as it a string but addslashes will make sure you don't get errors if it contains characters that need to be escaped.
Yes, yet another question! : How do I grab the variables (on a non-VB page) of whether or not the board makes use of hot topics, and the number of posts the board has used to set hot topics? I just need the SQL query basically, or the names of the fields and what table they're in.
Well, as you know, a post with 15 or more replies is designated as a "hot topic", and an "H" (or on some boards, a flame) is shown over the topics' folder.
The control panel allows you to disable this feature...it also allows you to determine how many replies a topic needs to become "hot"...I just need to know how I can call these values onto a non VB page...