Version 21.62.2: Nov 24, 2021 Fixed bug in forums. Reported by Javier Fernández Baldomero.

This commit is contained in:
acanas 2021-11-24 22:57:10 +01:00
parent 1c4b559ab2
commit bd74574f3c
5 changed files with 10 additions and 10 deletions

View File

@ -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. 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 CSS_FILE "swad21.59.css"
#define JS_FILE "swad21.59.js" #define JS_FILE "swad21.59.js"
/* /*
TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams 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.1: Nov 24, 2021 Added some header files. (319422 lines)
Version 21.62: Nov 24, 2021 Code refactoring in photos. (319415 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) Version 21.61: Nov 24, 2021 User's photo is shown near a mention. (319454 lines)

View File

@ -870,7 +870,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums,
Med_MediaConstructor (&Media); Med_MediaConstructor (&Media);
/***** Check if post is enabled *****/ /***** Check if post is enabled *****/
Enabled = For_DB_GetIfPstIsEnabled (Forums->PstCod); Enabled = !For_DB_GetIfPstIsDisabled (Forums->PstCod);
/***** Get data of post *****/ /***** Get data of post *****/
For_GetPstData (Forums->PstCod,&UsrDat.UsrCod,&CreatTimeUTC, 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 *****/ /***** Fill the list of threads for current page *****/
mysql_data_seek (mysql_res,(my_ulonglong) (PaginationThrs.FirstItemVisible - 1)); 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 <= PaginationThrs.LastItemVisible;
NumThr++, NumThrInScreen++) NumThr++, NumThrInScreen++)
/* Get thread code(row[0]) */ /* Get thread code(row[0]) */
@ -2351,8 +2351,7 @@ static void For_GetThreadData (struct For_Thread *Thr)
for (Order = Dat_STR_TIME; for (Order = Dat_STR_TIME;
Order <= Dat_END_TIME; Order <= Dat_END_TIME;
Order++) Order++)
Thr->Enabled[Order] = For_DB_GetIfPstIsEnabled (Thr->PstCod[Order]); Thr->Enabled[Order] = !For_DB_GetIfPstIsDisabled (Thr->PstCod[Order]);
// Thr->Enabled[Order] = true;
/***** Get number of posts in this thread *****/ /***** Get number of posts in this thread *****/
Thr->NumPosts = For_DB_GetNumPstsInThr (Thr->ThrCod); Thr->NumPosts = For_DB_GetNumPstsInThr (Thr->ThrCod);

View File

@ -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 *****/ /***** Trivial check: post code should be > 0 *****/
if (PstCod <= 0) if (PstCod <= 0)
return false; return true;
/***** Get if post is disabled from database *****/ /***** Get if post is disabled from database *****/
return return

View File

@ -96,7 +96,7 @@ void For_DB_RemoveExpiredClipboards (void);
//--------------------------- Disabled posts ---------------------------------- //--------------------------- Disabled posts ----------------------------------
void For_DB_InsertPstIntoDisabled (long PstCod); 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_RemovePstFromDisabled (long PstCod);
void For_DB_RemoveDisabledPstsInThread (long ThrCod); void For_DB_RemoveDisabledPstsInThread (long ThrCod);

View File

@ -572,7 +572,7 @@ static Str_LinkType_t Str_CheckNickname (char **PtrSrc,char PrevCh,
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL); ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_BuildHTMLUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : Pho_BuildHTMLUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO15x20",Pho_ZOOM, "PHOTO12x16",Pho_ZOOM,
&CaptionStr, &CaptionStr,
&ImgStr); &ImgStr);
if (asprintf (&(*Link)->Nick.Anchor3.Str, if (asprintf (&(*Link)->Nick.Anchor3.Str,