but1head

but1head

С нами с 01 апреля 2014; Место в рейтинге пользователей: #27
but1head
01 июля 2014, 22:58
+2
Василий, а что по поводу изменения цены от параметров? (цвет/размер)
but1head
26 мая 2014, 10:39
2
0
<?php
$end = $scriptProperties['end'];
$curday = strtotime(date('d.m.Y'));
$remaining_days = floor(($end-$curday)/(60*60*24));


if (!function_exists('numberEnd')) {
    function numberEnd($number, $titles) {
		$cases = array (2, 0, 1, 1, 1, 2);
    	return $titles[ ($number%100>4 && $number%100<20)? 2 : $cases[min($number%10, 5)] ];
	}
}


$number = $remaining_days; 


return $number.' д'. numberEnd($number, array('ень', 'ня', 'ней'));
Использование:
[[!timeleft? &end=`[[+unpub_date:strtotime`]]`]]