- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
include_once("xtemplate.class.php");
include_once("functions.php");
include_once("constants.php");
include_once("db.php");
$cat=(!empty($_GET['cat']))?(trim($_GET['cat'])):'index';
switch($cat)
{
default:
$buf=mysql_query("SELECT * FROM ".CAT_TABLE." WHERE cat_name='{$cat}' LIMIT 1",$db);
$kol=mysql_num_rows($buf);
if($kol!=0)
{
$templ=new XTemplate("./style/static.xtpl");
$templ->assign('SITENAME',SITENAME);
$cat=mysql_fetch_assoc($buf);
mysql_freeresult($buf);
$page=(!empty($_GET['p']))?(trim($_GET['p'])):$cat['cat_start'];
$buf=mysql_query("SELECT * FROM ".PAGES_TABLE." WHERE name='{$page}' AND cat={$cat['id']} LIMIT 1",$db);
$row=mysql_fetch_assoc($buf);
mysql_freeresult($buf);
bb($row['content']);
$templ->assign('PAGE_TITLE',$row['title']);
$templ->assign('TITLE',$row['title']);
$templ->assign('CONTENT',$row['content']);
show_menu($cat['cat_name']);
out('static');
}
else
{
header("Location: index.php");
}
}