That's how I grab my articles for my blog system. The idea here is to use custom param tags, so templates don't use phpPHP Code:
<?php
if(!defined('TINY')){die("Script loading is forbidden");}
class blogcore{
/**
*
* @author Adil
* Provides class for posting an article, deleting an article, and pulling an article
*
*/
public function getArticle($id){
global $template;
global $db;
$query=mysql_query("SELECT * FROM `posts` WHERE id=".$id);
while($content=mysql_fetch_assoc($query)){
$template->setParam('blog-title-'.$id,$content['title']);
$template->setParam('blog-content-'.$id,$content['post']);
$template->setParam('blog-author-'.$id,$content['author']);
$template->setParam('blog-id-'.$id,$content['id']);
}
}
}
?>
Posted via Mobile Device



















