add wp-future

This commit is contained in:
2022-04-26 00:46:54 +03:00
parent eb335f8d52
commit cebc3aca47
8 changed files with 99 additions and 52 deletions

View File

@@ -2,9 +2,9 @@
<?//if (!isset($_COOKIE[COOK_GOLOS])):?> <?//if (!isset($_COOKIE[COOK_GOLOS])):?>
<div id="golos-<?=$curr_id?>"> <!-- <div id="golos-<?=$curr_id?>">
<br><button style="padding: 8px; cursor: pointer;" id="golos" onclick="javascript:add_golos(<?= $curr_id;?>, 'golos-<?= $curr_id;?>');">Проголосовать</button> <br><button style="padding: 8px; cursor: pointer;" id="golos" onclick="javascript:add_golos(<?= $curr_id;?>, 'golos-<?= $curr_id;?>');">Проголосовать</button>
</div> </div> -->
<?//endif?> <?//endif?>

View File

@@ -46,6 +46,15 @@
<a href="<?=get_site_url().vij_lang('btn_lan_link', LANG_VERSION)?>"><li class="btn_lan"><nobr><?=vij_lang('btn_lan', LANG_VERSION)?></nobr></li></a> <a href="<?=get_site_url().vij_lang('btn_lan_link', LANG_VERSION)?>"><li class="btn_lan"><nobr><?=vij_lang('btn_lan', LANG_VERSION)?></nobr></li></a>
</ul> </ul>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VGN4NSFMW5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VGN4NSFMW5');
</script>
</header> </header>

View File

@@ -101,17 +101,6 @@
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?> <?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
<?endif?> <?endif?>
<?if (LANG_VERSION == 'ru'):?>
<div class="right-info">
<a href="https://vetandlife.ru/без-рубрики/veterinariya-i-zhizn-obyavlyaet-o-novom-fotokonkurse-sovremennoe-zhivotnovodstvo-i-veterinariya/">
<img src="https://vetandlife.ru/wp-content/uploads/2022/01/new_comp_240x400.jpg" width="240" height="400" />
</a>
</div>
<?endif?>
<?//php include VIJ_CACHE.'mosts.html';?> <?//php include VIJ_CACHE.'mosts.html';?>
</div> </div>
@@ -119,6 +108,7 @@
<?if (LANG_VERSION == 'ru'):?> <?if (LANG_VERSION == 'ru'):?>
<div class="mobile-info"> <div class="mobile-info">
<a href="https://www.youtube.com/channel/UCOXOjXmMNl8eVO4ldrv5c5Q" target="_blank"> <a href="https://www.youtube.com/channel/UCOXOjXmMNl8eVO4ldrv5c5Q" target="_blank">
<img src="https://vetandlife.ru/wp-content/uploads/2021/10/melano-live.png" width="240" height="200" /> <img src="https://vetandlife.ru/wp-content/uploads/2021/10/melano-live.png" width="240" height="200" />
@@ -145,11 +135,6 @@
</a> </a>
</div> </div>
<div class="mobile-info">
<a href="https://vetandlife.ru/без-рубрики/veterinariya-i-zhizn-obyavlyaet-o-novom-fotokonkurse-sovremennoe-zhivotnovodstvo-i-veterinariya/">
<img src="https://vetandlife.ru/wp-content/uploads/2022/01/new_comp_240x200.jpg" width="240" height="200" />
</a>
</div>
<?endif?> <?endif?>
@@ -226,6 +211,7 @@
<div id="footer_2"> <div id="footer_2">
<div id="copy">© <?=vij_lang('copyright', LANG_VERSION);?> <?=date('Y')?></div> <div id="copy">© <?=vij_lang('copyright', LANG_VERSION);?> <?=date('Y')?></div>
<ul id="svid"> <ul id="svid">
<li><a href="https://vetandlife.ru/rss/news.xml" target="_blank">RSS</a></li>
<li><a href="https://vetandlife.ru/wp-content/uploads/2021/11/vij-roskomnadzor.pdf" target="_blank"><?=vij_lang('svid_smi', LANG_VERSION);?></a></li> <li><a href="https://vetandlife.ru/wp-content/uploads/2021/11/vij-roskomnadzor.pdf" target="_blank"><?=vij_lang('svid_smi', LANG_VERSION);?></a></li>
<li><a href="https://vetandlife.ru/wp-content/uploads/2021/10/privacy.pdf" target="_blank"><?=vij_lang('conf_politic', LANG_VERSION);?></a></li> <li><a href="https://vetandlife.ru/wp-content/uploads/2021/10/privacy.pdf" target="_blank"><?=vij_lang('conf_politic', LANG_VERSION);?></a></li>
</ul> </ul>
@@ -257,7 +243,6 @@
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/burger-menu.js?ver=19"></script> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/burger-menu.js?ver=19"></script>
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/main-arrow.js?ver=1"></script> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/main-arrow.js?ver=1"></script>
</body> </body>
</html> </html>

