Version 20.36.3: Feb 26, 2021 Query moved to module swad_timeline_database.

This commit is contained in:
acanas 2021-02-26 23:13:06 +01:00
parent fd3aa49331
commit fad1befb90
4 changed files with 25 additions and 9 deletions

View File

@ -553,7 +553,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 20.36.2 (2021-02-26)"
#define Log_PLATFORM_VERSION "SWAD 20.36.3 (2021-02-26)"
#define CSS_FILE "swad20.33.9.css"
#define JS_FILE "swad20.6.2.js"
/*
@ -601,6 +601,7 @@ TODO: DNI de un estudiante sale err
TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede.
TODO: Salvador Romero Cortés: @acanas opción para editar posts
Version 20.36.3: Feb 26, 2021 Query moved to module swad_timeline_database. (305140 lines)
Version 20.36.2: Feb 26, 2021 Query moved to module swad_timeline_database. (305126 lines)
Version 20.36.1: Feb 26, 2021 Function moved to module swad_timeline_database. (305113 lines)
Version 20.36: Feb 26, 2021 New module swad_timeline_database. (305133 lines)

View File

@ -727,14 +727,7 @@ static long TL_Com_ReceiveComment (void)
TL_Pub_PublishPubInTimeline (&Pub); // Set Pub.PubCod
/* Insert comment content in the database */
DB_QueryINSERT ("can not store comment content",
"INSERT INTO tl_comments"
" (PubCod,Txt,MedCod)"
" VALUES"
" (%ld,'%s',%ld)",
Pub.PubCod,
Content.Txt,
Content.Media.MedCod);
TL_DB_InsertCommentContent (Pub.PubCod,&Content);
/***** Store notifications about the new comment *****/
Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TIMELINE_COMMENT,Pub.PubCod);

View File

@ -27,6 +27,7 @@
#include "swad_database.h"
#include "swad_timeline.h"
#include "swad_timeline_database.h"
#include "swad_timeline_publication.h"
/*****************************************************************************/
@ -117,3 +118,21 @@ unsigned TL_DB_GetFinalComments (long NotCod,
NotCod,(unsigned) TL_Pub_COMMENT_TO_NOTE,
NumFinalCommentsToGet);
}
/*****************************************************************************/
/******************* Insert comment content in database **********************/
/*****************************************************************************/
void TL_DB_InsertCommentContent (long PubCod,
const struct TL_Pst_PostContent *Content)
{
/***** Insert comment content in database *****/
DB_QueryINSERT ("can not store comment content",
"INSERT INTO tl_comments"
" (PubCod,Txt,MedCod)"
" VALUES"
" (%ld,'%s',%ld)",
PubCod,
Content->Txt,
Content->Media.MedCod);
}

View File

@ -28,6 +28,7 @@
/*****************************************************************************/
#include "swad_database.h"
#include "swad_timeline_post.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
@ -48,5 +49,7 @@ unsigned TL_DB_GetInitialComments (long NotCod,
unsigned TL_DB_GetFinalComments (long NotCod,
unsigned NumFinalCommentsToGet,
MYSQL_RES **mysql_res);
void TL_DB_InsertCommentContent (long PubCod,
const struct TL_Pst_PostContent *Content);
#endif