Файл: monst/core/pag/main.php
Строк: 808
<?
include $HOME . '/core/file/db_upd.php';
upd_loc('in city');
if ( $user['dungeon_goldlimit_day'] != date('d') ) {
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'dungeon_goldlimit_day' => date('d'),
'dungeon_goldlimit_count' => 0,
]
]
);
}
if ( $user['daily_day'] != date('d') ) {
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'daily' => 1,
'daily_day' => date('d')
]
]
);
}
// q
if ( $user['part'] == 2 ) {
if ( $quest_db[1]['count'] != 1 ) {
if ( date('d', $user['r_time']) != date('d') ) {
$quest_db[1]['count'] = 1;
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'quest' => $quest_db,
]
]
);
}
}
}
if ( isset($_GET['clan_leaved']) ) {
?>
<div class='error_box'>
<?=$lang['main.php']['clan_leaved']?>
</div>
<?
}
include $HOME . '/core/content/part.php';
$part = $PART[$user['part']];
include $HOME . '/core/content/monster.php';
$monster_id = $user['last_monster_id'] + 1;
@$monster = $MONSTER[$user['part']][$monster_id];
//echo '<pre>';
//print_r($user);
//echo '</pre>';
// bonus gold
if ( !$user['bonus_gold_date'] OR $user['bonus_gold_date'] != date('d') ) {
$day = $user['bonus_gold_day'];
if ( $day == 1 ) $gold = 20;
if ( $day == 2 ) $gold = 30;
if ( $day == 3 ) $gold = 40;
if ( $day == 4 ) $gold = 50;
if ( $day == 5 ) $gold = 100;
if ( $day >= 5 ) {
$day = 1;
}
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'gold' => $user['gold'] + $gold,
'bonus_gold_date' => date('d'),
'bonus_gold_day' => $day,
]
]
);
?>
<div style='backg2round: #111; padding: 20px; text-align: center;'>
<?=$lang['main.php']['bonus_gold__you_get']?> <img src='<?=$gold_icon?>' alt='' width='40'/><span class='gold_color'><?=$gold?></span><br/>
<br/>
<?
for ( $i = 1; $i <= 5; $i ++ ) {
if ( $day >= $i ) {
?>
<span style='color: yellowgreen; font-size: 30px;'>•</span>
<?
} else {
?>
<span style='color: #999; font-size: 30px;'>•</span>
<?
}
}
?>
<br/>
<span style='color: yellowgreen;'><?=$lang['main.php']['bonus_gold__next_day']?></span>
</div>
<?
}
//if ( isset($_GET['close_goldnot']) ) {
// Cook_set('gold_not__time', time());
//
//// $_SESSION['goldnot_hidden'] = 1;
// g('/main');
//}
//$_SESSION['goldnot_hidden'] = 0;
//if ( time() - @(int)$_COOKIE['gold_not__time'] >= 60 * 60 * 24 AND time() - $user['r_time'] > 60 * 10 ) {
// $time = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
// $time = ($time + 1) - time();
//
// ?>
<!-- <a href='/gold'>-->
<!-- <div style='text-align: center; background: #000; padding: 10px;'>-->
<!-- <img src='/core/i/menu/gold.png' alt='' width='50'/><br/>-->
<!-- <span class='gold_color'>-->
<!-- <img src='--><?//=$gold_icon?><!--' alt='' width='20'/>--><?//=$lang['main.php']['bonus_gold']?>
<!-- </span>-->
<!---->
<!-- <br/>-->
<!---->
<!-- <span style='color: #ccc;'>-->
<!-- --><?//=$lang['main.php']['bonus_gold_timer']?><!-- --><?//=hm($time, 1, 1, 1, 1)?>
<!-- </span>-->
<!-- </div>-->
<!-- </a>-->
<!-- <div style='text-align: right; background: #000;'>-->
<!-- <a href='/main?close_goldnot'><span style='color: #999;'>закрыть</span></a>-->
<!-- </div>-->
<!---->
<!-- --><?//
//}
//
?>
<a href='/campaign'>
<div class='op_top_im'>
<img src='/core/i/part/<?=$user['part']?>.jpg?1f' alt='' class='title_img' style=''/>
</div>
<div style='position: relative; top: -100px; color: <?=$part['color']?>; height: 0;'>
<span style='background: #000; font-size: 11px;'><?=$lang['main.php']['part']?> <?=$user['part']?></span><br/>
<span style='background: #000; font-size: 20px;'><?=$part['name']?></span><br/>
</div>
<?
if ( $monster ) {
?>
<div style='position: relative; top: -110px; bottom: 0; right: 20px; text-align: right; height: 0;'>
<img src='/core/i/monster/<?=$user['part']?>/<?=$monster_id?>.jpg?7' alt='' width='100' style='opa2city: 0.7; border: 1px solid #000;bo2rder-radius: 5%; box-2shadow: 0 0 20px #000;'/><br/>
</div>
<?
}
?>
</a>
<!--<div class='ok_box' style='text-align: center;'>-->
<!-- Тест-->
<!--</div>-->
<?
if ( isset($_GET['account_saved'] ) ) {
?>
<div class='ok_box'>
<?=$lang['main.php']['account_saved']?><br/>
</div>
<?
}
if ( !$user['account_saved'] ) {
?>
<div style='backgro32und: #111; padding: 20px;'>
<?=$lang['main.php']['save_text']?><br/>
<a href='/save'><?=$lang['main.php']['save']?></a><br/>
</div>
<?
}
if ( $quest ) {
$all_quest = count($quest);
$ended = 0;
foreach ( $quest as $quest_id => $quest_dat ) {
if ( $quest_dat['end'] ) {
$ended++;
}
}
$progress = floor($ended / $all_quest * 100);
} else {
$progress = 0;
}
?>
<div style='text-alig2n: center;'>
<a href='/quest'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/quest.jpg' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['quest']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['quest']['desc']?> <?=$progress?>%</span>
</div>
</div>
</div>
</a>
<a href='/coliseum'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/coliseum.jpg?2' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['coliseum']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['coliseum']['desc']?></span>
</div>
</div>
</div>
</a>
<a href='/param'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/training.jpg?5' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['training']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['training']['desc']?></span>
</div>
</div>
</div>
</a>
<?
if ( $user['part'] >= 2 ) {
?>
<a href='/treasury'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/treasury.jpg' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['treasury']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['treasury']['desc']?></span>
</div>
</div>
</div>
</a>
<?
}
?>
<a href='/forge'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/forge.jpg' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['forge']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['forge']['desc']?></span>
</div>
</div>
</div>
</a>
<?
if ( $user['part'] >= 2 ) {
?>
<a href='/dungeon'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/dungeon.jpg' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['dungeon']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['dungeon']['desc']?></span>
</div>
</div>
</div>
</a>
<?
}
?>
<a href='/rating'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/rating.jpg' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['rating']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['rating']['desc']?></span>
</div>
</div>
</div>
</a>
<a href='/shop'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/shop.jpg' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['shop']['title']?><br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['shop']['desc']?></span>
</div>
</div>
</div>
</a>
<?
$key = md5('monst__woodh');
$woodh_count = $mem -> get($key);
if ( !$woodh_count ) {
$find = $_woodh -> find(
[
'user_id' => [
'$gt' => 0
]
]
);
$woodh_count = $find -> count();
$mem -> set($key, $woodh_count, 0, 60 * 2);
}
?>
<a href='/woodh'>
<div class='menuicon_main<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='opacity_menuicon_im'>
<img src='/core/i/pic/woodh.jpg?1' alt='' class='menuicon_img'/>
</div>
<div class='menuicon_text_pos<? if ( $user['small_icons'] ) print '_min'; ?>'>
<div class='menuicon_text<? if ( $user['small_icons'] ) print '_min'; ?>'>
<span class='menuicon_text_title<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['woodh']['title']?> ( <?=$woodh_count?> )<br/></span>
<span class='menuicon_text_about<? if ( $user['small_icons'] ) print '_min'; ?>'><?=$lang['main.php']['menuicon']['woodh']['desc']?></span>
</div>
</div>
</div>
</a>
<?
include $HOME . '/core/file/ca.php';
// ca
$ca = $_ca -> findOne(
[
'id' => 1
]
);
if ( $ca) {
?>
<br/><br/>
<?
if ( $ca['count'] > 0 ) {
?>
<a href='/ca'>
<div class=''>
<img src='/core/i/pic/city.jpg' alt='' width='100%' style=";"/>
</div>
<div style='height: 0;'>
<div style=' width: 200px;position: relative; left:150px; top: -120px; z-index: 2; '>
<img src='<?=$ca['m']['icon']?>' alt='' width='100' style='op2acity: 0.7; border-rad2ius: 5%; border: 1px solid #000;'/>
<div style='position: relative; top: -20px; left: 5px;'>
<span style='color: #ccc;'><?=$ca['count']?></span>
</div>
</div>
</div>
<div style='height: 0;'>
<div style='color: #999; font-size: 10px;position: relative; text-align: left; top: -70px; background: #000; opacity: 0.6; padding: 10px;'>
<?=$lang['main.php']['ca']['city_attack']?>
</div>
</div>
</a>
<?
} else {
$ca_timer = (int)file_get_contents($HOME . '/core/data/ca_timer.dat');
$timer = $ca_timer - time();
?>
<a href='/ca'>
<div class=''>
<img src='/core/i/pic/city.jpg' alt='' width='100%' style=''/>
</div>
<div style='height: 0;'>
<div style='color: #999; font-size: 10px;position: relative; top: -70px; background: #000; opacity: 0.6; padding: 10px;'>
<?=$lang['main.php']['ca']['attack_end']?> <?=hm($timer, 0, 1, 1, 0)?>
</div>
</div>
</a>
<?
}
}
if ( isset($_GET['small_icons']) ) {
$small_icons = (int)$_GET['small_icons'];
if ( $small_icons != 0 AND $small_icons != 1 ) {
$small_icons = 0;
}
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'small_icons' => $small_icons
]
]
);
g('/main');
}
?>
<br/>
<?=$lang['main.php']['menu_icons']?>:
<?
if ( !$user['small_icons'] ) {
?>
<a href='/main?small_icons=1'><?=$lang['main.php']['menu_icons_small']?></a> / <u><?=$lang['main.php']['menu_icons_big']?></u>
<?
} else {
?>
<u><?=$lang['main.php']['menu_icons_small']?></u> / <a href='/main?small_icons=0'><?=$lang['main.php']['menu_icons_big']?></a>
<?
}
?>
<br/><br/>
</div>
<?
$key = md5('monst__online');
$online = $mem -> get($key);
if ( !$online ) {
$find = $_users -> find(
[
'l_time' => [
'$gte' => time() - 60 * 60
],
]
);
$online = $find -> count();
$mem -> set($key, $online, 0, 15);
}
//
$key = md5('monst__chatonline');
$chat_online = $mem -> get($key);
if ( !$chat_online ) {
$find = $_users -> find(
[
'l_time' => [
'$gte' => time() - 60 * 60
],
'loc' => 'chat'
]
);
$chat_online = $find -> count();
$mem -> set($key, $chat_online, 0, 15);
}
?>
<br/>
<div style='text-align: center;'>
<a href='/online'>
<div style='display: inline-block;'>
<img src='/core/i/menu/online.png' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['main.php']['micon']['online']?> (<?=$online?>)</span>
</div>
</a>
<a href='/chat'>
<div style='display: inline-block;'>
<img src='/core/i/menu/chat.png' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['main.php']['micon']['chat']?> (<?=$chat_online?>)</span>
</div>
</a>
<a href='/forum'>
<div style='display: inline-block;'>
<img src='/core/i/menu/forum.png?14' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['main.php']['micon']['forum']?></span>
</div>
</a>
<a href='/forum/thread/1'>
<div style='display: inline-block;'>
<img src='/core/i/menu/news.png' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['main.php']['micon']['news']?></span>
</div>
</a>
<a href='/gold'>
<div style='display: inline-block;'>
<img src='/core/i/menu/gold.png?1' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['main.php']['micon']['gold']?></span>
</div>
</a>
<a href='/dialog'>
<div style='display: inline-block;'>
<img src='/core/i/menu/dialog.png?1' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['main.php']['micon']['dialog']?></span>
</div>
</a>
<!-- <a href='/dialog'>-->
<!-- <div style='display: inline-block;'>-->
<!-- <img src='/core/i/menu/dialog.png' alt='' width='50'/><br/>-->
<!-- <span class='micon_text'>--><?//=$lang['main.php']['micon']['dialog']?><!--</span>-->
<!-- </div>-->
<!-- </a>-->
<?
if ( $user['id'] == 1 ) {
?>
<a href='/cp'>
<div style='display: inline-block;'>
<img src='/core/i/menu/cp.png' alt='' width='50'/><br/>
<span class='micon_text'>Control panel</span>
</div>
</a>
<?
}
?>
</div>
<br/>
<!--<br/>-->
<!--<a href='/gold'>-->
<!-- <div style='background: #111;'>-->
<!-- <img src='/core/i/menu/gold.png' alt='' width='100' style='float: left;'/>-->
<!-- --><?//=$lang['game']['gold_x2']?>
<!-- </div>-->
<!---->
<!--</a>-->
<!--<br/><br/>-->
<?
$key = md5('last_news');
if ( !$news = $mem -> get($key) ) {
$find = $_forum_topic -> find(
[
'forum_id' => 1
]
);
$find -> sort(
[
'time' => -1
]
);
$find -> limit(2);
$news = [];
foreach ( $find as $f ) {
$find2 = $_forum_post -> find(
[
'topic_id' => $f['id']
]
);
$find2 -> sort(
[
'time' => 1
]
);
$find2 -> limit(1);
foreach ( $find2 as $f2 ) {
$text = $f2['text'];
}
$f['text'] = $text;
$news[] = $f;
}
$mem -> set($key, $news, 0, 60 * 10);
}
if ( count($news) > 0 ) {
?>
<a href='/forum/thread/1'>
<div class='opacity_backgroundcircle_im'>
<img src='/core/i/pic/forum/1.jpg' alt='' width='100%' style='opacity: 0.8;'/>
</div>
<div style='text-align: center; position: relative; top: -100px; opaci2ty: 0.8 ; height: 0;'>
<?
foreach ( $news as $n ) {
$name = $n['name'];
$text = $n['text'];
$text = strip_tags($text);
if ( mb_strlen($text, 'UTF-8') > 50 ) {
$text = mb_substr($text, 0, 50) . ' ....';
}
$color = '#999';
if ( date('d', $n['time']) == date('d') ) $color = 'yellowgreen';
if ( date('d', $n['time']) == date('d', time() - 60 * 60 * 24) ) $color = 'orange';
?>
<!-- <a href='/forum/topic/--><?//=$n['forum_id']?><!--/--><?//=$n['id']?><!--'>-->
<div style='background: #000; padding: 5px; margin-bottom: 2px; opacity: 0.8;'>
<!-- <img src='/core/i/menu/news.png' alt='' width='40' class='gray' style='float: left;'/>-->
<div style='float: left; color: <?=$color?>; font-size: 10px;'>
<?=date('d', $n['time'])?><br/>
<?=month(time())?>.
</div>
<span style='col2or: #897f79; font-size: 11px;'><?=$name?></span>
<br/>
<!-- <span style='color: #777;'>--><?//=replace_time($n['time'])?><!--</span><br/>-->
<span style='color: #999; font-size: 11px;'><?=$text?></span>
</div>
<!-- </a>-->
<?
}
?>
</div>
</a>
<?
}
// alpennn1@gmail.com
// alpen1@list.ru
// alpenn1@yandex.ru
// anna@alpenn1.com
// anna@alpen1.net
?>
<br/>
<div style='float: left; opacit2y: 0.6;'>
<?
if ( empty($user['ok_id']) ) {
?>
alpennn1@gmail.com
<?
}
?>
</div>
<div style='float: right; text-align: center; margin-right: 10px;'>
<span style='color: #ccc; font-size: 11px;'><?=$lang['main.php']['subscribe']?></span><br/>
<br/>
<?
if ( @!$user['ok_id'] ) {
?>
<a href='https://vk.com/monst1' target="_blank"><img src='/core/i/soc/vk.png?1' alt='' width='50'/></a>
<?
}
?>
<a href='https://ok.ru/group/53502950244485' target="_blank"><img src='/core/i/soc/ok.png?1' alt='' width='50'/></a>
</div>
<div style='clear: both;'></div>