View File

@@ -213,11 +213,11 @@ function lat_slug( $post_id ){
if ( wp_is_post_revision( $post_id )) if ( wp_is_post_revision( $post_id ))
return; return;
$post = get_posts($post_id); $currpost = get_post($post_id);
$name = urldecode($post[0]->post_name); $name = urldecode($currpost->post_name);
if (isContainsRussianLetters($name)) { //если есть русские буковки if (isContainsRussianLetters($name)) { //если есть русские буковки
$title = express_slug($post[0]->post_title); $title = express_slug($currpost->post_title);
$latname = vij_slug($title); $latname = vij_slug($title);
remove_action( 'save_post', 'lat_slug' ); // избегаем зацикливания remove_action( 'save_post', 'lat_slug' ); // избегаем зацикливания
wp_update_post( array( 'ID' => $post_id, 'post_name' => $latname ) ); wp_update_post( array( 'ID' => $post_id, 'post_name' => $latname ) );

View File

@@ -9,14 +9,15 @@
<?if (defined('TESTMODE') and TESTMODE == 1):?> <?if (defined('TESTMODE') and TESTMODE == 1):?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/style-test.css?ver=3"> <link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/style-test.css?ver=3">
<?else:?> <?else:?>
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=267"> <link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=274">
<?endif?> <?endif?>
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> <link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
<!--<link href="<?php echo get_stylesheet_directory_uri()?>/pub/fontawesome.css" rel="stylesheet">--> <!--<link href="<?php echo get_stylesheet_directory_uri()?>/pub/fontawesome.css" rel="stylesheet">-->
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script>
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script>
<meta property="og:title" content="<?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?>" /> <meta property="og:title" content="<?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?>" />
<link rel="icon" href="https://vetandlife.ru/favicon.ico" type="image/x-icon"> <link type="image/x-icon" href="/favicon. ico" rel="shortcut icon">
<link type="Image/x-icon" href="/favicon. ico" rel="icon">
<?if (isset($post->ID)):?> <?if (isset($post->ID)):?>
<meta property="og:description" content="<?=strip_tags(get_the_excerpt( $post->ID ))?>" /> <meta property="og:description" content="<?=strip_tags(get_the_excerpt( $post->ID ))?>" />
<?if( has_post_thumbnail()): <?if( has_post_thumbnail()):
@@ -27,15 +28,7 @@
<?endif?> <?endif?>
<?php wp_head();?> <?php wp_head();?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VGN4NSFMW5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VGN4NSFMW5');
</script>
</head> </head>
<body> <body>
@@ -44,34 +37,48 @@
<?if (defined('TESTMODE') and TESTMODE == 1):?> <?if (defined('TESTMODE') and TESTMODE == 1):?>
<style> <style>
#mainbanner{ #testbanner{
width: 100%; width: 100%;
display: block; display: block;
padding: 10px; padding: 10px;
} }
#mainbanner img { #testbanner img {
display: block; display: block;
width: 100%; width: 100%;
max-width: 1600px; max-width: 554px;
height: 86px;
margin: auto; margin: auto;
border: 1px solid black; border: 1px solid black;
background-color: gray;
text-align: center; text-align: center;
} }
</style> </style>
<div id="mainbanner"> <div id="testbanner">
<img src ="https://vetandlife.ru/wp-content/uploads/2022/04/3200x200-scaled.gif" /> <img />
</div> </div>
<?else:?>
<div id="mainbanner">
<a href="https://vetandlife.ru/reklama-na-site/"><img src ="https://vetandlife.ru/wp-content/uploads/2022/04/2000x125_64c.gif" /></a>
</div>
<div id="mobmainbanner">
<a href="https://vetandlife.ru/reklama-na-site/"><img src =" https://vetandlife.ru/wp-content/uploads/2022/04/554x86.gif" /></a>
</div>
<?endif?> <?endif?>
<div id="mainbanner">
<a href="https://vetandlife.ru/reklama-na-site/"><img src ="https://vetandlife.ru/wp-content/uploads/2022/04/3200x200_2.gif" /></a>
</div>
<? $lang_version = lang_version(); <? $lang_version = lang_version();

