Вход Регистрация
Файл: www/onvid/vid.php
Строк: 71
<?php

        
include_once '../sys/inc/start.php';
        include_once 
'../sys/inc/compress.php';
        include_once 
'../sys/inc/sess.php';
        include_once 
'../sys/inc/home.php';
        include_once 
'../sys/inc/settings.php';
        include_once 
'../sys/inc/db_connect.php';
        include_once 
'../sys/inc/ipua.php';
        include_once 
'../sys/inc/fnc.php';
        include_once 
'../sys/inc/user.php';

        
/*Что сделанно

        Добавил постраничную навигацию в подкаталоги и вывод видео файлов

        */
        
$user_id $user['id'];
        
$id = isset($_REQUEST['id']) ? abs(intval($_REQUEST['id'])) : false;

        
$act = isset($_GET['act']) ? trim($_GET['act']) : '';
        
$realtime time();
        if (!
$user_id)
        {

                    
$set['title'] = 'Ошибка';
                    include_once 
'../sys/inc/thead.php';
                    
title();
                    echo 
'Только для зарегистрированных';

                    include_once 
'../sys/inc/tfoot.php';

                    exit;

        }
if (
$user['group_access'] >= 15){
        switch (
$act)
        {

                    case 
'soz':

                                
$set['title'] = 'Добавляем видео!';
                                include_once 
'../sys/inc/thead.php';
                                
title();

                                if (isset(
$_POST['submit']))
                                {

                                            
$name $_POST['name'];

                                            
$text $_POST['text'];

                                            
$opis $_POST['opis'];

                                            
$ref = isset($_GET['idr']) ? abs(intval($_GET['idr'])) : false;

                                            
$req mysql_query("SELECT * FROM `users` WHERE `id` = '" $user_id .
                                                        
"' LIMIT 1");

                                            
$users mysql_fetch_assoc($req);

                                            if (empty(
$text))
                                            {
                                                        
$set['title'] = 'Ошибка';
                                                        include_once 
'../sys/inc/thead.php';
                                                        
title();
                                                        echo 
'Введите код';

                                                        include_once 
'../sys/inc/tfoot.php';

                                                        exit;

                                            } elseif (empty(
$name))
                                            {

                                                        
$set['title'] = 'Ошибка';
                                                        include_once 
'../sys/inc/thead.php';
                                                        
title();
                                                        echo 
'Введите название';

                                                        include_once 
'../sys/inc/tfoot.php';

                                                        exit;

                                            }

                                            
mysql_query("INSERT INTO `vid` (refid, iduser, login, text, data, name, opis) VALUES ('$ref', '" .
                                                        
$user_id "', '" $user['nick'] . "', '$text', '" $realtime "', '$name', '$opis')");

                                            
header("location: index.php?id=$ref");

                                }

                                break;

                    case 
'del':

                                if (
$user['group_access'] >= 15)
                                {

                                            
mysql_query("DELETE FROM `vid` WHERE `id` = '$id' LIMIT 1");

                                            
header("location: index.php");

                                } else
                                {

                                            
header("location: index.php");

                                }

                                break;

                    default:

        }
}
        include_once 
'../sys/inc/tfoot.php';

?>
Онлайн: 2
Реклама