Avanzado sobre el backend

This commit is contained in:
2021-07-11 21:26:52 -03:00
parent 6ffc840032
commit 254bf0708f
5 changed files with 42 additions and 3 deletions

View File

@@ -19,10 +19,9 @@
<?php
require 'mySQLconnect.php';
require 'news_logic.php';
$selection = $mySQLconnect -> query('select * from noticias;')-> fetchAll();
print_r($selection);
check_news();
?>

3
news/00_news_done.txt Normal file
View File

@@ -0,0 +1,3 @@
./news/aaa.html
./news/bbb.html
./news/ccc.html

0
news/aaa.html Normal file
View File

36
news_logic.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
function check_news() {
$news = glob('./news/*');
print_r($news);
echo '<br>';
foreach ($news as $new) {
if ($new !== './news/00_news_done.txt'){
echo '<br>';
echo 'NEW: ' . $new;
echo '<br>';
$news_done = file_get_contents('./news/00_news_done.txt');
echo $news_done;
echo '<br>';
if (!strstr($news_done, $new)) {
$author = know_autor($new); //! HACER FUNCION
$create_entry($new, $author); //! HACER FUNCION
file_put_contents($news_done, $new . '/n', FILE_APPEND);
}
/*if ($new is in $done) {
}*/
}
}
}
?>

View File

@@ -54,6 +54,7 @@ header {
background-color: #ffffff;
border-radius: 15px;
display: flex;
margin-top: 2.5vh;
}
.card .text {