View File

@@ -18,7 +18,7 @@ $nn = 0;?>
array( array(
'category__in' => array(2), 'category__in' => array(2),
'post__not_in' => array($mainpost_id), 'post__not_in' => array($mainpost_id),
'posts_per_page' => 21, 'posts_per_page' => 22,
'meta_query' => array( 'meta_query' => array(
array( array(
'key' => '_thumbnail_id', 'key' => '_thumbnail_id',
@@ -38,11 +38,9 @@ $nn = 0;?>
<?$nn++?> <?$nn++?>
<?if ($nn == 10):?> <?//?if ($nn == 10){
//card_post_id(20427, 'до 13 апреля 2022 года');
<?card_post_id(20427, 'до 13 апреля 2022 года')?> //endif?>
<?endif?>
<div class="mini-card"> <div class="mini-card">
<?if ( has_post_thumbnail() ) :?> <?if ( has_post_thumbnail() ) :?>

View File

@@ -121,6 +121,22 @@ a{
text-align: center; text-align: center;
} }
#mobmainbanner{
width: 100%;
display: none;
padding: 10px;
}
#mobmainbanner img {
display: block;
width: 100%;
max-width: 554px;
max-height: 86px;
margin: auto;
text-align: center;
}
#left{ #left{
@@ -2283,9 +2299,13 @@ span.rub_back_title{
margin: 0; margin: 0;
} }
/** #mainbanner { #mainbanner {
display: none; display: none;
} */ }
#mobmainbanner{
display: block;
}
#header_icons{ #header_icons{
margin-left: 0; margin-left: 0;
@@ -2681,9 +2701,13 @@ and (max-device-width : 667px) {
display: block; display: block;
} }
/**#mainbanner { #mainbanner {
display: none; display: none;
}*/ }
#mobmainbanner{
display: block;
}
.mini-card{ .mini-card{
width: 100%; width: 100%;

24
wp-future.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
//require '/thosts/vij/wp/vendor/autoload.php';
require '/vhosts/beta/vendor/autoload.php';
dbl_config('vetandlife', 'mysql:host=mysql;dbname=vetandlife', 'vetandlife', 'g-34hJk-3-er2');
$future_news = db_get("SELECT ID FROM `wp_posts` WHERE `post_status` = 'future' AND `post_date` <= current_date() ");
if (count($future_news) == 0 ){
echo 'no count';
exit;
}
foreach ($future_news as $news) {
$upd_sql = "UPDATE `wp_posts` SET `post_status` = 'publish' WHERE `ID` = '${news['ID']}';";
$result = db_get($upd_sql);
}