core/api/modules/foto_add_album/index.php

44 lines
1004 B
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?php
/*
01.05.2021
Личный кабинет
*/
if (!$_SESSION['user_id'] && !ID)header( 'Location: /403/' );
$mod = new main( $smarty, $settings );
$mod -> db = $db;
$mod -> install();
$mod -> get_settings();
if ( @$_POST['naim'] ){
unset( $_POST['ok'] );
//Узнаем, есть ли категория
unset( $a );
$_POST['user_id']=$_SESSION['user_id'];
$_POST['t']=time();
if ($_POST['srok']=='1')$_POST['srok']=time() + 2678400;
if ($_POST['srok']=='2')$_POST['srok']=time() + 5356800;
if ($_POST['srok']=='3')$_POST['srok']=time() + 8035200;
if ($_POST['pwd']){
$_POST['pwd'] = md5 ( $_POST['pwd'] );
$_POST['private']=1;
}
if( @$_FILES['img']['tmp_name'] ) $_POST['img'] = $mod -> upload( $_FILES );
if ( !$id ) $db -> add( 'foto_albums', $_POST );
header( 'Location: /foto_my_albums/' );
}
unset($a);
$a['id']=$_SESSION['user_id'];
$smarty -> assign( 'user', $db -> get_massiv('users', $a, '', 1) );
?>