From 9e1d2dd0e72fe40fe1aba7f63b069262ffff7d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 12 Apr 2017 20:56:45 +0200 Subject: [PATCH] Version 16.176.3 --- swad_changelog.h | 3 +- swad_forum.c | 122 +---------------------------------------------- swad_text.c | 21 -------- 3 files changed, 3 insertions(+), 143 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 79777daf0..2f79cfa79 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -212,13 +212,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.176.2 (2017-04-12)" +#define Log_PLATFORM_VERSION "SWAD 16.176.3 (2017-04-12)" #define CSS_FILE "swad16.174.1.css" #define JS_FILE "swad16.144.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* + Version 16.176.3: Apr 12, 2017 Remove unused code in forums. (217582 lines) Version 16.176.2: Apr 12, 2017 Changes in layout of forums. (217705 lines) Version 16.176.1: Apr 11, 2017 Changes in layout of forums. (217699 lines) Version 16.176: Apr 11, 2017 Code refactoring in pagination. diff --git a/swad_forum.c b/swad_forum.c index 42b294936..43465cf98 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -286,7 +286,6 @@ static void For_ShowThreadPosts (long ThrCod); static void For_PutIconsForums (void); static void For_PutIconNewThread (void); -// static void For_WriteNumPsts (unsigned NumPsts); static void For_ShowAForumPost (struct ForumThread *Thr,unsigned PstNum,long PstCod, bool LastPst,char LastSubject[Cns_MAX_BYTES_SUBJECT + 1], bool NewPst,bool ICanModerateForum); @@ -331,7 +330,7 @@ static void For_WriteFormForumPst (bool IsReply,long ThrCod,const char *Subject) static void For_UpdateNumUsrsNotifiedByEMailAboutPost (long PstCod,unsigned NumUsrsToBeNotifiedByEMail); static void For_WriteNumberOfThrs (unsigned NumThrs,unsigned NumThrsWithNewPosts); static void For_WriteNumThrsAndPsts (unsigned NumThrs,unsigned NumThrsWithNewPosts,unsigned NumPosts); -// static void For_WriteThrSubject (long ThrCod); + static void For_GetParamsForum (void); static long For_GetParamThrCod (void); static void For_PutHiddenParamPstCod (long PstCod); @@ -971,10 +970,6 @@ static void For_ShowThreadPosts (long ThrCod) { extern const char *Hlp_SOCIAL_Forums; extern const char *Txt_Thread; - // extern const char *Txt_There_are_new_posts; - // extern const char *Txt_No_new_posts; - // extern const char *Txt_Posts; - // bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]; struct ForumThread Thr; char LastSubject[Cns_MAX_BYTES_SUBJECT + 1]; char FrameTitle[128 + Cns_MAX_BYTES_SUBJECT]; @@ -1013,55 +1008,12 @@ static void For_ShowThreadPosts (long ThrCod) sprintf (FrameTitle,"%s: %s",Txt_Thread,Thr.Subject); Lay_StartRoundFrame (NULL,FrameTitle,NULL,Hlp_SOCIAL_Forums); -/* - * Table start * - Lay_StartRoundFrame (NULL,Txt_Thread,For_PutIconsForums,Hlp_SOCIAL_Forums); - - * Put a form to select which forums * - For_PutFormWhichForums (); - - * Write a link to top level of forums * - fprintf (Gbl.F.Out,""); - Lay_EndRoundFrame (); -*/ LastSubject[0] = '\0'; if (NumPsts) // If there are posts... { @@ -1190,26 +1142,6 @@ static void For_PutIconNewThread (void) fprintf (Gbl.F.Out,""); } -/*****************************************************************************/ -/*************************** Write number of posts ***************************/ -/*****************************************************************************/ -/* -static void For_WriteNumPsts (unsigned NumPsts) - { - extern const char *Txt_post; - extern const char *Txt_posts; - - fprintf (Gbl.F.Out,"["); - - ***** Write total number of posts ***** - if (NumPsts == 1) - fprintf (Gbl.F.Out,"1 %s",Txt_post); - else - fprintf (Gbl.F.Out,"%u %s",NumPsts,Txt_posts); - - fprintf (Gbl.F.Out,"]"); - } -*/ /*****************************************************************************/ /**************************** Show a post from forum *************************/ /*****************************************************************************/ @@ -3791,52 +3723,6 @@ void For_GetThrData (struct ForumThread *Thr) Thr->NumReaders = For_GetNumOfReadersOfThr (Thr->ThrCod); } -/*****************************************************************************/ -/************* Write the subject of the first message of a thread ************/ -/*****************************************************************************/ -/* -static void For_WriteThrSubject (long ThrCod) - { - extern const char *Txt_no_subject; - extern const char *Txt_first_message_not_allowed; - char Query[512]; - MYSQL_RES *mysql_res; - MYSQL_ROW row; - unsigned long NumRows; - long FirstPstCod; - - ***** Get subject of a thread from database ***** - sprintf (Query,"SELECT forum_post.PstCod,forum_post.Subject" - " FROM forum_thread,forum_post" - " WHERE forum_thread.ThrCod=%ld" - " AND forum_thread.FirstPstCod=forum_post.PstCod", - ThrCod); - NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get the subject of a thread"); - - ***** The result of the query should have only one row ***** - if (NumRows != 1) - Lay_ShowErrorAndExit ("Error when getting the subject of a thread."); - row = mysql_fetch_row (mysql_res); - - ***** Get message code ***** - if (sscanf (row[0],"%ld",&FirstPstCod) != 1) - Lay_ShowErrorAndExit ("Error when getting the subject of a thread."); - - ***** Write the subject of the thread ***** - if (For_GetIfPstIsEnabled (FirstPstCod)) - { - if (row[1][0]) - fprintf (Gbl.F.Out,"%s",row[1]); - else - fprintf (Gbl.F.Out,"[%s]",Txt_no_subject); - } - else - fprintf (Gbl.F.Out,"[%s]",Txt_first_message_not_allowed); - - ***** Free the structure that stores the query result ***** - DB_FreeMySQLResult (&mysql_res); - } -*/ /*****************************************************************************/ /**************** Show posts of a thread in a discussion forum ***************/ /*****************************************************************************/ @@ -3954,12 +3840,6 @@ static long For_GetParamPstCod (void) static void For_ShowForumLevel2 (long ThrCod) { - /***** Get order type, degree and course of the forum *****/ - // For_GetParamsForum (); - - /***** Set forum type *****/ - // For_SetForumTypeAndRestrictAccess (); - /***** Show forums and threads *****/ For_ShowForumThrs (); diff --git a/swad_text.c b/swad_text.c index 9b4bda19a..6bb1bef33 100644 --- a/swad_text.c +++ b/swad_text.c @@ -29972,27 +29972,6 @@ const char *Txt_post = "post"; #endif -const char *Txt_Posts = -#if L==1 - "Missatges"; -#elif L==2 - "Nachrichten"; -#elif L==3 - "Posts"; -#elif L==4 - "Mensajes"; -#elif L==5 - "Messages"; -#elif L==6 - "Marandu"; -#elif L==7 - "Post"; -#elif L==8 - "Posty"; -#elif L==9 - "Posts"; -#endif - const char *Txt_posts = #if L==1 "missatges";