/** * Public function that creates a single instance */ public static function getInstance() { if (!isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
<? if(!defined("NODIRECT")){ die("No direct Access !!"); } require_once(PATH_CLASS."/tip.php"); // new links class $tips = new tips; $tips->konek(); // kategori berita $listkategori = $tips->Kategori(1); //echo "<pre>"; //print_r($listkategori); //echo "</pre>"; $fKat = "1=1"; if(isset($_GET['kategori'])){ $kategori = @preg_replace("@[^0-9]@i","",$_GET['kategori']); $listkategori = $tips->Kategori($kategori); if($listkategori != ""){ foreach($listkategori as $key->value){ $kate = $listkategori['description']; $fKat = "kategori = "."'".$listkategori['id']."'"; } } else { $kate = "Getting Started"; $fKat = "kategori = 1"; } $smarty->assign('kategori',$kategori);