Version 20.36.10: Feb 27, 2021 Query moved to module swad_timeline_database.

This commit is contained in:
acanas 2021-02-27 14:57:13 +01:00
parent 8c0f882f60
commit c2a05d146d
4 changed files with 19 additions and 7 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.9 (2021-02-07)"
#define Log_PLATFORM_VERSION "SWAD 20.36.10 (2021-02-07)"
#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.10: Feb 27, 2021 Query moved to module swad_timeline_database. (305243 lines)
Version 20.36.9: Feb 27, 2021 Query moved to module swad_timeline_database. (305233 lines)
Version 20.36.8: Feb 27, 2021 Function moved to module swad_timeline_database. (305215 lines)
Version 20.36.7: Feb 27, 2021 Query moved to module swad_timeline_database. (305212 lines)

View File

@ -141,6 +141,21 @@ unsigned TL_DB_GetNumCommentsInNote (long NotCod)
NotCod,(unsigned) TL_Pub_COMMENT_TO_NOTE);
}
/*****************************************************************************/
/************** Get publication codes of comments of a note from database *****************/
/*****************************************************************************/
// Returns the number of rows got
unsigned TL_DB_GetComments (long NotCod,MYSQL_RES **mysql_res)
{
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get comments",
"SELECT PubCod" // row[0]
" FROM tl_pubs"
" WHERE NotCod=%ld AND PubType=%u",
NotCod,(unsigned) TL_Pub_COMMENT_TO_NOTE);
}
/*****************************************************************************/
/************** Get initial comments of a note from database *****************/
/*****************************************************************************/

View File

@ -57,6 +57,7 @@ void TL_DB_InsertNoteInVisibleTimeline (long NotCod);
/* Comments */
unsigned TL_DB_GetNumCommentsInNote (long NotCod);
unsigned TL_DB_GetComments (long NotCod,MYSQL_RES **mysql_res);
unsigned TL_DB_GetInitialComments (long NotCod,
unsigned NumInitialCommentsToGet,
MYSQL_RES **mysql_res);

View File

@ -1207,12 +1207,7 @@ static void TL_Not_RemoveNoteMediaAndDBEntries (struct TL_Not_Note *Not)
/***** Remove comments associated to this note *****/
/* Get comments of this note */
NumComments = DB_QuerySELECT (&mysql_res,"can not get comments",
"SELECT PubCod"
" FROM tl_pubs"
" WHERE NotCod=%ld AND PubType=%u",
Not->NotCod,
(unsigned) TL_Pub_COMMENT_TO_NOTE);
NumComments = TL_DB_GetComments (Not->NotCod,&mysql_res);
/* For each comment... */
for (NumCom = 0;