Пример #1
0
function output($sort)
{
    // переглядаємо тип сортування
    if ($sort == "size_up") {
        $images = dataBase("SELECT * FROM images ORDER by size ASC");
    } else {
        if ($sort == "size_down") {
            $images = dataBase("SELECT * FROM images ORDER by size DESC");
        } else {
            if ($sort == "date_up") {
                $images = dataBase("SELECT * FROM images ORDER by date_upload ASC");
            } else {
                if ($sort == "date_down") {
                    $images = dataBase("SELECT * FROM images ORDER by date_upload DESC");
                } else {
                    $images = dataBase("SELECT * FROM images ORDER by id ASC");
                }
            }
        }
    }
    ?>
		<div id="gallery" style="display:none;">
		<?php 
    // відповідно до типу сортування виводимо всі зображення
    foreach ($images as $one) {
        ?>
				<a href="<?php 
        echo 'management.php?image=' . $one['name'];
        ?>
">
					<img alt="<?php 
        echo $one['date_upload'] . ' ' . $one['comment'];
        ?>
"
					src="<?php 
        echo 'images/thumbs/' . $one['name'];
        ?>
"
					data-image="<?php 
        echo 'images/big/' . $one['name'];
        ?>
"
					data-description="<?php 
        echo $one['date_upload'] . ' ' . $one['comment'];
        ?>
"
					style="display:none">
				</a>
				<?php 
    }
    ?>
		</div>
		<?php 
}
Пример #2
0
<?php

session_start();
//Подключение конфигов
include "../include/stack.php";
$con = dataBase();
//данные для доступа к API
$client_id = '5108363';
// ID приложения
$client_secret = '4Hr4peFt6uQXME6XizOX';
// Защищённый ключ
$redirect_uri = 'http://chat.self.ru/auth/vkontakte.php';
// Адрес сайта
if (isset($_POST['vauth'])) {
    $url = 'http://oauth.vk.com/authorize';
    $params = array('client_id' => $client_id, 'redirect_uri' => $redirect_uri, 'response_type' => 'code');
    header('Location: ' . $url . '?' . urldecode(http_build_query($params)) . '');
    exit;
}
if (isset($_GET['code'])) {
    $result = false;
    $params = array('client_id' => $client_id, 'client_secret' => $client_secret, 'code' => $_GET['code'], 'redirect_uri' => $redirect_uri);
    $token = json_decode(file_get_contents('https://oauth.vk.com/access_token' . '?' . urldecode(http_build_query($params))), true);
    if (isset($token['access_token'])) {
        $params = array('uids' => $token['user_id'], 'fields' => 'uid,first_name,last_name,screen_name,sex,bdate,photo_big', 'access_token' => $token['access_token']);
        $userInfo = json_decode(file_get_contents('https://api.vk.com/method/users.get' . '?' . urldecode(http_build_query($params))), true);
        if (isset($userInfo['response'][0]['uid'])) {
            $userInfo = $userInfo['response'][0];
            $result = true;
        }
    }
Пример #3
0
<?php

include 'database.php';
$db_connection = dataBase($db_host, $db_name, $db_user, $db_pass);
$user_errors = array();
class User
{
    public $first_name;
    public $last_name;
    public $email;
    public $username;
    public $password;
    public $authority;
    public $created_date;
    public function User($first_name, $last_name, $email, $username, $password, $authority)
    {
        date_default_timezone_set('UTC');
        $time = new DateTime();
        $this->first_name = $first_name;
        $this->last_name = $last_name;
        $this->email = $email;
        $this->username = $username;
        $this->password = $password;
        $this->authority = $authority;
        $this->created_date = $time->format('Y-m-d H:i:s');
    }
}
if (isset($_POST['firstname']) && $_POST['firstname'] !== '') {
    $input_firstname = filter_var($_POST['firstname'], FILTER_SANITIZE_STRING);
    // echo $input_firstname;
} else {
Пример #4
0
function output($sort)
{
    // переглядаємо тип сортування
    if ($sort == "size_up") {
        $images = dataBase("SELECT * FROM images ORDER by size ASC");
    } else {
        if ($sort == "size_down") {
            $images = dataBase("SELECT * FROM images ORDER by size DESC");
        } else {
            if ($sort == "date_up") {
                $images = dataBase("SELECT * FROM images ORDER by date_upload ASC");
            } else {
                if ($sort == "date_down") {
                    $images = dataBase("SELECT * FROM images ORDER by date_upload DESC");
                } else {
                    $images = dataBase("SELECT * FROM images ORDER by id ASC");
                }
            }
        }
    }
    ?>
		<script type='text/javascript' src='unitegallery/js/jquery-11.0.min.js'></script>	
		<script type='text/javascript' src='unitegallery/js/unitegallery.min.js'></script>	
		<script type='text/javascript' src='unitegallery/themes/tiles/ug-theme-tiles.js'></script>
		<script src="bootstrap/js/bootstrap.min.js"></script>
		
		<script type="text/javascript">
			$(document).ready(function(){
			
				jQuery("#gallery").unitegallery({
					tile_border_color:"#7a7a7a",
					tile_outline_color:"#8B8B8B",
					tile_enable_shadow:true,
					tile_shadow_color:"#8B8B8B",
					tile_overlay_opacity:0.3,
					tile_show_link_icon:true,
					tile_image_effect_type:"sepia",
					tile_image_effect_reverse:true,
					tile_enable_textpanel:true,
					lightbox_textpanel_title_color:"e5e5e5",
					tiles_col_width:230,
					tiles_space_between_cols:20				
				});

			});
		</script>
		
		<div id="gallery" style="display:none;">
		<?php 
    // відповідно до типу сортування виводимо всі зображення
    foreach ($images as $one) {
        ?>
				<a href="<?php 
        echo 'management.php?image=' . $one['name'];
        ?>
">
					<img alt="<?php 
        echo $one['date_upload'] . ' ' . $one['comment'];
        ?>
"
					src="<?php 
        echo 'images/thumbs/' . $one['name'];
        ?>
"
					data-image="<?php 
        echo 'images/big/' . $one['name'];
        ?>
"
					data-description="<?php 
        echo $one['date_upload'] . ' ' . $one['comment'];
        ?>
"
					style="display:none">
				</a>
				<?php 
    }
    ?>
		</div>
		<?php 
}