Файл: vk.com_vhllam/klan/functions.php
Строк: 59
<?php
function ban($user, $clan) {
$sql = mysql_fetch_array(mysql_query("SELECT * FROM `clan_user` WHERE `id_user` = '".$user."' && `id_clan` = '".$clan."' && `ban_time` > '".time()."'"));
if ($sql) {
return '1';
} else {
return '0';
}
}
function t2($timediff) {
$oneMinute=60;
$oneHour=60*60;
$hourfield=floor(($timediff)/$oneHour);
$minutefield=floor(($timediff-$hourfield*$oneHour)/$oneMinute);
$secondfield=floor(($timediff-$hourfield*$oneHour-$minutefield*$oneMinute));
$sHoursLeft=$hourfield;
$sHoursText = "часов";
$nHoursLeftLength = strlen($sHoursLeft);
$h_1=substr($sHoursLeft,-1,1);
if (substr($sHoursLeft,-2,1) != 1 && $nHoursLeftLength>1)
{
if ($h_1== 2 || $h_1== 3 || $h_1== 4)
{
$sHoursText = "часа";
}
elseif ($h_1== 1)
{
$sHoursText = "час";
}
}
if ($nHoursLeftLength==1)
{
if ($h_1== 2 || $h_1== 3 || $h_1== 4)
{
$sHoursText = "часа";
}
elseif ($h_1== 1)
{
$sHoursText = "час";
}
}
$sMinsLeft =$minutefield;
$sMinsText = "минут";
$nMinsLeftLength = strlen($sMinsLeft);
$m_1=substr($sMinsLeft,-1,1);
if ($nMinsLeftLength>1 && substr($sMinsLeft,-2,1) != 1)
{
if ($m_1== 2 || $m_1== 3 || $m_1== 4)
{
$sMinsText = "минуты";
}
else if ($m_1== 1)
{
$sMinsText = "минута";
}
}
if ($nMinsLeftLength==1)
{
if ($m_1== 2 || $m_1==3 || $m_1== 4)
{
$sMinsText = "минуты";
}
elseif ($m_1== "1")
{
$sMinsText = "минута";
}
}
$displaystring="".
$sHoursLeft." ".
$sHoursText." ".
$sMinsLeft." ".
$sMinsText." ";
if ($timediff<0) $displaystring='дата уже наступила';
return $displaystring;
}
?>