HEX
Server: Apache/2.4.65 (Debian)
System: Linux srv39710 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
User: root (0)
PHP: 8.4.11
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: /var/www/www-root/data/www/NEWs/news.mowik.click/templates/2/view.php
<?php if (isset($_GET['type'])) { ?>
<div class="page_step step_1">
    <section class="clearfix">
        <div class="column wide lt-first-mt">
            <a href="/view/<?php echo $nowchpuz.'.'.$real_id.$nextlink; ?>" class="big-preview js-news-block go_base sec_top_wrap <?php echo $retab; ?>" <?php if ($data['news_newtab'] == 2) { if ($data_new['newtab'] == 1) { echo ' target="_blank"'; } } else { if ($data['news_newtab'] == 1) { echo ' target="_blank"'; } } ?>>
                <div class="image">
                    <img class="lk-short-image" src="/img/upl/<?php echo $data_new['img']; ?>" alt="">
                </div>
                <div class="title">
                    <?php echo htmlspecialchars(macros_city($data_new['ti'])); ?>
                    <div class="read-more"><?php echo $nextlink_w; ?></div>
                </div>
            </a>
        </div>
        <div class="column wide lt-removeAfter">
            <section class="first clearfix ">
<?php
if (!isset($_COOKIE['last_o'])) {
$qr = mysqli_query($connect_db, "SELECT id,ti,img,(clk/views) AS ctr,newtabtype,relasttab FROM `t_offers` WHERE `hide` = '0' AND (cou = '' OR cou LIKE '%".$crabs_country."%') ORDER BY ctr DESC LIMIT 2");
setcookie ('last_o', '1', $dt+315360000, '/', SITE);
} else {
$qr = mysqli_query($connect_db, "SELECT id,ti,img,newtabtype,relasttab FROM `t_offers` WHERE `hide` = '0' AND (cou = '' OR cou LIKE '%".$crabs_country."%') ORDER BY RAND() LIMIT 2");
}
while($row = mysqli_fetch_assoc($qr)) {
$isdayo1 = mysqli_num_rows(mysqli_query($connect_db, "SELECT id FROM `t_offers_stat` WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1"));
if ($crabs_sub > 0) {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views,s".$crabs_sub."_views) VALUES ('$row[id]','$nowday','1','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1, `s".$crabs_sub."_views` = `s".$crabs_sub."_views`+1 WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1");
}
} else {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views) VALUES ('$row[id]','$nowday','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1 WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1");
}
}
$toviews .= $row['id'].', ';
if ($data['offers_newtab'] == 2) {
if ($row['newtabtype'] == 0) { $retab_o = ''; } else {
if ($row['relasttab'] == 0) { $retab_o = ''; }
if ($row['relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($row['relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
} else {
if ($data['offers_newtab'] == 0) { $retab_o = ''; } else {
if ($data['offers_relasttab'] == 0) { $retab_o = ''; }
if ($data['offers_relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($data['offers_relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
}
?>
<div class="column wide">
<a href="/oclick/<?php echo wu_encode($row['id']); ?>?n=<?php echo wu_encode($id); ?>" class="wide-preview js-ad-block click_link unread sec_wrap go_base <?php echo $retab_o; ?>" data-prnt="24174" data-posi="1" data-id="12704" <?php if ($data['offers_newtab'] == 2) { if ($row['newtabtype'] == 1) { echo ' target="_blank"'; } } else { if ($data['offers_newtab'] == 1) { echo ' target="_blank"'; } } ?> rel=”nofollow”>
<div class="image"><img src="/img/upl/<?php echo $row['img']; ?>"></div>
<div class="text">
<div class="category-label">Горячая новость!</div>
<div class="title"><?php echo htmlspecialchars(macros_city($row['ti'])); ?></div>
</div>
</a>
</div>
<?php
}
$toviews = substr($toviews,0,-2);
if ($crabs_sub > 0) {
mysqli_query($connect_db, "UPDATE `t_offers` SET `views` = `views`+1, s".$crabs_sub."_views = `s".$crabs_sub."_views`+1 WHERE id in ($toviews)");
} else {
mysqli_query($connect_db, "UPDATE `t_offers` SET `views` = `views`+1 WHERE id in ($toviews)");
}
?>
            </section>
        </div>
</section>
	


<?php } else { ?>







<div class="row bottom_line page_step step_1" id="fullPage">
    <section class="clearfix full-news-section">
        <article class="clearfix">
            <div class="column wide">
                <div class="image main-news">
                    <img class="lk-short-image" src="/img/upl/<?php echo $data_new['img']; ?>">
                    <div class="title"><?php echo htmlspecialchars(macros_city($data_new['ti'])); ?></div>
                </div>
                <div class="article-content">
                    <div class="status-line">
                        <span class="date"><?php echo date('d.m.Y',$dt); ?></span>|&nbsp;
                        <div class="views"><?php echo rand(70000,200000); ?></div>
                    </div>
                    <a id="fullNewsStart"></a>
                    <div class="text" id="js-full-article-text-block">

<?php
if ($data['news_dopoffers'] == 1 || $data['news_dopoffers'] == 3) {
$oneoffer = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT id,ti,img,newtabtype,relasttab FROM t_offers WHERE hide = '0' AND (cou = '' OR cou LIKE '%".$crabs_country."%') ORDER BY RAND() LIMIT 1"));
if ($data['offers_newtab'] == 2) {
if ($oneoffer['newtabtype'] == 0) { $retab_o = ''; } else {
if ($oneoffer['relasttab'] == 0) { $retab_o = ''; }
if ($oneoffer['relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($oneoffer['relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
} else {
if ($data['offers_newtab'] == 0) { $retab_o = ''; } else {
if ($data['offers_relasttab'] == 0) { $retab_o = ''; }
if ($data['offers_relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($data['offers_relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
}
$isdayo1 = mysqli_num_rows(mysqli_query($connect_db, "SELECT id FROM `t_offers_stat` WHERE o = '$oneoffer[id]' AND ymd = '$nowday' LIMIT 1"));
if ($crabs_sub > 0) {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views,s".$crabs_sub."_views) VALUES ('$oneoffer[id]','$nowday','1','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1, `s".$crabs_sub."_views` = `s".$crabs_sub."_views`+1 WHERE o = '$oneoffer[id]' AND ymd = '$nowday' LIMIT 1");
}
} else {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views) VALUES ('$oneoffer[id]','$nowday','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1 WHERE o = '$oneoffer[id]' AND ymd = '$nowday' LIMIT 1");
}
}
?>
                        <div id="jsAdBlockInText1" class="container-custom-bl0ck-0b1">
                            <a target="_blank" href="/oclick/<?php echo wu_encode($oneoffer['id']); ?>?n=<?php echo wu_encode($id); ?>" class="custom-bl0ck-0b1 js-ad-top-position js-ad-block utm_links_t click_link unread <?php echo $retab_o; ?>" <?php if ($data['offers_newtab'] == 2) { if ($oneoffer['newtabtype'] == 1) { echo ' target="_blank"'; } } else { if ($data['offers_newtab'] == 1) { echo ' target="_blank"'; } } ?> rel=”nofollow”>
                                <div class="img-bl0ck-0b1"><img src="/img/upl/<?php echo $oneoffer['img']; ?>" alt=""></div>
                                <div class="text-bl0ck-0b1">
                                    <div class="title-bl0ck-0b1"><?php echo htmlspecialchars(macros_city($oneoffer['ti'])); ?></div>
                                </div>
                            </a>
                        </div>
<?php } ?>
<p><?php echo macros_city($data_new['txt']); ?></p>
<?php
if ($data['news_dopoffers'] == 2 || $data['news_dopoffers'] == 3) {
$oneoffer = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT id,ti,img,newtabtype,relasttab FROM t_offers WHERE hide = '0' AND (cou = '' OR cou LIKE '%".$crabs_country."%') ORDER BY RAND() LIMIT 1"));
if ($data['offers_newtab'] == 2) {
if ($oneoffer['newtabtype'] == 0) { $retab_o = ''; } else {
if ($oneoffer['relasttab'] == 0) { $retab_o = ''; }
if ($oneoffer['relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($oneoffer['relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
} else {
if ($data['offers_newtab'] == 0) { $retab_o = ''; } else {
if ($data['offers_relasttab'] == 0) { $retab_o = ''; }
if ($data['offers_relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($data['offers_relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
}
$isdayo1 = mysqli_num_rows(mysqli_query($connect_db, "SELECT id FROM `t_offers_stat` WHERE o = '$oneoffer[id]' AND ymd = '$nowday' LIMIT 1"));
if ($crabs_sub > 0) {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views,s".$crabs_sub."_views) VALUES ('$oneoffer[id]','$nowday','1','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1, `s".$crabs_sub."_views` = `s".$crabs_sub."_views`+1 WHERE o = '$oneoffer[id]' AND ymd = '$nowday' LIMIT 1");
}
} else {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views) VALUES ('$oneoffer[id]','$nowday','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1 WHERE o = '$oneoffer[id]' AND ymd = '$nowday' LIMIT 1");
}
}
?>
                        <div id="jsAdBlockInText1" class="container-custom-bl0ck-0b1">
                            <a target="_blank" href="/oclick/<?php echo wu_encode($oneoffer['id']); ?>?n=<?php echo wu_encode($id); ?>" class="custom-bl0ck-0b1 js-ad-top-position js-ad-block utm_links_t click_link unread <?php echo $retab_o; ?>" <?php if ($data['offers_newtab'] == 2) { if ($oneoffer['newtabtype'] == 1) { echo ' target="_blank"'; } } else { if ($data['offers_newtab'] == 1) { echo ' target="_blank"'; } } ?> rel=”nofollow”>
                                <div class="img-bl0ck-0b1"><img src="/img/upl/<?php echo $oneoffer['img']; ?>" alt=""></div>
                                <div class="text-bl0ck-0b1">
                                    <div class="title-bl0ck-0b1"><?php echo htmlspecialchars(macros_city($oneoffer['ti'])); ?></div>
                                </div>
                            </a>
                        </div>
<?php } ?>


                    </div>
                    <div class='onesignal-customlink-container'></div>
                    <div class="social-buttons">
                        <div class="share-group">
                            <a class="resp-sharing-button__link" href="https://vk.com/share.php?title=" target="_blank" rel="noopener" aria-label="" data-share="vk">
                                <div class="resp-sharing-button resp-sharing-button--vk resp-sharing-button--small">
                                    <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
                                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                                            <path d="M21.547 7h-3.29a.743.743 0 0 0-.655.392s-1.312 2.416-1.734 3.23C14.734 12.813 14 12.126 14 11.11V7.603A1.104 1.104 0 0 0 12.896 6.5h-2.474a1.982 1.982 0 0 0-1.75.813s1.255-.204 1.255 1.49c0 .42.022 1.626.04 2.64a.73.73 0 0 1-1.272.503 21.54 21.54 0 0 1-2.498-4.543.693.693 0 0 0-.63-.403h-2.99a.508.508 0 0 0-.48.685C3.005 10.175 6.918 18 11.38 18h1.878a.742.742 0 0 0 .742-.742v-1.135a.73.73 0 0 1 1.23-.53l2.247 2.112a1.09 1.09 0 0 0 .746.295h2.953c1.424 0 1.424-.988.647-1.753-.546-.538-2.518-2.617-2.518-2.617a1.02 1.02 0 0 1-.078-1.323c.637-.84 1.68-2.212 2.122-2.8.603-.804 1.697-2.507.197-2.507z" />
                                        </svg>
                                    </div>
                                </div>
                            </a>
                            <a class="resp-sharing-button__link" href="https://connect.ok.ru/offer?imageUrl=https://<?php echo SITE; ?>/img/upl/<?php echo $data_new['img']; ?>" target="_blank" rel="noopener" aria-label="" data-share="ok">
                                <div class="resp-sharing-button resp-sharing-button--ok resp-sharing-button--small">
                                    <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
                                        <svg height="512px" version="1.1" viewBox="0 0 297 512" width="297px" xmlns="http://www.w3.org/2000/svg">
                                            <g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1">
                                                <path d="M148.400335,77.4415778 C178.574791,77.4415778 203.112044,101.982784 203.112044,132.156449 C203.112044,162.29928 178.574791,186.842858 148.400335,186.842858 C118.257504,186.842858 93.6894167,162.29928 93.6894167,132.156449 C93.6894167,101.982784 118.257504,77.4415778 148.400335,77.4415778 L148.400335,77.4415778 L148.400335,77.4415778 Z M148.400335,264.253601 C221.287084,264.253601 280.537809,205.002085 280.537809,132.156449 C280.537809,59.2760254 221.287084,0 148.400335,0 C75.5301893,0 16.2636515,59.2760254 16.2636515,132.156449 C16.2636515,205.002085 75.5301893,264.253601 148.400335,264.253601 L148.400335,264.253601 Z M201.861265,372.048318 C228.760925,365.91776 254.703921,355.278231 278.592065,340.264926 C296.675391,328.868762 302.126006,304.967968 290.729842,286.885432 C279.348699,268.762573 255.460555,263.311168 237.346394,274.707333 C183.222124,308.747978 113.532689,308.732956 59.4392543,274.707333 C41.3258836,263.311168 17.4369488,268.762573 6.07161913,286.885432 C-5.32454523,304.979827 0.111047246,328.868762 18.1935833,340.264926 C42.0825181,355.259255 68.0247232,365.91776 94.9251739,372.048318 L21.0501354,445.919403 C5.94828059,461.037071 5.94828059,485.543489 21.065948,500.661156 C28.6322928,508.212479 38.5310008,511.995652 48.4289182,511.995652 C58.3426483,511.995652 68.2563783,508.212479 75.8235137,500.661156 L148.385313,428.068522 L221.008782,500.661156 C236.111427,515.779615 260.617845,515.779615 275.735513,500.661156 C290.868993,485.543489 290.868993,461.025211 275.735513,445.919403 L201.861265,372.048318 L201.861265,372.048318 Z" fill="#fff" />
                                            </g>
                                        </svg>
                                    </div>
                                </div>
                            </a>
                            <a class="resp-sharing-button__link" href="https://facebook.com/sharer/sharer.php?&picture=https://<?php echo SITE; ?>/img/upl/<?php echo $data_new['img']; ?>" target="_blank" rel="noopener" aria-label="" data-share="facebook">
                                <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small">
                                    <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
                                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                                            <path d="M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z" />
                                        </svg>
                                    </div>
                                </div>
                            </a>
                            <a class="resp-sharing-button__link" href="https://api.whatsapp.com/send?text=" target="_blank" rel="noopener" aria-label="" data-share="whatsapp">
                                <div class="resp-sharing-button resp-sharing-button--whatsapp resp-sharing-button--small">
                                    <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
                                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                                            <path d="M20.1 3.9C17.9 1.7 15 .5 12 .5 5.8.5.7 5.6.7 11.9c0 2 .5 3.9 1.5 5.6L.6 23.4l6-1.6c1.6.9 3.5 1.3 5.4 1.3 6.3 0 11.4-5.1 11.4-11.4-.1-2.8-1.2-5.7-3.3-7.8zM12 21.4c-1.7 0-3.3-.5-4.8-1.3l-.4-.2-3.5 1 1-3.4L4 17c-1-1.5-1.4-3.2-1.4-5.1 0-5.2 4.2-9.4 9.4-9.4 2.5 0 4.9 1 6.7 2.8 1.8 1.8 2.8 4.2 2.8 6.7-.1 5.2-4.3 9.4-9.5 9.4zm5.1-7.1c-.3-.1-1.7-.9-1.9-1-.3-.1-.5-.1-.7.1-.2.3-.8 1-.9 1.1-.2.2-.3.2-.6.1s-1.2-.5-2.3-1.4c-.9-.8-1.4-1.7-1.6-2-.2-.3 0-.5.1-.6s.3-.3.4-.5c.2-.1.3-.3.4-.5.1-.2 0-.4 0-.5C10 9 9.3 7.6 9 7c-.1-.4-.4-.3-.5-.3h-.6s-.4.1-.7.3c-.3.3-1 1-1 2.4s1 2.8 1.1 3c.1.2 2 3.1 4.9 4.3.7.3 1.2.5 1.6.6.7.2 1.3.2 1.8.1.6-.1 1.7-.7 1.9-1.3.2-.7.2-1.2.2-1.3-.1-.3-.3-.4-.6-.5z" />
                                        </svg>
                                    </div>
                                </div>
                            </a>
                            <a class="resp-sharing-button__link" href="https://telegram.me/share/url?text=" target="_blank" rel="noopener" aria-label="" data-share="telegram">
                                <div class="resp-sharing-button resp-sharing-button--telegram resp-sharing-button--small">
                                    <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
                                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                                            <path d="M.707 8.475C.275 8.64 0 9.508 0 9.508s.284.867.718 1.03l5.09 1.897 1.986 6.38a1.102 1.102 0 0 0 1.75.527l2.96-2.41a.405.405 0 0 1 .494-.013l5.34 3.87a1.1 1.1 0 0 0 1.046.135 1.1 1.1 0 0 0 .682-.803l3.91-18.795A1.102 1.102 0 0 0 22.5.075L.706 8.475z" />
                                        </svg>
                                    </div>
                                </div>
                            </a>
                            <a class="resp-sharing-button__link" href="https://twitter.com/intent/tweet/?text=" target="_blank" rel="noopener" aria-label="" data-share="twitter">
                                <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--small">
                                    <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
                                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                                            <path d="M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z" />
                                        </svg>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
                <div class="lines read-also mob_hide_block">
                    <div class="lines-title">
                        ЧИТАЙТЕ ТАКЖЕ:
                    </div>
                    <div class="line clearfix" id="content_els">
					
					<?php
$qrd = mysqli_query($connect_db, "SELECT id,ti,img,uchpu,linktype,newtab,relasttab FROM `t_news` WHERE `hide` = '0' ORDER BY RAND() LIMIT 3");
while($rowd = mysqli_fetch_assoc($qrd)) {
if (empty($rowd['uchpu'])) { $nowchpu = '1'; } else { $nowchpu = htmlspecialchars($rowd['uchpu']); }
if ($data['news_linktype'] == 3) {
if ($rowd['linktype'] == 0) { $lnkviewd = '?type=open'; }
if ($rowd['linktype'] == 1) { $lnkviewd = '?type=short'; }
if ($rowd['linktype'] == 2) { $lnkviewd = ''; }
} else {
if ($data['news_linktype'] == 0) { $lnkviewd = '?type=open'; }
if ($data['news_linktype'] == 1) { $lnkviewd = '?type=short'; }
if ($data['news_linktype'] == 2) { $lnkviewd = ''; }
}

if ($data['news_newtab'] == 2) {
if ($rowd['newtab'] == 0) { $retabd = ''; } else {
if ($rowd['relasttab'] == 0) { $retabd = ''; }
if ($rowd['relasttab'] == 1) { $retabd = 'crabs_remain'; }
if ($rowd['relasttab'] == 2) { $retabd = 'crabs_renew'; }
}
} else {
if ($data['news_newtab'] == 0) { $retabd = ''; } else {
if ($data['news_relasttab'] == 0) { $retabd = ''; }
if ($data['news_relasttab'] == 1) { $retabd = 'crabs_remain'; }
if ($data['news_relasttab'] == 2) { $retabd = 'crabs_renew'; }
}
}
?>
<a href="/view/<?php echo $nowchpu.'.'.wu_encode($rowd['id']); echo $lnkviewd; ?>" class="new-micro-preview js-ad-top-position js-ad-block utm_links_t click_link unread <?php echo $retabd; ?>" <?php if ($data['news_newtab'] == 2) { if ($rowd['newtab'] == 1) { echo ' target="_blank"'; } } else { if ($data['news_newtab'] == 1) { echo ' target="_blank"'; } } ?>>
<div class="image"><img class="lazyload" src="/img/upl/<?php echo $rowd['img']; ?>" data-src="/img/upl/<?php echo $rowd['img']; ?>"></div>
<div class="title">
<div class="headline"><?php echo htmlspecialchars(macros_city($rowd['ti'])); ?></div>
</div>
</a>
<?php } ?>
                    </div>
                </div>
            </div>
        </article>
        <aside class="sticky-top-on-scroll">
            <div class="js-block-relatively-floating">

<?php
if (!isset($_COOKIE['last_o'])) {
$qr = mysqli_query($connect_db, "SELECT id,ti,img,(clk/views) AS ctr,newtabtype,relasttab FROM `t_offers` WHERE `hide` = '0' AND (cou = '' OR cou LIKE '%".$crabs_country."%') ORDER BY ctr DESC LIMIT 6");
setcookie ('last_o', '1', $dt+315360000, '/', SITE);
} else {
$qr = mysqli_query($connect_db, "SELECT id,ti,img,newtabtype,relasttab FROM `t_offers` WHERE `hide` = '0' AND (cou = '' OR cou LIKE '%".$crabs_country."%') ORDER BY RAND() LIMIT 6");
}
$i=0;
while($row = mysqli_fetch_assoc($qr)) {
$isdayo1 = mysqli_num_rows(mysqli_query($connect_db, "SELECT id FROM `t_offers_stat` WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1"));
if ($crabs_sub > 0) {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views,s".$crabs_sub."_views) VALUES ('$row[id]','$nowday','1','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1, `s".$crabs_sub."_views` = `s".$crabs_sub."_views`+1 WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1");
}
} else {
if ($isdayo1 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views) VALUES ('$row[id]','$nowday','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1 WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1");
}
}
$toviews .= $row['id'].', ';
$i++;
if ($data['offers_newtab'] == 2) {
if ($row['newtabtype'] == 0) { $retab_o = ''; } else {
if ($row['relasttab'] == 0) { $retab_o = ''; }
if ($row['relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($row['relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
} else {
if ($data['offers_newtab'] == 0) { $retab_o = ''; } else {
if ($data['offers_relasttab'] == 0) { $retab_o = ''; }
if ($data['offers_relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($data['offers_relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
}
?>
<?php
if ($i == 1 || $i == 3 || $i == 5) { echo '<section class="clearfix" id="first_n_second">'; }
?>
 <div class="column standard">
                        <a href="/oclick/<?php echo wu_encode($row['id']); ?>?n=<?php echo wu_encode($id); ?>" class="mid-preview js-ad-top-position js-ad-block utm_links_t click_link unread sec_wrap <?php echo $retab_o; ?>" <?php if ($data['offers_newtab'] == 2) { if ($row['newtabtype'] == 1) { echo ' target="_blank"'; } } else { if ($data['offers_newtab'] == 1) { echo ' target="_blank"'; } } ?> rel=”nofollow”>
                            <div class="image"><img class="lazyload" src="/img/upl/<?php echo $row['img']; ?>" data-src="/img/upl/<?php echo $row['img']; ?>"></div>
                            <div class="title">
                                <div class="headline"><?php echo htmlspecialchars(macros_city($row['ti'])); ?></div>
                            </div>
                        </a>
                    </div>

<?php
if ($i == 2 || $i == 4 || $i == 6) { echo '</section>'; }
?>

<?php
}
$toviews = substr($toviews,0,-2);
if ($crabs_sub > 0) {
mysqli_query($connect_db, "UPDATE `t_offers` SET `views` = `views`+1, s".$crabs_sub."_views = `s".$crabs_sub."_views`+1 WHERE id in ($toviews)");
} else {
mysqli_query($connect_db, "UPDATE `t_offers` SET `views` = `views`+1 WHERE id in ($toviews)");
}
?>
			
                <div class="clearfix"></div>
            </div>
        </aside>
    </section>





<?php } ?>


<!--noindex-->
<div id="crabs_autoload">
<?php
$qr = mysqli_query($connect_db, "SELECT id,ti,img,newtabtype,relasttab FROM `t_offers` WHERE `hide` = '0' AND (cou = '' OR cou LIKE '%".$crabs_country."%') ORDER BY RAND() LIMIT 6");
$i=0;
while($row = mysqli_fetch_assoc($qr)) {
$isdayo2 = mysqli_num_rows(mysqli_query($connect_db, "SELECT id FROM `t_offers_stat` WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1"));
if ($crabs_sub > 0) {
if ($isdayo2 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views,s".$crabs_sub."_views) VALUES ('$row[id]','$nowday','1','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1, `s".$crabs_sub."_views` = `s".$crabs_sub."_views`+1 WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1");
}
} else {
if ($isdayo2 == 0) {
mysqli_query($connect_db, "INSERT INTO t_offers_stat (o,ymd,views) VALUES ('$row[id]','$nowday','1')");
} else {
mysqli_query($connect_db, "UPDATE `t_offers_stat` SET `views` = `views`+1 WHERE o = '$row[id]' AND ymd = '$nowday' LIMIT 1");
}
}
$toviews2 .= $row['id'].', ';
$i++;
if ($data['offers_newtab'] == 2) {
if ($row['newtabtype'] == 0) { $retab_o = ''; } else {
if ($row['relasttab'] == 0) { $retab_o = ''; }
if ($row['relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($row['relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
} else {
if ($data['offers_newtab'] == 0) { $retab_o = ''; } else {
if ($data['offers_relasttab'] == 0) { $retab_o = ''; }
if ($data['offers_relasttab'] == 1) { $retab_o = 'crabs_remain'; }
if ($data['offers_relasttab'] == 2) { $retab_o = 'crabs_renew'; }
}
}
?>
<?php
if ($i == 1 || $i == 5) { echo '<section class="clearfix">'; }
if ($i < 5) {
?>
        <div class="column standard">
            <a href="/oclick/<?php echo wu_encode($row['id']); ?>?n=<?php echo wu_encode($id); ?>" class="mid-preview js-ad-block click_link unread sec_wrap go_base <?php echo $retab_o; ?>" <?php if ($data['offers_newtab'] == 2) { if ($row['newtabtype'] == 1) { echo ' target="_blank"'; } } else { if ($data['offers_newtab'] == 1) { echo ' target="_blank"'; } } ?> rel=”nofollow”>
                <div class="image"><img src="/img/upl/<?php echo $row['img']; ?>"></div>
                <div class="title"><?php echo htmlspecialchars(macros_city($row['ti'])); ?></div>
            </a>
        </div>
<?php } else { ?>
        <div class="column wide" id="jsNewsBlockWrapper9">
            <a href="/oclick/<?php echo wu_encode($row['id']); ?>?n=<?php echo wu_encode($id); ?>" class="wide-preview js-ad-block click_link unread sec_wrap go_base <?php echo $retab_o; ?>" <?php if ($data['offers_newtab'] == 2) { if ($row['newtabtype'] == 1) { echo ' target="_blank"'; } } else { if ($data['offers_newtab'] == 1) { echo ' target="_blank"'; } } ?> rel=”nofollow”>
                <div class="image"><img src="/img/upl/<?php echo $row['img']; ?>"></div>
                <div class="text">
                    <div class="category-label">Горячая новость!</div>
                    <div class="title"><?php echo htmlspecialchars(macros_city($row['ti'])); ?></div>
                </div>
            </a>
        </div>
<?php } ?>
<?php
if ($i == 4 || $i == 6) { echo '</section>'; }
?>

<?php
}
$toviews2 = substr($toviews2,0,-2);
if ($crabs_sub > 0) {
mysqli_query($connect_db, "UPDATE `t_offers` SET `views` = `views`+1, s".$crabs_sub."_views = `s".$crabs_sub."_views`+1 WHERE id in ($toviews2)");
} else {
mysqli_query($connect_db, "UPDATE `t_offers` SET `views` = `views`+1 WHERE id in ($toviews2)");
}
?>
</div>
<!--/noindex-->

</div>

<script>
$(document).ready(function(){
var inProgress = false;
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() >= $(document).height() - 200 && !inProgress) {
$.ajax({
url: '/templates/2/offers_load.php',
method: 'POST',
data: {"n" : '<?php echo wu_encode($id); ?>'},
beforeSend: function() {
inProgress = true;}
}).done(function(data){
$("#crabs_autoload").append(data);
inProgress = false;
});
}
});
});
</script>