core/api/modules/find_fotograf/index.php

47 lines
2.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
$mod = new main( $smarty, $settings );
$mod -> db = $db;
/*
$check = $db->free_sql("CHECK TABLE `foto_img`");
if ($check[0]['Msg_text']=='OK'){
//проверяем авторизацию
if (MYID){
//проверяем 18+
unset($a);
$a['id']=MYID;
$audit=$db -> get_val('users', $a, 'vosrast');
if ($audit>18)
$rnd_img=$db->free_sql("SELECT * FROM `foto_img` WHERE `album_id`= " . ID);
else
$rnd_img=$db->free_sql("SELECT * FROM `foto_img` WHERE `album_id`= " . ID . " AND `audit`<>1");
}else{
$rnd_img=$db->free_sql("SELECT * FROM `foto_img` WHERE `album_id`= " . ID . " AND `audit`<>1");
}
require_once MYDIR . '/api/php/img2.php';
// $rnd_img=$db->free_sql("SELECT * FROM `foto_img` WHERE `audit`<>1 ORDER BY RAND() LIMIT 250");
$count=count($rnd_img);
for( $i = 0; $i < $count; $i++ ){
@mkdir (MYDIR . '/img/albums/' . $rnd_img[$i]['user_id'] . '/' . $rnd_img[$i]['album_id'] . '/250', 0700);
//проверяем наличие файла, если файла нет - создаем превью в квадрате
if (!file_exists(MYDIR . '/img/albums/' . $rnd_img[$i]['user_id'] . '/' . $rnd_img[$i]['album_id'] . '/250/' . $rnd_img[$i]['img'] . '.jpg')){
square_preview(MYDIR . '/img/albums/' . $rnd_img[$i]['user_id'] . '/' . $rnd_img[$i]['album_id'] . '/' . $rnd_img[$i]['img'] . '.jpg', 250, MYDIR . '/img/albums/' . $rnd_img[$i]['user_id'] . '/' . $rnd_img[$i]['album_id'] . '/250/' . $rnd_img[$i]['img'] . '.jpg');
}
}
$smarty->assign('rnd_img', $rnd_img);
}
//получаем инфу об альбоме
unset($a);
$a['id']=ID;
$album=$db->get_massiv('foto_albums', $a, '', 1);
$smarty->assign('album', $album);
//Получаем инфо об авторе
unset($a);
$a['id']=$album[0]['user_id'];
$user=$db->get_massiv('users', $a, '', 1);
$smarty->assign('user', $user);
*/
?>