Файл: vk.com_vhllam/sys/core/geme.func.php
Строк: 41
<?php
//////Автор OPPS (Kasell)////
/////Скрипт бесплатный //////
////Плтную версию можно купить vk.com/vhllam///
///Ферма
function add_farm_event($msg)
{
global $user;
mysql_query("INSERT INTO `farm_event` (`time`, `uid`, `msg`) VALUES
('".time()."', '".$user['id']."', '".my_esc($msg)."')");
}
///События
function farm_event($usid = NULL)
{
global $user;
if ($usid==NULL)
{
$uid=$user['id'];
}
else
{
$uid=intval($usid);
}
$checkevent = mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_event` WHERE `uid` = '$uid'"),0);
if ($checkevent!=0)
{
$event = mysql_fetch_array(mysql_query("SELECT * FROM `farm_event` WHERE `uid` = '$uid' ORDER BY id LIMIT 1"));
echo "<div class='gmenu'>";
echo "<table class='post'><td rowspan='2' style='width:33px'>";
echo "<img src='/style/icons/event.png' alt='' /></td><td>Событие!</td></tr><tr><td>";
echo "".esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($event['msg']))))))))."";
echo "</td></tr></table></div>";
mysql_query("DELETE FROM `farm_event` WHERE `id` = '$event[id]' LIMIT 1");
mysql_query("OPTIMIZE TABLE `farm_event`");
}
}
//Время
function ras_to_mime($ras=null)
{
if ($ras==null)
{
return 'application/octet-stream';
}
else
{
$htaccess=file(H.'.htaccess');
for ($i=0;$i<count($htaccess);$i++)
{
if (preg_match('#^AddType#i',trim($htaccess[$i])))
{
$type=explode(' ', trim($htaccess[$i]));
$rass=str_replace('.',null,$type[2]);
$mime[$rass]=$type[1];
}
}
if (isset($mime[$ras]))
{
return $mime[$ras];
}
else
return 'application/octet-stream';
}
}
///Склон
function sklon_after_number($Number,$Slovo1,$Slovo2,$Slovo3,$Mode)
{
$Str=strval($Number);
$chars = mb_strlen($Str, "utf8");
$LastChar = mb_substr($Str, $chars - 1, 1, "utf8");
if($LastChar=="1")
{
$Result=$Slovo1;
};
if(($LastChar=="2")or($LastChar=="3")or($LastChar=="4"))
{
$Result=$Slovo2;
};
if(($LastChar=="5")or($LastChar=="6")or($LastChar=="7")or($LastChar=="8")or($LastChar=="9")or($LastChar=="0"))
{
$Result=$Slovo3;
};
if($Mode==1)
{
$Ret=$Str." ".$Result;
};
if($Mode==2)
{
$Ret=$Result;
};
return $Ret;
};
?>