game/modules_data/location/elka.php
2022-06-07 00:30:34 +03:00

416 lines
15 KiB
PHP

<?php
if(!defined('GAME'))
{
die();
}
//id Íîâîãîäíåãî ïîäàðêà
$pidid = 4008;
$dy = 1;
if((date('n',time())==2 && date('j',time())<=14))
{
$dy = 0;
}
$dt = date('Y',time())+$dy;
$dt = 2022;
if($u->room['file']=='elka')
{
if(isset($_GET['elka_shar'])&& isset($_GET['shar_name'])) //Óêðàøåíèå ¨ëêè
{
$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))
{
//eff Áëàãîñëîâåíèå ¨ëêè X
$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;
$newname='Áëàãîñëîâåíèå ¨ëêè x'.($tdata/5);
$effeadd=mysql_query('UPDATE `eff_users` SET `name` = "'.$newname.'",`data`="'.$newdata.'", `timeUse` = "'.time().'"WHERE `id` ="'.$effe['id'].'" ');
if (isset($effeadd))
{
echo "Âû ïîëó÷èëè <b><font color=red>Áëàãîñëîâåíèå ¨ëêè x".round($tdata/5)."</font></b> " ;
}
}
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
(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")');
if (isset($effeadd))
{
echo "Âû ïîëó÷èëè <b><font color=red>Áëàãîñëîâåíèå ¨ëêè x1</font></b> " ;
}
}
echo "Èñïîëüçîâàë: <b><font color=red>".$_GET['shar_name']."</font><b>" ;
}
else
{
echo "<b><font color=red>Îøèáêà</font></b>" ;
}
}
}
if(isset($_GET['take_gift']) && (date('m') == 12 || (date('m') == 1 && date('d') <= 8)))
{
//ïîëó÷àåì ñâîé íîâîãîäíèé ïîäàðîê çà òåêóùèé ãîä addItem($id,$uid)
$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)
{
mysql_query('UPDATE `items_users` SET `gift` = "Àäìèíèñòðàöèÿ",`gtxt1` = "Ïîçäðàâëÿåì Âàñ ñ Íîâûì Ãîäîì!" WHERE `id` = "'.$pid.'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
$u->addAction(time(),'take_gift_'.$dt.'',$u->info['city']);
echo '<font color=red>Ïðåäìåò íàõîäèòñÿ ó Âàñ â èíâåíòàðå, â ðàçäåëå "ïðî÷åå"</font>';
}else{
echo '<font color=red>Íå óäàëîñü ïîëó÷èòü ïîäàðîê...</font>';
}
}else{
echo '<font color=red>Âû óæå ïîëó÷èëè ñâîé ïîäàðîê ;)</font>';
}
}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');
echo '<font color=red>Óñïåøíî èñïîëüçîâàí ýëèêñèð "Ïîëíîå âîññòàíîâëåíèå"</font>';
}
}elseif(isset($_POST['message']))
{
$_POST['message'] = htmlspecialchars($_POST['message'],NULL,'cp1251');
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']))
{
echo '<font color=red>Îñòàâëÿòü íàäïèñè íà ñòâîëå ¸ëêè ìîæíî íå ÷àùå îäíîãî ðàçà â 10 ìèíóò</font>';
}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">
<tr><td valign="top"><div align="center" class="pH3">Íîâîãîäíÿÿ åëêà <?
echo $dt; ?>!</div>
<br />
<!-- Ïîäàðêè -->
<?
$sg = 1;
//Åñëè åñòü ïîäàðêè
if((date('n',time())==12 || date('n',time())<=2) && $sg==1)
{
?>
<div style="padding-left:10px;">
<span class="pH3"><small>Ïîäàðêè:</small></span>
<div>
<?
$smt = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.(time()-600).' AND `vars` = "use_cupNewYear" LIMIT 1',1);
?>
<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>
<?
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);
?>
<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="Âçÿòü `Íîâîãîäíèé ïîäàðîê 2022`"></a>
<? } ?>
</div>
</div>
<hr>
<?
}
//ÒÓÒ Åëêà
// if($u->info['admin']>0)
// {
?>
<div style="padding-left:10px;">
<span class="pH3"><small>Íàðÿæàåì ¨ëêó:</small></span>
<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'));
?>
<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>
<?}
else { echo "Ó Âàñ íåò øàðîâ äëÿ óêðàøåíèÿ ¨ëêè!";}
?>
</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>';
}
$pagesN .= ' <a href="?id='.$post['id'].'&d='.$_GET['d'].'&page='.$j.'" title="Ïåðåéòè íà ñòðàíèöó ¹'.$j.'">'.$jt.'</a> ';
}
}
}
$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>';
}
$pagesN .= ' <a href="?id='.$post['id'].'&d='.$_GET['d'].'&page='.$j.'" title="Ïåðåéòè íà ñòðàíèöó ¹'.$j.'">'.$jt.'</a> ';
}
$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)
{
$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> ';
}
$pages .= ' '.$pagesN.' ';
if($fpage<$d-5)
{
$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>';
}
}
}else{
$pages = '';
}
?>
<U>Ïîñåòèòåëè îñòàâèëè íàäïèñè íà ñòâîëå åëêè:</U> <? echo $pages; ?><br>
<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">';
}
$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>';
if($pl['delete']!='0')
{
if($pl['delete']=='1')
{
if($u->info['admin']>0)
{
$pl['text'] = '<font color=red><i>Ñîîáùåíèå ñòåðòî</i></font> <font color=grey><small>('.$pl['text'].')</small></font>';
}else{
$pl['text'] = '<font color=red><i>Ñîîáùåíèå ñòåðòî</i></font>';
}
}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">';
}
$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>';
if($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4))
{
$pl['text'] = '<i><font color=red>Ñîîáùåíèå ñòåðòî ïåðñîíàæåì</font> '.$pers2.'</i> <font color=grey><small>('.$pl['text'].')</small></font>';
}else{
$pl['text'] = '<i><font color=red>Ñîîáùåíèå ñòåðòî ïåðñîíàæåì</font> '.$pers2.'</i>';
}
}
}
if(($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4)) && $pl['delete']=='0')
{
$dl = ' <a href="main.php?page='.$_POST['page'].'&del='.$pl['id'].'"><small>Ñòåðåòü</small></a>';
}else{
$dl = '';
}
echo '<font class=date>'.date('d.m.Y H:i',$pl['time']).'</font> '.$pers.' - '.$pl['text'].''.$dl.'<BR>';
}
?>
</div>
Ñòðàíèöû: <? echo $pages; ?><br>
<FORM method="post" action="main.php">
Îñòàâèòü ñîîáùåíèå: <INPUT type=text name=message maxlength=150 size=50>&nbsp;<INPUT type=submit name=addmessage value='Äîáàâèòü'>
</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>
<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>
</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>
<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>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<br />
<center></center></td>
</table>
<div id="textgo" style="visibility:hidden;"></div>
<?
}
?>