Przejrzałem jeszcze kod na szybko i sie niczego nie dopatrzyłem :|
Może wy coś poradzicie....
<?php function czas () { $result = $db->query("SELECT reg_date, lastdate, user_id FROM " . PREFIX . "_users ORDER BY reg_date DESC LIMIT 0,1"); $row = $db->get_row($result); $count_days=1; $r1="rok"; $r2="lata"; $r3="lat"; $m1="miesiąc"; $m2="miesiące"; $m3="miesięcy"; $d1="dzień"; $d2="dni"; if ($with_us_year >= 1) { if ($with_us_year == 1) $after_y = $r1; if ($with_us_year > 1 && $with_us_year < 5) $after_y = $r2; if ($with_us_year > 4) $after_y = $r3; $years = $with_us_year." ".$after_y; $with_us = $with_us - ($years * 365); $count_days=0; } if ($with_us_month >= 1) { if ($with_us_month == 1) $after_m = $m1; if ($with_us_month > 1 && $with_us_month < 5) $after_m = $m2; if ($with_us_month > 4) $after_m = $m3; $monthes = $with_us_month." ".$after_m; $with_us = $with_us - ($monthes * 31); if ($with_us_month > 6) $count_days=0; if ($with_us_month == 12) {$years = ($with_us_year+1)." ".$r1;$with_us_month=$monthes=''; } } if ($count_days == 1) { if ($with_us > 0) { if ($with_us == 1) $after_d = $d1; if ($with_us > 1) $after_d = $d2; $days = $with_us." ".$after_d; } } $czas = $years." ".$monthes." ".$days; return $czas; } $with_us = czas (reg_date); ?>