game/modules_data/location/elka.php

416 lines
16 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?php
if(!defined('GAME'))
{
die();
}
2023-01-10 16:29:32 +00:00
//id Новогоднего подарка
2022-06-06 21:30:34 +00:00
$pidid = 4008;
$dy = 1;
if((date('n',time())==2 && date('j',time())<=14))
{
$dy = 0;
}
$dt = date('Y',time())+$dy;
2022-12-19 18:26:14 +00:00
$dt = 2023;
2022-06-06 21:30:34 +00:00
if($u->room['file']=='elka')
{
2023-01-10 16:29:32 +00:00
if(isset($_GET['elka_shar'])&& isset($_GET['shar_name'])) //Украшение Ёлки
2022-06-06 21:30:34 +00:00
{
$itd = mysql_fetch_array(mysql_query(' SELECT * FROM `items_users` WHERE `item_id` > 2723 AND `item_id` < 2741 AND `uid`= "'.$u->info['id'].'" AND `delete` = 0 AND `id`= "'.$_GET['elka_shar'].'" LIMIT 1 '));
if (isset($itd['id'])){
$itdu=mysql_query('UPDATE `items_users` SET `delete` ="'.time().'" WHERE `id` ="'.$_GET['elka_shar'].'" LIMIT 1 ');
if (isset($itdu))
{
2023-01-10 16:29:32 +00:00
//eff Благословение Ёлки X
2022-06-06 21:30:34 +00:00
$effe = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`= "'.$u->info['id'].'" AND `delete` = 0 AND `id_eff`= 477 LIMIT 1'));
if (isset($effe['id']))
{
$tdata=str_replace("add_hpAll=", "", $effe['data']);
$tdata=$tdata+5;
if ($tdata>500){$tdata=500;}
$newdata='add_hpAll='.$tdata;
2023-01-10 16:29:32 +00:00
$newname='Благословение Ёлки x'.($tdata/5);
2022-06-06 21:30:34 +00:00
$effeadd=mysql_query('UPDATE `eff_users` SET `name` = "'.$newname.'",`data`="'.$newdata.'", `timeUse` = "'.time().'"WHERE `id` ="'.$effe['id'].'" ');
if (isset($effeadd))
{
2023-01-10 16:29:32 +00:00
echo "Вы получили <b><font color=red>Благословение Ёлки x".round($tdata/5)."</font></b> " ;
2022-06-06 21:30:34 +00:00
}
}
else
{
$effeadd=mysql_query('INSERT INTO `eff_users`
(`id`,`id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`)
VALUES
2023-01-10 16:29:32 +00:00
(NULL, "477", "'.$u->info['id'].'", "Благословение Ёлки x1", "add_hpAll=5", "110", "'.time().'", "0", "", "0", "0", "0", "", "1", "-1", "0", "0", "0", "", "0", "0", "0", "0", "0")');
2022-06-06 21:30:34 +00:00
if (isset($effeadd))
{
2023-01-10 16:29:32 +00:00
echo "Вы получили <b><font color=red>Благословение Ёлки x1</font></b> " ;
2022-06-06 21:30:34 +00:00
}
}
2023-01-10 16:29:32 +00:00
echo "Использовал: <b><font color=red>".$_GET['shar_name']."</font><b>" ;
2022-06-06 21:30:34 +00:00
}
else
{
2023-01-10 16:29:32 +00:00
echo "<b><font color=red>Ошибка</font></b>" ;
2022-06-06 21:30:34 +00:00
}
}
}
if(isset($_GET['take_gift']) && (date('m') == 12 || (date('m') == 1 && date('d') <= 8)))
{
2023-01-10 16:29:32 +00:00
//получаем свой новогодний подарок за текущий год addItem($id,$uid)
2022-06-06 21:30:34 +00:00
$smt = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "take_gift_'.$dt.'" LIMIT 1',1);
if(!isset($smt['id']))
{
$pid = $u->addItem($pidid,$u->info['id']);
if($pid>0)
{
2023-01-10 16:29:32 +00:00
mysql_query('UPDATE `items_users` SET `gift` = "Администрация",`gtxt1` = "Поздравляем Вас с Новым Годом!" WHERE `id` = "'.$pid.'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
2022-06-06 21:30:34 +00:00
$u->addAction(time(),'take_gift_'.$dt.'',$u->info['city']);
2023-01-10 16:29:32 +00:00
echo '<font color=red>Предмет находится у Вас в инвентаре, в разделе "прочее"</font>';
2022-06-06 21:30:34 +00:00
}else{
2023-01-10 16:29:32 +00:00
echo '<font color=red>Не удалось получить подарок...</font>';
2022-06-06 21:30:34 +00:00
}
}else{
2023-01-10 16:29:32 +00:00
echo '<font color=red>Вы уже получили свой подарок ;)</font>';
2022-06-06 21:30:34 +00:00
}
}elseif(isset($_GET['del']))
{
if($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4))
{
if($u->info['admin']==0)
{
$pInfo = ''.$u->info['align'].'|'.$u->info['clan'].'|'.$u->info['login'].'|'.$u->info['level'].'|'.$u->info['cityreg'].'';
}else{
$pInfo = '1';
}
mysql_query("UPDATE `elka` SET `delete`='".$pInfo."' WHERE `id`='".mysql_real_escape_string($_GET['del'])."'");
}
}elseif(isset($_GET['use_cup']))
{
$smt = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.(time()-600).' AND `vars` = "use_cupNewYear" LIMIT 1',1);
if(!isset($smt['id']))
{
$u->addAction(time(),'use_cupNewYear','');
mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpAll'].'",`mpNow` = "'.$u->stats['mpAll'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
2023-01-10 16:29:32 +00:00
echo '<font color=red>Успешно использован эликсир "Полное восстановление"</font>';
2022-06-06 21:30:34 +00:00
}
}elseif(isset($_POST['message']))
{
$_POST['message'] = htmlspecialchars($_POST['message'],NULL);
2022-06-06 21:30:34 +00:00
if($_POST['message']!='')
{
$dy = 1;
if((date('n',time())==1 && date('j',time())<=15))
{
$dy = 0;
}
$u->info['ET'] = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.(time()-600).' AND `vars` = "send_elka" LIMIT 1',1);
if(isset($u->info['ET']['id']))
{
2023-01-10 16:29:32 +00:00
echo '<font color=red>Оставлять надписи на стволе ёлки можно не чаще одного раза в 10 минут</font>';
2022-06-06 21:30:34 +00:00
}else{
$pInfo = ''.$u->info['align'].'|'.$u->info['clan'].'|'.$u->info['login'].'|'.$u->info['level'].'|'.$u->info['cityreg'].'|'.$u->info['id'].'';
mysql_query("INSERT INTO `elka` (`year`,`time`,`pers`,`text`,`city`) VALUES (".(date('Y',time())+$dy).",".time().",'".$pInfo."','".mysql_real_escape_string($_POST['message'])."','".$u->info['city']."'); ");
$u->addAction(time(),'send_elka','');
}
}
}
?>
<style type="text/css">
.pH3 { COLOR: #8f0000; FONT-FAMILY: Arial; FONT-SIZE: 12pt; FONT-WEIGHT: bold; }
.class_ {
font-weight: bold;
color: #C5C5C5;
cursor:pointer;
}
.class_st {
font-weight: bold;
color: #659BA3;
cursor:pointer;
}
.class__ {
font-weight: bold;
color: #FFFFFF;
cursor:pointer;
background-color: #659BA3;
}
.class__st {
font-weight: bold;
color: #FFFFFF;
cursor:pointer;
background-color: #659BA3;
font-size: 10px;
}
.class_old {
font-weight: bold;
color: #919191;
cursor:pointer;
}
.class__old {
font-weight: bold;
color: #FFFFFF;
cursor:pointer;
background-color: #838383;
font-size: 10px;
}
</style>
<div align="right"><? if($re!=''){ echo '<font color="red"><b>'.$re.'</b></font>'; } ?></div>
<div id="hint3" style="visibility:hidden"></div>
<TABLE width="100%" cellspacing="0" cellpadding="0">
2023-01-10 16:29:32 +00:00
<tr><td valign="top"><div align="center" class="pH3">Новогодняя елка <?
2022-06-06 21:30:34 +00:00
echo $dt; ?>!</div>
<br />
2023-01-10 16:29:32 +00:00
<!-- Подарки -->
2022-06-06 21:30:34 +00:00
<?
$sg = 1;
2023-01-10 16:29:32 +00:00
//Если есть подарки
2022-06-06 21:30:34 +00:00
if((date('n',time())==12 || date('n',time())<=2) && $sg==1)
{
?>
<div style="padding-left:10px;">
2023-01-10 16:29:32 +00:00
<span class="pH3"><small>Подарки:</small></span>
2022-06-06 21:30:34 +00:00
<div>
<?
$smt = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.(time()-600).' AND `vars` = "use_cupNewYear" LIMIT 1',1);
?>
2023-01-10 16:29:32 +00:00
<a href="?use_cup=<? echo $code; ?>" <? if(isset($smt['id'])){ echo 'onClick="alert(\'Использовать "Чаша жизненных сил" можно не чаще одного раза в 10 минут\');return false;"'; } ?> /><img src="https://img.new-combats.com/cup2012.gif" style="padding:10px;<? if(isset($smt['id'])){ echo 'filter: alpha(opacity=35); -moz-opacity: 0.35; -khtml-opacity: 0.35; opacity: 0.35;'; } ?>" title="Выпить из`Чаши жизненных сил`"></a>
2022-06-06 21:30:34 +00:00
<?
if( date('m') == 12 || (date('m') == 1 && date('d') <= 8)) {
$pd = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.(time()-600).' AND `vars` = "take_gift'.$dt.'" LIMIT 1',1);
?>
2023-01-10 16:29:32 +00:00
<a href="?take_gift=<? echo $code; ?>" <? if(isset($pd['id'])){ echo 'onClick="return false;"'; } ?> /><img src="https://img.new-combats.com/i/items/<? echo 'podarok'.($dt-1); ?>.gif" style="padding:10px;<? if(isset($pd['id'])){ echo 'filter: alpha(opacity=35); -moz-opacity: 0.35; -khtml-opacity: 0.35; opacity: 0.35;'; } ?>" title="Взять `Новогодний подарок 2023`"></a>
2022-06-06 21:30:34 +00:00
<? } ?>
</div>
</div>
<hr>
<?
}
2023-01-10 16:29:32 +00:00
//ТУТ Елка
2022-06-06 21:30:34 +00:00
// if($u->info['admin']>0)
// {
?>
<div style="padding-left:10px;">
2023-01-10 16:29:32 +00:00
<span class="pH3"><small>Наряжаем Ёлку:</small></span>
2022-06-06 21:30:34 +00:00
<div>
<?
$it = mysql_fetch_array(mysql_query(' SELECT * FROM `items_users` WHERE `item_id` > 2723 AND `item_id` < 2741 AND `uid`= "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1 '));
if (isset($it['item_id']))
{
$itt = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$it['item_id'].'" LIMIT 1'));
?>
2023-01-10 16:29:32 +00:00
<a href="?elka_shar=<?echo $it['id'];?>&shar_name=<?echo $itt['name'];?>" <? if(!isset($itt['id'])){ echo 'onClick="return false;"'; } ?> /><img src="https://img.new-combats.com/i/items/<? echo $itt['img']; ?>" style="padding:10px;<? if(!isset($it['id'])){ echo 'filter: alpha(opacity=35); -moz-opacity: 0.35; -khtml-opacity: 0.35; opacity: 0.35;'; } ?>" title="Повесить `Шар`"></a>
2022-06-06 21:30:34 +00:00
<?}
2023-01-10 16:29:32 +00:00
else { echo "У Вас нет шаров для украшения Ёлки!";}
2022-06-06 21:30:34 +00:00
?>
</div>
</div>
<hr>
<?
// }
if(isset($_GET['page']))
{
$fpage = round($_GET['page']);
if($fpage<=0)
{
$fpage = 1;
}
}else{
$fpage = 1;
}
$limit1 = ($fpage-1)*20+$fpage-1;
$limit2 = 21;
$i = mysql_fetch_array(mysql_query('SELECT COUNT(`year`) FROM `elka` WHERE `year` = "'.$dt.'" AND (`delete` = "0" OR '.$u->info['admin'].' > 0) ORDER BY `id` DESC'));
$i = $i[0];
$d = ceil($i/21);
if($i>0)
{
if($d<13)
{
$j=0;
$pagesN = '';
while($i>=0)
{
$i -= 21;
if($i!=0)
{
$j++;
$r2 = '';
if($j<=$d)
{
if(isset($r))
{
$r2 = '&r='.$r;
}
$jt = $j;
if($fpage==$j)
{
$jt = '<span class="number">'.$j.'</span>';
}
2023-01-10 16:29:32 +00:00
$pagesN .= ' <a href="?id='.$post['id'].'&d='.$_GET['d'].'&page='.$j.'" title="Перейти на страницу №'.$j.'">'.$jt.'</a> ';
2022-06-06 21:30:34 +00:00
}
}
}
$pages .= ' '.$pagesN.' ';
}else{
$j = $fpage-6;
$i = 0;
$pagesN = '';
while($k<13)
{
if($j>0)
{
if($j<=$d)
{
$jt = $j;
if($fpage==$j)
{
$jt = '<span class="number">'.$j.'</span>';
}
2023-01-10 16:29:32 +00:00
$pagesN .= ' <a href="?id='.$post['id'].'&d='.$_GET['d'].'&page='.$j.'" title="Перейти на страницу №'.$j.'">'.$jt.'</a> ';
2022-06-06 21:30:34 +00:00
}
$k++;
}
$j++;
}
$prpage = $fpage-12;
$nxpage = $fpage+12;
if($prpage<=0)
{
$prpage = 1;
}
if($nxpage>$d)
{
$nxpage = $d;
}
$_GET['d'] = (int)$_GET['d'];
if($fpage-7>0)
{
2023-01-10 16:29:32 +00:00
$pages .= '<a href="?id='.$post['id'].'&d='.$_GET['d'].'&page=1" title="Первая страница">«</a> <a href="?id='.$post['id'].'&d='.$_GET['d'].'&page='.$prpage.'" title="Показать предыдущие страницы">...</a> ';
2022-06-06 21:30:34 +00:00
}
$pages .= ' '.$pagesN.' ';
if($fpage<$d-5)
{
2023-01-10 16:29:32 +00:00
$pages .= '<a href="?id='.$post['id'].'&d='.$_GET['d'].'&page='.$nxpage.'" title="Показать следующие страницы">...</a> <a href="?id='.$post['id'].'&d='.$_GET['d'].'&page='.$d.'" title="Последняя страница">»</a>';
2022-06-06 21:30:34 +00:00
}
}
}else{
$pages = '';
}
?>
2023-01-10 16:29:32 +00:00
<U>Посетители оставили надписи на стволе елки:</U> <? echo $pages; ?><br>
2022-06-06 21:30:34 +00:00
<div style="padding:5px;">
<?
$sp = mysql_query('SELECT * FROM `elka` WHERE `year`="'.$dt.'" AND `city`="'.$u->info['city'].'" AND (`delete` = "0" OR '.$u->info['admin'].' > 0) ORDER BY `time` DESC LIMIT '.$limit1.','.$limit2.'');
$page = floor((int)$_POST['page']);
if($page<1){ $page = 1; }elseif($page>300){ $page==300; }
while($pl = mysql_fetch_array($sp))
{
$prs = explode('|',$pl['pers']); $pers = '';
if($prs[0]!=0)
{
$pers .= '<img src="https://img.new-combats.com/i/align/align'.$prs[0].'.gif">';
}
if($prs[1]!=0)
{
$clanPrs = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$prs[1].'" LIMIT 1'));
$pers .= '<img src="https://img.new-combats.com/i/clan/'.$clanPrs['name_mini'].'.gif">';
}
2023-01-10 16:29:32 +00:00
$pers .= '<b>'.$prs[2].'</b>['.$prs[3].']<a href="https://new-combats.com/info/'.$prs[5].'" title="Инф. о '.$prs[2].'" target="blank"><img src="https://img.new-combats.com/i/inf_'.$prs[4].'.gif"></a>';
2022-06-06 21:30:34 +00:00
if($pl['delete']!='0')
{
if($pl['delete']=='1')
{
if($u->info['admin']>0)
{
2023-01-10 16:29:32 +00:00
$pl['text'] = '<font color=red><i>Сообщение стерто</i></font> <font color=grey><small>('.$pl['text'].')</small></font>';
2022-06-06 21:30:34 +00:00
}else{
2023-01-10 16:29:32 +00:00
$pl['text'] = '<font color=red><i>Сообщение стерто</i></font>';
2022-06-06 21:30:34 +00:00
}
}else{
$prs = explode('|',$pl['delete']); $pers2 = '';
if($prs[0]!=0)
{
$pers2 .= '<img src="https://img.new-combats.com/i/align/align'.$prs[0].'.gif">';
}
if($prs[1]!=0)
{
$clanPrs = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$prs[1].'" LIMIT 1'));
$pers2 .= '<img src="https://img.new-combats.com/i/clan/'.$clanPrs['img'].'.gif">';
}
2023-01-10 16:29:32 +00:00
$pers2 .= '<a href="javascript:top.toUser(\''.$prs[2].'\',\'private\');"><b>'.$prs[2].'</b></a>['.$prs[3].']<a href="https://new-combats.com/info/'.$prs[2].'" title="Инф. о '.$prs[2].'" target="blank"><img src="https://img.new-combats.com/i/inf_'.$prs[4].'.gif"></a>';
2022-06-06 21:30:34 +00:00
if($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4))
{
2023-01-10 16:29:32 +00:00
$pl['text'] = '<i><font color=red>Сообщение стерто персонажем</font> '.$pers2.'</i> <font color=grey><small>('.$pl['text'].')</small></font>';
2022-06-06 21:30:34 +00:00
}else{
2023-01-10 16:29:32 +00:00
$pl['text'] = '<i><font color=red>Сообщение стерто персонажем</font> '.$pers2.'</i>';
2022-06-06 21:30:34 +00:00
}
}
}
if(($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4)) && $pl['delete']=='0')
{
2023-01-10 16:29:32 +00:00
$dl = ' <a href="main.php?page='.$_POST['page'].'&del='.$pl['id'].'"><small>Стереть</small></a>';
2022-06-06 21:30:34 +00:00
}else{
$dl = '';
}
echo '<font class=date>'.date('d.m.Y H:i',$pl['time']).'</font> '.$pers.' - '.$pl['text'].''.$dl.'<BR>';
}
?>
</div>
2023-01-10 16:29:32 +00:00
Страницы: <? echo $pages; ?><br>
2022-06-06 21:30:34 +00:00
<FORM method="post" action="main.php">
2023-01-10 16:29:32 +00:00
Оставить сообщение: <INPUT type=text name=message maxlength=150 size=50>&nbsp;<INPUT type=submit name=addmessage value='Добавить'>
2022-06-06 21:30:34 +00:00
</FORM>
<td width="280" valign="top"><table cellspacing="0" cellpadding="0">
<tr>
<td width="100%">&nbsp;</td>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top">
<td><!-- -->
<? echo $goLis; ?>
<!-- -->
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE">
<tr>
<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
2023-01-10 16:29:32 +00:00
<td bgcolor="#D3D3D3" nowrap="nowrap"><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.9&amp;rnd=<? echo $code; ?>';" title="<? thisInfRm('1.180.0.9',1); ?>">Центральная Площадь</a></td>
2022-06-06 21:30:34 +00:00
</tr>
</table></td>
</tr> <tr>
<td nowrap="nowrap"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE">
<tr>
<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
2023-01-10 16:29:32 +00:00
<td bgcolor="#D3D3D3" nowrap="nowrap"><div align="left"><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.209&amp;rnd=<? echo $code; ?>';" title="<? thisInfRm('1.180.0.209',1); ?>">Ледяная пещера</a></div></td>
2022-06-06 21:30:34 +00:00
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<br />
<center></center></td>
</table>
<div id="textgo" style="visibility:hidden;"></div>
<?
}
?>