37 lines
1.4 KiB
PHP
Executable File
37 lines
1.4 KiB
PHP
Executable File
<?php
|
|
|
|
if ( @$_SESSION['dostup'] !='a' && @$_SESSION['dostup'] !='e' )header( 'Location: /403/' );/*Если не админ - шлем в опу*/
|
|
//Инсталлятор....
|
|
/*$result = mysql_query('SELECT `alias` from `page_cat` LIMIT 1');
|
|
if (!$result)mysql_query('ALTER TABLE `page_cat` ADD `alias` varchar(250) NOT NULL');
|
|
$result = mysql_query('SELECT `parent` from `page_cat` LIMIT 1');
|
|
if (!$result)mysql_query('ALTER TABLE `page_cat` ADD `parent` varchar(250) NOT NULL');
|
|
$result = mysql_query('SELECT `public` from `page_cat` LIMIT 1');
|
|
if (!$result)mysql_query('ALTER TABLE `page_cat` ADD `public` int(1)');*/
|
|
//узнавалка текущей категории
|
|
unset($b);
|
|
$b['id']=ID;
|
|
$db -> get_val('page_cat', $b, 'txt');
|
|
$smarty -> assign( 'description', $db->result );
|
|
//получаем список категорий страниц
|
|
unset($a);
|
|
if (ID){
|
|
$a['parent']=ID;
|
|
//узнаем вышестоящий каталог...
|
|
unset($b);
|
|
$b['id']=ID;
|
|
$db -> get_val('page_cat', $b, 'parent');
|
|
$parent=$db->result;
|
|
if ($parent>0)$smarty -> assign( 'parent', $parent );
|
|
}else
|
|
$a['parent']='0';
|
|
$a['public']=1;
|
|
//if (@$_SESSION['dostup'] =='e' )$a['user_id']=$_SESSION['user_id'];
|
|
$db -> get_massiv ( 'page_cat', $a, 'txt' );
|
|
$smarty -> assign( 'cats', $db->result );
|
|
unset($b);
|
|
$b['cat']=$a['parent'];
|
|
$db -> get_massiv ( 'pages', $b, 'title' );
|
|
$smarty -> assign( 'list', $db->result );
|
|
|
|
?>
|