From 88c9787858bc011cddf32db00105e3f2836bdbc3 Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Sat, 17 Jul 2021 23:48:27 -0300 Subject: [PATCH] =?UTF-8?q?Logica=20de=20paginaci=C3=B3n=20y=20de=20creaci?= =?UTF-8?q?=C3=B3n=20dinamica=20de=20pagina=20lista?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control-files/00_ids_done.txt | 2 +- control-files/00_news_done.txt | 2 +- index.php | 50 +++++++++++++++++------ news.php | 2 +- news_logic.php | 45 ++++++++++++++++----- pages/pages-1.php | 73 ++++++++++++++++++++++++++++++++++ pages/pages-2.php | 73 ++++++++++++++++++++++++++++++++++ pages/print_page_data.php | 70 ++++++++++++++++++++++++++++++++ pages/template-code-blocks.php | 36 +++++++++++++++++ pages/template.html | 27 +++++++++++++ scripts/infobae.js | 2 +- scripts/tn.js | 0 style.css | 1 - 13 files changed, 355 insertions(+), 28 deletions(-) create mode 100755 pages/pages-1.php create mode 100755 pages/pages-2.php create mode 100755 pages/print_page_data.php create mode 100755 pages/template-code-blocks.php create mode 100755 pages/template.html mode change 100644 => 100755 scripts/tn.js diff --git a/control-files/00_ids_done.txt b/control-files/00_ids_done.txt index f11c82a..da2d398 100755 --- a/control-files/00_ids_done.txt +++ b/control-files/00_ids_done.txt @@ -1 +1 @@ -9 \ No newline at end of file +14 \ No newline at end of file diff --git a/control-files/00_news_done.txt b/control-files/00_news_done.txt index b64d3cc..fb8efeb 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 \ 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 \ No newline at end of file diff --git a/index.php b/index.php index 665b149..784a379 100755 --- a/index.php +++ b/index.php @@ -29,11 +29,13 @@ require 'news_logic.php'; - check_news(); + $actual_page = 1; $news_per_page = 10; - $result = bring_the_news_back_home(1, $news_per_page); + check_news($news_per_page, 'mySQLconnect.php'); + + $result = bring_the_news_back_home($actual_page, $news_per_page, 'mySQLconnect.php'); foreach ($result as $news ) { $id = $news[0]; @@ -53,19 +55,41 @@ "; - } + + } ?> -
- -
-

Lorem, ipsum dolor sit amet consectetur adipisicing elit. Corporis expedita repellendus sunt modi sint earum atque nihil porro neque, excepturi doloremque deserunt nesciunt nemo dolores, veniam error possimus non. Facere.

-

Content... Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut numquam accusamus, voluptas vel et corrupti, dolore maxime ipsum veritatis quae obcaecati magni provident iure possimus praesentium animi debitis, quos consequuntur. Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, reprehenderit. Voluptatem inventore est necessitatibus blanditiis? Voluptatem pariatur fuga officiis minus, excepturi laudantium assumenda enim, rem officia quis obcaecati facilis consequuntur? Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur facilis odio blanditiis perspiciatis quaerat quos magni dolor praesentium repellat officia fugit eum natus, impedit quis, quo optio? Similique, temporibus delectus. Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque dicta quia minima! Harum, alias maxime, architecto debitis distinctio amet assumenda, fugiat iure quis nesciunt ut laboriosam rem voluptatibus aspernatur nobis!

-
-
- + - - + \ No newline at end of file diff --git a/news.php b/news.php index bcd3c38..410b8e0 100755 --- a/news.php +++ b/news.php @@ -9,7 +9,7 @@ ', ''); $icon = get_string_between($pre_icon, '992w,', ' 1200w" '); $inner_HTML = get_string_between($content, '
', '
') . ''; - $frist_p = get_string_between($content, ''); + $frist_p = get_string_between($content, ' prepare("select id, title, frist_paragraph, icon_route, page_source from noticias where id < ? and id > ?"); @@ -168,8 +193,8 @@ function bring_the_news_back_home($actual_page, $news_per_page) { return $return; } -function bring_the_choosen_one($id) { - require './mySQLconnect.php'; +function bring_the_choosen_one($id, $mySQLconnectRoute) { + require $mySQLconnectRoute; $prepared_query = $mySQLconnect -> prepare('select * from noticias where id = ?'); $prepared_query -> bindParam(1, $id, PDO::PARAM_INT); diff --git a/pages/pages-1.php b/pages/pages-1.php new file mode 100755 index 0000000..a9f1cd8 --- /dev/null +++ b/pages/pages-1.php @@ -0,0 +1,73 @@ + + + + + + + All news + + + + + +
+ + +

AllNews.com

+
+
+ + + + +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/pages/pages-2.php b/pages/pages-2.php new file mode 100755 index 0000000..16ce4d4 --- /dev/null +++ b/pages/pages-2.php @@ -0,0 +1,73 @@ + + + + + + + All news + + + + + +
+ + +

AllNews.com

+
+
+ + + + +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/pages/print_page_data.php b/pages/print_page_data.php new file mode 100755 index 0000000..3aa32ed --- /dev/null +++ b/pages/print_page_data.php @@ -0,0 +1,70 @@ + +
', + + ' + + ', + + '
+ + + + ' + + ); +} + +?> \ No newline at end of file diff --git a/pages/template-code-blocks.php b/pages/template-code-blocks.php new file mode 100755 index 0000000..7dc7cb3 --- /dev/null +++ b/pages/template-code-blocks.php @@ -0,0 +1,36 @@ + +
+ +
+

$title

+

$frist_p

+
+ $source +
+
+
+ "; +} + +function code_block2($c) { + return " + +
+ $c +
+
+ "; +} + +function code_block3($page, $c) { + return " + +
+ $c +
+
+ "; +} +?> \ No newline at end of file diff --git a/pages/template.html b/pages/template.html new file mode 100755 index 0000000..079df52 --- /dev/null +++ b/pages/template.html @@ -0,0 +1,27 @@ + + + + + + + All news + + + + + +
+ + +

AllNews.com

+
+
+ + + + +
\ No newline at end of file diff --git a/scripts/infobae.js b/scripts/infobae.js index 24c5c3c..b48424a 100755 --- a/scripts/infobae.js +++ b/scripts/infobae.js @@ -26,7 +26,7 @@ console.log(all); //todo - Purificacion de la informacion for (let i = 0; i < paragraphs.length; i++) { - if (paragraphs[i].innerHTML == "SEGUIR LEYENDO:" || paragraphs[i].innerHTML == "SEGUIR LEYENDO" || paragraphs[i].innerHTML == "
") { + if (paragraphs[i].innerHTML == "SEGUIR LEYENDO:" || paragraphs[i].innerHTML == "SEGUIR LEYENDO" || paragraphs[i].innerHTML == "
" || paragraphs[i].innerHTML == 'Seguir leyendo:') { console.log("AAAAA"); trash.push(paragraphs[i]) diff --git a/scripts/tn.js b/scripts/tn.js old mode 100644 new mode 100755 diff --git a/style.css b/style.css index 7322397..9554949 100755 --- a/style.css +++ b/style.css @@ -7,7 +7,6 @@ html { font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; background: rgb(157,211,255); background: linear-gradient(180deg, rgba(157,211,255,1) 40%, rgba(205,233,255,1) 100%); - } header {