0 ){ //if( !@$_SESSION['user_id'] ) { /* если не авторизован - кешируем на часок */ $smarty -> caching = true; $smarty -> cache_lifetime = $settings['cachePage']; //} } } /* ------------------------------------------------------------------------------------------------------------------------- */ function install(){ // Инсталлятор $db = $this -> db; /*if ($_SESSION['user_id']){ @mkdir(MYDIR . '/img/albums/' . $_SESSION['user_id'], 0700); @mkdir(MYDIR . '/img/albums/' . $_SESSION['user_id'] . '/' . ID, 0700); @mkdir(MYDIR . '/img/albums/' . $_SESSION['user_id'] . '/' . ID . '/original', 0700); @mkdir(MYDIR . '/img/albums/' . $_SESSION['user_id'] . '/' . ID . '/big', 0700); } $db->free_sql("CREATE TABLE IF NOT EXISTS `foto_img` ( `id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user_id` int(10) NULL, `album_id` int(10) NULL, `img` varchar(15) NULL, `tags` varchar(254) NULL, `reyt` int(10) NULL DEFAULT '0', `downloads` int(10) NULL, `t` varchar(30) NULL, FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), FOREIGN KEY (`album_id`) REFERENCES `foto_albums` (`id`) ) ENGINE='InnoDB';"); $db->free_sql2("ALTER TABLE `foto_img` ADD `naim` varchar(254) COLLATE 'utf8_general_ci' NULL;"); $db->free_sql2("ALTER TABLE `foto_img` ADD `audit` int(1) COLLATE 'utf8_general_ci' NULL;"); */ } /* загрузка обложки раздела */ function upload($img){ if ( preg_match( '/[.](jpg)|(jpeg)|(JPG)|(JPEG)$/', $img['img']['name'] ) ){ include_once ( MYDIR . '/api/php/genpass.php' ); $img_name = generate_password( 10 ); $source = $img['img']['tmp_name']; $target = MYDIR.'/img/pages_cat/' . $img_name . '.jpg'; copy( $source, $target ); } return $img_name; } function add($massiv){ $db = $this -> db; } /* ------------------------------------------------------------------------------------------------------------------------- */ function get_pages( $id ){ // Получаем страницы $db = $this -> db; $db -> or_by_desc = 1; $a['public'] = 1; $a['post_type'] = 'page'; $a['pages_cat'] = $id; $postrow = $db -> get_massiv( 'pages', $a, 't' ); //print_r( $postrow ); return $postrow; } /* ------------------------------------------------------------------------------------------------------------------------- */ } ?>