Свежие отраслевые новости на нашем канале в Telegram
+Добавьте «Ветеринарию и жизнь» в избранное в ЯНДЕКС.НОВОСТИ
+Подписывайтесь на канал «ВиЖ» в ЯНДЕКС.ДЗЕН
+From a13b193d5b6a31f9d338624af677d84fd3b80a7f Mon Sep 17 00:00:00 2001
From: AK Delfin
', '
', $text);
+ $slug = express_slug(vij_slug($title));
+
+ $sql = "SELECT `ID` from `wp_posts` WHERE `post_name` = '$slug' and `post_date` = '$mysqldate'";
+ $result = $wpdb->get_results($sql);
+
+ if ($result) {
+ continue;
+ }
+
+
+ $my_post = [
+ 'post_title' => $title,
+ 'post_name' => $slug,
+ 'post_type' => 'post',
+ 'post_content' => $text,
+ 'post_date' => $mysqldate,
+ 'post_status' => 'publish',
+ 'post_author' => 1,
+ 'comment_status' => 'closed',
+ 'post_category' => array( 37 )
+ ];
+
+ wp_insert_post( $my_post);
+
+ }
+
+ }
+
+ return True;
+
+}
+
+
+function file_get_contents_curl( $url ) {
+
+ $ch = curl_init();
+
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, TRUE );
+ curl_setopt( $ch, CURLOPT_HEADER, 0 );
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
+ curl_setopt( $ch, CURLOPT_URL, $url );
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE );
+
+ $data = curl_exec( $ch );
+ curl_close( $ch );
+
+ return $data;
+
+}
+
+
+
+function replace_br($html) {
+
+ $html = preg_replace('#(?:
\s*?){2,}#', '
', $html); + return "
$html
"; + +} + +function delete_p($html){ + + $pattern = "/]*><\\/p[^>]*>/";
+ return preg_replace($pattern, '', $html);
+
+}
\ No newline at end of file
diff --git a/category-rosselkhoznadzor.php b/category-rosselkhoznadzor.php
index 356400e..fc2da80 100644
--- a/category-rosselkhoznadzor.php
+++ b/category-rosselkhoznadzor.php
@@ -46,6 +46,7 @@ $nn = 0;?>
Свежие отраслевые новости на нашем канале в Telegram
+Добавьте «Ветеринарию и жизнь» в избранное в ЯНДЕКС.НОВОСТИ
+Подписывайтесь на канал «ВиЖ» в ЯНДЕКС.ДЗЕН
+