Ik heb het volgende php scriptje, maar nu wil ik dit in een .thtm file laten tonen. Hoe moet ik dat doen?
<?
require "php/xtpl.inc.php";
include_once("php/db.inc.php");
include_once("php/functions.inc.php");
include("news/news-vars.inc");
$xtpl=new XTemplate ("templates/news.thtm");
$xtpl->assign("CATEGORY_TABLE",writeCategory());
$xtpl->parse("main");
$xtpl->out("main");
/***************************************************
Get news posts from MySQL - Create array
***************************************************/
$query = "SELECT * FROM news_data ORDER BY id DESC LIMIT $postlimit";
$result = mysql_query($query)
or die (mysql_error());
while ($data = mysql_fetch_assoc($result)) {
extract ($data);
/***************************************************
Get news poster's email address
***************************************************/
$sqlmail = "SELECT email FROM news_users WHERE uname = '$poster'";
$resmail = mysql_query($sqlmail)
or die (mysql_error());
$email = mysql_fetch_assoc($resmail);
/***************************************************
Simplify variables from array
***************************************************/
$title = $data['title']; //Title of news post
$poster = $data['poster']; //User who posted the news item
$date = $data['date']; //Date news post was added
$image = $data['image']; //Image that will be displayed with the post
$post = $data['post']; //The news post itself
$email = $email['email']; //Email address of the poster
}
?>
<?
require "php/xtpl.inc.php";
include_once("php/db.inc.php");
include_once("php/functions.inc.php");
include("news/news-vars.inc");
$xtpl=new XTemplate ("templates/news.thtm");
$xtpl->assign("CATEGORY_TABLE",writeCategory());
$xtpl->parse("main");
$xtpl->out("main");
/***************************************************
Get news posts from MySQL - Create array
***************************************************/
$query = "SELECT * FROM news_data ORDER BY id DESC LIMIT $postlimit";
$result = mysql_query($query)
or die (mysql_error());
while ($data = mysql_fetch_assoc($result)) {
extract ($data);
/***************************************************
Get news poster's email address
***************************************************/
$sqlmail = "SELECT email FROM news_users WHERE uname = '$poster'";
$resmail = mysql_query($sqlmail)
or die (mysql_error());
$email = mysql_fetch_assoc($resmail);
/***************************************************
Simplify variables from array
***************************************************/
$title = $data['title']; //Title of news post
$poster = $data['poster']; //User who posted the news item
$date = $data['date']; //Date news post was added
$image = $data['image']; //Image that will be displayed with the post
$post = $data['post']; //The news post itself
$email = $email['email']; //Email address of the poster
}
?>