From 0c2299160fc16a0cf5f0fd3f252dab90132d31ee Mon Sep 17 00:00:00 2001 From: acanas Date: Sun, 21 Nov 2021 11:52:19 +0100 Subject: [PATCH] Version 21.58.2: Nov 21, 2021 Code refactoring in timeline. --- swad_changelog.h | 3 ++- swad_timeline_database.c | 4 ++-- swad_timeline_publication.c | 4 ++-- swad_timeline_publication.h | 7 +++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index be41ee4a..4b22f1f1 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. */ -#define Log_PLATFORM_VERSION "SWAD 21.58.1 (2021-11-21)" +#define Log_PLATFORM_VERSION "SWAD 21.58.2 (2021-11-21)" #define CSS_FILE "swad21.57.css" #define JS_FILE "swad21.58.js" /* TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams + Version 21.58.2: Nov 21, 2021 Code refactoring in timeline. (319135 lines) Version 21.58.1: Nov 21, 2021 Code refactoring in timeline. (319131 lines) Version 21.58: Nov 21, 2021 Code refactoring in timeline. (319140 lines) Version 21.57.5: Nov 18, 2021 Code refactoring related to check if user logged is me. (319174 lines) diff --git a/swad_timeline_database.c b/swad_timeline_database.c index 06a97818..940cb64f 100644 --- a/swad_timeline_database.c +++ b/swad_timeline_database.c @@ -933,8 +933,8 @@ unsigned Tml_DB_SelectTheMostRecentPub (MYSQL_RES **mysql_res, " ORDER BY tml_pubs.PubCod DESC" " LIMIT 1", SubQueries->Publishers.Table, - SubQueries->RangeBottom, - SubQueries->RangeTop, + SubQueries->Range.Bottom, + SubQueries->Range.Top, SubQueries->Publishers.SubQuery); } diff --git a/swad_timeline_publication.c b/swad_timeline_publication.c index 3a2bc951..7e1edabf 100644 --- a/swad_timeline_publication.c +++ b/swad_timeline_publication.c @@ -109,7 +109,7 @@ void Tml_Pub_GetListPubsToShowInTimeline (struct Tml_Timeline *Timeline) Bottom pub. code remains unchanged in all iterations of the loop. */ Tml_DB_CreateSubQueryRange (Tml_Pub_BOTTOM, RangePubsToGet.Bottom, - SubQueries.RangeBottom); + SubQueries.Range.Bottom); /***** Initialize list of publications *****/ /* Chained list of publications: @@ -158,7 +158,7 @@ void Tml_Pub_GetListPubsToShowInTimeline (struct Tml_Timeline *Timeline) In each iteration of this loop, top publication code is changed to a lower value */ Tml_DB_CreateSubQueryRange (Tml_Pub_TOP, RangePubsToGet.Top, - SubQueries.RangeTop); + SubQueries.Range.Top); /* Select the most recent publication from tml_pubs */ Pub = Tml_Pub_SelectTheMostRecentPub (&SubQueries); diff --git a/swad_timeline_publication.h b/swad_timeline_publication.h index 18a1c7f8..95192eb4 100644 --- a/swad_timeline_publication.h +++ b/swad_timeline_publication.h @@ -93,8 +93,11 @@ struct Tml_Pub_SubQueries char *Table; char SubQuery[Tml_Pub_MAX_BYTES_SUBQUERY + 1]; } Publishers; - char RangeBottom [Tml_Pub_MAX_BYTES_SUBQUERY + 1]; - char RangeTop [Tml_Pub_MAX_BYTES_SUBQUERY + 1]; + struct + { + char Top [Tml_Pub_MAX_BYTES_SUBQUERY + 1]; + char Bottom[Tml_Pub_MAX_BYTES_SUBQUERY + 1]; + } Range; }; /*****************************************************************************/