From 254bf0708f4d2351a5d03f6c79ba623f7105ed4a Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Sun, 11 Jul 2021 21:26:52 -0300 Subject: [PATCH] Avanzado sobre el backend --- index.php | 5 ++--- news/00_news_done.txt | 3 +++ news/aaa.html | 0 news_logic.php | 36 ++++++++++++++++++++++++++++++++++++ style.css | 1 + 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 news/00_news_done.txt create mode 100644 news/aaa.html create mode 100644 news_logic.php diff --git a/index.php b/index.php index 9d427e0..4778af5 100644 --- a/index.php +++ b/index.php @@ -19,10 +19,9 @@ query('select * from noticias;')-> fetchAll(); - - print_r($selection); + check_news(); ?> diff --git a/news/00_news_done.txt b/news/00_news_done.txt new file mode 100644 index 0000000..9544851 --- /dev/null +++ b/news/00_news_done.txt @@ -0,0 +1,3 @@ +./news/aaa.html +./news/bbb.html +./news/ccc.html \ No newline at end of file diff --git a/news/aaa.html b/news/aaa.html new file mode 100644 index 0000000..e69de29 diff --git a/news_logic.php b/news_logic.php new file mode 100644 index 0000000..1c4b41e --- /dev/null +++ b/news_logic.php @@ -0,0 +1,36 @@ +'; + + foreach ($news as $new) { + if ($new !== './news/00_news_done.txt'){ + + echo '
'; + + echo 'NEW: ' . $new; + + echo '
'; + + $news_done = file_get_contents('./news/00_news_done.txt'); + + echo $news_done; + echo '
'; + + 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) { + + }*/ + } + } +} + +?> \ No newline at end of file diff --git a/style.css b/style.css index b5aa991..4b9792c 100644 --- a/style.css +++ b/style.css @@ -54,6 +54,7 @@ header { background-color: #ffffff; border-radius: 15px; display: flex; + margin-top: 2.5vh; } .card .text {