$results = $wpdb->get_results("SELECT COUNT(user_id) as count
FROM `wp_konkurs`
WHERE ( `user_email` = 'mail@mail.ru' ) AND ( DATE(user_time) = ' $nowDate ' ) ;
");
$result[0]->count
<?php echo '<img src="'.isset(json_decode($child->params)->image) ? json_decode($child->params)->image : '' . '" />'; ?>
location /parser/ {
rewrite ^(.*)$ /parser/index.php permanent;
}
location ~ /parser/.+\.php$ {
error_log /var/www/theinsider/sites/logs/nginx_error_parser.log;
root /var/www/theinsider/sites/theinsider.ua;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_buffers 64 64k;
fastcgi_buffer_size 256k;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
$date='2016-05-26 18:06:08';
//переводим в секунды
$time=strtotime($date);
$zone=new DateTime($date, new DateTimeZone('America/New_York'));
// Смещение временной зоны в секундах.
$dif=$zone->format('Z');
if($dif < 0){
$date=$time+$dif;
}
if($dif > 0){
$date=$time-$dif;
}
echo date('Y-m-d H:i:s',$date);