![]() |
Well say we have the variable from your query above:
$savethreadid You place [/b]$savethreadid[/b] in the template where you want that value to appear. --- You just do this if your template doesn't contain other templates (like forumdisplay contains forumdisplaybit): eval("echo dovars(\"".gettemplate("Your_Template_Name_Here"). "\");"); Example: <? // Your PHP code goes here, your queries // $query = (...); // $savethreadid = (...); // $othervars = (...); // //eval("echo dovars(\"".gettemplate("Your_Template_Name_Here"). "\");"); 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? [Edited by rangersfan on 09-28-2000 at 12:03 PM] |
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. |
Thanks man...used some of your advice, and worked around the rest.
Lo and behold: one of my last hurdles! :) Code:
$DB_site->query("INSERT INTO savethreads (savethreadid,threadlinkid,saveuser) VALUES (NULL,$threadid,$username)"); |
Try this one ;)
Code:
$DB_site->query("INSERT INTO savethreads (savethreadid,threadlinkid,saveuser) VALUES (NULL,$threadid,'".addslashes($username)."')"); |
Seems to have worked - thanks a bunch!
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. :) Oh so close... :) |
I'm not familiar with that setting or I am not understanding you.
|
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... :) |
Oh that, ok..
They are stored in the templates table in a template name options (along with all the other CP options" $usehotthreads = "1"; $hotnumber = "15"; They will actually be available to you if you just access those variables since they are set in global.php and will flow to your script. (if $hotthreads == "1" ) // yes (if $hotthreads == "0") // No |
Ok, thanks! Works just fine. You the man.
Thanks for your help...getting over these little hurdles has really helped me. Expect the hack shortly! :) |
All times are GMT. The time now is 02:17 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:
|