Файл: vfermu.ru/sys/other/verh_site.php
Строк: 258
<?php
if($ku['opyt_open']==1)
{
$exp=round($kr/($level['rating']/100));
if($exp>=100)
{
$expt=100;
echo ' div class="ware_first">
<div class="exp_thrd" style="width:'.$expt.'%"></div>
</div></div></td><td>';
}
else
{
echo '<div class="ware_first">
<div class="exp_thrd" style="width:'.$exp.'%"></div>
</div></div></td><td>';
}
}
if($ku['new_news']!='')
{
echo '<div class="feedback">
<div class="title">
<span class="nobr"><img src="/images/icons/newspaper48.png" width="24" height="24" alt="o" title="Новости"/>
<a href="'.$ku['new_news'].'">Свежие новости!</a></span>
</div>
</div>';
mysql_query("UPDATE `farm_user` SET `new_news` = '' WHERE `id` = '$ku[id]'");
}
if($ku['money_ruby_open']==1)
{
echo '
<div style="text-align:right;padding:4px;" class="small">';
echo "<span><span class='nobr'><img width='16' height='16' src='/images/icons/money.png' alt='o'/> <span class='title'>".(strkol($ku['money']))."</span></span></span> ";
echo "<span><span class='nobr'><img width='16' height='16' src='/images/icons/ruby.png' alt='o'/> <span class='title'>".(strkol($ku['rubies']))."</span></span></span>";
echo'</div>';
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0' AND `type`='to'"),0)!=0)
{
echo "<div class='feedback'><div>Вам пришло сообщение <span class='title'>(<span>".mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)."</span>)</span><br><a href='/mail/new'>Читать</a><br></div></div>";
}
if(isset($_SESSION['harvest']))
{
harvest($_SESSION['harvest']);
unset($_SESSION['harvest']);
}
if(isset($_SESSION['harvest2']))
{
harvest2($_SESSION['harvest2']);
unset($_SESSION['harvest2']);
}
if(isset($_SESSION['suikll']))
{
suikll($_SESSION['suikll']);
unset($_SESSION['suikll']);
}
if(isset($_SESSION['rating']))
{
ratingg($_SESSION['rating']);
unset($_SESSION['rating']);
}
if($ku['umoney']!=0)
{
money($ku['umoney']);
}
if(isset($_SESSION['catchfish']))
{
catchfish($_SESSION['catchfish']);
unset($_SESSION['catchfish']);
}
if(isset($_SESSION['no_rubies']))
{
no_rubies($_SESSION['no_rubies']);
unset($_SESSION['no_rubies']);
}
if(isset($_SESSION['suikll']))
{
suikll($_SESSION['suikll']);
unset($_SESSION['suikll']);
}
if(isset($_SESSION['ratingg']))
{
no_rubies($_SESSION['ratingg']);
unset($_SESSION['ratingg']);
}
if(isset($_SESSION['no_money']))
{
no_money($_SESSION['no_money']);
unset($_SESSION['no_money']);
}
if(isset($_SESSION['qqqq']))
{
qqqq($_SESSION['qqqq']);
unset($_SESSION['qqqq']);
}
if(isset($_SESSION['qqqqq']))
{
qqqqq($_SESSION['qqqqq']);
unset($_SESSION['qqqqq']);
}
if(isset($_SESSION['mast']))
{
mast($_SESSION['mast']);
unset($_SESSION['mast']);
}
if(isset($_SESSION['kulmas']))
{
kulmas($_SESSION['kulmas']);
unset($_SESSION['kulmas']);
}
if(isset($_SESSION['msg']))
{
msg_game($_SESSION['msg']);
unset($_SESSION['msg']);
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_collective_invite` WHERE `id_user` = '$ku[id]'"),0)!=0 && !isset($mc))
{
$invite=mysql_fetch_array(mysql_query("SELECT * FROM `farm_collective_invite` WHERE `id_user` = '$ku[id]'"));
$cti=mysql_fetch_array(mysql_query("SELECT * FROM `farm_collective` WHERE `id` = '$invite[id_collective]'"));
$who=mysql_fetch_array(mysql_query("SELECT * FROM `farm_user` WHERE `id` = '$invite[id_who]'"));
if(isset($_GET['invite_collective']) && $_GET['invite_collective']=='yes')
{
mysql_query("DELETE FROM `farm_collective_invite` WHERE `id` = '$invite[id]'");
mysql_query("INSERT INTO `farm_collective_user` SET `id_user` = '$ku[id]', `id_collective` = '$cti[id]', `time` = '$time', `status` = '7'");
mysql_query("INSERT INTO `farm_collective_history` SET `id_user` = '$ku[id]', `id_who` = '$who[id]', `id_collective` = '$cti[id]', `time` = '$time', `type` = 'in', `dei` = 'who'");
mysql_query("DELETE FROM `farm_rating_mouser` WHERE `id_user` = '$ku[id]'");
update_ku('colid', $cti['id']);
header("Location: /collective-$cti[id]");
}
elseif(isset($_GET['invite_collective']) && $_GET['invite_collective']=='no')
{
mysql_query("DELETE FROM `farm_collective_invite` WHERE `id` = '$invite[id]'");
}
else
{
echo "<div class='feedback'><div><span>";
echo on_k($who['id']);
echo " <a class='' href='/user/$who[id]'>".nc($who['id'])."</a></span> приглашает Вас в свой колхоз <a href='/collective-$cti[id]'><span>".hsc($cti['name'])."</span></a><br/>";
echo "<img width='16' height='16' src='images/icons/tick.png' alt='o'> <a href='/myfarm/invite_collective-yes'>Принять приглашение</a><br/>";
echo "<img width='16' height='16' src='images/icons/delete.png' alt='o'> <a href='/myfarm/invite_collective-no'>Отказаться</a>";
echo "</div>n
</div>";
}
}
if($ku['pol']==0 && empty($ku['brak']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_zags` WHERE `status`='0' AND `nevesta` = '$ku[id]'"),0)!=0)
{
$invite=mysql_fetch_array(mysql_query("SELECT * FROM `farm_zags` WHERE `nevesta` = '$ku[id]' AND `status`='0'"));
$who=mysql_fetch_array(mysql_query("SELECT * FROM `farm_user` WHERE `id` = '$invite[zenih]'"));
if(isset($_GET['invite_zags']) && $_GET['invite_zags']=='yes')
{
$uctu=mysql_fetch_array(mysql_query("SELECT * FROM `farm_collective_user` WHERE `id_user` = '$who[id]'"));
if(empty($mc['id']))$mc['id']=0;
mysql_query("UPDATE `farm_zags` SET `status`='1',`nkh`='$mc[id]',`zkh`='$uctu[id_collective]' WHERE `nevesta` = '$ku[id]' AND `status`='0'");
mysql_query("UPDATE `farm_user` SET `brak` = '$ku[id]' WHERE `id` = '$who[id]'");
mysql_query("UPDATE `farm_user` SET `brak` = '$who[id]' WHERE `id` = '$ku[id]'");
$text=''.$ku['nick'].' приняла ваше предложение. Администрация искренне поздравляет вас, теперь вы муж и жена.';
mysql_query("INSERT INTO `farm_mail` SET `id_user` = '$who[id]', `id_kont` = '0', `msg` = '$text', `time` = '$time', `type` = 'to'");
$utext = 'Администрация искренне поздравляет вас! Теперь вы муж и жена.';
mysql_query("INSERT INTO `farm_mail` SET `id_user` = '$ku[id]', `id_kont` = '0', `msg` = '$utext', `time` = '$time', `type` = 'to'");
header("Location:/myfarm");
}
elseif(isset($_GET['invite_zags']) && $_GET['invite_zags']=='no')
{
$text=''.$ku['nick'].' отказалась от вашего предложения, на ваш счет возвращено 80 алмазов.';
mysql_query("INSERT INTO `farm_mail` SET `id_user` = '$who[id]', `id_kont` = '0', `msg` = '$text', `time` = '$time', `type` = 'to'");
mysql_query("UPDATE `farm_user` SET `rubies` = '".($who['rubies']+80)."' WHERE `id` = '$who[id]'");
mysql_query("DELETE FROM `farm_zags` WHERE `nevesta` = '$ku[id]' AND `status`='0' ");
header("Location: /myfarm");
}
else
{
echo "<div class='feedback'><div><span>";
echo on_k($who['id']);
echo " <a class='' href='/user/$who[id]'>".nc($who['id'])."</a></span> предлагает вам заключить брак.<br/>";
echo "<img width='16' height='16' src='images/icons/tick.png' alt='*'> <a href='/myfarm/invite_zags-yes'>Согласиться</a><br/>";
echo "<img width='16' height='16' src='images/icons/delete.png' alt='*'> <a href='/myfarm/invite_zags-no'>Отказаться</a>";
echo "</div>n
</div>";
}
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_turnir` WHERE `active` = '1'"),0)>0)$turnir=mysql_fetch_array(mysql_query("SELECT `id`,`name`,`nameexp`,`procent` FROM `farm_turnir` WHERE `active` = '1' ORDER by `id` DESC")); else $turnir['id']=0;
if($turnir['id']>0 && $ku['active_turnir']==1){
if(isset($_GET['trophy']))
{
echo "<div class='event'><h1>Вы нашли $turnir[nameexp]!</h1></div>";
echo '<div class="content"><div class="block">';
if(!isset($_SESSION['prize']))$_SESSION['prize']='';
if(isset($_GET['trophy']) && isset($_SESSION['trophy']) && $_SESSION['trophy']==$_GET['gen_code'])
{
$cci=$ku['turnir_count']+1;
mysql_query("UPDATE `farm_user` SET `turnir_count` = '$cci' WHERE `id` = '$ku[id]'");
if($cci>1 && $cci<5)$ssl='трофея';
else if($cci>=5 && $cci<21)$ssl='трофеев';
else if($cci>20 && substr("$cci", -1)==1)$ssl='трофей';
else if($cci>20 && substr("$cci", -1)>1 && substr("$cci", -1)<5)$ssl='трофея';
else if($cci>20 && (substr("$cci", -1)>4 || substr("$cci", -1)==0))$ssl='трофеев';
else $ssl='трофей';
echo "Поздравляем! У вас уже <img width='16' height='16' src='/images/turnir/$turnir[id].png'/><span class='title'> $cci</span> $ssl ";
unset($_SESSION['trophy']);
}
else
{
echo "Эх, не успели!";
}
echo "</div>";
include_once 'sys/other/foot.php';
}
$rand=rand(1,100);
if($rand<=$turnir['procent'])
{
$_SESSION['trophy']=md5($rand);
echo "<div class='feedback'><center><img width='16' height='16' src='images/turnir/$turnir[id].png'> <a href='/trophy-1/gen_code-".md5($rand)."'>Вы нашли $turnir[nameexp]!</a> <img width='16' height='16' src='images/turnir/$turnir[id].png'></center></div>";
}
}//end
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_gifts` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0)
{
echo "<div class='feedback'><div>У вас новый подарок<br><a href='/presents-$ku[id]'>Смотреть</a><br></div></div>";
}
if($ku['otvets'] == 1){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div> ";
}
elseif($ku['otvets'] == 2){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 3){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 4){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 5){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 6){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 7){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 8){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 9){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
elseif($ku['otvets'] == 10){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
if($ku['reklam'] == 1){
echo "<div class='event-panel'><center>А вам нравится наша игра? проголосуйте в нашей группе вконтакте <a href='/?buildingMaterials&reklama&da'>(голосовать)</a> Перейдя по ссылке вы получите 300 <img width='16' height='16' src='/images/icons/ruby.png'> или <a href='/?buildingMaterials&reklamazark&da'><img width='16' height='16' src='/images/icons/cross.png'></a></center></div> ";
}
elseif($ku['reklam'] == 2){
echo "<div class='event-panel'><center>Вам ответили в чате <a href='/?buildingMaterials&otv&da'>Перейти в чат</a></center></div>";
}
?>