diff --git a/swad_changelog.h b/swad_changelog.h index 8a8edb872..6f63c3a93 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -598,10 +598,11 @@ 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 */ -#define Log_PLATFORM_VERSION "SWAD 20.36.47 (2021-03-01)" +#define Log_PLATFORM_VERSION "SWAD 20.36.48 (2021-03-01)" #define CSS_FILE "swad20.33.9.css" #define JS_FILE "swad20.6.2.js" /* + Version 20.36.48: Mar 01, 2021 Query moved to module swad_timeline_database. (305553 lines) Version 20.36.47: Mar 01, 2021 Query moved to module swad_timeline_database. (305543 lines) Version 20.36.46: Mar 01, 2021 Fixed bugs in timeline. (305529 lines) Version 20.36.45: Mar 01, 2021 Queries moved to module swad_timeline_database. (305528 lines) diff --git a/swad_timeline_database.c b/swad_timeline_database.c index ec8995bfe..2c7c43c1f 100644 --- a/swad_timeline_database.c +++ b/swad_timeline_database.c @@ -73,7 +73,7 @@ extern struct Globals Gbl; static long TL_DB_GetMedCodFromPub (long PubCod,const char *DBTable); /*****************************************************************************/ -/********************* Get data of note using its code ***********************/ +/********************* Get which users to show in timeline *******************/ /*****************************************************************************/ // Returns the number of rows got @@ -81,12 +81,26 @@ unsigned TL_DB_GetWho (MYSQL_RES **mysql_res) { /***** Get which users from database *****/ return (unsigned) - DB_QuerySELECT (mysql_res,"can not get timeline users", + DB_QuerySELECT (mysql_res,"can not get which timeline users", "SELECT TimelineUsrs" // row[0] " FROM usr_last WHERE UsrCod=%ld", Gbl.Usrs.Me.UsrDat.UsrCod); } +/*****************************************************************************/ +/********************* Get which users to show in timeline *******************/ +/*****************************************************************************/ + +void TL_DB_UpdateWho (Usr_Who_t Who) + { + /***** Update which users in database *****/ + DB_QueryUPDATE ("can not update which timeline users", + "UPDATE usr_last SET TimelineUsrs=%u" + " WHERE UsrCod=%ld", + (unsigned) Who, + Gbl.Usrs.Me.UsrDat.UsrCod); + } + /*****************************************************************************/ /********************* Get data of note using its code ***********************/ /*****************************************************************************/ diff --git a/swad_timeline_database.h b/swad_timeline_database.h index a3d143c34..cc3fdda80 100644 --- a/swad_timeline_database.h +++ b/swad_timeline_database.h @@ -49,6 +49,7 @@ /****************************** Timeline from who ****************************/ unsigned TL_DB_GetWho (MYSQL_RES **mysql_res); +void TL_DB_UpdateWho (Usr_Who_t Who); /*********************************** Notes ***********************************/ unsigned TL_DB_GetDataOfNoteByCod (long NotCod,MYSQL_RES **mysql_res); diff --git a/swad_timeline_who.c b/swad_timeline_who.c index eb5e2788d..8ac7aef2e 100644 --- a/swad_timeline_who.c +++ b/swad_timeline_who.c @@ -164,11 +164,7 @@ void TL_Who_SaveWhoInDB (struct TL_Timeline *Timeline) /***** Update which users in database *****/ // Who is stored in usr_last for next time I log in - DB_QueryUPDATE ("can not update timeline users in user's last data", - "UPDATE usr_last SET TimelineUsrs=%u" - " WHERE UsrCod=%ld", - (unsigned) Timeline->Who, - Gbl.Usrs.Me.UsrDat.UsrCod); + TL_DB_UpdateWho (Timeline->Who); } }