Version 16.176.3

This commit is contained in:
Antonio Cañas Vargas 2017-04-12 20:56:45 +02:00
parent 5976d0d791
commit 9e1d2dd0e7
3 changed files with 3 additions and 143 deletions

View File

@ -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.

View File

@ -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,"<ul class=\"LIST_LEFT\">");
For_WriteLinkToTopLevelOfForums ();
* Write a link to current forum *
IsLastItemInLevel[1] = true;
For_WriteLinkToAForum (Gbl.Forum.Type,Gbl.Forum.Cod,
true,true,1,IsLastItemInLevel);
* Write thread title *
fprintf (Gbl.F.Out,"<li class=\"DAT\" style=\"height:25px;\">");
IsLastItemInLevel[2] = true;
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
fprintf (Gbl.F.Out,"<img src=\"%s/%s16x16.gif\""
" alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" /> ",
Gbl.Prefs.IconsURL,
Thr.NumUnreadPosts ? "msg-unread" :
"msg-open",
Thr.NumUnreadPosts ? Txt_There_are_new_posts :
Txt_No_new_posts,
Thr.NumUnreadPosts ? Txt_There_are_new_posts :
Txt_No_new_posts);
For_WriteThrSubject (ThrCod);
*/
/***** Get posts of a thread from database *****/
sprintf (Query,"SELECT PstCod,UNIX_TIMESTAMP(CreatTime) FROM forum_post"
" WHERE ThrCod=%ld ORDER BY PstCod",
ThrCod);
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get posts of a thread");
NumPsts = (unsigned) NumRows;
/*
/ Write number of posts and number of new posts /
fprintf (Gbl.F.Out," ");
For_WriteNumPsts (NumPsts);
fprintf (Gbl.F.Out,"</li>"
"</ul>");
Lay_EndRoundFrame ();
*/
LastSubject[0] = '\0';
if (NumPsts) // If there are posts...
{
@ -1190,26 +1142,6 @@ static void For_PutIconNewThread (void)
fprintf (Gbl.F.Out,"</a>");
}
/*****************************************************************************/
/*************************** 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 ();

View File

@ -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";