diff --git a/control-files/00_ids_done.txt b/control-files/00_ids_done.txt index 3f10ffe..dec2bf5 100755 --- a/control-files/00_ids_done.txt +++ b/control-files/00_ids_done.txt @@ -1 +1 @@ -15 \ No newline at end of file +19 \ No newline at end of file diff --git a/control-files/00_news_done.txt b/control-files/00_news_done.txt index 5e96b2b..0197029 100755 --- a/control-files/00_news_done.txt +++ b/control-files/00_news_done.txt @@ -1 +1 @@ - ./news/1.html ./news/2.html ./news/3.html ./news/4.html ./news/5.html ./news/6.html ./news/7.html ./news/8.html ./news/9.html ./news/10.html ./news/11.html ./news/12.html ./news/13.html ./news/14.html ./news/15.html \ No newline at end of file + ./news/1.html ./news/2.html ./news/3.html ./news/4.html ./news/5.html ./news/6.html ./news/7.html ./news/8.html ./news/9.html ./news/10.html ./news/11.html ./news/12.html ./news/13.html ./news/14.html ./news/15.html ./news/16.html ./news/17.html ./news/18.html ./news/19.html \ No newline at end of file diff --git a/news.css b/news.css index 047e8a8..c72754e 100755 --- a/news.css +++ b/news.css @@ -97,4 +97,12 @@ article { figcaption { color: #797979; margin-bottom: 3vh; +} + +iframe { + /*! RELACIÓN 16:9 ENTRE ANCHO Y ALTO, EL CONTENIDO TIENE 56 VW DE ANCHO. POR LO TANTO, EL ALTO DEBE SER DE 32 VW PARA QUE EL VIDEO EMBEBIDO TENGA EL TAMAÑO ADECUADO PARA EL RATO 16:9*/ + + width: 100% !important; + height: 32vw !important; + border: none; } \ No newline at end of file diff --git a/news.php b/news.php index 410b8e0..a9044c0 100755 --- a/news.php +++ b/news.php @@ -5,6 +5,7 @@ + <?php require 'news_logic.php'; diff --git a/news_logic.php b/news_logic.php index 96a7aec..cb1918d 100755 --- a/news_logic.php +++ b/news_logic.php @@ -19,7 +19,8 @@ function check_news($news_per_page, $mySQLconnectRoute) { $page = know_page($news_unique); $author = know_author($page, $news_unique); - create_entry_in_DB($news_unique, $page, $author, $mySQLconnectRoute); + $page_data = get_contents($news_unique, $page, $author); + create_entry_in_DB($mySQLconnectRoute, $page_data, $news_unique); } } @@ -92,8 +93,7 @@ function get_string_between($string, $start, $end){ //! CREDITS: https://stackoverflow.com/a/9826656 } -function create_entry_in_DB($news_unique, $page, $author, $mySQLconnectRoute) { - require $mySQLconnectRoute; +function get_contents($news_unique, $page, $author) { $content = file_get_contents($news_unique); switch ($page) { @@ -135,10 +135,32 @@ function create_entry_in_DB($news_unique, $page, $author, $mySQLconnectRoute) { break; } - $title; - $icon; - $inner_HTML; - $frist_p; + return [ + 'title' => $title, + 'inner_HTML' => $inner_HTML, + 'icon' => $icon, + 'page_source' => $page, + 'author' => $author, + 'frist_p' => $frist_p + ]; + +} + +function create_entry_in_DB($mySQLconnectRoute, $page_data, $news_unique) { + require $mySQLconnectRoute; + + //* ASIGNACIÓN DE VARIABLES + + $title = $page_data['title']; + $inner_HTML = $page_data['inner_HTML']; + + $icon = $page_data['icon']; + $page = $page_data['page_source']; + + $author = $page_data['author']; + $frist_p = $page_data['frist_p']; + + //* QUERY A LA DB $insert_news = $mySQLconnect -> prepare('insert into noticias (title, content, icon_route, page_source, author, frist_paragraph) values (?, ?, ?, ?, ?, ?)');