test.php 683 Bytes
<?php


require "libs/Smarty.class.php";
$db = new SQLite3('wiki.db');
$smarty = new Smarty;
$current_page=$_SERVER['SCRIPT_NAME'];
$current_page=str_replace(".php", "", $current_page);

function sidebar_navigation()
{
	global $db, $smarty;
	$page = $db->query("SELECT * FROM page");
	$num_pages = count($page);
	$menu_pages=array();

	$i=0;
	while ($row=$page->fetchArray())
	{
		$menu_pages[$i]=$row[1];
		$i++;
	}
	
	return $menu_pages;
}



$smarty->assign("menu_pages", sidebar_navigation());
$smarty->assign("page_title", "Slimspots Wiki");
$smarty->assign("current_page", $current_page);

//$smarty->assign("menu_sections", $menu_sections);

$smarty->display('index.tpl');

?>