From f15cdecd02e270e01925e52c636d28a3f56585ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 11 Apr 2017 14:27:45 +0200 Subject: [PATCH] Version 16.175.1 --- swad_changelog.h | 5 +++-- swad_forum.c | 37 ++++++++++++++++++++++++++++--------- swad_text.c | 21 --------------------- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 32af3f5eb..59d3491f9 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -212,14 +212,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.175 (2017-04-11)" +#define Log_PLATFORM_VERSION "SWAD 16.175.1 (2017-04-11)" #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.175: Apr 11, 2017 Code refactoring in forums. (217669 lines) + Version 16.175.1: Apr 11, 2017 Changes in layout of forums. (217667 lines) + Version 16.175: Apr 11, 2017 Code refactoring and changes in layout of forums. (217669 lines) Version 16.174.1: Apr 10, 2017 Change in layout of frames (white boxes). New '+' icon in list of forum threads to add a new thread. (217591 lines) Version 16.174: Apr 07, 2017 Suffix .en added to help URLs in English. (217568 lines) diff --git a/swad_forum.c b/swad_forum.c index 497794d62..4ad21c86b 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -238,7 +238,9 @@ const Act_Action_t For_ActionsDisPstFor[For_NUM_TYPES_FORUM] = ActDisPstForSWATch, }; -#define For_ID_NEW_THREAD_SECTION "new_thread" // Link to go to
+// Links to go to
+#define For_ID_FORUM_THREADS_SECTION "forum_threads" +#define For_ID_NEW_THREAD_SECTION "new_thread" // Forum images will be saved with: // - maximum width of For_IMAGE_SAVED_MAX_HEIGHT @@ -2416,7 +2418,7 @@ static void For_WriteLinkToForum (For_ForumType_t ForumType,long Cod, } /***** Write link to forum *****/ - Act_FormStart (NextAct); + Act_FormStartAnchor (NextAct,For_ID_FORUM_THREADS_SECTION); For_PutParamWhichForum (); For_PutParamForumOrder (); switch (ForumType) @@ -2636,7 +2638,7 @@ static unsigned For_GetNumOfPostsInThrNewerThan (long ThrCod,const char *Time) void For_ShowForumThrs (void) { extern const char *Hlp_SOCIAL_Forums; - extern const char *Txt_Threads; + extern const char *Txt_Forum; extern const char *Txt_MSG_Subject; extern const char *Txt_FORUM_THREAD_HELP_ORDER[2]; extern const char *Txt_FORUM_THREAD_ORDER[2]; @@ -2648,6 +2650,8 @@ void For_ShowForumThrs (void) char Query[2048]; MYSQL_RES *mysql_res; MYSQL_ROW row; + char FrameTitle[128 + For_MAX_BYTES_FORUM_NAME]; + char ForumName[For_MAX_BYTES_FORUM_NAME + 1]; unsigned NumThr; unsigned NumThrs; unsigned NumThrInScreen; // From 0 to Pag_ITEMS_PER_PAGE-1 @@ -2669,6 +2673,14 @@ void For_ShowForumThrs (void) /***** Show list of available forums *****/ For_ShowForumList (); + /***** Set forum name *****/ + For_SetForumName (Gbl.Forum.Type, + &Gbl.Forum.Ins, + &Gbl.Forum.Ctr, + &Gbl.Forum.Deg, + &Gbl.Forum.Crs, + ForumName,Gbl.Prefs.Language,true); + /***** Get page number *****/ Pag_GetParamPagNum (Pag_THREADS_FORUM); @@ -2742,6 +2754,12 @@ void For_ShowForumThrs (void) /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); + /***** Start frame for threads of this forum *****/ + fprintf (Gbl.F.Out,"
",For_ID_FORUM_THREADS_SECTION); + sprintf (FrameTitle,"%s: %s",Txt_Forum,ForumName); + Lay_StartRoundFrame (NULL,FrameTitle,For_PutIconNewThread, + Hlp_SOCIAL_Forums); + /***** List the threads *****/ if (NumThrs) { @@ -2749,12 +2767,9 @@ void For_ShowForumThrs (void) if (PaginationThrs.MoreThanOnePage) Pag_WriteLinksToPagesCentered (Pag_THREADS_FORUM,0,&PaginationThrs); - /***** Start table *****/ - Lay_StartRoundFrameTable (NULL,Txt_Threads,For_PutIconNewThread, - Hlp_SOCIAL_Forums,2); - /***** Heading row *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" + "" "" @@ -2807,7 +2822,7 @@ void For_ShowForumThrs (void) For_ListForumThrs (ThrCods,&PaginationThrs); /***** End table *****/ - Lay_EndRoundFrameTable (); + fprintf (Gbl.F.Out,"
" "
"); /***** Write links to all the pages in the listing of threads *****/ if (PaginationThrs.MoreThanOnePage) @@ -2818,6 +2833,10 @@ void For_ShowForumThrs (void) fprintf (Gbl.F.Out,"
",For_ID_NEW_THREAD_SECTION); For_WriteFormForumPst (false,-1,NULL); fprintf (Gbl.F.Out,"
"); + + /***** End frame with threads of this forum ****/ + Lay_EndRoundFrame (); + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ diff --git a/swad_text.c b/swad_text.c index b0d053c96..9b4bda19a 100644 --- a/swad_text.c +++ b/swad_text.c @@ -47528,27 +47528,6 @@ const char *Txt_Thread_with_posts_from_you = "Thread with posts from you."; // Necessita de tradução #endif -const char *Txt_Threads = -#if L==1 - "Discussions"; -#elif L==2 - "Threads"; -#elif L==3 - "Threads"; -#elif L==4 - "Discusiones"; -#elif L==5 - "Fils"; -#elif L==6 - "Discusiones"; // Okoteve traducción -#elif L==7 - "Discussione"; -#elif L==8 - "Wątki"; -#elif L==9 - "Threads"; -#endif - const char *Txt_threads = #if L==1 "discussions";