From 312e7b14eb86a655cbe4459fa24f684063970456 Mon Sep 17 00:00:00 2001 From: acanas Date: Wed, 10 Feb 2021 19:53:57 +0100 Subject: [PATCH] Version20.22 --- swad_action.c | 146 +++++----- swad_action.h | 72 ++--- swad_changelog.h | 3 +- swad_layout.c | 46 ++-- swad_menu.c | 2 +- swad_notification.c | 10 +- swad_profile.c | 2 +- swad_profile.h | 2 +- swad_text.c | 4 +- swad_text_action.c | 72 ++--- swad_timeline.c | 560 +++++++++++++++++++------------------- swad_timeline.h | 6 +- swad_timeline_favourite.c | 244 ++++++++--------- swad_timeline_favourite.h | 8 +- swad_timeline_share.c | 126 ++++----- swad_timeline_share.h | 4 +- swad_user.c | 2 +- 17 files changed, 655 insertions(+), 654 deletions(-) diff --git a/swad_action.c b/swad_action.c index 732ebc6f4..5b14263a2 100644 --- a/swad_action.c +++ b/swad_action.c @@ -110,7 +110,7 @@ extern struct Globals Gbl; /************************* Private global variables **************************/ /*****************************************************************************/ -#define Act_DEFAULT_ACTION_AFTER_LOGIN ActSeeSocTmlGbl +#define Act_DEFAULT_ACTION_AFTER_LOGIN ActSeeTmlGbl const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = { @@ -125,7 +125,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = // TabStr ****************************************************************** [ActFrmLogIn ] = {1521, 0,TabStr,ActFrmLogIn , 0,0x001,0x001,0x001,0x001,0x001,0x001,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WriteLandingPage ,"power-off" }, [ActReqSch ] = { 627, 1,TabStr,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Sch_ReqSysSearch ,"search" }, - [ActSeeSocTmlGbl ] = {1490, 2,TabStr,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ShowTimelineGbl ,"comment-dots" }, + [ActSeeTmlGbl ] = {1490, 2,TabStr,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ShowTimelineGbl ,"comment-dots" }, [ActSeeSocPrf ] = {1520, 3,TabStr,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_SeeSocialProfiles ,"user-circle" }, [ActSeeCal ] = {1622, 4,TabStr,ActSeeCal ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cal_ShowCalendar ,"calendar" }, [ActSeeNtf ] = { 990, 5,TabStr,ActSeeNtf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ntf_ShowMyNotifications ,"bell" }, @@ -140,44 +140,44 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = [ActSch ] = { 628,-1,TabUnk,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,Sch_GetParamsSearch ,Sch_SysSearch ,NULL}, - [ActRefNewSocPubGbl ] = {1509,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_AJAX_RFRESH,TL_GetParamWho ,TL_RefreshNewTimelineGbl ,NULL}, - [ActRefOldSocPubGbl ] = {1510,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,TL_GetParamWho ,TL_RefreshOldTimelineGbl ,NULL}, - [ActRcvSocPstGbl ] = {1492,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ReceivePostGbl ,NULL}, - [ActRcvSocComGbl ] = {1503,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ReceiveCommentGbl ,NULL}, - [ActShoHidSocComGbl ] = {1806,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_ShowHiddenCommentsGbl ,NULL}, - [ActAllShaSocNotGbl ] = {1766,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShowAllSharersNoteGbl ,NULL}, - [ActAllFavSocNotGbl ] = {1767,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversNoteGbl ,NULL}, - [ActAllFavSocComGbl ] = {1768,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversComGbl ,NULL}, - [ActShaSocNotGbl ] = {1495,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShaNoteGbl ,NULL}, - [ActUnsSocNotGbl ] = {1496,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_UnsNoteGbl ,NULL}, - [ActFavSocNotGbl ] = {1512,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavNoteGbl ,NULL}, - [ActUnfSocNotGbl ] = {1513,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfNoteGbl ,NULL}, - [ActFavSocComGbl ] = {1516,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavCommentGbl ,NULL}, - [ActUnfSocComGbl ] = {1517,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfCommentGbl ,NULL}, - [ActReqRemSocPubGbl ] = {1494,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RequestRemNoteGbl ,NULL}, - [ActRemSocPubGbl ] = {1493,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RemoveNoteGbl ,NULL}, - [ActReqRemSocComGbl ] = {1505,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RequestRemComGbl ,NULL}, - [ActRemSocComGbl ] = {1507,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RemoveComGbl ,NULL}, + [ActRefNewTL_PubGbl ] = {1509,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_AJAX_RFRESH,TL_GetParamWho ,TL_RefreshNewTimelineGbl ,NULL}, + [ActRefOldTL_PubGbl ] = {1510,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,TL_GetParamWho ,TL_RefreshOldTimelineGbl ,NULL}, + [ActRcvTL_PstGbl ] = {1492,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ReceivePostGbl ,NULL}, + [ActRcvTL_ComGbl ] = {1503,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_ReceiveCommentGbl ,NULL}, + [ActShoHidTL_ComGbl ] = {1806,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_ShowHiddenCommentsGbl ,NULL}, + [ActAllShaTL_NotGbl ] = {1766,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShowAllSharersNoteGbl ,NULL}, + [ActAllFavTL_NotGbl ] = {1767,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversNoteGbl ,NULL}, + [ActAllFavTL_ComGbl ] = {1768,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversComGbl ,NULL}, + [ActShaTL_NotGbl ] = {1495,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShaNoteGbl ,NULL}, + [ActUnsTL_NotGbl ] = {1496,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_UnsNoteGbl ,NULL}, + [ActFavTL_NotGbl ] = {1512,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavNoteGbl ,NULL}, + [ActUnfTL_NotGbl ] = {1513,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfNoteGbl ,NULL}, + [ActFavTL_ComGbl ] = {1516,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavCommentGbl ,NULL}, + [ActUnfTL_ComGbl ] = {1517,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfCommentGbl ,NULL}, + [ActReqRemTL_PubGbl ] = {1494,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RequestRemNoteGbl ,NULL}, + [ActRemTL_PubGbl ] = {1493,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RemoveNoteGbl ,NULL}, + [ActReqRemTL_ComGbl ] = {1505,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RequestRemComGbl ,NULL}, + [ActRemTL_ComGbl ] = {1507,-1,TabUnk,ActSeeTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_GetParamWho ,TL_RemoveComGbl ,NULL}, [ActReqOthPubPrf ] = {1401,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_RequestUserProfile ,NULL}, - [ActRefOldSocPubUsr ] = {1511,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_RefreshOldTimelineUsr ,NULL}, - [ActRcvSocPstUsr ] = {1498,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TL_ReceivePostUsr ,NULL}, - [ActRcvSocComUsr ] = {1504,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TL_ReceiveCommentUsr ,NULL}, - [ActShoHidSocComUsr ] = {1807,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_ShowHiddenCommentsUsr ,NULL}, - [ActAllShaSocNotUsr ] = {1769,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShowAllSharersNoteUsr ,NULL}, - [ActAllFavSocNotUsr ] = {1770,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversNoteUsr ,NULL}, - [ActAllFavSocComUsr ] = {1771,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversComUsr ,NULL}, - [ActShaSocNotUsr ] = {1499,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShaNoteUsr ,NULL}, - [ActUnsSocNotUsr ] = {1500,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_UnsNoteUsr ,NULL}, - [ActFavSocNotUsr ] = {1514,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavNoteUsr ,NULL}, - [ActUnfSocNotUsr ] = {1515,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfNoteUsr ,NULL}, - [ActFavSocComUsr ] = {1518,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavCommentUsr ,NULL}, - [ActUnfSocComUsr ] = {1519,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfCommentUsr ,NULL}, - [ActReqRemSocPubUsr ] = {1501,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RequestRemNoteUsr ,NULL}, - [ActRemSocPubUsr ] = {1502,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RemoveNoteUsr ,NULL}, - [ActReqRemSocComUsr ] = {1506,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RequestRemComUsr ,NULL}, - [ActRemSocComUsr ] = {1508,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RemoveComUsr ,NULL}, + [ActRefOldTL_PubUsr ] = {1511,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_RefreshOldTimelineUsr ,NULL}, + [ActRcvTL_PstUsr ] = {1498,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TL_ReceivePostUsr ,NULL}, + [ActRcvTL_ComUsr ] = {1504,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,TL_ReceiveCommentUsr ,NULL}, + [ActShoHidTL_ComUsr ] = {1807,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_ShowHiddenCommentsUsr ,NULL}, + [ActAllShaTL_NotUsr ] = {1769,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShowAllSharersNoteUsr ,NULL}, + [ActAllFavTL_NotUsr ] = {1770,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversNoteUsr ,NULL}, + [ActAllFavTL_ComUsr ] = {1771,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_ShowAllFaversComUsr ,NULL}, + [ActShaTL_NotUsr ] = {1499,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_ShaNoteUsr ,NULL}, + [ActUnsTL_NotUsr ] = {1500,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Sha_UnsNoteUsr ,NULL}, + [ActFavTL_NotUsr ] = {1514,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavNoteUsr ,NULL}, + [ActUnfTL_NotUsr ] = {1515,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfNoteUsr ,NULL}, + [ActFavTL_ComUsr ] = {1518,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_FavCommentUsr ,NULL}, + [ActUnfTL_ComUsr ] = {1519,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TL_Fav_UnfCommentUsr ,NULL}, + [ActReqRemTL_PubUsr ] = {1501,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RequestRemNoteUsr ,NULL}, + [ActRemTL_PubUsr ] = {1502,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RemoveNoteUsr ,NULL}, + [ActReqRemTL_ComUsr ] = {1506,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RequestRemComUsr ,NULL}, + [ActRemTL_ComUsr ] = {1508,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RemoveComUsr ,NULL}, [ActSeeOthPubPrf ] = {1402,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_GetUsrDatAndShowUserProfile,NULL}, [ActCalFig ] = {1405,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, @@ -3309,36 +3309,36 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActChgMyTT1stDay, // #1487 ActReqRemOldBrf, // #1488 ActRemOldBrf, // #1489 - ActSeeSocTmlGbl, // #1490 + ActSeeTmlGbl, // #1490 -1, // #1491 (obsolete action) - ActRcvSocPstGbl, // #1492 - ActRemSocPubGbl, // #1493 - ActReqRemSocPubGbl, // #1494 - ActShaSocNotGbl, // #1495 - ActUnsSocNotGbl, // #1496 + ActRcvTL_PstGbl, // #1492 + ActRemTL_PubGbl, // #1493 + ActReqRemTL_PubGbl, // #1494 + ActShaTL_NotGbl, // #1495 + ActUnsTL_NotGbl, // #1496 -1, // #1497 (obsolete action) - ActRcvSocPstUsr, // #1498 - ActShaSocNotUsr, // #1499 - ActUnsSocNotUsr, // #1500 - ActReqRemSocPubUsr, // #1501 - ActRemSocPubUsr, // #1502 - ActRcvSocComGbl, // #1503 - ActRcvSocComUsr, // #1504 - ActReqRemSocComGbl, // #1505 - ActReqRemSocComUsr, // #1506 - ActRemSocComGbl, // #1507 - ActRemSocComUsr, // #1508 - ActRefNewSocPubGbl, // #1509 - ActRefOldSocPubGbl, // #1510 - ActRefOldSocPubUsr, // #1511 - ActFavSocNotGbl, // #1512 - ActUnfSocNotGbl, // #1513 - ActFavSocNotUsr, // #1514 - ActUnfSocNotUsr, // #1515 - ActFavSocComGbl, // #1516 - ActUnfSocComGbl, // #1517 - ActFavSocComUsr, // #1518 - ActUnfSocComUsr, // #1519 + ActRcvTL_PstUsr, // #1498 + ActShaTL_NotUsr, // #1499 + ActUnsTL_NotUsr, // #1500 + ActReqRemTL_PubUsr, // #1501 + ActRemTL_PubUsr, // #1502 + ActRcvTL_ComGbl, // #1503 + ActRcvTL_ComUsr, // #1504 + ActReqRemTL_ComGbl, // #1505 + ActReqRemTL_ComUsr, // #1506 + ActRemTL_ComGbl, // #1507 + ActRemTL_ComUsr, // #1508 + ActRefNewTL_PubGbl, // #1509 + ActRefOldTL_PubGbl, // #1510 + ActRefOldTL_PubUsr, // #1511 + ActFavTL_NotGbl, // #1512 + ActUnfTL_NotGbl, // #1513 + ActFavTL_NotUsr, // #1514 + ActUnfTL_NotUsr, // #1515 + ActFavTL_ComGbl, // #1516 + ActUnfTL_ComGbl, // #1517 + ActFavTL_ComUsr, // #1518 + ActUnfTL_ComUsr, // #1519 ActSeeSocPrf, // #1520 ActFrmLogIn, // #1521 ActUpdSignUpReq, // #1522 @@ -3585,12 +3585,12 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActUnfSevTch, // #1763 ActChgCooPrf, // #1764 ActChgExtPriPrf, // #1765 - ActAllShaSocNotGbl, // #1766 - ActAllFavSocNotGbl, // #1767 - ActAllFavSocComGbl, // #1768 - ActAllShaSocNotUsr, // #1769 - ActAllFavSocNotUsr, // #1770 - ActAllFavSocComUsr, // #1771 + ActAllShaTL_NotGbl, // #1766 + ActAllFavTL_NotGbl, // #1767 + ActAllFavTL_ComGbl, // #1768 + ActAllShaTL_NotUsr, // #1769 + ActAllFavTL_NotUsr, // #1770 + ActAllFavTL_ComUsr, // #1771 ActReqMaiUsr, // #1772 ActLckPrj, // #1773 ActUnlPrj, // #1774 @@ -3625,8 +3625,8 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActCfgPrj, // #1803 ActRcvCfgPrj, // #1804 ActReqUsrPrj, // #1805 - ActShoHidSocComGbl, // #1806 - ActShoHidSocComUsr, // #1807 + ActShoHidTL_ComGbl, // #1806 + ActShoHidTL_ComUsr, // #1807 ActSeeMchAnsQstStd, // #1808 ActRemMchAnsQstStd, // #1809 ActSeeMyMchResGam, // #1810 diff --git a/swad_action.h b/swad_action.h index 424343e46..a1b8f7c2a 100644 --- a/swad_action.h +++ b/swad_action.h @@ -86,7 +86,7 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to // Actions in menu #define ActFrmLogIn (ActWebSvc + 1) #define ActReqSch (ActWebSvc + 2) -#define ActSeeSocTmlGbl (ActWebSvc + 3) +#define ActSeeTmlGbl (ActWebSvc + 3) #define ActSeeSocPrf (ActWebSvc + 4) #define ActSeeCal (ActWebSvc + 5) #define ActSeeNtf (ActWebSvc + 6) @@ -102,44 +102,44 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to #define ActSch (ActWebSvc + 14) -#define ActRefNewSocPubGbl (ActWebSvc + 15) -#define ActRefOldSocPubGbl (ActWebSvc + 16) -#define ActRcvSocPstGbl (ActWebSvc + 17) -#define ActRcvSocComGbl (ActWebSvc + 18) -#define ActShoHidSocComGbl (ActWebSvc + 19) -#define ActAllShaSocNotGbl (ActWebSvc + 20) -#define ActAllFavSocNotGbl (ActWebSvc + 21) -#define ActAllFavSocComGbl (ActWebSvc + 22) -#define ActShaSocNotGbl (ActWebSvc + 23) -#define ActUnsSocNotGbl (ActWebSvc + 24) -#define ActFavSocNotGbl (ActWebSvc + 25) -#define ActUnfSocNotGbl (ActWebSvc + 26) -#define ActFavSocComGbl (ActWebSvc + 27) -#define ActUnfSocComGbl (ActWebSvc + 28) -#define ActReqRemSocPubGbl (ActWebSvc + 29) -#define ActRemSocPubGbl (ActWebSvc + 30) -#define ActReqRemSocComGbl (ActWebSvc + 31) -#define ActRemSocComGbl (ActWebSvc + 32) +#define ActRefNewTL_PubGbl (ActWebSvc + 15) +#define ActRefOldTL_PubGbl (ActWebSvc + 16) +#define ActRcvTL_PstGbl (ActWebSvc + 17) +#define ActRcvTL_ComGbl (ActWebSvc + 18) +#define ActShoHidTL_ComGbl (ActWebSvc + 19) +#define ActAllShaTL_NotGbl (ActWebSvc + 20) +#define ActAllFavTL_NotGbl (ActWebSvc + 21) +#define ActAllFavTL_ComGbl (ActWebSvc + 22) +#define ActShaTL_NotGbl (ActWebSvc + 23) +#define ActUnsTL_NotGbl (ActWebSvc + 24) +#define ActFavTL_NotGbl (ActWebSvc + 25) +#define ActUnfTL_NotGbl (ActWebSvc + 26) +#define ActFavTL_ComGbl (ActWebSvc + 27) +#define ActUnfTL_ComGbl (ActWebSvc + 28) +#define ActReqRemTL_PubGbl (ActWebSvc + 29) +#define ActRemTL_PubGbl (ActWebSvc + 30) +#define ActReqRemTL_ComGbl (ActWebSvc + 31) +#define ActRemTL_ComGbl (ActWebSvc + 32) #define ActReqOthPubPrf (ActWebSvc + 33) -#define ActRefOldSocPubUsr (ActWebSvc + 34) -#define ActRcvSocPstUsr (ActWebSvc + 35) -#define ActRcvSocComUsr (ActWebSvc + 36) -#define ActShoHidSocComUsr (ActWebSvc + 37) -#define ActAllShaSocNotUsr (ActWebSvc + 38) -#define ActAllFavSocNotUsr (ActWebSvc + 39) -#define ActAllFavSocComUsr (ActWebSvc + 40) -#define ActShaSocNotUsr (ActWebSvc + 41) -#define ActUnsSocNotUsr (ActWebSvc + 42) -#define ActFavSocNotUsr (ActWebSvc + 43) -#define ActUnfSocNotUsr (ActWebSvc + 44) -#define ActFavSocComUsr (ActWebSvc + 45) -#define ActUnfSocComUsr (ActWebSvc + 46) -#define ActReqRemSocPubUsr (ActWebSvc + 47) -#define ActRemSocPubUsr (ActWebSvc + 48) -#define ActReqRemSocComUsr (ActWebSvc + 49) -#define ActRemSocComUsr (ActWebSvc + 50) +#define ActRefOldTL_PubUsr (ActWebSvc + 34) +#define ActRcvTL_PstUsr (ActWebSvc + 35) +#define ActRcvTL_ComUsr (ActWebSvc + 36) +#define ActShoHidTL_ComUsr (ActWebSvc + 37) +#define ActAllShaTL_NotUsr (ActWebSvc + 38) +#define ActAllFavTL_NotUsr (ActWebSvc + 39) +#define ActAllFavTL_ComUsr (ActWebSvc + 40) +#define ActShaTL_NotUsr (ActWebSvc + 41) +#define ActUnsTL_NotUsr (ActWebSvc + 42) +#define ActFavTL_NotUsr (ActWebSvc + 43) +#define ActUnfTL_NotUsr (ActWebSvc + 44) +#define ActFavTL_ComUsr (ActWebSvc + 45) +#define ActUnfTL_ComUsr (ActWebSvc + 46) +#define ActReqRemTL_PubUsr (ActWebSvc + 47) +#define ActRemTL_PubUsr (ActWebSvc + 48) +#define ActReqRemTL_ComUsr (ActWebSvc + 49) +#define ActRemTL_ComUsr (ActWebSvc + 50) #define ActSeeOthPubPrf (ActWebSvc + 51) #define ActCalFig (ActWebSvc + 52) diff --git a/swad_changelog.h b/swad_changelog.h index 33dea56cd..2242c9fd0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -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.21.4 (2021-02-10)" +#define Log_PLATFORM_VERSION "SWAD 20.22 (2021-02-10)" #define CSS_FILE "swad20.8.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.22: Feb 10, 2021 Code refactoring in timeline. (305137 lines) Version 20.21.4: Feb 10, 2021 Code refactoring in timeline. (305136 lines) Version 20.21.3: Feb 10, 2021 Code refactoring in timeline. (305122 lines) Version 20.21.2: Feb 10, 2021 Fixed bug in timeline. (305128 lines) diff --git a/swad_layout.c b/swad_layout.c index 281b616b1..562c74373 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -768,13 +768,13 @@ static void Lay_WriteScriptInit (void) break; /* Timeline */ - case ActSeeSocTmlGbl: - case ActRcvSocPstGbl: - case ActRcvSocComGbl: - case ActReqRemSocPubGbl: - case ActRemSocPubGbl: - case ActReqRemSocComGbl: - case ActRemSocComGbl: + case ActSeeTmlGbl: + case ActRcvTL_PstGbl: + case ActRcvTL_ComGbl: + case ActReqRemTL_PubGbl: + case ActRemTL_PubGbl: + case ActReqRemTL_ComGbl: + case ActRemTL_ComGbl: RefreshNewTimeline = true; break; @@ -874,31 +874,31 @@ static void Lay_WriteScriptParamsAJAX (void) switch (Gbl.Action.Act) { /* Parameters related with global timeline refreshing */ - case ActSeeSocTmlGbl: - case ActRcvSocPstGbl: - case ActRcvSocComGbl: - case ActReqRemSocPubGbl: - case ActRemSocPubGbl: - case ActReqRemSocComGbl: - case ActRemSocComGbl: + case ActSeeTmlGbl: + case ActRcvTL_PstGbl: + case ActRcvTL_ComGbl: + case ActReqRemTL_PubGbl: + case ActRemTL_PubGbl: + case ActReqRemTL_ComGbl: + case ActRemTL_ComGbl: /* In all the actions related to view or editing global timeline ==> put parameters used by AJAX */ // Refresh parameters HTM_TxtF ("var RefreshParamNxtActNewPub = \"act=%ld\";\n" "var RefreshParamNxtActOldPub = \"act=%ld\";\n" "var RefreshParamWho = \"Who=%u\";\n", - Act_GetActCod (ActRefNewSocPubGbl), - Act_GetActCod (ActRefOldSocPubGbl), + Act_GetActCod (ActRefNewTL_PubGbl), + Act_GetActCod (ActRefOldTL_PubGbl), (unsigned) TL_GetGlobalWho ()); // Global variable got in a priori function break; /* Parameters related with user timeline refreshing */ case ActSeeOthPubPrf: - case ActRcvSocPstUsr: - case ActRcvSocComUsr: - case ActReqRemSocPubUsr: - case ActRemSocPubUsr: - case ActReqRemSocComUsr: - case ActRemSocComUsr: + case ActRcvTL_PstUsr: + case ActRcvTL_ComUsr: + case ActReqRemTL_PubUsr: + case ActRemTL_PubUsr: + case ActReqRemTL_ComUsr: + case ActRemTL_ComUsr: /* In all the actions related to view or editing user's timeline ==> put parameters used by AJAX */ if (Gbl.Usrs.Other.UsrDat.UsrCod <= 0) @@ -906,7 +906,7 @@ static void Lay_WriteScriptParamsAJAX (void) // Refresh parameters HTM_TxtF ("var RefreshParamNxtActOldPub = \"act=%ld\";\n" "var RefreshParamUsr = \"OtherUsrCod=%s\";\n", - Act_GetActCod (ActRefOldSocPubUsr), + Act_GetActCod (ActRefOldTL_PubUsr), Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); break; /* Parameters related with match refreshing (for students) */ diff --git a/swad_menu.c b/swad_menu.c index 7061eea1a..97a7619a5 100644 --- a/swad_menu.c +++ b/swad_menu.c @@ -67,7 +67,7 @@ static const Act_Action_t Mnu_MenuActions[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_ [TabStr] = { [ 0] = ActFrmLogIn, [ 1] = ActReqSch, - [ 2] = ActSeeSocTmlGbl, + [ 2] = ActSeeTmlGbl, [ 3] = ActSeeSocPrf, [ 4] = ActSeeCal, [ 5] = ActSeeNtf, diff --git a/swad_notification.c b/swad_notification.c index d08a67c8d..26f96a64c 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -106,10 +106,10 @@ static const Act_Action_t Ntf_DefaultActions[Ntf_NUM_NOTIFY_EVENTS] = { [Ntf_EVENT_UNKNOWN ] = ActUnk, /* Start tab */ - [Ntf_EVENT_TIMELINE_COMMENT ] = ActSeeSocTmlGbl, - [Ntf_EVENT_TIMELINE_FAV ] = ActSeeSocTmlGbl, - [Ntf_EVENT_TIMELINE_SHARE ] = ActSeeSocTmlGbl, - [Ntf_EVENT_TIMELINE_MENTION ] = ActSeeSocTmlGbl, + [Ntf_EVENT_TIMELINE_COMMENT ] = ActSeeTmlGbl, + [Ntf_EVENT_TIMELINE_FAV ] = ActSeeTmlGbl, + [Ntf_EVENT_TIMELINE_SHARE ] = ActSeeTmlGbl, + [Ntf_EVENT_TIMELINE_MENTION ] = ActSeeTmlGbl, [Ntf_EVENT_FOLLOWER ] = ActSeeFlr, /* System tab */ /* Country tab */ @@ -724,7 +724,7 @@ static bool Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent, case Ntf_EVENT_TIMELINE_SHARE: case Ntf_EVENT_TIMELINE_MENTION: // Cod is the code of the social publishing - Frm_StartForm (ActSeeSocTmlGbl); + Frm_StartForm (ActSeeTmlGbl); TL_PutHiddenParamPubCod (Cod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Ntf_PutHiddenParamNotifyEvent (NotifyEvent); diff --git a/swad_profile.c b/swad_profile.c index b02b9f4d8..877813f55 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -1334,7 +1334,7 @@ void Prf_IncrementNumClicksUsr (long UsrCod) /********* Increment number of social publications sent by a user ************/ /*****************************************************************************/ -void Prf_IncrementNumSocPubUsr (long UsrCod) +void Prf_IncrementNumPubsUsr (long UsrCod) { /***** Increment number of social publications *****/ // If NumSocPub < 0 ==> not yet calculated, so do nothing diff --git a/swad_profile.h b/swad_profile.h index 5dacf0d06..805990729 100644 --- a/swad_profile.h +++ b/swad_profile.h @@ -71,7 +71,7 @@ bool Prf_GetAndStoreAllUsrFigures (long UsrCod,struct UsrFigures *UsrFigures); void Prf_CreateNewUsrFigures (long UsrCod,bool CreatingMyOwnAccount); void Prf_RemoveUsrFigures (long UsrCod); void Prf_IncrementNumClicksUsr (long UsrCod); -void Prf_IncrementNumSocPubUsr (long UsrCod); +void Prf_IncrementNumPubsUsr (long UsrCod); void Prf_IncrementNumFileViewsUsr (long UsrCod); void Prf_IncrementNumForPstUsr (long UsrCod); void Prf_IncrementNumMsgSntUsr (long UsrCod); diff --git a/swad_text.c b/swad_text.c index 87f4871ee..7e9e08375 100644 --- a/swad_text.c +++ b/swad_text.c @@ -19603,7 +19603,7 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] = "Procurar" #endif , - // 2: ActSeeSocTmlGbl + // 2: ActSeeTmlGbl #if L==1 // ca "Timeline" #elif L==2 // de @@ -21470,7 +21470,7 @@ const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] = "Procurar disciplinas, professores e documentos" #endif , - // 2: ActSeeSocTmlGbl + // 2: ActSeeTmlGbl #if L==1 // ca "Timeline dels usuaris que segueixo o de tots els usuaris" #elif L==2 // de diff --git a/swad_text_action.c b/swad_text_action.c index 5d6beed4c..ae1b34023 100644 --- a/swad_text_action.c +++ b/swad_text_action.c @@ -188,7 +188,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Request search" // Precisa de tradução #endif , - [ActSeeSocTmlGbl] = + [ActSeeTmlGbl] = #if L==1 // ca "Show timeline global" // Necessita traducció #elif L==2 // de @@ -440,7 +440,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Search" // Precisa de tradução #endif , - [ActRefNewSocPubGbl] = + [ActRefNewTL_PubGbl] = #if L==1 // ca "Refresh global timeline (new publications)" // Necessita traducció #elif L==2 // de @@ -461,7 +461,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Refresh global timeline (new publications)" // Precisa de tradução #endif , - [ActRefOldSocPubGbl] = + [ActRefOldTL_PubGbl] = #if L==1 // ca "Show previous publications in global timeline" // Necessita traducció #elif L==2 // de @@ -482,7 +482,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show previous publications in global timeline" // Precisa de tradução #endif , - [ActRcvSocPstGbl] = + [ActRcvTL_PstGbl] = #if L==1 // ca "Create post in global timeline" // Necessita traducció #elif L==2 // de @@ -503,7 +503,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Create post in global timeline" // Precisa de tradução #endif , - [ActRcvSocComGbl] = + [ActRcvTL_ComGbl] = #if L==1 // ca "Create comment in global timeline" // Necessita traducció #elif L==2 // de @@ -524,7 +524,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Create comment in global timeline" // Precisa de tradução #endif , - [ActShoHidSocComGbl] = + [ActShoHidTL_ComGbl] = #if L==1 // ca "Show hidden comments in global timeline" // Necessita traducció #elif L==2 // de @@ -545,7 +545,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show hidden comments in global timeline" // Precisa de tradução #endif , - [ActAllShaSocNotGbl] = + [ActAllShaTL_NotGbl] = #if L==1 // ca "Show who shared a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -566,7 +566,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show who shared a publication in global timeline" // Precisa de tradução #endif , - [ActAllFavSocNotGbl] = + [ActAllFavTL_NotGbl] = #if L==1 // ca "Show who favourited a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -587,7 +587,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show who favourited a publication in global timeline" // Precisa de tradução #endif , - [ActAllFavSocComGbl] = + [ActAllFavTL_ComGbl] = #if L==1 // ca "Show who favourited a comment in global timeline" // Necessita traducció #elif L==2 // de @@ -608,7 +608,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show who favourited a comment in global timeline" // Precisa de tradução #endif , - [ActShaSocNotGbl] = + [ActShaTL_NotGbl] = #if L==1 // ca "Share a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -629,7 +629,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Share a publication in global timeline" // Precisa de tradução #endif , - [ActUnsSocNotGbl] = + [ActUnsTL_NotGbl] = #if L==1 // ca "Unshare a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -650,7 +650,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Unshare a publication in global timeline" // Precisa de tradução #endif , - [ActFavSocNotGbl] = + [ActFavTL_NotGbl] = #if L==1 // ca "Favourite a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -671,7 +671,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Favourite a publication in global timeline" // Precisa de tradução #endif , - [ActUnfSocNotGbl] = + [ActUnfTL_NotGbl] = #if L==1 // ca "Unfavourite a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -692,7 +692,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Unfavourite a publication in global timeline" // Precisa de tradução #endif , - [ActFavSocComGbl] = + [ActFavTL_ComGbl] = #if L==1 // ca "Favourite a comment in global timeline" // Necessita traducció #elif L==2 // de @@ -713,7 +713,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Favourite a comment in global timeline" // Precisa de tradução #endif , - [ActUnfSocComGbl] = + [ActUnfTL_ComGbl] = #if L==1 // ca "Unfavourite a comment in global timeline" // Necessita traducció #elif L==2 // de @@ -734,7 +734,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Unfavourite a comment in global timeline" // Precisa de tradução #endif , - [ActReqRemSocPubGbl] = + [ActReqRemTL_PubGbl] = #if L==1 // ca "Request deletion of a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -755,7 +755,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Request deletion of a publication in global timeline" // Precisa de tradução #endif , - [ActRemSocPubGbl] = + [ActRemTL_PubGbl] = #if L==1 // ca "Delete a publication in global timeline" // Necessita traducció #elif L==2 // de @@ -776,7 +776,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Delete a publication in global timeline" // Precisa de tradução #endif , - [ActReqRemSocComGbl] = + [ActReqRemTL_ComGbl] = #if L==1 // ca "Request deletion of a comment in global timeline" // Necessita traducció #elif L==2 // de @@ -797,7 +797,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Request deletion of a comment in global timeline" // Precisa de tradução #endif , - [ActRemSocComGbl] = + [ActRemTL_ComGbl] = #if L==1 // ca "Delete a comment in global timeline" // Necessita traducció #elif L==2 // de @@ -839,7 +839,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Request to show public user profile" // Precisa de tradução #endif , - [ActRefOldSocPubUsr] = + [ActRefOldTL_PubUsr] = #if L==1 // ca "Show previous publications in user timeline" // Necessita traducció #elif L==2 // de @@ -860,7 +860,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show previous publications in user timeline" // Precisa de tradução #endif , - [ActRcvSocPstUsr] = + [ActRcvTL_PstUsr] = #if L==1 // ca "Create post in user timeline" // Necessita traducció #elif L==2 // de @@ -881,7 +881,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Create post in user timeline" // Precisa de tradução #endif , - [ActRcvSocComUsr] = + [ActRcvTL_ComUsr] = #if L==1 // ca "Create comment in user timeline" // Necessita traducció #elif L==2 // de @@ -902,7 +902,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Create comment in user timeline" // Precisa de tradução #endif , - [ActShoHidSocComUsr] = + [ActShoHidTL_ComUsr] = #if L==1 // ca "Show hidden comments in user timeline" // Necessita traducció #elif L==2 // de @@ -923,7 +923,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show hidden comments in user timeline" // Precisa de tradução #endif , - [ActAllShaSocNotUsr] = + [ActAllShaTL_NotUsr] = #if L==1 // ca "Show who shared a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -944,7 +944,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show who shared a publication in user timeline" // Precisa de tradução #endif , - [ActAllFavSocNotUsr] = + [ActAllFavTL_NotUsr] = #if L==1 // ca "Show who favourited a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -965,7 +965,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show who favourited a publication in user timeline" // Precisa de tradução #endif , - [ActAllFavSocComUsr] = + [ActAllFavTL_ComUsr] = #if L==1 // ca "Show who favourited a comment in user timeline" // Necessita traducció #elif L==2 // de @@ -986,7 +986,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Show who favourited a comment in user timeline" // Precisa de tradução #endif , - [ActShaSocNotUsr] = + [ActShaTL_NotUsr] = #if L==1 // ca "Share a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -1007,7 +1007,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Share a publication in user timeline" // Precisa de tradução #endif , - [ActUnsSocNotUsr] = + [ActUnsTL_NotUsr] = #if L==1 // ca "Unshare a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -1028,7 +1028,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Unshare a publication in user timeline" // Precisa de tradução #endif , - [ActFavSocNotUsr] = + [ActFavTL_NotUsr] = #if L==1 // ca "Favourite a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -1049,7 +1049,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Favourite a publication in user timeline" // Precisa de tradução #endif , - [ActUnfSocNotUsr] = + [ActUnfTL_NotUsr] = #if L==1 // ca "Unfavourite a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -1070,7 +1070,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Unfavourite a publication in user timeline" // Precisa de tradução #endif , - [ActFavSocComUsr] = + [ActFavTL_ComUsr] = #if L==1 // ca "Favourite a comment in user timeline" // Necessita traducció #elif L==2 // de @@ -1091,7 +1091,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Favourite a comment in user timeline" // Precisa de tradução #endif , - [ActUnfSocComUsr] = + [ActUnfTL_ComUsr] = #if L==1 // ca "Unfavourite a comment in user timeline" // Necessita traducció #elif L==2 // de @@ -1112,7 +1112,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Unfavourite a comment in user timeline" // Precisa de tradução #endif , - [ActReqRemSocPubUsr] = + [ActReqRemTL_PubUsr] = #if L==1 // ca "Request deletion of a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -1133,7 +1133,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Request deletion of a publication in user timeline" // Precisa de tradução #endif , - [ActRemSocPubUsr] = + [ActRemTL_PubUsr] = #if L==1 // ca "Delete a publication in user timeline" // Necessita traducció #elif L==2 // de @@ -1154,7 +1154,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Delete a publication in user timeline" // Precisa de tradução #endif , - [ActReqRemSocComUsr] = + [ActReqRemTL_ComUsr] = #if L==1 // ca "Request deletion of a comment in user timeline" // Necessita traducció #elif L==2 // de @@ -1175,7 +1175,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] = "Request deletion of a comment in user timeline" // Precisa de tradução #endif , - [ActRemSocComUsr] = + [ActRemTL_ComUsr] = #if L==1 // ca "Delete a comment in user timeline" // Necessita traducció #elif L==2 // de diff --git a/swad_timeline.c b/swad_timeline.c index 81195980f..4a6d46746 100644 --- a/swad_timeline.c +++ b/swad_timeline.c @@ -223,7 +223,7 @@ Usr_Who_t TL_GlobalWho; static void TL_InitTimelineGbl (struct TL_Timeline *Timeline); static void TL_ShowHighlightedNote (struct TL_Timeline *Timeline, - struct TL_Note *SocNot); + struct TL_Note *Not); static void TL_ShowNoteAndTimelineGbl (struct TL_Timeline *Timeline); static void TL_ShowTimelineGblHighlightingNot (struct TL_Timeline *Timeline, @@ -252,7 +252,7 @@ static void TL_AllocateListPubs (struct TL_Timeline *Timeline, unsigned MaxPubsToGet); static void TL_FreeListPubs (const struct TL_Timeline *Timeline); static void TL_SelectTheMostRecentPub (const struct TL_SubQueries *SubQueries, - struct TL_Publication *SocPub); + struct TL_Publication *Pub); static void TL_InsertNoteInJustRetrievedNotes (long NotCod); static void TL_InsertNoteInVisibleTimeline (long NotCod); @@ -279,7 +279,7 @@ static void TL_PutLinkToViewNewPublications (void); static void TL_PutLinkToViewOldPublications (void); static void TL_WriteNote (struct TL_Timeline *Timeline, - const struct TL_Note *SocNot, + const struct TL_Note *Not, TL_TopMessage_t TopMessage, long PublisherCod, // Who did the action (publication, commenting, faving, sharing, mentioning) TL_HighlightNote_t HighlightNote, // Highlight note @@ -288,11 +288,11 @@ static void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long PublisherCod); static void TL_WriteAuthorNote (const struct UsrData *UsrDat); static void TL_WriteDateTime (time_t TimeUTC); static void TL_GetAndWritePost (long PstCod); -static void TL_PutFormGoToAction (const struct TL_Note *SocNot, +static void TL_PutFormGoToAction (const struct TL_Note *Not, const struct For_Forums *Forums); -static void TL_GetNoteSummary (const struct TL_Note *SocNot, +static void TL_GetNoteSummary (const struct TL_Note *Not, char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]); -static void TL_StoreAndPublishNoteInternal (TL_NoteType_t NoteType,long Cod,struct TL_Publication *SocPub); +static void TL_StoreAndPublishNoteInternal (TL_NoteType_t NoteType,long Cod,struct TL_Publication *Pub); static void TL_PutFormToWriteNewPost (struct TL_Timeline *Timeline); static void TL_PutTextarea (const char *Placeholder,const char *ClassTextArea); @@ -306,7 +306,7 @@ static void TL_PutHiddenFormToWriteNewCommentToNote (const struct TL_Timeline *T const char IdNewComment[Frm_MAX_BYTES_ID + 1]); static unsigned long TL_GetNumCommentsInNote (long NotCod); static void TL_WriteCommentsInNote (struct TL_Timeline *Timeline, - const struct TL_Note *SocNot, + const struct TL_Note *Not, unsigned NumComments); static void TL_FormToShowHiddenComments (Act_Action_t ActionGbl,Act_Action_t ActionUsr, long NotCod, @@ -324,7 +324,7 @@ static void TL_LinkToShowPreviousComments (const char IdComments[Frm_MAX_BYTES_I static void TL_PutIconToToggleComments (const char *UniqueId, const char *Icon,const char *Text); static void TL_WriteComment (struct TL_Timeline *Timeline, - struct TL_Comment *SocCom, + struct TL_Comment *Com, TL_TopMessage_t TopMessage,long UsrCod, bool ShowCommentAlone); // Comment is shown alone, not in a list static void TL_WriteAuthorComment (struct UsrData *UsrDat); @@ -342,7 +342,7 @@ static long TL_ReceiveComment (void); static void TL_RequestRemovalNote (struct TL_Timeline *Timeline); static void TL_PutParamsRemoveNote (void *Timeline); static void TL_RemoveNote (void); -static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot); +static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *Not); static long TL_GetNotCodFromPubCod (long PubCod); @@ -352,15 +352,15 @@ static void TL_RemoveComment (void); static void TL_RemoveCommentMediaAndDBEntries (long PubCod); static void TL_GetDataOfPublicationFromNextRow (MYSQL_RES *mysql_res, - struct TL_Publication *SocPub); -static void TL_GetDataOfNoteFromRow (MYSQL_ROW row,struct TL_Note *SocNot); + struct TL_Publication *Pub); +static void TL_GetDataOfNoteFromRow (MYSQL_ROW row,struct TL_Note *Not); static TL_PubType_t TL_GetPubTypeFromStr (const char *Str); static TL_NoteType_t TL_GetNoteTypeFromStr (const char *Str); -static void TL_GetDataOfCommentFromRow (MYSQL_ROW row,struct TL_Comment *SocCom); +static void TL_GetDataOfCommentFromRow (MYSQL_ROW row,struct TL_Comment *Com); -static void TL_ResetPublication (struct TL_Publication *SocPub); -static void TL_ResetNote (struct TL_Note *SocNot); -static void TL_ResetComment (struct TL_Comment *SocCom); +static void TL_ResetPublication (struct TL_Publication *Pub); +static void TL_ResetNote (struct TL_Note *Not); +static void TL_ResetComment (struct TL_Comment *Com); static void TL_ClearTimelineThisSession (void); static void TL_AddNotesJustRetrievedToTimelineThisSession (void); @@ -421,10 +421,10 @@ void TL_ShowTimelineGbl (void) static void TL_ShowNoteAndTimelineGbl (struct TL_Timeline *Timeline) { long PubCod; - struct TL_Note SocNot; + struct TL_Note Not; /***** Initialize note code to -1 ==> no highlighted note *****/ - SocNot.NotCod = -1L; + Not.NotCod = -1L; /***** Get parameter with the code of a publication *****/ // This parameter is optional. It can be provided by a notification. @@ -433,15 +433,15 @@ static void TL_ShowNoteAndTimelineGbl (struct TL_Timeline *Timeline) /***** If a note should be highlighted ==> get code of note from database *****/ if (PubCod > 0) - SocNot.NotCod = TL_GetNotCodFromPubCod (PubCod); + Not.NotCod = TL_GetNotCodFromPubCod (PubCod); /***** If a note should be highlighted ==> show it above the timeline *****/ - if (SocNot.NotCod > 0) + if (Not.NotCod > 0) /***** Show the note highlighted above the timeline *****/ - TL_ShowHighlightedNote (Timeline,&SocNot); + TL_ShowHighlightedNote (Timeline,&Not); /***** Show timeline with possible highlighted note *****/ - TL_ShowTimelineGblHighlightingNot (Timeline,SocNot.NotCod); + TL_ShowTimelineGblHighlightingNot (Timeline,Not.NotCod); } /*****************************************************************************/ @@ -449,7 +449,7 @@ static void TL_ShowNoteAndTimelineGbl (struct TL_Timeline *Timeline) /*****************************************************************************/ static void TL_ShowHighlightedNote (struct TL_Timeline *Timeline, - struct TL_Note *SocNot) + struct TL_Note *Not) { struct UsrData PublisherDat; Ntf_NotifyEvent_t NotifyEvent; @@ -500,8 +500,8 @@ static void TL_ShowHighlightedNote (struct TL_Timeline *Timeline, NotifyEvent = Ntf_GetParamNotifyEvent (); /***** Show the note highlighted *****/ - TL_GetDataOfNoteByCod (SocNot); - TL_WriteNote (Timeline,SocNot, + TL_GetDataOfNoteByCod (Not); + TL_WriteNote (Timeline,Not, TopMessages[NotifyEvent],PublisherDat.UsrCod, TL_HIGHLIGHT_NOTE, TL_SHOW_NOTE_ALONE); @@ -1046,7 +1046,7 @@ static void TL_FreeListPubs (const struct TL_Timeline *Timeline) /*****************************************************************************/ static void TL_SelectTheMostRecentPub (const struct TL_SubQueries *SubQueries, - struct TL_Publication *SocPub) + struct TL_Publication *Pub) { MYSQL_RES *mysql_res; unsigned NumPubs = 0; // Initialized to avoid warning @@ -1068,10 +1068,10 @@ static void TL_SelectTheMostRecentPub (const struct TL_SubQueries *SubQueries, if (NumPubs == 1) /* Get data of publication */ - TL_GetDataOfPublicationFromNextRow (mysql_res,SocPub); + TL_GetDataOfPublicationFromNextRow (mysql_res,Pub); else /* Reset data of publication */ - TL_ResetPublication (SocPub); + TL_ResetPublication (Pub); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); @@ -1138,7 +1138,7 @@ static void TL_ShowTimeline (struct TL_Timeline *Timeline, { extern const char *Hlp_START_Timeline; unsigned long NumPub; - struct TL_Note SocNot; + struct TL_Note Not; bool GlobalTimeline = (Gbl.Usrs.Other.UsrDat.UsrCod <= 0); bool ItsMe = Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod); @@ -1177,14 +1177,14 @@ static void TL_ShowTimeline (struct TL_Timeline *Timeline, NumPub++) { /* Get data of note */ - SocNot.NotCod = Timeline->Pubs.Lst[NumPub].NotCod; - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = Timeline->Pubs.Lst[NumPub].NotCod; + TL_GetDataOfNoteByCod (&Not); /* Write note */ - TL_WriteNote (Timeline,&SocNot, + TL_WriteNote (Timeline,&Not, Timeline->Pubs.Lst[NumPub].TopMessage, Timeline->Pubs.Lst[NumPub].PublisherCod, - SocNot.NotCod == NotCodToHighlight ? TL_HIGHLIGHT_NOTE : + Not.NotCod == NotCodToHighlight ? TL_HIGHLIGHT_NOTE : TL_DONT_HIGHLIGHT_NOTE, TL_DONT_SHOW_NOTE_ALONE); } @@ -1256,7 +1256,7 @@ static void TL_PutFormWho (struct TL_Timeline *Timeline) HTM_DIV_Begin ("class=\"%s\"", Who == Timeline->Who ? "PREF_ON" : "PREF_OFF"); - Frm_StartForm (ActSeeSocTmlGbl); + Frm_StartForm (ActSeeTmlGbl); Par_PutHiddenParamUnsigned (NULL,"Who",(unsigned) Who); Usr_PutWhoIcon (Who); Frm_EndForm (); @@ -1391,7 +1391,7 @@ static void TL_ShowWarningYouDontFollowAnyUser (void) static void TL_InsertNewPubsInTimeline (struct TL_Timeline *Timeline) { unsigned long NumPub; - struct TL_Note SocNot; + struct TL_Note Not; /***** List new publications timeline *****/ for (NumPub = 0; @@ -1399,11 +1399,11 @@ static void TL_InsertNewPubsInTimeline (struct TL_Timeline *Timeline) NumPub++) { /* Get data of note */ - SocNot.NotCod = Timeline->Pubs.Lst[NumPub].NotCod; - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = Timeline->Pubs.Lst[NumPub].NotCod; + TL_GetDataOfNoteByCod (&Not); /* Write note */ - TL_WriteNote (Timeline,&SocNot, + TL_WriteNote (Timeline,&Not, Timeline->Pubs.Lst[NumPub].TopMessage, Timeline->Pubs.Lst[NumPub].PublisherCod, TL_DONT_HIGHLIGHT_NOTE, @@ -1419,7 +1419,7 @@ static void TL_InsertNewPubsInTimeline (struct TL_Timeline *Timeline) static void TL_ShowOldPubsInTimeline (struct TL_Timeline *Timeline) { unsigned long NumPub; - struct TL_Note SocNot; + struct TL_Note Not; /***** List old publications in timeline *****/ for (NumPub = 0; @@ -1427,11 +1427,11 @@ static void TL_ShowOldPubsInTimeline (struct TL_Timeline *Timeline) NumPub++) { /* Get data of note */ - SocNot.NotCod = Timeline->Pubs.Lst[NumPub].NotCod; - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = Timeline->Pubs.Lst[NumPub].NotCod; + TL_GetDataOfNoteByCod (&Not); /* Write note */ - TL_WriteNote (Timeline,&SocNot, + TL_WriteNote (Timeline,&Not, Timeline->Pubs.Lst[NumPub].TopMessage, Timeline->Pubs.Lst[NumPub].PublisherCod, TL_DONT_HIGHLIGHT_NOTE, @@ -1499,7 +1499,7 @@ static void TL_PutLinkToViewOldPublications (void) /*****************************************************************************/ static void TL_WriteNote (struct TL_Timeline *Timeline, - const struct TL_Note *SocNot, + const struct TL_Note *Not, TL_TopMessage_t TopMessage, long PublisherCod, // Who did the action (publication, commenting, faving, sharing, mentioning) TL_HighlightNote_t HighlightNote, // Highlight note @@ -1544,9 +1544,9 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, (HighlightNote == TL_HIGHLIGHT_NOTE ? "TL_WIDTH TL_SEP TL_NEW_PUB" : "TL_WIDTH TL_SEP")); - if (SocNot->NotCod <= 0 || - SocNot->NoteType == TL_NOTE_UNKNOWN || - SocNot->UsrCod <= 0) + if (Not->NotCod <= 0 || + Not->NoteType == TL_NOTE_UNKNOWN || + Not->UsrCod <= 0) Ale_ShowAlert (Ale_ERROR,"Error in note."); else { @@ -1563,7 +1563,7 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, Usr_UsrDataConstructor (&AuthorDat); /***** Get author data *****/ - AuthorDat.UsrCod = SocNot->UsrCod; + AuthorDat.UsrCod = Not->UsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&AuthorDat,Usr_DONT_GET_PREFS); IAmTheAuthor = Usr_ItsMe (AuthorDat.UsrCod); @@ -1581,37 +1581,37 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, /* Write author's full name and date-time */ TL_WriteAuthorNote (&AuthorDat); - TL_WriteDateTime (SocNot->DateTimeUTC); + TL_WriteDateTime (Not->DateTimeUTC); /* Write content of the note */ - if (SocNot->NoteType == TL_NOTE_POST) + if (Not->NoteType == TL_NOTE_POST) /* Write post content */ - TL_GetAndWritePost (SocNot->Cod); + TL_GetAndWritePost (Not->Cod); else { /* Reset forums */ For_ResetForums (&Forums); /* Get location in hierarchy */ - if (!SocNot->Unavailable) - switch (SocNot->NoteType) + if (!Not->Unavailable) + switch (Not->NoteType) { case TL_NOTE_INS_DOC_PUB_FILE: case TL_NOTE_INS_SHA_PUB_FILE: /* Get institution data */ - Ins.InsCod = SocNot->HieCod; + Ins.InsCod = Not->HieCod; Ins_GetDataOfInstitutionByCod (&Ins); break; case TL_NOTE_CTR_DOC_PUB_FILE: case TL_NOTE_CTR_SHA_PUB_FILE: /* Get centre data */ - Ctr.CtrCod = SocNot->HieCod; + Ctr.CtrCod = Not->HieCod; Ctr_GetDataOfCentreByCod (&Ctr); break; case TL_NOTE_DEG_DOC_PUB_FILE: case TL_NOTE_DEG_SHA_PUB_FILE: /* Get degree data */ - Deg.DegCod = SocNot->HieCod; + Deg.DegCod = Not->HieCod; Deg_GetDataOfDegreeByCod (&Deg); break; case TL_NOTE_CRS_DOC_PUB_FILE: @@ -1619,12 +1619,12 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, case TL_NOTE_EXAM_ANNOUNCEMENT: case TL_NOTE_NOTICE: /* Get course data */ - Crs.CrsCod = SocNot->HieCod; + Crs.CrsCod = Not->HieCod; Crs_GetDataOfCourseByCod (&Crs); break; case TL_NOTE_FORUM_POST: /* Get forum type of the post */ - For_GetForumTypeAndLocationOfAPost (SocNot->Cod,&Forums.Forum); + For_GetForumTypeAndLocationOfAPost (Not->Cod,&Forums.Forum); For_SetForumName (&Forums.Forum,ForumName,Gbl.Prefs.Language,false); // Set forum name in recipient's language break; default: @@ -1632,11 +1632,11 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, } /* Write note type */ - TL_PutFormGoToAction (SocNot,&Forums); + TL_PutFormGoToAction (Not,&Forums); /* Write location in hierarchy */ - if (!SocNot->Unavailable) - switch (SocNot->NoteType) + if (!Not->Unavailable) + switch (Not->NoteType) { case TL_NOTE_INS_DOC_PUB_FILE: case TL_NOTE_INS_SHA_PUB_FILE: @@ -1679,7 +1679,7 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, } /* Write note summary */ - TL_GetNoteSummary (SocNot,SummaryStr); + TL_GetNoteSummary (Not,SummaryStr); HTM_DIV_Begin ("class=\"TL_TXT\""); HTM_Txt (SummaryStr); HTM_DIV_End (); @@ -1693,11 +1693,11 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, Frm_SetUniqueId (IdNewComment); /* Get number of comments in this note */ - NumComments = TL_GetNumCommentsInNote (SocNot->NotCod); + NumComments = TL_GetNumCommentsInNote (Not->NotCod); /* Put icon to add a comment */ HTM_DIV_Begin ("class=\"TL_BOTTOM_LEFT\""); - if (SocNot->Unavailable) // Unavailable notes can not be commented + if (Not->Unavailable) // Unavailable notes can not be commented TL_PutIconCommentDisabled (); else TL_PutIconToToggleCommentNote (IdNewComment); @@ -1712,20 +1712,20 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, /* Foot column 1: Fav zone */ HTM_DIV_Begin ("id=\"fav_not_%s_%u\" class=\"TL_FAV_NOT TL_FAV_NOT_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); - TL_Fav_PutFormToFavUnfNote (SocNot,TL_SHOW_FEW_USRS); + TL_Fav_PutFormToFavUnfNote (Not,TL_SHOW_FEW_USRS); HTM_DIV_End (); /* Foot column 2: Share zone */ HTM_DIV_Begin ("id=\"sha_not_%s_%u\" class=\"TL_SHA_NOT TL_SHA_NOT_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); - TL_Sha_PutFormToShaUnsNote (SocNot,TL_SHOW_FEW_USRS); + TL_Sha_PutFormToShaUnsNote (Not,TL_SHOW_FEW_USRS); HTM_DIV_End (); /* Foot column 3: Icon to remove this note */ HTM_DIV_Begin ("class=\"TL_REM\""); if (IAmTheAuthor) TL_PutFormToRemovePublication (Timeline, - SocNot->NotCod); + Not->NotCod); HTM_DIV_End (); /* End foot container */ @@ -1733,14 +1733,14 @@ static void TL_WriteNote (struct TL_Timeline *Timeline, /* Comments */ if (NumComments) - TL_WriteCommentsInNote (Timeline,SocNot,NumComments); + TL_WriteCommentsInNote (Timeline,Not,NumComments); /* End container for buttons and comments */ HTM_DIV_End (); /* Put hidden form to write a new comment */ TL_PutHiddenFormToWriteNewCommentToNote (Timeline, - SocNot->NotCod,IdNewComment); + Not->NotCod,IdNewComment); /***** Free memory used for author's data *****/ Usr_UsrDataDestructor (&AuthorDat); @@ -1909,7 +1909,7 @@ static void TL_GetAndWritePost (long PstCod) /************* Put form to go to an action depending on the note *************/ /*****************************************************************************/ -static void TL_PutFormGoToAction (const struct TL_Note *SocNot, +static void TL_PutFormGoToAction (const struct TL_Note *Not, const struct For_Forums *Forums) { extern const Act_Action_t For_ActionsSeeFor[For_NUM_TYPES_FORUM]; @@ -1970,13 +1970,13 @@ static void TL_PutFormGoToAction (const struct TL_Note *SocNot, /* Profile tab */ }; - if (SocNot->Unavailable || // File/notice... pointed by this note is unavailable + if (Not->Unavailable || // File/notice... pointed by this note is unavailable Gbl.Form.Inside) // Inside another form { /***** Do not put form *****/ HTM_DIV_Begin ("class=\"TL_FORM_OFF\""); - HTM_Txt (Txt_TIMELINE_NOTE[SocNot->NoteType]); - if (SocNot->Unavailable) + HTM_Txt (Txt_TIMELINE_NOTE[Not->NoteType]); + if (Not->Unavailable) HTM_TxtF (" (%s)",Txt_not_available); HTM_DIV_End (); } @@ -1985,44 +1985,44 @@ static void TL_PutFormGoToAction (const struct TL_Note *SocNot, HTM_DIV_Begin ("class=\"TL_FORM\""); /***** Begin form with parameters depending on the type of note *****/ - switch (SocNot->NoteType) + switch (Not->NoteType) { case TL_NOTE_INS_DOC_PUB_FILE: case TL_NOTE_INS_SHA_PUB_FILE: - Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]); - Brw_PutHiddenParamFilCod (SocNot->Cod); - if (SocNot->HieCod != Gbl.Hierarchy.Ins.InsCod) // Not the current institution - Ins_PutParamInsCod (SocNot->HieCod); // Go to another institution + Frm_StartFormUnique (TL_DefaultActions[Not->NoteType]); + Brw_PutHiddenParamFilCod (Not->Cod); + if (Not->HieCod != Gbl.Hierarchy.Ins.InsCod) // Not the current institution + Ins_PutParamInsCod (Not->HieCod); // Go to another institution break; case TL_NOTE_CTR_DOC_PUB_FILE: case TL_NOTE_CTR_SHA_PUB_FILE: - Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]); - Brw_PutHiddenParamFilCod (SocNot->Cod); - if (SocNot->HieCod != Gbl.Hierarchy.Ctr.CtrCod) // Not the current centre - Ctr_PutParamCtrCod (SocNot->HieCod); // Go to another centre + Frm_StartFormUnique (TL_DefaultActions[Not->NoteType]); + Brw_PutHiddenParamFilCod (Not->Cod); + if (Not->HieCod != Gbl.Hierarchy.Ctr.CtrCod) // Not the current centre + Ctr_PutParamCtrCod (Not->HieCod); // Go to another centre break; case TL_NOTE_DEG_DOC_PUB_FILE: case TL_NOTE_DEG_SHA_PUB_FILE: - Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]); - Brw_PutHiddenParamFilCod (SocNot->Cod); - if (SocNot->HieCod != Gbl.Hierarchy.Deg.DegCod) // Not the current degree - Deg_PutParamDegCod (SocNot->HieCod); // Go to another degree + Frm_StartFormUnique (TL_DefaultActions[Not->NoteType]); + Brw_PutHiddenParamFilCod (Not->Cod); + if (Not->HieCod != Gbl.Hierarchy.Deg.DegCod) // Not the current degree + Deg_PutParamDegCod (Not->HieCod); // Go to another degree break; case TL_NOTE_CRS_DOC_PUB_FILE: case TL_NOTE_CRS_SHA_PUB_FILE: - Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]); - Brw_PutHiddenParamFilCod (SocNot->Cod); - if (SocNot->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course - Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course + Frm_StartFormUnique (TL_DefaultActions[Not->NoteType]); + Brw_PutHiddenParamFilCod (Not->Cod); + if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course + Crs_PutParamCrsCod (Not->HieCod); // Go to another course break; case TL_NOTE_EXAM_ANNOUNCEMENT: - Frm_SetAnchorStr (SocNot->Cod,&Anchor); - Frm_StartFormUniqueAnchor (TL_DefaultActions[SocNot->NoteType], + Frm_SetAnchorStr (Not->Cod,&Anchor); + Frm_StartFormUniqueAnchor (TL_DefaultActions[Not->NoteType], Anchor); // Locate on this specific exam Frm_FreeAnchorStr (Anchor); - ExaAnn_PutHiddenParamExaCod (SocNot->Cod); - if (SocNot->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course - Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course + ExaAnn_PutHiddenParamExaCod (Not->Cod); + if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course + Crs_PutParamCrsCod (Not->HieCod); // Go to another course break; case TL_NOTE_POST: // Not applicable return; @@ -2035,29 +2035,29 @@ static void TL_PutFormGoToAction (const struct TL_Note *SocNot, Forums->Forum.Location, Forums->Thread.Selected, -1L); - if (SocNot->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course - Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course + if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course + Crs_PutParamCrsCod (Not->HieCod); // Go to another course break; case TL_NOTE_NOTICE: - Frm_SetAnchorStr (SocNot->Cod,&Anchor); - Frm_StartFormUniqueAnchor (TL_DefaultActions[SocNot->NoteType], + Frm_SetAnchorStr (Not->Cod,&Anchor); + Frm_StartFormUniqueAnchor (TL_DefaultActions[Not->NoteType], Anchor); Frm_FreeAnchorStr (Anchor); - Not_PutHiddenParamNotCod (SocNot->Cod); - if (SocNot->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course - Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course + Not_PutHiddenParamNotCod (Not->Cod); + if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course + Crs_PutParamCrsCod (Not->HieCod); // Go to another course break; default: // Not applicable return; } /***** Icon and link to go to action *****/ - HTM_BUTTON_SUBMIT_Begin (Txt_TIMELINE_NOTE[SocNot->NoteType], + HTM_BUTTON_SUBMIT_Begin (Txt_TIMELINE_NOTE[Not->NoteType], Str_BuildStringStr ("BT_LINK %s ICO_HIGHLIGHT", The_ClassFormInBoxBold[Gbl.Prefs.Theme]), NULL); - Ico_PutIcon (TL_Icons[SocNot->NoteType],Txt_TIMELINE_NOTE[SocNot->NoteType],"CONTEXT_ICO_x16"); - HTM_TxtF (" %s",Txt_TIMELINE_NOTE[SocNot->NoteType]); + Ico_PutIcon (TL_Icons[Not->NoteType],Txt_TIMELINE_NOTE[Not->NoteType],"CONTEXT_ICO_x16"); + HTM_TxtF (" %s",Txt_TIMELINE_NOTE[Not->NoteType]); HTM_BUTTON_End (); Str_FreeString (); @@ -2072,12 +2072,12 @@ static void TL_PutFormGoToAction (const struct TL_Note *SocNot, /********************** Get note summary and content *************************/ /*****************************************************************************/ -static void TL_GetNoteSummary (const struct TL_Note *SocNot, +static void TL_GetNoteSummary (const struct TL_Note *Not, char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]) { SummaryStr[0] = '\0'; - switch (SocNot->NoteType) + switch (Not->NoteType) { case TL_NOTE_UNKNOWN: break; @@ -2089,19 +2089,19 @@ static void TL_GetNoteSummary (const struct TL_Note *SocNot, case TL_NOTE_DEG_SHA_PUB_FILE: case TL_NOTE_CRS_DOC_PUB_FILE: case TL_NOTE_CRS_SHA_PUB_FILE: - Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,SocNot->Cod,false); + Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,Not->Cod,false); break; case TL_NOTE_EXAM_ANNOUNCEMENT: - ExaAnn_GetSummaryAndContentExamAnn (SummaryStr,NULL,SocNot->Cod,false); + ExaAnn_GetSummaryAndContentExamAnn (SummaryStr,NULL,Not->Cod,false); break; case TL_NOTE_POST: // Not applicable break; case TL_NOTE_FORUM_POST: - For_GetSummaryAndContentForumPst (SummaryStr,NULL,SocNot->Cod,false); + For_GetSummaryAndContentForumPst (SummaryStr,NULL,Not->Cod,false); break; case TL_NOTE_NOTICE: - Not_GetSummaryAndContentNotice (SummaryStr,NULL,SocNot->Cod,false); + Not_GetSummaryAndContentNotice (SummaryStr,NULL,Not->Cod,false); break; } } @@ -2112,12 +2112,12 @@ static void TL_GetNoteSummary (const struct TL_Note *SocNot, void TL_StoreAndPublishNote (TL_NoteType_t NoteType,long Cod) { - struct TL_Publication SocPub; + struct TL_Publication Pub; - TL_StoreAndPublishNoteInternal (NoteType,Cod,&SocPub); + TL_StoreAndPublishNoteInternal (NoteType,Cod,&Pub); } -static void TL_StoreAndPublishNoteInternal (TL_NoteType_t NoteType,long Cod,struct TL_Publication *SocPub) +static void TL_StoreAndPublishNoteInternal (TL_NoteType_t NoteType,long Cod,struct TL_Publication *Pub) { long HieCod; // Hierarchy code (institution/centre/degree/course) @@ -2147,7 +2147,7 @@ static void TL_StoreAndPublishNoteInternal (TL_NoteType_t NoteType,long Cod,stru } /***** Store note *****/ - SocPub->NotCod = + Pub->NotCod = DB_QueryINSERTandReturnCode ("can not create new note", "INSERT INTO tl_notes" " (NoteType,Cod,UsrCod,HieCod,Unavailable,TimeNote)" @@ -2157,9 +2157,9 @@ static void TL_StoreAndPublishNoteInternal (TL_NoteType_t NoteType,long Cod,stru Cod,Gbl.Usrs.Me.UsrDat.UsrCod,HieCod); /***** Publish note in timeline *****/ - SocPub->PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; - SocPub->PubType = TL_PUB_ORIGINAL_NOTE; - TL_PublishNoteInTimeline (SocPub); + Pub->PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; + Pub->PubType = TL_PUB_ORIGINAL_NOTE; + TL_PublishNoteInTimeline (Pub); } /*****************************************************************************/ @@ -2307,23 +2307,23 @@ void TL_MarkNotesChildrenOfFolderAsUnavailable (const char *Path) /*****************************************************************************/ /************************* Publish note in timeline **************************/ /*****************************************************************************/ -// SocPub->PubCod is set by the function +// Pub->PubCod is set by the function -void TL_PublishNoteInTimeline (struct TL_Publication *SocPub) +void TL_PublishNoteInTimeline (struct TL_Publication *Pub) { /***** Publish note in timeline *****/ - SocPub->PubCod = + Pub->PubCod = DB_QueryINSERTandReturnCode ("can not publish note", "INSERT INTO tl_pubs" " (NotCod,PublisherCod,PubType,TimePublish)" " VALUES" " (%ld,%ld,%u,NOW())", - SocPub->NotCod, - SocPub->PublisherCod, - (unsigned) SocPub->PubType); + Pub->NotCod, + Pub->PublisherCod, + (unsigned) Pub->PubType); /***** Increment number of publications in user's figures *****/ - Prf_IncrementNumSocPubUsr (SocPub->PublisherCod); + Prf_IncrementNumPubsUsr (Pub->PublisherCod); } /*****************************************************************************/ @@ -2356,7 +2356,7 @@ static void TL_PutFormToWriteNewPost (struct TL_Timeline *Timeline) /* Form to write the post */ HTM_DIV_Begin ("class=\"TL_FORM_NEW_PST TL_RIGHT_WIDTH\""); - TL_FormStart (Timeline,ActRcvSocPstGbl,ActRcvSocPstUsr); + TL_FormStart (Timeline,ActRcvTL_PstGbl,ActRcvTL_PstUsr); TL_PutTextarea (Txt_New_TIMELINE_post,"TL_PST_TEXTAREA TL_RIGHT_WIDTH"); Frm_EndForm (); HTM_DIV_End (); @@ -2457,7 +2457,7 @@ static long TL_ReceivePost (void) { struct TL_PostContent Content; long PstCod; - struct TL_Publication SocPub; + struct TL_Publication Pub; /***** Get the content of the new post *****/ Par_GetParAndChangeFormat ("Txt",Content.Txt,Cns_MAX_BYTES_LONG_TEXT, @@ -2491,18 +2491,18 @@ static long TL_ReceivePost (void) Content.Media.MedCod); /* Insert post in notes */ - TL_StoreAndPublishNoteInternal (TL_NOTE_POST,PstCod,&SocPub); + TL_StoreAndPublishNoteInternal (TL_NOTE_POST,PstCod,&Pub); /***** Analyze content and store notifications about mentions *****/ - Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (SocPub.PubCod,Content.Txt); + Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt); } else // Text and image are empty - SocPub.NotCod = -1L; + Pub.NotCod = -1L; /***** Free image *****/ Med_MediaDestructor (&Content.Media); - return SocPub.NotCod; + return Pub.NotCod; } /*****************************************************************************/ @@ -2566,7 +2566,7 @@ static void TL_PutHiddenFormToWriteNewCommentToNote (const struct TL_Timeline *T HTM_DIV_Begin ("class=\"TL_COM_CONT TL_COMM_WIDTH\""); /* Begin form to write the post */ - TL_FormStart (Timeline,ActRcvSocComGbl,ActRcvSocComUsr); + TL_FormStart (Timeline,ActRcvTL_ComGbl,ActRcvTL_ComUsr); TL_PutHiddenParamNotCod (NotCod); /* Textarea and button */ @@ -2600,7 +2600,7 @@ static unsigned long TL_GetNumCommentsInNote (long NotCod) /*****************************************************************************/ static void TL_WriteCommentsInNote (struct TL_Timeline *Timeline, - const struct TL_Note *SocNot, + const struct TL_Note *Not, unsigned NumComments) { MYSQL_RES *mysql_res; @@ -2644,7 +2644,7 @@ static void TL_WriteCommentsInNote (struct TL_Timeline *Timeline, " ORDER BY tl_pubs.PubCod DESC LIMIT %u" ") AS comments" " ORDER BY PubCod", - SocNot->NotCod,(unsigned) TL_PUB_COMMENT_TO_NOTE, + Not->NotCod,(unsigned) TL_PUB_COMMENT_TO_NOTE, NumFinalCommentsToGet); /* @@ -2700,8 +2700,8 @@ static void TL_WriteCommentsInNote (struct TL_Timeline *Timeline, /***** Div which content will be updated via AJAX *****/ HTM_DIV_Begin ("id=\"%s\" class=\"TL_RIGHT_WIDTH\"",IdComments); - TL_FormToShowHiddenComments (ActShoHidSocComGbl,ActShoHidSocComUsr, - SocNot->NotCod, + TL_FormToShowHiddenComments (ActShoHidTL_ComGbl,ActShoHidTL_ComUsr, + Not->NotCod, IdComments, NumInitialComments); HTM_DIV_End (); @@ -2886,22 +2886,22 @@ static void TL_WriteOneCommentInList (struct TL_Timeline *Timeline, MYSQL_RES *mysql_res) { MYSQL_ROW row; - struct TL_Comment SocCom; + struct TL_Comment Com; /***** Initialize image *****/ - Med_MediaConstructor (&SocCom.Content.Media); + Med_MediaConstructor (&Com.Content.Media); /***** Get data of comment *****/ row = mysql_fetch_row (mysql_res); - TL_GetDataOfCommentFromRow (row,&SocCom); + TL_GetDataOfCommentFromRow (row,&Com); /***** Write comment *****/ - TL_WriteComment (Timeline,&SocCom, + TL_WriteComment (Timeline,&Com, TL_TOP_MESSAGE_NONE,-1L, false); // Not alone /***** Free image *****/ - Med_MediaDestructor (&SocCom.Content.Media); + Med_MediaDestructor (&Com.Content.Media); } /*****************************************************************************/ @@ -2967,7 +2967,7 @@ static void TL_PutIconToToggleComments (const char *UniqueId, /*****************************************************************************/ static void TL_WriteComment (struct TL_Timeline *Timeline, - struct TL_Comment *SocCom, + struct TL_Comment *Com, TL_TopMessage_t TopMessage,long UsrCod, bool ShowCommentAlone) // Comment is shown alone, not in a list { @@ -3006,15 +3006,15 @@ static void TL_WriteComment (struct TL_Timeline *Timeline, else HTM_LI_Begin ("class=\"TL_COM\""); - if (SocCom->PubCod <= 0 || - SocCom->NotCod <= 0 || - SocCom->UsrCod <= 0) + if (Com->PubCod <= 0 || + Com->NotCod <= 0 || + Com->UsrCod <= 0) Ale_ShowAlert (Ale_ERROR,"Error in comment."); else { /***** Get author's data *****/ Usr_UsrDataConstructor (&UsrDat); - UsrDat.UsrCod = SocCom->UsrCod; + UsrDat.UsrCod = Com->UsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS); IAmTheAuthor = Usr_ItsMe (UsrDat.UsrCod); @@ -3033,18 +3033,18 @@ static void TL_WriteComment (struct TL_Timeline *Timeline, TL_WriteAuthorComment (&UsrDat); /* Write date and time */ - TL_WriteDateTime (SocCom->DateTimeUTC); + TL_WriteDateTime (Com->DateTimeUTC); /* Write content of the comment */ - if (SocCom->Content.Txt[0]) + if (Com->Content.Txt[0]) { HTM_DIV_Begin ("class=\"TL_TXT\""); - Msg_WriteMsgContent (SocCom->Content.Txt,Cns_MAX_BYTES_LONG_TEXT,true,false); + Msg_WriteMsgContent (Com->Content.Txt,Cns_MAX_BYTES_LONG_TEXT,true,false); HTM_DIV_End (); } /* Show image */ - Med_ShowMedia (&SocCom->Content.Media,"TL_COM_MED_CONT TL_COMM_WIDTH", + Med_ShowMedia (&Com->Content.Media,"TL_COM_MED_CONT TL_COMM_WIDTH", "TL_COM_MED TL_COMM_WIDTH"); /* Start foot container */ @@ -3053,13 +3053,13 @@ static void TL_WriteComment (struct TL_Timeline *Timeline, /* Fav zone */ HTM_DIV_Begin ("id=\"fav_com_%s_%u\" class=\"TL_FAV_COM TL_FAV_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); - TL_Fav_PutFormToFavUnfComment (SocCom,TL_SHOW_FEW_USRS); + TL_Fav_PutFormToFavUnfComment (Com,TL_SHOW_FEW_USRS); HTM_DIV_End (); /* Put icon to remove this comment */ HTM_DIV_Begin ("class=\"TL_REM\""); if (IAmTheAuthor && !ShowCommentAlone) - TL_PutFormToRemoveComment (Timeline,SocCom->PubCod); + TL_PutFormToRemoveComment (Timeline,Com->PubCod); HTM_DIV_End (); /* End foot container */ @@ -3111,7 +3111,7 @@ static void TL_PutFormToRemoveComment (const struct TL_Timeline *Timeline, extern const char *Txt_Remove; /***** Form to remove publication *****/ - TL_FormStart (Timeline,ActReqRemSocComGbl,ActReqRemSocComUsr); + TL_FormStart (Timeline,ActReqRemTL_ComGbl,ActReqRemTL_ComUsr); TL_PutHiddenParamPubCod (PubCod); Ico_PutIconLink ("trash.svg",Txt_Remove); Frm_EndForm (); @@ -3127,7 +3127,7 @@ static void TL_PutFormToRemovePublication (const struct TL_Timeline *Timeline, extern const char *Txt_Remove; /***** Form to remove publication *****/ - TL_FormStart (Timeline,ActReqRemSocPubGbl,ActReqRemSocPubUsr); + TL_FormStart (Timeline,ActReqRemTL_PubGbl,ActReqRemTL_PubUsr); TL_PutHiddenParamNotCod (NotCod); Ico_PutIconLink ("trash.svg",Txt_Remove); Frm_EndForm (); @@ -3220,14 +3220,14 @@ static long TL_ReceiveComment (void) { extern const char *Txt_The_original_post_no_longer_exists; struct TL_PostContent Content; - struct TL_Note SocNot; - struct TL_Publication SocPub; + struct TL_Note Not; + struct TL_Publication Pub; /***** Get data of note *****/ - SocNot.NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&Not); - if (SocNot.NotCod > 0) + if (Not.NotCod > 0) { /***** Get the content of the comment *****/ Par_GetParAndChangeFormat ("Txt",Content.Txt,Cns_MAX_BYTES_LONG_TEXT, @@ -3251,10 +3251,10 @@ static long TL_ReceiveComment (void) /***** Publish *****/ /* Insert into publications */ - SocPub.NotCod = SocNot.NotCod; - SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; - SocPub.PubType = TL_PUB_COMMENT_TO_NOTE; - TL_PublishNoteInTimeline (&SocPub); // Set SocPub.PubCod + Pub.NotCod = Not.NotCod; + Pub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; + Pub.PubType = TL_PUB_COMMENT_TO_NOTE; + TL_PublishNoteInTimeline (&Pub); // Set Pub.PubCod /* Insert comment content in the database */ DB_QueryINSERT ("can not store comment content", @@ -3262,15 +3262,15 @@ static long TL_ReceiveComment (void) " (PubCod,Txt,MedCod)" " VALUES" " (%ld,'%s',%ld)", - SocPub.PubCod, + Pub.PubCod, Content.Txt, Content.Media.MedCod); /***** Store notifications about the new comment *****/ - Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TIMELINE_COMMENT,SocPub.PubCod); + Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TIMELINE_COMMENT,Pub.PubCod); /***** Analyze content and store notifications about mentions *****/ - Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (SocPub.PubCod,Content.Txt); + Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt); } /***** Free image *****/ @@ -3279,7 +3279,7 @@ static long TL_ReceiveComment (void) else Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); - return SocNot.NotCod; + return Not.NotCod; } /*****************************************************************************/ @@ -3370,16 +3370,16 @@ static void TL_RequestRemovalNote (struct TL_Timeline *Timeline) extern const char *Txt_The_original_post_no_longer_exists; extern const char *Txt_Do_you_really_want_to_remove_the_following_post; extern const char *Txt_Remove; - struct TL_Note SocNot; + struct TL_Note Not; bool ItsMe; /***** Get data of note *****/ - SocNot.NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&Not); - if (SocNot.NotCod > 0) + if (Not.NotCod > 0) { - ItsMe = Usr_ItsMe (SocNot.UsrCod); + ItsMe = Usr_ItsMe (Not.UsrCod); if (ItsMe) // I am the author of this note { /***** Show question and button to remove note *****/ @@ -3387,19 +3387,19 @@ static void TL_RequestRemovalNote (struct TL_Timeline *Timeline) Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_post); /* Show note */ - TL_WriteNote (Timeline,&SocNot, + TL_WriteNote (Timeline,&Not, TL_TOP_MESSAGE_NONE,-1L, TL_DONT_HIGHLIGHT_NOTE, TL_SHOW_NOTE_ALONE); /* End alert */ - Timeline->NotCod = SocNot.NotCod; // Note to be removed + Timeline->NotCod = Not.NotCod; // Note to be removed if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) - Ale_ShowAlertAndButton2 (ActRemSocPubUsr,"timeline",NULL, + Ale_ShowAlertAndButton2 (ActRemTL_PubUsr,"timeline",NULL, TL_PutParamsRemoveNote,Timeline, Btn_REMOVE_BUTTON,Txt_Remove); else - Ale_ShowAlertAndButton2 (ActRemSocPubGbl,NULL,NULL, + Ale_ShowAlertAndButton2 (ActRemTL_PubGbl,NULL,NULL, TL_PutParamsRemoveNote,Timeline, Btn_REMOVE_BUTTON,Txt_Remove); } @@ -3472,23 +3472,23 @@ static void TL_RemoveNote (void) { extern const char *Txt_The_original_post_no_longer_exists; extern const char *Txt_TIMELINE_Post_removed; - struct TL_Note SocNot; + struct TL_Note Not; bool ItsMe; /***** Get data of note *****/ - SocNot.NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&Not); - if (SocNot.NotCod > 0) + if (Not.NotCod > 0) { - ItsMe = Usr_ItsMe (SocNot.UsrCod); + ItsMe = Usr_ItsMe (Not.UsrCod); if (ItsMe) // I am the author of this note { /***** Delete note from database *****/ - TL_RemoveNoteMediaAndDBEntries (&SocNot); + TL_RemoveNoteMediaAndDBEntries (&Not); /***** Reset note *****/ - TL_ResetNote (&SocNot); + TL_ResetNote (&Not); /***** Message of success *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_TIMELINE_Post_removed); @@ -3502,7 +3502,7 @@ static void TL_RemoveNote (void) /*********************** Remove a note from database *************************/ /*****************************************************************************/ -static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot) +static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *Not) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -3517,7 +3517,7 @@ static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot) "SELECT PubCod" " FROM tl_pubs" " WHERE NotCod=%ld AND PubType=%u", - SocNot->NotCod, + Not->NotCod, (unsigned) TL_PUB_COMMENT_TO_NOTE); /* For each comment... */ @@ -3538,14 +3538,14 @@ static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot) DB_FreeMySQLResult (&mysql_res); /***** Remove media associated to post *****/ - if (SocNot->NoteType == TL_NOTE_POST) + if (Not->NoteType == TL_NOTE_POST) { /* Remove media associated to a post from database */ if (DB_QuerySELECT (&mysql_res,"can not get media", "SELECT MedCod" // row[0] " FROM tl_posts" " WHERE PstCod=%ld", - SocNot->Cod) == 1) // Result should have a unique row + Not->Cod) == 1) // Result should have a unique row { /* Get media code */ row = mysql_fetch_row (mysql_res); @@ -3562,7 +3562,7 @@ static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot) /***** Mark possible notifications on the publications of this note as removed *****/ /* Mark notifications of the original note as removed */ - PubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); + PubCod = TL_GetPubCodOfOriginalNote (Not->NotCod); if (PubCod > 0) { Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV ,PubCod); @@ -3574,28 +3574,28 @@ static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot) DB_QueryDELETE ("can not remove favs for note", "DELETE FROM tl_notes_fav" " WHERE NotCod=%ld", - SocNot->NotCod); + Not->NotCod); /***** Remove all the publications of this note *****/ DB_QueryDELETE ("can not remove a publication", "DELETE FROM tl_pubs" " WHERE NotCod=%ld", - SocNot->NotCod); + Not->NotCod); /***** Remove note *****/ DB_QueryDELETE ("can not remove a note", "DELETE FROM tl_notes" " WHERE NotCod=%ld" " AND UsrCod=%ld", // Extra check: I am the author - SocNot->NotCod, + Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); - if (SocNot->NoteType == TL_NOTE_POST) + if (Not->NoteType == TL_NOTE_POST) /***** Remove post *****/ DB_QueryDELETE ("can not remove a post", "DELETE FROM tl_posts" " WHERE PstCod=%ld", - SocNot->Cod); + Not->Cod); } /*****************************************************************************/ @@ -3701,19 +3701,19 @@ static void TL_RequestRemovalComment (struct TL_Timeline *Timeline) extern const char *Txt_The_comment_no_longer_exists; extern const char *Txt_Do_you_really_want_to_remove_the_following_comment; extern const char *Txt_Remove; - struct TL_Comment SocCom; + struct TL_Comment Com; bool ItsMe; /***** Initialize image *****/ - Med_MediaConstructor (&SocCom.Content.Media); + Med_MediaConstructor (&Com.Content.Media); /***** Get data of comment *****/ - SocCom.PubCod = TL_GetParamPubCod (); - TL_GetDataOfCommByCod (&SocCom); + Com.PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (&Com); - if (SocCom.PubCod > 0) + if (Com.PubCod > 0) { - ItsMe = Usr_ItsMe (SocCom.UsrCod); + ItsMe = Usr_ItsMe (Com.UsrCod); if (ItsMe) // I am the author of this comment { /***** Show question and button to remove comment *****/ @@ -3721,18 +3721,18 @@ static void TL_RequestRemovalComment (struct TL_Timeline *Timeline) Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_comment); /* Show comment */ - TL_WriteComment (Timeline,&SocCom, + TL_WriteComment (Timeline,&Com, TL_TOP_MESSAGE_NONE,-1L, true); // Alone /* End alert */ - Timeline->PubCod = SocCom.PubCod; // Publication to be removed + Timeline->PubCod = Com.PubCod; // Publication to be removed if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) - Ale_ShowAlertAndButton2 (ActRemSocComUsr,"timeline",NULL, + Ale_ShowAlertAndButton2 (ActRemTL_ComUsr,"timeline",NULL, TL_PutParamsRemoveComment,Timeline, Btn_REMOVE_BUTTON,Txt_Remove); else - Ale_ShowAlertAndButton2 (ActRemSocComGbl,NULL,NULL, + Ale_ShowAlertAndButton2 (ActRemTL_ComGbl,NULL,NULL, TL_PutParamsRemoveComment,Timeline, Btn_REMOVE_BUTTON,Txt_Remove); } @@ -3741,7 +3741,7 @@ static void TL_RequestRemovalComment (struct TL_Timeline *Timeline) Ale_ShowAlert (Ale_WARNING,Txt_The_comment_no_longer_exists); /***** Free image *****/ - Med_MediaDestructor (&SocCom.Content.Media); + Med_MediaDestructor (&Com.Content.Media); } /*****************************************************************************/ @@ -3808,27 +3808,27 @@ static void TL_RemoveComment (void) { extern const char *Txt_The_comment_no_longer_exists; extern const char *Txt_Comment_removed; - struct TL_Comment SocCom; + struct TL_Comment Com; bool ItsMe; /***** Initialize image *****/ - Med_MediaConstructor (&SocCom.Content.Media); + Med_MediaConstructor (&Com.Content.Media); /***** Get data of comment *****/ - SocCom.PubCod = TL_GetParamPubCod (); - TL_GetDataOfCommByCod (&SocCom); + Com.PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (&Com); - if (SocCom.PubCod > 0) + if (Com.PubCod > 0) { - ItsMe = Usr_ItsMe (SocCom.UsrCod); + ItsMe = Usr_ItsMe (Com.UsrCod); if (ItsMe) // I am the author of this comment { /***** Remove media associated to comment and delete comment from database *****/ - TL_RemoveCommentMediaAndDBEntries (SocCom.PubCod); + TL_RemoveCommentMediaAndDBEntries (Com.PubCod); /***** Reset fields of comment *****/ - TL_ResetComment (&SocCom); + TL_ResetComment (&Com); /***** Message of success *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_Comment_removed); @@ -3838,7 +3838,7 @@ static void TL_RemoveComment (void) Ale_ShowAlert (Ale_WARNING,Txt_The_comment_no_longer_exists); /***** Free image *****/ - Med_MediaDestructor (&SocCom.Content.Media); + Med_MediaDestructor (&Com.Content.Media); } /*****************************************************************************/ @@ -4151,12 +4151,12 @@ void TL_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr, /******************** Get data of note using its code ************************/ /*****************************************************************************/ -void TL_GetDataOfNoteByCod (struct TL_Note *SocNot) +void TL_GetDataOfNoteByCod (struct TL_Note *Not) { MYSQL_RES *mysql_res; MYSQL_ROW row; - if (SocNot->NotCod > 0) + if (Not->NotCod > 0) { /***** Get data of note from database *****/ if (DB_QuerySELECT (&mysql_res,"can not get data of note", @@ -4169,34 +4169,34 @@ void TL_GetDataOfNoteByCod (struct TL_Note *SocNot) "UNIX_TIMESTAMP(TimeNote)" // row[6] " FROM tl_notes" " WHERE NotCod=%ld", - SocNot->NotCod)) + Not->NotCod)) { /***** Get data of note *****/ row = mysql_fetch_row (mysql_res); - TL_GetDataOfNoteFromRow (row,SocNot); + TL_GetDataOfNoteFromRow (row,Not); } else /***** Reset fields of note *****/ - TL_ResetNote (SocNot); + TL_ResetNote (Not); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); } else /***** Reset fields of note *****/ - TL_ResetNote (SocNot); + TL_ResetNote (Not); } /*****************************************************************************/ /******************* Get data of comment using its code **********************/ /*****************************************************************************/ -void TL_GetDataOfCommByCod (struct TL_Comment *SocCom) +void TL_GetDataOfCommByCod (struct TL_Comment *Com) { MYSQL_RES *mysql_res; MYSQL_ROW row; - if (SocCom->PubCod > 0) + if (Com->PubCod > 0) { /***** Get data of comment from database *****/ if (DB_QuerySELECT (&mysql_res,"can not get data of comment", @@ -4210,22 +4210,22 @@ void TL_GetDataOfCommByCod (struct TL_Comment *SocCom) " WHERE tl_pubs.PubCod=%ld" " AND tl_pubs.PubType=%u" " AND tl_pubs.PubCod=tl_comments.PubCod", - SocCom->PubCod,(unsigned) TL_PUB_COMMENT_TO_NOTE)) + Com->PubCod,(unsigned) TL_PUB_COMMENT_TO_NOTE)) { /***** Get data of comment *****/ row = mysql_fetch_row (mysql_res); - TL_GetDataOfCommentFromRow (row,SocCom); + TL_GetDataOfCommentFromRow (row,Com); } else /***** Reset fields of comment *****/ - TL_ResetComment (SocCom); + TL_ResetComment (Com); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); } else /***** Reset fields of comment *****/ - TL_ResetComment (SocCom); + TL_ResetComment (Com); } /*****************************************************************************/ @@ -4233,7 +4233,7 @@ void TL_GetDataOfCommByCod (struct TL_Comment *SocCom) /*****************************************************************************/ static void TL_GetDataOfPublicationFromNextRow (MYSQL_RES *mysql_res, - struct TL_Publication *SocPub) + struct TL_Publication *Pub) { static const TL_TopMessage_t TopMessages[TL_NUM_PUB_TYPES] = { @@ -4254,24 +4254,24 @@ static void TL_GetDataOfPublicationFromNextRow (MYSQL_RES *mysql_res, */ /***** Get code of publication (row[0]) *****/ - SocPub->PubCod = Str_ConvertStrCodToLongCod (row[0]); + Pub->PubCod = Str_ConvertStrCodToLongCod (row[0]); /***** Get note code (row[1]) *****/ - SocPub->NotCod = Str_ConvertStrCodToLongCod (row[1]); + Pub->NotCod = Str_ConvertStrCodToLongCod (row[1]); /***** Get publisher's code (row[2]) *****/ - SocPub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]); + Pub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]); /***** Get type of publication (row[3]) *****/ - SocPub->PubType = TL_GetPubTypeFromStr ((const char *) row[3]); - SocPub->TopMessage = TopMessages[SocPub->PubType]; + Pub->PubType = TL_GetPubTypeFromStr ((const char *) row[3]); + Pub->TopMessage = TopMessages[Pub->PubType]; } /*****************************************************************************/ /************************ Get data of note from row **************************/ /*****************************************************************************/ -static void TL_GetDataOfNoteFromRow (MYSQL_ROW row,struct TL_Note *SocNot) +static void TL_GetDataOfNoteFromRow (MYSQL_ROW row,struct TL_Note *Not) { /* row[0]: NotCod @@ -4283,31 +4283,31 @@ static void TL_GetDataOfNoteFromRow (MYSQL_ROW row,struct TL_Note *SocNot) row[5]: UNIX_TIMESTAMP(TimeNote) */ /***** Get code (row[0]) *****/ - SocNot->NotCod = Str_ConvertStrCodToLongCod (row[0]); + Not->NotCod = Str_ConvertStrCodToLongCod (row[0]); /***** Get note type (row[1]) *****/ - SocNot->NoteType = TL_GetNoteTypeFromStr ((const char *) row[1]); + Not->NoteType = TL_GetNoteTypeFromStr ((const char *) row[1]); /***** Get file/post... code (row[2]) *****/ - SocNot->Cod = Str_ConvertStrCodToLongCod (row[2]); + Not->Cod = Str_ConvertStrCodToLongCod (row[2]); /***** Get (from) user code (row[3]) *****/ - SocNot->UsrCod = Str_ConvertStrCodToLongCod (row[3]); + Not->UsrCod = Str_ConvertStrCodToLongCod (row[3]); /***** Get hierarchy code (row[4]) *****/ - SocNot->HieCod = Str_ConvertStrCodToLongCod (row[4]); + Not->HieCod = Str_ConvertStrCodToLongCod (row[4]); /***** File/post... unavailable (row[5]) *****/ - SocNot->Unavailable = (row[5][0] == 'Y'); + Not->Unavailable = (row[5][0] == 'Y'); /***** Get time of the note (row[6]) *****/ - SocNot->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[6]); + Not->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[6]); /***** Get number of times this note has been shared *****/ - TL_Sha_UpdateNumTimesANoteHasBeenShared (SocNot); + TL_Sha_UpdateNumTimesANoteHasBeenShared (Not); /***** Get number of times this note has been favourited *****/ - TL_Fav_GetNumTimesANoteHasBeenFav (SocNot); + TL_Fav_GetNumTimesANoteHasBeenFav (Not); } /*****************************************************************************/ @@ -4344,7 +4344,7 @@ static TL_NoteType_t TL_GetNoteTypeFromStr (const char *Str) /********************** Get data of comment from row *************************/ /*****************************************************************************/ -static void TL_GetDataOfCommentFromRow (MYSQL_ROW row,struct TL_Comment *SocCom) +static void TL_GetDataOfCommentFromRow (MYSQL_ROW row,struct TL_Comment *Com) { /* row[0]: PubCod @@ -4355,69 +4355,69 @@ static void TL_GetDataOfCommentFromRow (MYSQL_ROW row,struct TL_Comment *SocCom) row[5]: MedCod */ /***** Get code of comment (row[0]) *****/ - SocCom->PubCod = Str_ConvertStrCodToLongCod (row[0]); + Com->PubCod = Str_ConvertStrCodToLongCod (row[0]); /***** Get (from) user code (row[1]) *****/ - SocCom->UsrCod = Str_ConvertStrCodToLongCod (row[1]); + Com->UsrCod = Str_ConvertStrCodToLongCod (row[1]); /***** Get code of note (row[2]) *****/ - SocCom->NotCod = Str_ConvertStrCodToLongCod (row[2]); + Com->NotCod = Str_ConvertStrCodToLongCod (row[2]); /***** Get time of the note (row[3]) *****/ - SocCom->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[3]); + Com->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[3]); /***** Get text content (row[4]) *****/ - Str_Copy (SocCom->Content.Txt,row[4], + Str_Copy (Com->Content.Txt,row[4], Cns_MAX_BYTES_LONG_TEXT); /***** Get number of times this comment has been favourited *****/ - TL_Fav_GetNumTimesACommHasBeenFav (SocCom); + TL_Fav_GetNumTimesACommHasBeenFav (Com); /***** Get media content (row[5]) *****/ - SocCom->Content.Media.MedCod = Str_ConvertStrCodToLongCod (row[5]); - Med_GetMediaDataByCod (&SocCom->Content.Media); + Com->Content.Media.MedCod = Str_ConvertStrCodToLongCod (row[5]); + Med_GetMediaDataByCod (&Com->Content.Media); } /*****************************************************************************/ /************************ Reset fields of publication ************************/ /*****************************************************************************/ -static void TL_ResetPublication (struct TL_Publication *SocPub) +static void TL_ResetPublication (struct TL_Publication *Pub) { - SocPub->PubCod = -1L; - SocPub->NotCod = -1L; - SocPub->PublisherCod = -1L; - SocPub->PubType = TL_PUB_UNKNOWN; - SocPub->TopMessage = TL_TOP_MESSAGE_NONE; + Pub->PubCod = -1L; + Pub->NotCod = -1L; + Pub->PublisherCod = -1L; + Pub->PubType = TL_PUB_UNKNOWN; + Pub->TopMessage = TL_TOP_MESSAGE_NONE; } /*****************************************************************************/ /*************************** Reset fields of note ****************************/ /*****************************************************************************/ -static void TL_ResetNote (struct TL_Note *SocNot) +static void TL_ResetNote (struct TL_Note *Not) { - SocNot->NotCod = -1L; - SocNot->NoteType = TL_NOTE_UNKNOWN; - SocNot->UsrCod = -1L; - SocNot->HieCod = -1L; - SocNot->Cod = -1L; - SocNot->Unavailable = false; - SocNot->DateTimeUTC = (time_t) 0; - SocNot->NumShared = 0; + Not->NotCod = -1L; + Not->NoteType = TL_NOTE_UNKNOWN; + Not->UsrCod = -1L; + Not->HieCod = -1L; + Not->Cod = -1L; + Not->Unavailable = false; + Not->DateTimeUTC = (time_t) 0; + Not->NumShared = 0; } /*****************************************************************************/ /************************** Reset fields of comment **************************/ /*****************************************************************************/ -static void TL_ResetComment (struct TL_Comment *SocCom) +static void TL_ResetComment (struct TL_Comment *Com) { - SocCom->PubCod = -1L; - SocCom->UsrCod = -1L; - SocCom->NotCod = -1L; - SocCom->DateTimeUTC = (time_t) 0; - SocCom->Content.Txt[0] = '\0'; + Com->PubCod = -1L; + Com->UsrCod = -1L; + Com->NotCod = -1L; + Com->DateTimeUTC = (time_t) 0; + Com->Content.Txt[0] = '\0'; } /*****************************************************************************/ @@ -4486,14 +4486,14 @@ void TL_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], { MYSQL_RES *mysql_res; MYSQL_ROW row; - struct TL_Publication SocPub; - struct TL_Note SocNot; + struct TL_Publication Pub; + struct TL_Note Not; struct TL_PostContent Content; size_t Length; bool ContentCopied = false; /***** Return nothing on error *****/ - SocPub.PubType = TL_PUB_UNKNOWN; + Pub.PubType = TL_PUB_UNKNOWN; SummaryStr[0] = '\0'; // Return nothing on error Content.Txt[0] = '\0'; @@ -4506,30 +4506,30 @@ void TL_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], " FROM tl_pubs WHERE PubCod=%ld", PubCod) == 1) // Result should have a unique row /* Get data of publication from row */ - TL_GetDataOfPublicationFromNextRow (mysql_res,&SocPub); + TL_GetDataOfPublicationFromNextRow (mysql_res,&Pub); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); /***** Get summary and content *****/ - switch (SocPub.PubType) + switch (Pub.PubType) { case TL_PUB_UNKNOWN: break; case TL_PUB_ORIGINAL_NOTE: case TL_PUB_SHARED_NOTE: /* Get data of note */ - SocNot.NotCod = SocPub.NotCod; - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = Pub.NotCod; + TL_GetDataOfNoteByCod (&Not); - if (SocNot.NoteType == TL_NOTE_POST) + if (Not.NoteType == TL_NOTE_POST) { /***** Get content of post from database *****/ if (DB_QuerySELECT (&mysql_res,"can not get the content of a post", "SELECT Txt" // row[0] " FROM tl_posts" " WHERE PstCod=%ld", - SocNot.Cod) == 1) // Result should have a unique row + Not.Cod) == 1) // Result should have a unique row { /***** Get row *****/ row = mysql_fetch_row (mysql_res); @@ -4560,7 +4560,7 @@ void TL_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], Ntf_MAX_BYTES_SUMMARY); } else - TL_GetNoteSummary (&SocNot,SummaryStr); + TL_GetNoteSummary (&Not,SummaryStr); break; case TL_PUB_COMMENT_TO_NOTE: /***** Get content of post from database *****/ @@ -4569,7 +4569,7 @@ void TL_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], "SELECT Txt" // row[0] " FROM tl_comments" " WHERE PubCod=%ld", - SocPub.PubCod) == 1) // Result should have a unique row + Pub.PubCod) == 1) // Result should have a unique row { /***** Get row *****/ row = mysql_fetch_row (mysql_res); diff --git a/swad_timeline.h b/swad_timeline.h index faa777ab9..f70471afd 100644 --- a/swad_timeline.h +++ b/swad_timeline.h @@ -194,7 +194,7 @@ void TL_MarkNoteAsUnavailable (TL_NoteType_t NoteType,long Cod); void TL_MarkNoteOneFileAsUnavailable (const char *Path); void TL_MarkNotesChildrenOfFolderAsUnavailable (const char *Path); -void TL_PublishNoteInTimeline (struct TL_Publication *SocPub); +void TL_PublishNoteInTimeline (struct TL_Publication *Pub); void TL_ReceivePostUsr (void); void TL_ReceivePostGbl (void); @@ -236,8 +236,8 @@ void TL_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr, const char *ParamFormat,long ParamCod, const char *Icon,const char *Title); -void TL_GetDataOfNoteByCod (struct TL_Note *SocNot); -void TL_GetDataOfCommByCod (struct TL_Comment *SocCom); +void TL_GetDataOfNoteByCod (struct TL_Note *Not); +void TL_GetDataOfCommByCod (struct TL_Comment *Com); void TL_ClearOldTimelinesDB (void); diff --git a/swad_timeline_favourite.c b/swad_timeline_favourite.c index d648455a5..1eb63aade 100644 --- a/swad_timeline_favourite.c +++ b/swad_timeline_favourite.c @@ -63,18 +63,18 @@ static void TL_Fav_PutFormToUnfNote (long ParamCod); static void TL_Fav_PutFormToFavComment (long ParamCod); static void TL_Fav_PutFormToUnfComment (long ParamCod); -static void TL_Fav_FavNote (struct TL_Note *SocNot); -static void TL_Fav_UnfNote (struct TL_Note *SocNot); +static void TL_Fav_FavNote (struct TL_Note *Not); +static void TL_Fav_UnfNote (struct TL_Note *Not); -static void TL_Fav_FavComment (struct TL_Comment *SocCom); -static void TL_Fav_UnfComment (struct TL_Comment *SocCom); +static void TL_Fav_FavComment (struct TL_Comment *Com); +static void TL_Fav_UnfComment (struct TL_Comment *Com); static bool TL_Fav_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod); static bool TL_Fav_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod); -static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot, +static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs); -static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom, +static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *Com, TL_HowManyUsrs_t HowManyUsrs); /*****************************************************************************/ @@ -108,7 +108,7 @@ static void TL_Fav_PutFormToFavNote (long ParamCod) extern const char *Txt_Mark_as_favourite; /***** Form and icon to mark note as favourite *****/ - TL_FormFavSha (ActFavSocNotGbl,ActFavSocNotUsr, + TL_FormFavSha (ActFavTL_NotGbl,ActFavTL_NotUsr, "NotCod=%ld",ParamCod, TL_ICON_FAV,Txt_Mark_as_favourite); } @@ -118,7 +118,7 @@ static void TL_Fav_PutFormToUnfNote (long ParamCod) extern const char *Txt_TIMELINE_NOTE_Favourite; /***** Form and icon to unfav (remove mark as favourite) note *****/ - TL_FormFavSha (ActUnfSocNotGbl,ActUnfSocNotUsr, + TL_FormFavSha (ActUnfTL_NotGbl,ActUnfTL_NotUsr, "NotCod=%ld",ParamCod, TL_ICON_FAVED,Txt_TIMELINE_NOTE_Favourite); } @@ -132,7 +132,7 @@ static void TL_Fav_PutFormToFavComment (long ParamCod) extern const char *Txt_Mark_as_favourite; /***** Form and icon to mark comment as favourite *****/ - TL_FormFavSha (ActFavSocComGbl,ActFavSocComUsr, + TL_FormFavSha (ActFavTL_ComGbl,ActFavTL_ComUsr, "PubCod=%ld",ParamCod, TL_ICON_FAV,Txt_Mark_as_favourite); } @@ -142,7 +142,7 @@ static void TL_Fav_PutFormToUnfComment (long ParamCod) extern const char *Txt_TIMELINE_NOTE_Favourite; /***** Form and icon to unfav (remove mark as favourite) comment *****/ - TL_FormFavSha (ActUnfSocComGbl,ActUnfSocComUsr, + TL_FormFavSha (ActUnfTL_ComGbl,ActUnfTL_ComUsr, "PubCod=%ld",ParamCod, TL_ICON_FAVED,Txt_TIMELINE_NOTE_Favourite); } @@ -162,14 +162,14 @@ void TL_Fav_ShowAllFaversNoteUsr (void) void TL_Fav_ShowAllFaversNoteGbl (void) { - struct TL_Note SocNot; + struct TL_Note Not; /***** Get data of note *****/ - SocNot.NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&Not); /***** Write HTML inside DIV with form to fav/unfav *****/ - TL_Fav_PutFormToFavUnfNote (&SocNot,TL_SHOW_ALL_USRS); + TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_ALL_USRS); } void TL_Fav_FavNoteUsr (void) @@ -183,13 +183,13 @@ void TL_Fav_FavNoteUsr (void) void TL_Fav_FavNoteGbl (void) { - struct TL_Note SocNot; + struct TL_Note Not; /***** Mark note as favourite *****/ - TL_Fav_FavNote (&SocNot); + TL_Fav_FavNote (&Not); /***** Write HTML inside DIV with form to unfav *****/ - TL_Fav_PutFormToFavUnfNote (&SocNot,TL_SHOW_FEW_USRS); + TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_FEW_USRS); } void TL_Fav_UnfNoteUsr (void) @@ -203,58 +203,58 @@ void TL_Fav_UnfNoteUsr (void) void TL_Fav_UnfNoteGbl (void) { - struct TL_Note SocNot; + struct TL_Note Not; /***** Stop marking as favourite a previously favourited note *****/ - TL_Fav_UnfNote (&SocNot); + TL_Fav_UnfNote (&Not); /***** Write HTML inside DIV with form to fav *****/ - TL_Fav_PutFormToFavUnfNote (&SocNot,TL_SHOW_FEW_USRS); + TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_FEW_USRS); } -void TL_Fav_PutFormToFavUnfNote (const struct TL_Note *SocNot, +void TL_Fav_PutFormToFavUnfNote (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs) { bool IAmTheAuthor; - bool IAmAFaverOfThisSocNot; + bool IAmAFaverOfThisNot; /***** Put form to fav/unfav this note *****/ HTM_DIV_Begin ("class=\"TL_ICO\""); - IAmTheAuthor = Usr_ItsMe (SocNot->UsrCod); - if (SocNot->Unavailable || // Unavailable notes can not be favourited + IAmTheAuthor = Usr_ItsMe (Not->UsrCod); + if (Not->Unavailable || // Unavailable notes can not be favourited IAmTheAuthor) // I am the author /* Put disabled icon */ - TL_Fav_PutDisabledIconFav (SocNot->NumFavs); + TL_Fav_PutDisabledIconFav (Not->NumFavs); else // Available and I am not the author { /* Put icon to fav/unfav */ - IAmAFaverOfThisSocNot = TL_Fav_CheckIfNoteIsFavedByUsr (SocNot->NotCod, + IAmAFaverOfThisNot = TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); - if (IAmAFaverOfThisSocNot) // I have favourited this note - TL_Fav_PutFormToUnfNote (SocNot->NotCod); + if (IAmAFaverOfThisNot) // I have favourited this note + TL_Fav_PutFormToUnfNote (Not->NotCod); else // I am not a faver of this note - TL_Fav_PutFormToFavNote (SocNot->NotCod); + TL_Fav_PutFormToFavNote (Not->NotCod); } HTM_DIV_End (); /***** Show who have marked this note as favourite *****/ - TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot,HowManyUsrs); + TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (Not,HowManyUsrs); } -static void TL_Fav_FavNote (struct TL_Note *SocNot) +static void TL_Fav_FavNote (struct TL_Note *Not) { bool ItsMe; long OriginalPubCod; /***** Get data of note *****/ - SocNot->NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (SocNot); + Not->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (Not); - if (SocNot->NotCod > 0) + if (Not->NotCod > 0) { - ItsMe = Usr_ItsMe (SocNot->UsrCod); + ItsMe = Usr_ItsMe (Not->UsrCod); if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (!TL_Fav_CheckIfNoteIsFavedByUsr (SocNot->NotCod, + if (!TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the note { /***** Mark as favourite in database *****/ @@ -263,50 +263,50 @@ static void TL_Fav_FavNote (struct TL_Note *SocNot) " (NotCod,UsrCod,TimeFav)" " VALUES" " (%ld,%ld,NOW())", - SocNot->NotCod, + Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); /***** Update number of times this note is favourited *****/ - TL_Fav_GetNumTimesANoteHasBeenFav (SocNot); + TL_Fav_GetNumTimesANoteHasBeenFav (Not); /***** Create notification about favourite post for the author of the post *****/ - OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); + OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) - TL_CreateNotifToAuthor (SocNot->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_FAV); + TL_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_FAV); } } } -static void TL_Fav_UnfNote (struct TL_Note *SocNot) +static void TL_Fav_UnfNote (struct TL_Note *Not) { long OriginalPubCod; bool ItsMe; /***** Get data of note *****/ - SocNot->NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (SocNot); + Not->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (Not); - if (SocNot->NotCod > 0) + if (Not->NotCod > 0) { - ItsMe = Usr_ItsMe (SocNot->UsrCod); - if (SocNot->NumFavs && + ItsMe = Usr_ItsMe (Not->UsrCod); + if (Not->NumFavs && Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (TL_Fav_CheckIfNoteIsFavedByUsr (SocNot->NotCod, + if (TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the note { /***** Delete the mark as favourite from database *****/ DB_QueryDELETE ("can not unfavourite note", "DELETE FROM tl_notes_fav" " WHERE NotCod=%ld AND UsrCod=%ld", - SocNot->NotCod, + Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); /***** Update number of times this note is favourited *****/ - TL_Fav_GetNumTimesANoteHasBeenFav (SocNot); + TL_Fav_GetNumTimesANoteHasBeenFav (Not); /***** Mark possible notifications on this note as removed *****/ - OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); + OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,OriginalPubCod); } @@ -328,16 +328,16 @@ void TL_Fav_ShowAllFaversComUsr (void) void TL_Fav_ShowAllFaversComGbl (void) { - struct TL_Comment SocCom; + struct TL_Comment Com; /***** Get data of comment *****/ - Med_MediaConstructor (&SocCom.Content.Media); - SocCom.PubCod = TL_GetParamPubCod (); - TL_GetDataOfCommByCod (&SocCom); - Med_MediaDestructor (&SocCom.Content.Media); + Med_MediaConstructor (&Com.Content.Media); + Com.PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (&Com); + Med_MediaDestructor (&Com.Content.Media); /***** Write HTML inside DIV with form to fav/unfav *****/ - TL_Fav_PutFormToFavUnfComment (&SocCom,TL_SHOW_ALL_USRS); + TL_Fav_PutFormToFavUnfComment (&Com,TL_SHOW_ALL_USRS); } void TL_Fav_FavCommentUsr (void) @@ -351,13 +351,13 @@ void TL_Fav_FavCommentUsr (void) void TL_Fav_FavCommentGbl (void) { - struct TL_Comment SocCom; + struct TL_Comment Com; /***** Mark comment as favourite *****/ - TL_Fav_FavComment (&SocCom); + TL_Fav_FavComment (&Com); /***** Write HTML inside DIV with form to unfav *****/ - TL_Fav_PutFormToFavUnfComment (&SocCom,TL_SHOW_FEW_USRS); + TL_Fav_PutFormToFavUnfComment (&Com,TL_SHOW_FEW_USRS); } void TL_Fav_UnfCommentUsr (void) @@ -371,61 +371,61 @@ void TL_Fav_UnfCommentUsr (void) void TL_Fav_UnfCommentGbl (void) { - struct TL_Comment SocCom; + struct TL_Comment Com; /***** Stop marking as favourite a previously favourited comment *****/ - TL_Fav_UnfComment (&SocCom); + TL_Fav_UnfComment (&Com); /***** Write HTML inside DIV with form to fav *****/ - TL_Fav_PutFormToFavUnfComment (&SocCom,TL_SHOW_FEW_USRS); + TL_Fav_PutFormToFavUnfComment (&Com,TL_SHOW_FEW_USRS); } -void TL_Fav_PutFormToFavUnfComment (const struct TL_Comment *SocCom, +void TL_Fav_PutFormToFavUnfComment (const struct TL_Comment *Com, TL_HowManyUsrs_t HowManyUsrs) { bool IAmTheAuthor; - bool IAmAFaverOfThisSocCom; + bool IAmAFaverOfThisCom; /***** Put form to fav/unfav this comment *****/ HTM_DIV_Begin ("class=\"TL_ICO\""); - IAmTheAuthor = Usr_ItsMe (SocCom->UsrCod); + IAmTheAuthor = Usr_ItsMe (Com->UsrCod); if (IAmTheAuthor) // I am the author /* Put disabled icon */ - TL_Fav_PutDisabledIconFav (SocCom->NumFavs); + TL_Fav_PutDisabledIconFav (Com->NumFavs); else // I am not the author { /* Put icon to mark this comment as favourite */ - IAmAFaverOfThisSocCom = TL_Fav_CheckIfCommIsFavedByUsr (SocCom->PubCod, + IAmAFaverOfThisCom = TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod); - if (IAmAFaverOfThisSocCom) // I have favourited this comment + if (IAmAFaverOfThisCom) // I have favourited this comment /* Put icon to unfav this publication and list of users */ - TL_Fav_PutFormToUnfComment (SocCom->PubCod); + TL_Fav_PutFormToUnfComment (Com->PubCod); else // I am not a favouriter /* Put icon to fav this publication and list of users */ - TL_Fav_PutFormToFavComment (SocCom->PubCod); + TL_Fav_PutFormToFavComment (Com->PubCod); } HTM_DIV_End (); /***** Show who have marked this comment as favourite *****/ - TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (SocCom,HowManyUsrs); + TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (Com,HowManyUsrs); } -static void TL_Fav_FavComment (struct TL_Comment *SocCom) +static void TL_Fav_FavComment (struct TL_Comment *Com) { bool IAmTheAuthor; /***** Initialize image *****/ - Med_MediaConstructor (&SocCom->Content.Media); + Med_MediaConstructor (&Com->Content.Media); /***** Get data of comment *****/ - SocCom->PubCod = TL_GetParamPubCod (); - TL_GetDataOfCommByCod (SocCom); + Com->PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (Com); - if (SocCom->PubCod > 0) + if (Com->PubCod > 0) { - IAmTheAuthor = Usr_ItsMe (SocCom->UsrCod); + IAmTheAuthor = Usr_ItsMe (Com->UsrCod); if (!IAmTheAuthor) // I am not the author - if (!TL_Fav_CheckIfCommIsFavedByUsr (SocCom->PubCod, + if (!TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the comment { /***** Mark as favourite in database *****/ @@ -434,58 +434,58 @@ static void TL_Fav_FavComment (struct TL_Comment *SocCom) " (PubCod,UsrCod,TimeFav)" " VALUES" " (%ld,%ld,NOW())", - SocCom->PubCod, + Com->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod); /* Update number of times this comment is favourited */ - TL_Fav_GetNumTimesACommHasBeenFav (SocCom); + TL_Fav_GetNumTimesACommHasBeenFav (Com); /**** Create notification about favourite post for the author of the post ***/ - TL_CreateNotifToAuthor (SocCom->UsrCod,SocCom->PubCod,Ntf_EVENT_TIMELINE_FAV); + TL_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TIMELINE_FAV); } } /***** Free image *****/ - Med_MediaDestructor (&SocCom->Content.Media); + Med_MediaDestructor (&Com->Content.Media); } -static void TL_Fav_UnfComment (struct TL_Comment *SocCom) +static void TL_Fav_UnfComment (struct TL_Comment *Com) { bool IAmTheAuthor; /***** Initialize image *****/ - Med_MediaConstructor (&SocCom->Content.Media); + Med_MediaConstructor (&Com->Content.Media); /***** Get data of comment *****/ - SocCom->PubCod = TL_GetParamPubCod (); - TL_GetDataOfCommByCod (SocCom); + Com->PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (Com); - if (SocCom->PubCod > 0) + if (Com->PubCod > 0) { - IAmTheAuthor = Usr_ItsMe (SocCom->UsrCod); - if (SocCom->NumFavs && + IAmTheAuthor = Usr_ItsMe (Com->UsrCod); + if (Com->NumFavs && !IAmTheAuthor) // I am not the author - if (TL_Fav_CheckIfCommIsFavedByUsr (SocCom->PubCod, + if (TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the comment { /***** Delete the mark as favourite from database *****/ DB_QueryDELETE ("can not unfavourite comment", "DELETE FROM tl_comments_fav" " WHERE PubCod=%ld AND UsrCod=%ld", - SocCom->PubCod, + Com->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod); /***** Update number of times this comment is favourited *****/ - TL_Fav_GetNumTimesACommHasBeenFav (SocCom); + TL_Fav_GetNumTimesACommHasBeenFav (Com); /***** Mark possible notifications on this comment as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,SocCom->PubCod); + Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,Com->PubCod); } } /***** Free image *****/ - Med_MediaDestructor (&SocCom->Content.Media); + Med_MediaDestructor (&Com->Content.Media); } /*****************************************************************************/ @@ -518,48 +518,48 @@ static bool TL_Fav_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod) /*************** Get number of times a note has been favourited **************/ /*****************************************************************************/ -void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Note *SocNot) +void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Note *Not) { /***** Get number of times (users) this note has been favourited *****/ - SocNot->NumFavs = + Not->NumFavs = (unsigned) DB_QueryCOUNT ("can not get number of times" " a note has been favourited", "SELECT COUNT(*) FROM tl_notes_fav" " WHERE NotCod=%ld" " AND UsrCod<>%ld", // Extra check - SocNot->NotCod, - SocNot->UsrCod); // The author + Not->NotCod, + Not->UsrCod); // The author } /*****************************************************************************/ /************ Get number of times a comment has been favourited **************/ /*****************************************************************************/ -void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Comment *SocCom) +void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Comment *Com) { /***** Get number of times (users) this comment has been favourited *****/ - SocCom->NumFavs = + Com->NumFavs = (unsigned) DB_QueryCOUNT ("can not get number of times" " a comment has been favourited", "SELECT COUNT(*) FROM tl_comments_fav" " WHERE PubCod=%ld" " AND UsrCod<>%ld", // Extra check - SocCom->PubCod, - SocCom->UsrCod); // The author + Com->PubCod, + Com->UsrCod); // The author } /*****************************************************************************/ /************ Show users who have marked this note as favourite **************/ /*****************************************************************************/ -static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot, +static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs; /***** Get users who have marked this note as favourite *****/ - if (SocNot->NumFavs) + if (Not->NumFavs) /***** Get list of users from database *****/ NumFirstUsrs = (unsigned) DB_QuerySELECT (&mysql_res,"can not get users", @@ -567,8 +567,8 @@ static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot, " WHERE NotCod=%ld" " AND UsrCod<>%ld" // Extra check " ORDER BY FavCod LIMIT %u", - SocNot->NotCod, - SocNot->UsrCod, + Not->NotCod, + Not->UsrCod, HowManyUsrs == TL_SHOW_FEW_USRS ? TL_DEF_USRS_SHOWN : TL_MAX_USRS_SHOWN); else @@ -577,21 +577,21 @@ static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot, /***** Show users *****/ /* Number of users */ HTM_DIV_Begin ("class=\"TL_NUM_USRS\""); - TL_ShowNumSharersOrFavers (SocNot->NumFavs); + TL_ShowNumSharersOrFavers (Not->NumFavs); HTM_DIV_End (); /* List users one by one */ HTM_DIV_Begin ("class=\"TL_USRS\""); - TL_ShowSharersOrFavers (&mysql_res,SocNot->NumFavs,NumFirstUsrs); - if (NumFirstUsrs < SocNot->NumFavs) // Not all are shown + TL_ShowSharersOrFavers (&mysql_res,Not->NumFavs,NumFirstUsrs); + if (NumFirstUsrs < Not->NumFavs) // Not all are shown /* Clickable ellipsis to show all users */ - TL_PutFormToSeeAllFaversSharers (ActAllFavSocNotGbl,ActAllFavSocNotUsr, - "NotCod=%ld",SocNot->NotCod, + TL_PutFormToSeeAllFaversSharers (ActAllFavTL_NotGbl,ActAllFavTL_NotUsr, + "NotCod=%ld",Not->NotCod, HowManyUsrs); HTM_DIV_End (); /***** Free structure that stores the query result *****/ - if (SocNot->NumFavs) + if (Not->NumFavs) DB_FreeMySQLResult (&mysql_res); } @@ -599,14 +599,14 @@ static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot, /************ Show users who have marked this note as favourite **************/ /*****************************************************************************/ -static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom, +static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *Com, TL_HowManyUsrs_t HowManyUsrs) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs; /***** Get users who have marked this comment as favourite *****/ - if (SocCom->NumFavs) + if (Com->NumFavs) /***** Get list of users from database *****/ NumFirstUsrs = (unsigned) DB_QuerySELECT (&mysql_res,"can not get users", @@ -614,8 +614,8 @@ static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocC " WHERE PubCod=%ld" " AND UsrCod<>%ld" // Extra check " ORDER BY FavCod LIMIT %u", - SocCom->PubCod, - SocCom->UsrCod, + Com->PubCod, + Com->UsrCod, HowManyUsrs == TL_SHOW_FEW_USRS ? TL_DEF_USRS_SHOWN : TL_MAX_USRS_SHOWN); else @@ -624,20 +624,20 @@ static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocC /***** Show users *****/ /* Number of users */ HTM_DIV_Begin ("class=\"TL_NUM_USRS\""); - TL_ShowNumSharersOrFavers (SocCom->NumFavs); + TL_ShowNumSharersOrFavers (Com->NumFavs); HTM_DIV_End (); /* List users one by one */ HTM_DIV_Begin ("class=\"TL_USRS\""); - TL_ShowSharersOrFavers (&mysql_res,SocCom->NumFavs,NumFirstUsrs); - if (NumFirstUsrs < SocCom->NumFavs) + TL_ShowSharersOrFavers (&mysql_res,Com->NumFavs,NumFirstUsrs); + if (NumFirstUsrs < Com->NumFavs) /* Clickable ellipsis to show all users */ - TL_PutFormToSeeAllFaversSharers (ActAllFavSocComGbl,ActAllFavSocComUsr, - "PubCod=%ld",SocCom->PubCod, + TL_PutFormToSeeAllFaversSharers (ActAllFavTL_ComGbl,ActAllFavTL_ComUsr, + "PubCod=%ld",Com->PubCod, HowManyUsrs); HTM_DIV_End (); /***** Free structure that stores the query result *****/ - if (SocCom->NumFavs) + if (Com->NumFavs) DB_FreeMySQLResult (&mysql_res); } diff --git a/swad_timeline_favourite.h b/swad_timeline_favourite.h index 98077920b..0634cbb12 100644 --- a/swad_timeline_favourite.h +++ b/swad_timeline_favourite.h @@ -50,7 +50,7 @@ void TL_Fav_FavNoteUsr (void); void TL_Fav_FavNoteGbl (void); void TL_Fav_UnfNoteUsr (void); void TL_Fav_UnfNoteGbl (void); -void TL_Fav_PutFormToFavUnfNote (const struct TL_Note *SocNot, +void TL_Fav_PutFormToFavUnfNote (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs); void TL_Fav_ShowAllFaversComUsr (void); @@ -59,10 +59,10 @@ void TL_Fav_FavCommentUsr (void); void TL_Fav_FavCommentGbl (void); void TL_Fav_UnfCommentUsr (void); void TL_Fav_UnfCommentGbl (void); -void TL_Fav_PutFormToFavUnfComment (const struct TL_Comment *SocCom, +void TL_Fav_PutFormToFavUnfComment (const struct TL_Comment *Com, TL_HowManyUsrs_t HowManyUsrs); -void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Note *SocNot); -void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Comment *SocCom); +void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Note *Not); +void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Comment *Com); #endif diff --git a/swad_timeline_share.c b/swad_timeline_share.c index a70ba7092..28cb46742 100644 --- a/swad_timeline_share.c +++ b/swad_timeline_share.c @@ -60,12 +60,12 @@ static void TL_Sha_PutDisabledIconShare (unsigned NumShared); static void TL_Sha_PutFormToShaNote (long ParamCod); static void TL_Sha_PutFormToUnsNote (long ParamCod); -static void TL_Sha_ShaNote (struct TL_Note *SocNot); -static void TL_Sha_UnsNote (struct TL_Note *SocNot); +static void TL_Sha_ShaNote (struct TL_Note *Not); +static void TL_Sha_UnsNote (struct TL_Note *Not); static bool TL_Sha_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod); -static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot, +static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs); /*****************************************************************************/ @@ -99,7 +99,7 @@ static void TL_Sha_PutFormToShaNote (long ParamCod) extern const char *Txt_Share; /***** Form and icon to mark note as favourite *****/ - TL_FormFavSha (ActShaSocNotGbl,ActShaSocNotUsr, + TL_FormFavSha (ActShaTL_NotGbl,ActShaTL_NotUsr, "NotCod=%ld",ParamCod, TL_ICON_SHARE,Txt_Share); } @@ -109,7 +109,7 @@ static void TL_Sha_PutFormToUnsNote (long ParamCod) extern const char *Txt_TIMELINE_NOTE_Shared; /***** Form and icon to mark note as favourite *****/ - TL_FormFavSha (ActUnsSocNotGbl,ActUnsSocNotUsr, + TL_FormFavSha (ActUnsTL_NotGbl,ActUnsTL_NotUsr, "NotCod=%ld",ParamCod, TL_ICON_SHARED,Txt_TIMELINE_NOTE_Shared); } @@ -129,14 +129,14 @@ void TL_Sha_ShowAllSharersNoteUsr (void) void TL_Sha_ShowAllSharersNoteGbl (void) { - struct TL_Note SocNot; + struct TL_Note Not; /***** Get data of note *****/ - SocNot.NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (&SocNot); + Not.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&Not); /***** Write HTML inside DIV with form to share/unshare *****/ - TL_Sha_PutFormToShaUnsNote (&SocNot,TL_SHOW_ALL_USRS); + TL_Sha_PutFormToShaUnsNote (&Not,TL_SHOW_ALL_USRS); } void TL_Sha_ShaNoteUsr (void) @@ -150,47 +150,47 @@ void TL_Sha_ShaNoteUsr (void) void TL_Sha_ShaNoteGbl (void) { - struct TL_Note SocNot; + struct TL_Note Not; /***** Share note *****/ - TL_Sha_ShaNote (&SocNot); + TL_Sha_ShaNote (&Not); /***** Write HTML inside DIV with form to unshare *****/ - TL_Sha_PutFormToShaUnsNote (&SocNot,TL_SHOW_FEW_USRS); + TL_Sha_PutFormToShaUnsNote (&Not,TL_SHOW_FEW_USRS); } -static void TL_Sha_ShaNote (struct TL_Note *SocNot) +static void TL_Sha_ShaNote (struct TL_Note *Not) { // extern const char *Txt_The_original_post_no_longer_exists; - struct TL_Publication SocPub; + struct TL_Publication Pub; bool ItsMe; long OriginalPubCod; /***** Get data of note *****/ - SocNot->NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (SocNot); + Not->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (Not); - if (SocNot->NotCod > 0) + if (Not->NotCod > 0) { - ItsMe = Usr_ItsMe (SocNot->UsrCod); + ItsMe = Usr_ItsMe (Not->UsrCod); if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (!TL_Sha_CheckIfNoteIsSharedByUsr (SocNot->NotCod, + if (!TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // Not yet shared by me { /***** Share (publish note in timeline) *****/ - SocPub.NotCod = SocNot->NotCod; - SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; - SocPub.PubType = TL_PUB_SHARED_NOTE; - TL_PublishNoteInTimeline (&SocPub); // Set SocPub.PubCod + Pub.NotCod = Not->NotCod; + Pub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; + Pub.PubType = TL_PUB_SHARED_NOTE; + TL_PublishNoteInTimeline (&Pub); // Set Pub.PubCod /* Update number of times this note is shared */ - TL_Sha_UpdateNumTimesANoteHasBeenShared (SocNot); + TL_Sha_UpdateNumTimesANoteHasBeenShared (Not); /**** Create notification about shared post for the author of the post ***/ - OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); + OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) - TL_CreateNotifToAuthor (SocNot->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_SHARE); + TL_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_SHARE); } } } @@ -210,31 +210,31 @@ void TL_Sha_UnsNoteUsr (void) void TL_Sha_UnsNoteGbl (void) { - struct TL_Note SocNot; + struct TL_Note Not; /***** Unshare note *****/ - TL_Sha_UnsNote (&SocNot); + TL_Sha_UnsNote (&Not); /***** Write HTML inside DIV with form to share *****/ - TL_Sha_PutFormToShaUnsNote (&SocNot,TL_SHOW_FEW_USRS); + TL_Sha_PutFormToShaUnsNote (&Not,TL_SHOW_FEW_USRS); } -static void TL_Sha_UnsNote (struct TL_Note *SocNot) +static void TL_Sha_UnsNote (struct TL_Note *Not) { // extern const char *Txt_The_original_post_no_longer_exists; long OriginalPubCod; bool ItsMe; /***** Get data of note *****/ - SocNot->NotCod = TL_GetParamNotCod (); - TL_GetDataOfNoteByCod (SocNot); + Not->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (Not); - if (SocNot->NotCod > 0) + if (Not->NotCod > 0) { - ItsMe = Usr_ItsMe (SocNot->UsrCod); - if (SocNot->NumShared && + ItsMe = Usr_ItsMe (Not->UsrCod); + if (Not->NumShared && Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (TL_Sha_CheckIfNoteIsSharedByUsr (SocNot->NotCod, + if (TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I am a sharer { /***** Delete publication from database *****/ @@ -243,48 +243,48 @@ static void TL_Sha_UnsNote (struct TL_Note *SocNot) " WHERE NotCod=%ld" " AND PublisherCod=%ld" " AND PubType=%u", - SocNot->NotCod, + Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod, (unsigned) TL_PUB_SHARED_NOTE); /***** Update number of times this note is shared *****/ - TL_Sha_UpdateNumTimesANoteHasBeenShared (SocNot); + TL_Sha_UpdateNumTimesANoteHasBeenShared (Not); /***** Mark possible notifications on this note as removed *****/ - OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); + OriginalPubCod = TL_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE,OriginalPubCod); } } } -void TL_Sha_PutFormToShaUnsNote (const struct TL_Note *SocNot, +void TL_Sha_PutFormToShaUnsNote (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs) { bool IAmTheAuthor; - bool IAmASharerOfThisSocNot; + bool IAmASharerOfThisNot; /***** Put form to share/unshare this note *****/ HTM_DIV_Begin ("class=\"TL_ICO\""); - IAmTheAuthor = Usr_ItsMe (SocNot->UsrCod); - if (SocNot->Unavailable || // Unavailable notes can not be shared + IAmTheAuthor = Usr_ItsMe (Not->UsrCod); + if (Not->Unavailable || // Unavailable notes can not be shared IAmTheAuthor) // I am the author /* Put disabled icon */ - TL_Sha_PutDisabledIconShare (SocNot->NumShared); + TL_Sha_PutDisabledIconShare (Not->NumShared); else // Available and I am not the author { /* Put icon to share/unshare */ - IAmASharerOfThisSocNot = TL_Sha_CheckIfNoteIsSharedByUsr (SocNot->NotCod, + IAmASharerOfThisNot = TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); - if (IAmASharerOfThisSocNot) // I have shared this note - TL_Sha_PutFormToUnsNote (SocNot->NotCod); + if (IAmASharerOfThisNot) // I have shared this note + TL_Sha_PutFormToUnsNote (Not->NotCod); else // I have not shared this note - TL_Sha_PutFormToShaNote (SocNot->NotCod); + TL_Sha_PutFormToShaNote (Not->NotCod); } HTM_DIV_End (); /***** Show who have shared this note *****/ - TL_Sha_ShowUsrsWhoHaveSharedNote (SocNot,HowManyUsrs); + TL_Sha_ShowUsrsWhoHaveSharedNote (Not,HowManyUsrs); } /*****************************************************************************/ @@ -307,18 +307,18 @@ static bool TL_Sha_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod) /********** Get number of times a note has been shared in timeline ***********/ /*****************************************************************************/ -void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *SocNot) +void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *Not) { /***** Get number of times (users) this note has been shared *****/ - SocNot->NumShared = + Not->NumShared = (unsigned) DB_QueryCOUNT ("can not get number of times" " a note has been shared", "SELECT COUNT(*) FROM tl_pubs" " WHERE NotCod=%ld" " AND PublisherCod<>%ld" " AND PubType=%u", - SocNot->NotCod, - SocNot->UsrCod, // The author + Not->NotCod, + Not->UsrCod, // The author (unsigned) TL_PUB_SHARED_NOTE); } @@ -326,14 +326,14 @@ void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *SocNot) /******************* Show users who have shared this note ********************/ /*****************************************************************************/ -static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot, +static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs; /***** Get users who have shared this note *****/ - if (SocNot->NumShared) + if (Not->NumShared) NumFirstUsrs = (unsigned) DB_QuerySELECT (&mysql_res,"can not get users", "SELECT PublisherCod FROM tl_pubs" @@ -341,8 +341,8 @@ static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot, " AND PublisherCod<>%ld" " AND PubType=%u" " ORDER BY PubCod LIMIT %u", - SocNot->NotCod, - SocNot->UsrCod, + Not->NotCod, + Not->UsrCod, (unsigned) TL_PUB_SHARED_NOTE, HowManyUsrs == TL_SHOW_FEW_USRS ? TL_DEF_USRS_SHOWN : TL_MAX_USRS_SHOWN); @@ -352,20 +352,20 @@ static void TL_Sha_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot, /***** Show users *****/ /* Number of users */ HTM_DIV_Begin ("class=\"TL_NUM_USRS\""); - TL_ShowNumSharersOrFavers (SocNot->NumShared); + TL_ShowNumSharersOrFavers (Not->NumShared); HTM_DIV_End (); /* List users one by one */ HTM_DIV_Begin ("class=\"TL_USRS\""); - TL_ShowSharersOrFavers (&mysql_res,SocNot->NumShared,NumFirstUsrs); - if (NumFirstUsrs < SocNot->NumShared) + TL_ShowSharersOrFavers (&mysql_res,Not->NumShared,NumFirstUsrs); + if (NumFirstUsrs < Not->NumShared) /* Clickable ellipsis to show all users */ - TL_PutFormToSeeAllFaversSharers (ActAllShaSocNotGbl,ActAllShaSocNotUsr, - "NotCod=%ld",SocNot->NotCod, + TL_PutFormToSeeAllFaversSharers (ActAllShaTL_NotGbl,ActAllShaTL_NotUsr, + "NotCod=%ld",Not->NotCod, HowManyUsrs); HTM_DIV_End (); /***** Free structure that stores the query result *****/ - if (SocNot->NumShared) + if (Not->NumShared) DB_FreeMySQLResult (&mysql_res); } diff --git a/swad_timeline_share.h b/swad_timeline_share.h index 7526e6af3..7cd632e9f 100644 --- a/swad_timeline_share.h +++ b/swad_timeline_share.h @@ -45,9 +45,9 @@ void TL_Sha_ShaNoteUsr (void); void TL_Sha_ShaNoteGbl (void); void TL_Sha_UnsNoteUsr (void); void TL_Sha_UnsNoteGbl (void); -void TL_Sha_PutFormToShaUnsNote (const struct TL_Note *SocNot, +void TL_Sha_PutFormToShaUnsNote (const struct TL_Note *Not, TL_HowManyUsrs_t HowManyUsrs); -void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *SocNot); +void TL_Sha_UpdateNumTimesANoteHasBeenShared (struct TL_Note *Not); #endif diff --git a/swad_user.c b/swad_user.c index b8c9d409b..feb34b8f5 100644 --- a/swad_user.c +++ b/swad_user.c @@ -3124,7 +3124,7 @@ void Usr_ChkUsrAndGetUsrData (void) /* Get the first option allowed */ Action = Mnu_GetFirstActionAvailableInCurrentTab (); - Gbl.Action.Act = (Action == ActUnk) ? ((Gbl.Usrs.Me.Logged) ? ActSeeSocTmlGbl : // Default action if logged + Gbl.Action.Act = (Action == ActUnk) ? ((Gbl.Usrs.Me.Logged) ? ActSeeTmlGbl : // Default action if logged ActFrmLogIn) : // Default action if not logged Action; Tab_SetCurrentTab ();