From bd74574f3c909610c8787f9f8974a6da3097dae3 Mon Sep 17 00:00:00 2001 From: acanas Date: Wed, 24 Nov 2021 22:57:10 +0100 Subject: [PATCH] =?UTF-8?q?Version=2021.62.2:=20=20Nov=2024,=202021=20=20F?= =?UTF-8?q?ixed=20bug=20in=20forums.=20Reported=20by=20Javier=20Fern=C3=A1?= =?UTF-8?q?ndez=20Baldomero.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- swad_changelog.h | 3 ++- swad_forum.c | 7 +++---- swad_forum_database.c | 6 +++--- swad_forum_database.h | 2 +- swad_string.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 9aeb42bb1..b9958e1f3 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.62.1 (2021-11-24)" +#define Log_PLATFORM_VERSION "SWAD 21.62.2 (2021-11-24)" #define CSS_FILE "swad21.59.css" #define JS_FILE "swad21.59.js" /* TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams + Version 21.62.2: Nov 24, 2021 Fixed bug in forums. Reported by Javier Fernández Baldomero. (319422 lines) Version 21.62.1: Nov 24, 2021 Added some header files. (319422 lines) Version 21.62: Nov 24, 2021 Code refactoring in photos. (319415 lines) Version 21.61: Nov 24, 2021 User's photo is shown near a mention. (319454 lines) diff --git a/swad_forum.c b/swad_forum.c index 95a3456ae..b0c01ca7b 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -870,7 +870,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums, Med_MediaConstructor (&Media); /***** Check if post is enabled *****/ - Enabled = For_DB_GetIfPstIsEnabled (Forums->PstCod); + Enabled = !For_DB_GetIfPstIsDisabled (Forums->PstCod); /***** Get data of post *****/ For_GetPstData (Forums->PstCod,&UsrDat.UsrCod,&CreatTimeUTC, @@ -1999,7 +1999,7 @@ static void For_ShowForumThreadsHighlightingOneThread (struct For_Forums *Forums /***** Fill the list of threads for current page *****/ mysql_data_seek (mysql_res,(my_ulonglong) (PaginationThrs.FirstItemVisible - 1)); - for (NumThr = PaginationThrs.FirstItemVisible, NumThrInScreen = 0; + for (NumThr = PaginationThrs.FirstItemVisible, NumThrInScreen = 0; NumThr <= PaginationThrs.LastItemVisible; NumThr++, NumThrInScreen++) /* Get thread code(row[0]) */ @@ -2351,8 +2351,7 @@ static void For_GetThreadData (struct For_Thread *Thr) for (Order = Dat_STR_TIME; Order <= Dat_END_TIME; Order++) - Thr->Enabled[Order] = For_DB_GetIfPstIsEnabled (Thr->PstCod[Order]); - // Thr->Enabled[Order] = true; + Thr->Enabled[Order] = !For_DB_GetIfPstIsDisabled (Thr->PstCod[Order]); /***** Get number of posts in this thread *****/ Thr->NumPosts = For_DB_GetNumPstsInThr (Thr->ThrCod); diff --git a/swad_forum_database.c b/swad_forum_database.c index 8d28ef0ef..b829374c0 100644 --- a/swad_forum_database.c +++ b/swad_forum_database.c @@ -935,14 +935,14 @@ void For_DB_InsertPstIntoDisabled (long PstCod) } /*****************************************************************************/ -/*********************** Get if a forum post is enabled **********************/ +/*********************** Get if a forum post is disabled *********************/ /*****************************************************************************/ -bool For_DB_GetIfPstIsEnabled (long PstCod) +bool For_DB_GetIfPstIsDisabled (long PstCod) { /***** Trivial check: post code should be > 0 *****/ if (PstCod <= 0) - return false; + return true; /***** Get if post is disabled from database *****/ return diff --git a/swad_forum_database.h b/swad_forum_database.h index ae914cf27..325fcac70 100644 --- a/swad_forum_database.h +++ b/swad_forum_database.h @@ -96,7 +96,7 @@ void For_DB_RemoveExpiredClipboards (void); //--------------------------- Disabled posts ---------------------------------- void For_DB_InsertPstIntoDisabled (long PstCod); -bool For_DB_GetIfPstIsEnabled (long PstCod); +bool For_DB_GetIfPstIsDisabled (long PstCod); void For_DB_RemovePstFromDisabled (long PstCod); void For_DB_RemoveDisabledPstsInThread (long ThrCod); diff --git a/swad_string.c b/swad_string.c index 0a35eddfb..7802c705e 100644 --- a/swad_string.c +++ b/swad_string.c @@ -572,7 +572,7 @@ static Str_LinkType_t Str_CheckNickname (char **PtrSrc,char PrevCh, ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL); Pho_BuildHTMLUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO15x20",Pho_ZOOM, + "PHOTO12x16",Pho_ZOOM, &CaptionStr, &ImgStr); if (asprintf (&(*Link)->Nick.Anchor3.Str,