![]() |
How do you do this?
I want a PHP file that will go directly to a template And the template will use stuff from the database like amount of posts and newest member, sessionhash-ed links etc. The file would do nothing apart from display the thing in the template! What the PHP code? I tried one, and it went to the template, but did not display any variable stuff, eg - it said "Registered Members: threads in total | posts in total You last visited: 03-25-2001 02:22 PM. The time now is 02:22 PM. . Welcome to our newest member, ." That was just using this code: Code:
<? How do I do it??? Thanx in advance |
when you're included php file generates some variables like
$newestmember etc.. Then you can reference to them in the template So if you have: <? $templatesused = "newtemplate"; require("./global.php"); $bla = "123"; eval("dooutput(\"".gettemplate("newtemplate")."\") ;"); ?> Then you can reference to $bla in your template....Or if you have a separate php file which contains $bla and you include this file before evaluating the template you can do exact the same thing... Evaluate does just evaluating the content of a template as if it was php code...so every $variable in the template is parsed with their corresponding variable... |
Thanx for ya help
What I now need to know is how to enter variable details like amount of members and connecting to the database.... |
if you include global.php you don't need to connect to the database....
use a code like this: $query = "SELECT <fields> FROM <tables>"; $result = $DB_site->query($query); while($row = $DB_site->fetch_array($result)) { doSomeStuff(); } |
All times are GMT. The time now is 12:51 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|