test.php
683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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');
?>