diff --git a/Makefile b/Makefile index 597d68e3..1d1b92cf 100644 --- a/Makefile +++ b/Makefile @@ -50,10 +50,10 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \ swad_profile.o swad_project.o \ swad_QR.o \ swad_record.o swad_report.o swad_role.o swad_RSS.o \ - swad_scope.o swad_search.o swad_session.o swad_setup.o swad_social.o \ + swad_scope.o swad_search.o swad_session.o swad_setup.o \ swad_statistic.o swad_string.o swad_survey.o swad_syllabus.o \ swad_tab.o swad_table.o swad_test.o swad_test_import.o swad_theme.o \ - swad_timetable.o \ + swad_timeline.o swad_timetable.o \ swad_user.o \ swad_web_service.o \ swad_xml.o \ diff --git a/html/changelog/index.html b/html/changelog/index.html index 4cea2ef9..59f3d044 100644 --- a/html/changelog/index.html +++ b/html/changelog/index.html @@ -8729,7 +8729,7 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1511','es','N','Carg
Version 15.110.17:Jan 13, 2016
- Reviewed code related to Soc_MAX_RECENT_PUBS_TO_GET. (192568 lines) + Reviewed code related to TL_MAX_RECENT_PUBS_TO_GET. (192568 lines)
Version 15.110.16:Jan 13, 2016
@@ -9428,7 +9428,7 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1490','es','N','Ver
Version 15.76: Dec 28, 2015
New option for social network activity (timeline).
- New module swad_social. (187807 lines) + New module swad_timeline. (187807 lines)
Version 15.75: Dec 28, 2015
diff --git a/js/swad18.64.js b/js/swad18.64.js index 96c1b44b..1cca452d 100644 --- a/js/swad18.64.js +++ b/js/swad18.64.js @@ -690,7 +690,7 @@ function readOldTimelineData () { timeline.appendChild(oldTimeline.firstChild); } - if (countOldTimeline < RefreshParamMaxOldPubsToGetAndShow) // Set to Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW + if (countOldTimeline < RefreshParamMaxOldPubsToGetAndShow) // Set to TL_MAX_OLD_PUBS_TO_GET_AND_SHOW // No more old publishings document.getElementById("view_old_posts_container").style.display = 'none'; else { diff --git a/swad_account.c b/swad_account.c index c89adbba..93c1348b 100644 --- a/swad_account.c +++ b/swad_account.c @@ -44,7 +44,7 @@ #include "swad_parameter.h" #include "swad_profile.h" #include "swad_report.h" -#include "swad_social.h" +#include "swad_timeline.h" /*****************************************************************************/ /****************************** Public constants *****************************/ @@ -1084,7 +1084,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat, UsrDat->UsrCod); /***** Remove social content associated to the user *****/ - Soc_RemoveUsrSocialContent (UsrDat->UsrCod); + TL_RemoveUsrContent (UsrDat->UsrCod); /***** Remove user's figures *****/ Prf_RemoveUsrFigures (UsrDat->UsrCod); diff --git a/swad_action.c b/swad_action.c index 16a8b8cd..80518239 100644 --- a/swad_action.c +++ b/swad_action.c @@ -72,9 +72,9 @@ #include "swad_role.h" #include "swad_search.h" #include "swad_setup.h" -#include "swad_social.h" #include "swad_tab.h" #include "swad_test_import.h" +#include "swad_timeline.h" #include "swad_zip.h" /*****************************************************************************/ @@ -1596,15 +1596,15 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActMnu */{ 2,-1,TabUnk,ActMnu ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,NULL ,NULL}, /* ActRefCon */{ 845,-1,TabUnk,ActRefCon ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Lay_RefreshNotifsAndConnected ,NULL}, /* ActRefLstClk */{ 994,-1,TabUnk,ActRefLstClk ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Lay_RefreshLastClicks ,NULL}, - /* ActRefNewSocPubGbl*/{1509,-1,TabUnk,ActRefNewSocPubGbl ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RefreshNewTimelineGbl ,NULL}, - /* ActRefOldSocPubGbl*/{1510,-1,TabUnk,ActRefOldSocPubGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RefreshOldTimelineGbl ,NULL}, - /* ActRefOldSocPubUsr*/{1511,-1,TabUnk,ActRefOldSocPubUsr ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RefreshOldTimelineUsr ,NULL}, + /* ActRefNewSocPubGbl*/{1509,-1,TabUnk,ActRefNewSocPubGbl ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RefreshNewTimelineGbl ,NULL}, + /* ActRefOldSocPubGbl*/{1510,-1,TabUnk,ActRefOldSocPubGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RefreshOldTimelineGbl ,NULL}, + /* ActRefOldSocPubUsr*/{1511,-1,TabUnk,ActRefOldSocPubUsr ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RefreshOldTimelineUsr ,NULL}, /* ActWebSvc */{ 892,-1,TabUnk,ActWebSvc ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Plg_WebService ,NULL}, // TabSta ****************************************************************** /* ActFrmLogIn */{1521, 0,TabSta,ActFrmLogIn , 0,0x001,0x001,0x001,0x001,0x001,0x001,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WriteLandingPage ,"power-off" }, /* ActReqSch */{ 627, 1,TabSta,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Sch_ReqSysSearch ,"search" }, - /* ActSeeSocTmlGbl */{1490, 2,TabSta,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_ShowTimelineGbl2 ,"comment-dots" }, + /* ActSeeSocTmlGbl */{1490, 2,TabSta,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_ShowTimelineGbl2 ,"comment-dots" }, /* ActSeeSocPrf */{1520, 3,TabSta,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_SeeSocialProfiles ,"user-check" }, /* ActSeeCal */{1622, 4,TabSta,ActSeeCal ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cal_ShowCalendar ,"calendar" }, /* ActSeeNtf */{ 990, 5,TabSta,ActSeeNtf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ntf_ShowMyNotifications ,"bell" }, @@ -1619,33 +1619,33 @@ 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}, - /* ActRcvSocPstGbl */{1492,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_ReceiveSocialPostGbl ,NULL}, - /* ActRcvSocComGbl */{1503,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_ReceiveCommentGbl ,NULL}, - /* ActShaSocNotGbl */{1495,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_ShareSocialNoteGbl ,NULL}, - /* ActUnsSocNotGbl */{1496,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_UnshareSocialNoteGbl ,NULL}, - /* ActFavSocNotGbl */{1512,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_FavSocialNoteGbl ,NULL}, - /* ActUnfSocNotGbl */{1513,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_UnfavSocialNoteGbl ,NULL}, - /* ActFavSocComGbl */{1516,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_FavSocialCommentGbl ,NULL}, - /* ActUnfSocComGbl */{1517,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_UnfavSocialCommentGbl ,NULL}, - /* ActReqRemSocPubGbl*/{1494,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_RequestRemSocialNoteGbl ,NULL}, - /* ActRemSocPubGbl */{1493,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_RemoveSocialNoteGbl ,NULL}, - /* ActReqRemSocComGbl*/{1505,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_RequestRemSocialComGbl ,NULL}, - /* ActRemSocComGbl */{1507,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_RemoveSocialComGbl ,NULL}, + /* ActRcvSocPstGbl */{1492,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_ReceivePostGbl ,NULL}, + /* ActRcvSocComGbl */{1503,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_ReceiveCommentGbl ,NULL}, + /* ActShaSocNotGbl */{1495,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShareNoteGbl ,NULL}, + /* ActUnsSocNotGbl */{1496,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_UnshareNoteGbl ,NULL}, + /* ActFavSocNotGbl */{1512,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_FavNoteGbl ,NULL}, + /* ActUnfSocNotGbl */{1513,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_UnfavNoteGbl ,NULL}, + /* ActFavSocComGbl */{1516,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_FavCommentGbl ,NULL}, + /* ActUnfSocComGbl */{1517,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_UnfavCommentGbl ,NULL}, + /* ActReqRemSocPubGbl*/{1494,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_RequestRemNoteGbl ,NULL}, + /* ActRemSocPubGbl */{1493,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_RemoveNoteGbl ,NULL}, + /* ActReqRemSocComGbl*/{1505,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,TL_RequestRemComGbl ,NULL}, + /* ActRemSocComGbl */{1507,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TL_ShowTimelineGbl1 ,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}, - /* ActRcvSocPstUsr */{1498,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,Soc_ReceiveSocialPostUsr ,NULL}, - /* ActRcvSocComUsr */{1504,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,NULL ,Soc_ReceiveCommentUsr ,NULL}, - /* ActShaSocNotUsr */{1499,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_ShareSocialNoteUsr ,NULL}, - /* ActUnsSocNotUsr */{1500,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_UnshareSocialNoteUsr ,NULL}, - /* ActFavSocNotUsr */{1514,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_FavSocialNoteUsr ,NULL}, - /* ActUnfSocNotUsr */{1515,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_UnfavSocialNoteUsr ,NULL}, - /* ActFavSocComUsr */{1518,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_FavSocialCommentUsr ,NULL}, - /* ActUnfSocComUsr */{1519,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_UnfavSocialCommentUsr ,NULL}, - /* ActReqRemSocPubUsr*/{1501,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RequestRemSocialNoteUsr ,NULL}, - /* ActRemSocPubUsr */{1502,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RemoveSocialNoteUsr ,NULL}, - /* ActReqRemSocComGbl*/{1506,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RequestRemSocialComUsr ,NULL}, - /* ActRemSocComGbl */{1508,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RemoveSocialComUsr ,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}, + /* ActShaSocNotUsr */{1499,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShareNoteUsr ,NULL}, + /* ActUnsSocNotUsr */{1500,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_UnshareNoteUsr ,NULL}, + /* ActFavSocNotUsr */{1514,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_FavNoteUsr ,NULL}, + /* ActUnfSocNotUsr */{1515,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_UnfavNoteUsr ,NULL}, + /* ActFavSocComUsr */{1518,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_FavCommentUsr ,NULL}, + /* ActUnfSocComUsr */{1519,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_UnfavCommentUsr ,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}, + /* ActReqRemSocComGbl*/{1506,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_RequestRemComUsr ,NULL}, + /* ActRemSocComGbl */{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}, diff --git a/swad_changelog.h b/swad_changelog.h index eb2b1a47..497fc250 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -429,7 +429,7 @@ Lo de mutear anuncios, en principio prefiero hacer una opci // TODO: Change in usability of Announcements of exams, suggested by Javier Fernández Baldomero. // TODO: Al pulsar sobre una convocatoria de examen / aviso --> ir a la sección de esa convocatoria/aviso en lugar de mostrarlo repetido y destacado arriba -// TODO: Intentar aumentar la velocidad de carga del timeline (comprobar ralentización al mostrar la titulación de cada usuario) +// TODO: Fix important bug: Cuando se baja varias veces el timeline pulsando en "Ver más", se para aleatoriamente tras varias actualizaciones hacia abajo, no siempre llega hasta la primera publicación // TODO: Los usuarios que no tienes permiso para ver su perfil público, se debería mostrar algo, una mínima ficha sin tinmeline o algo así @@ -452,11 +452,12 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.73.7 (2019-03-12)" +#define Log_PLATFORM_VERSION "SWAD 18.74 (2019-03-12)" #define CSS_FILE "swad18.68.3.css" #define JS_FILE "swad18.64.js" /* - Version 18.73.7: Mar 12, 2019 Code refactoring irelated to list of users and options. (239614 lines) + Version 18.74: Mar 12, 2019 Module swad_social is renamed swad_timeline. (239633 lines) + Version 18.73.7: Mar 12, 2019 Code refactoring related to list of users and options. (239614 lines) Version 18.73.6: Mar 12, 2019 Create new email message from list of users. This option will be active when email action allows selecting individual users. (239580 lines) Copy the following icon to icon public directory: sudo cp icon/marker.svg /var/www/html/swad/icon/ @@ -4570,7 +4571,7 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1511','es','N','Carg Version 15.111: Jan 14, 2016 Fixed bug in user's timeline. Code refactoring related with social timeline. (192622 lines) Version 15.110.18:Jan 13, 2016 Optimization in query to get initial recent timeline. (192564 lines) - Version 15.110.17:Jan 13, 2016 Reviewed code related to Soc_MAX_RECENT_PUBS_TO_GET. (192568 lines) + Version 15.110.17:Jan 13, 2016 Reviewed code related to TL_MAX_RECENT_PUBS_TO_GET. (192568 lines) Version 15.110.16:Jan 13, 2016 Form to go to public profile of author of comment in timeline. (192563 lines) Version 15.110.15:Jan 13, 2016 Form to go to public profile of author of note in timeline. Extensions '.exe' and '.com' not allowed (Google reported malware). (192543 lines) diff --git a/swad_config.h b/swad_config.h index 5822928e..8b4e2831 100644 --- a/swad_config.h +++ b/swad_config.h @@ -455,7 +455,7 @@ #define Cfg_TIME_TO_REFRESH_LAST_CLICKS ((time_t)( 1UL * 1000UL)) // Refresh period of last clicks in miliseconds -#define Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE ((time_t)( 10UL * 1000UL)) // Refresh period of social timeline in miliseconds +#define Cfg_TIME_TO_REFRESH_TIMELINE ((time_t)( 10UL * 1000UL)) // Refresh period of social timeline in miliseconds #define Cfg_TIME_TO_CHANGE_BANNER ((time_t)( 2UL * 60UL)) // After these seconds, change banner #define Cfg_NUMBER_OF_BANNERS 1 // Number of banners to show simultaneously diff --git a/swad_exam.c b/swad_exam.c index 301614a1..2af7f265 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -47,8 +47,8 @@ #include "swad_parameter.h" #include "swad_QR.h" #include "swad_RSS.h" -#include "swad_social.h" #include "swad_string.h" +#include "swad_timeline.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -292,7 +292,7 @@ void Exa_ReceiveExamAnnouncement2 (void) extern const char *Txt_Created_new_announcement_of_exam; extern const char *Txt_The_announcement_of_exam_has_been_successfully_updated; unsigned NumUsrsToBeNotifiedByEMail; - struct SocialPublication SocPub; + struct TL_Publication SocPub; /***** Show message *****/ Ale_ShowAlert (Ale_SUCCESS, @@ -304,7 +304,7 @@ void Exa_ReceiveExamAnnouncement2 (void) Exa_UpdateNumUsrsNotifiedByEMailAboutExamAnnouncement (Gbl.ExamAnns.ExaDat.ExaCod,NumUsrsToBeNotifiedByEMail); /***** Create a new social note about the new exam announcement *****/ - Soc_StoreAndPublishSocialNote (Soc_NOTE_EXAM_ANNOUNCEMENT,Gbl.ExamAnns.ExaDat.ExaCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_EXAM_ANNOUNCEMENT,Gbl.ExamAnns.ExaDat.ExaCod,&SocPub); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs); @@ -403,7 +403,7 @@ void Exa_RemoveExamAnnouncement1 (void) Ntf_MarkNotifAsRemoved (Ntf_EVENT_EXAM_ANNOUNCEMENT,ExaCod); /***** Mark possible social note as unavailable *****/ - Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NOTE_EXAM_ANNOUNCEMENT,ExaCod); + TL_MarkNoteAsUnavailableUsingNoteTypeAndCod (TL_NOTE_EXAM_ANNOUNCEMENT,ExaCod); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs); diff --git a/swad_figure.c b/swad_figure.c index 7314e2bd..67827c9e 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -3343,18 +3343,18 @@ static void Fig_GetAndShowSocialActivityStats (void) extern const char *Txt_No_of_users; extern const char *Txt_PERCENT_of_users; extern const char *Txt_No_of_posts_BR_per_user; - extern const char *Txt_SOCIAL_NOTE[Soc_NUM_NOTE_TYPES]; + extern const char *Txt_TIMELINE_NOTE[TL_NUM_NOTE_TYPES]; extern const char *Txt_Total; MYSQL_RES *mysql_res; MYSQL_ROW row; - Soc_NoteType_t NoteType; + TL_NoteType_t NoteType; unsigned long NumSocialNotes; unsigned long NumRows; unsigned NumUsrs; unsigned NumUsrsTotal; /***** Start box and table *****/ - Box_StartBoxTable (NULL,Txt_FIGURE_TYPES[Fig_SOCIAL_ACTIVITY],NULL, + Box_StartBoxTable (NULL,Txt_FIGURE_TYPES[Fig_TIMELINE],NULL, Hlp_ANALYTICS_Figures_timeline,Box_NOT_CLOSABLE,2); /***** Heading row *****/ @@ -3389,8 +3389,8 @@ static void Fig_GetAndShowSocialActivityStats (void) 1 << Rol_TCH); /***** Get total number of following/followers from database *****/ - for (NoteType = (Soc_NoteType_t) 0; - NoteType < Soc_NUM_NOTE_TYPES; + for (NoteType = (TL_NoteType_t) 0; + NoteType < TL_NUM_NOTE_TYPES; NoteType++) { switch (Gbl.Scope.Current) @@ -3512,7 +3512,7 @@ static void Fig_GetAndShowSocialActivityStats (void) "%.2f" "" "", - Txt_SOCIAL_NOTE[NoteType], + Txt_TIMELINE_NOTE[NoteType], NumSocialNotes, NumUsrs, NumUsrsTotal ? (float) NumUsrs * 100.0 / (float) NumUsrsTotal : diff --git a/swad_figure.h b/swad_figure.h index 101e1dc5..6069f1a9 100644 --- a/swad_figure.h +++ b/swad_figure.h @@ -46,7 +46,7 @@ typedef enum Fig_TESTS, // Number of test questions Fig_GAMES, // Number of games Fig_SURVEYS, // Number of surveys - Fig_SOCIAL_ACTIVITY, // Number of social notes + Fig_TIMELINE, // Number of timeline notes Fig_FOLLOW, // Number of following and followers Fig_FORUMS, // Number of forums, threads and posts Fig_NOTIFY_EVENTS, // Number of users per notify event diff --git a/swad_file_browser.c b/swad_file_browser.c index 1188f956..0b2e8c89 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -53,9 +53,9 @@ #include "swad_parameter.h" #include "swad_photo.h" #include "swad_profile.h" -#include "swad_social.h" #include "swad_string.h" #include "swad_table.h" +#include "swad_timeline.h" #include "swad_zip.h" /*****************************************************************************/ @@ -10405,7 +10405,7 @@ void Brw_ChgFileMetadata (void) bool PublicFileBeforeEdition; bool PublicFileAfterEdition; Brw_License_t License; - struct SocialPublication SocPub; + struct TL_Publication SocPub; /***** Get parameters related to file browser *****/ Brw_GetParAndInitFileBrowser (); @@ -10476,28 +10476,28 @@ void Brw_ChgFileMetadata (void) switch (Gbl.FileBrowser.Type) { case Brw_ADMI_DOC_INS: - Soc_StoreAndPublishSocialNote (Soc_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); break; case Brw_ADMI_SHR_INS: - Soc_StoreAndPublishSocialNote (Soc_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); break; case Brw_ADMI_DOC_CTR: - Soc_StoreAndPublishSocialNote (Soc_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); break; case Brw_ADMI_SHR_CTR: - Soc_StoreAndPublishSocialNote (Soc_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); break; case Brw_ADMI_DOC_DEG: - Soc_StoreAndPublishSocialNote (Soc_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); break; case Brw_ADMI_SHR_DEG: - Soc_StoreAndPublishSocialNote (Soc_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); break; case Brw_ADMI_DOC_CRS: - Soc_StoreAndPublishSocialNote (Soc_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub); break; case Brw_ADMI_SHR_CRS: - Soc_StoreAndPublishSocialNote (Soc_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub); break; default: break; @@ -11394,7 +11394,7 @@ static void Brw_RemoveOneFileOrFolderFromDB (const char Path[PATH_MAX + 1]) Set possible social note as unavailable. Important: do this before removing from files *****/ Ntf_MarkNotifOneFileAsRemoved (Path); - Soc_MarkSocialNoteOneFileAsUnavailable (Path); + TL_MarkNoteOneFileAsUnavailable (Path); /***** Remove from database the entries that store the marks properties *****/ if (FileBrowser == Brw_ADMI_MRK_CRS || @@ -11438,7 +11438,7 @@ static void Brw_RemoveChildrenOfFolderFromDB (const char Path[PATH_MAX + 1]) Set possible social notes as unavailable. Important: do this before removing from files *****/ Ntf_MarkNotifChildrenOfFolderAsRemoved (Path); - Soc_MarkSocialNotesChildrenOfFolderAsUnavailable (Path); + TL_MarkNotesChildrenOfFolderAsUnavailable (Path); /***** Remove from database the entries that store the marks properties *****/ if (FileBrowser == Brw_ADMI_MRK_CRS || diff --git a/swad_follow.c b/swad_follow.c index a1c2ce2f..218cf37e 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -122,7 +122,7 @@ void Fol_PutLinkWhoToFollow (void) void Fol_SuggestUsrsToFollowMainZone (void) { - extern const char *Hlp_SOCIAL_Profiles_who_to_follow; + extern const char *Hlp_START_Profiles_who_to_follow; extern const char *Txt_Who_to_follow; extern const char *Txt_No_user_to_whom_you_can_follow_Try_again_later; MYSQL_RES *mysql_res; @@ -144,7 +144,7 @@ void Fol_SuggestUsrsToFollowMainZone (void) { /***** Start box and table *****/ Box_StartBoxTable ("560px",Txt_Who_to_follow,Fol_PutIconsWhoToFollow, - Hlp_SOCIAL_Profiles_who_to_follow,Box_NOT_CLOSABLE,2); + Hlp_START_Profiles_who_to_follow,Box_NOT_CLOSABLE,2); /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); diff --git a/swad_forum.c b/swad_forum.c index a0d8f103..1570bf7b 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -46,8 +46,8 @@ #include "swad_parameter.h" #include "swad_profile.h" #include "swad_role.h" -#include "swad_social.h" #include "swad_table.h" +#include "swad_timeline.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -942,7 +942,7 @@ void For_RemoveUsrFromReadThrs (long UsrCod) static void For_ShowPostsOfAThread (Ale_AlertType_t AlertType,const char *Message) { - extern const char *Hlp_SOCIAL_Forums_posts; + extern const char *Hlp_MESSAGES_Forums_posts; extern const char *Txt_Thread; struct ForumThread Thr; char LastSubject[Cns_MAX_BYTES_SUBJECT + 1]; @@ -982,7 +982,7 @@ static void For_ShowPostsOfAThread (Ale_AlertType_t AlertType,const char *Messag "%s: %s", Txt_Thread,Thr.Subject); Box_StartBox (NULL,FrameTitle,For_PutIconNewPost, - Hlp_SOCIAL_Forums_posts,Box_NOT_CLOSABLE); + Hlp_MESSAGES_Forums_posts,Box_NOT_CLOSABLE); /***** Get posts of a thread from database *****/ NumRows = DB_QuerySELECT (&mysql_res,"can not get posts of a thread", @@ -1557,7 +1557,7 @@ static void For_PutHiddenParamPstCod (long PstCod) static void For_ShowForumList (void) { - extern const char *Hlp_SOCIAL_Forums; + extern const char *Hlp_MESSAGES_Forums; extern const char *Txt_Forums; bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]; MYSQL_RES *mysql_resCtr; @@ -1588,7 +1588,7 @@ static void For_ShowForumList (void) /***** Start box *****/ Box_StartBox (NULL,Txt_Forums,For_PutIconsForums, - Hlp_SOCIAL_Forums,Box_NOT_CLOSABLE); + Hlp_MESSAGES_Forums,Box_NOT_CLOSABLE); /***** Put a form to select which forums *****/ For_PutFormWhichForums (); @@ -2468,7 +2468,7 @@ void For_ShowForumTheads (void) static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, Ale_AlertType_t AlertType,const char *Message) { - extern const char *Hlp_SOCIAL_Forums_threads; + extern const char *Hlp_MESSAGES_Forums_threads; extern const char *Txt_Forum; extern const char *Txt_MSG_Subject; extern const char *Txt_FORUM_THREAD_HELP_ORDER[2]; @@ -2557,7 +2557,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, "%s: %s", Txt_Forum,ForumName); Box_StartBox (NULL,FrameTitle,For_PutIconNewThread, - Hlp_SOCIAL_Forums_threads,Box_NOT_CLOSABLE); + Hlp_MESSAGES_Forums_threads,Box_NOT_CLOSABLE); /***** List the threads *****/ if (NumThrs) @@ -3936,8 +3936,8 @@ static void For_RestrictAccess (void) static void For_WriteFormForumPst (bool IsReply,const char *Subject) { - extern const char *Hlp_SOCIAL_Forums_new_post; - extern const char *Hlp_SOCIAL_Forums_new_thread; + extern const char *Hlp_MESSAGES_Forums_new_post; + extern const char *Hlp_MESSAGES_Forums_new_thread; extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *Txt_New_post; extern const char *Txt_New_thread; @@ -3948,10 +3948,10 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject) /***** Start box *****/ if (IsReply) Box_StartBox (NULL,Txt_New_post,NULL, - Hlp_SOCIAL_Forums_new_post,Box_NOT_CLOSABLE); + Hlp_MESSAGES_Forums_new_post,Box_NOT_CLOSABLE); else Box_StartBox (NULL,Txt_New_thread,NULL, - Hlp_SOCIAL_Forums_new_thread,Box_NOT_CLOSABLE); + Hlp_MESSAGES_Forums_new_thread,Box_NOT_CLOSABLE); /***** Start form *****/ if (IsReply) // Form to write a reply to a post of an existing thread @@ -4030,7 +4030,7 @@ void For_ReceiveForumPost (void) bool IsReply = false; long PstCod = 0; unsigned NumUsrsToBeNotifiedByEMail; - struct SocialPublication SocPub; + struct TL_Publication SocPub; char Content[Cns_MAX_BYTES_LONG_TEXT + 1]; struct Media Media; @@ -4115,7 +4115,7 @@ void For_ReceiveForumPost (void) { case For_FORUM_GLOBAL_USRS: case For_FORUM__SWAD__USRS: - Soc_StoreAndPublishSocialNote (Soc_NOTE_FORUM_POST,PstCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_FORUM_POST,PstCod,&SocPub); break; default: break; @@ -4200,7 +4200,7 @@ void For_RemovePost (void) { case For_FORUM_GLOBAL_USRS: case For_FORUM__SWAD__USRS: - Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NOTE_FORUM_POST,Gbl.Forum.ForumSelected.PstCod); + TL_MarkNoteAsUnavailableUsingNoteTypeAndCod (TL_NOTE_FORUM_POST,Gbl.Forum.ForumSelected.PstCod); break; default: break; diff --git a/swad_global.c b/swad_global.c index 2b2eb232..1dc26210 100644 --- a/swad_global.c +++ b/swad_global.c @@ -434,7 +434,7 @@ void Gbl_InitializeGlobals (void) Gbl.Games.ListQuestions = NULL; /* Public activity */ - Gbl.Social.WhichUsrs = Soc_DEFAULT_WHICH_USRS; + Gbl.Timeline.WhichUsrs = TL_DEFAULT_WHICH_USRS; /* Forums */ Gbl.Forum.ForumSet = For_DEFAULT_FORUM_SET; diff --git a/swad_global.h b/swad_global.h index b6d2c373..80161942 100644 --- a/swad_global.h +++ b/swad_global.h @@ -73,10 +73,10 @@ #include "swad_record.h" #include "swad_search.h" #include "swad_session.h" -#include "swad_social.h" #include "swad_survey.h" #include "swad_syllabus.h" #include "swad_test.h" +#include "swad_timeline.h" #include "swad_timetable.h" #include "swad_web_service.h" @@ -613,10 +613,10 @@ struct Globals } AttEvents; struct { - Soc_WhichUsrs_t WhichUsrs; + TL_WhichUsrs_t WhichUsrs; long NotCod; // Used as parameter about social note to be edited, removed... long PubCod; // Used as parameter about social publishing to be edited, removed... - } Social; + } Timeline; struct { For_ForumSet_t ForumSet; diff --git a/swad_help_URL.c b/swad_help_URL.c index a32c7a64..ca45cde5 100644 --- a/swad_help_URL.c +++ b/swad_help_URL.c @@ -2024,7 +2024,7 @@ const char *Hlp_USERS_Connected_last_clicks = /***** SOCIAL tab *****/ -const char *Hlp_SOCIAL_Timeline = +const char *Hlp_START_Timeline = #if L==1 "SOCIAL.Timeline.es"; #elif L==2 @@ -2045,7 +2045,7 @@ const char *Hlp_SOCIAL_Timeline = "SOCIAL.Timeline.en"; #endif -const char *Hlp_SOCIAL_Profiles_view_public_profile = +const char *Hlp_START_Profiles_view_public_profile = #if L==1 "SOCIAL.Profiles.es#ver-perfil-p%C3%BAblico"; #elif L==2 @@ -2066,7 +2066,7 @@ const char *Hlp_SOCIAL_Profiles_view_public_profile = "SOCIAL.Profiles.en#view-public-profile"; #endif -const char *Hlp_SOCIAL_Profiles_who_to_follow = +const char *Hlp_START_Profiles_who_to_follow = #if L==1 "SOCIAL.Profiles.es#a-qui%C3%A9n-seguir"; #elif L==2 @@ -2087,7 +2087,7 @@ const char *Hlp_SOCIAL_Profiles_who_to_follow = "SOCIAL.Profiles.en#who-to-follow"; #endif -const char *Hlp_SOCIAL_Forums = +const char *Hlp_MESSAGES_Forums = #if L==1 "SOCIAL.Forums.es"; #elif L==2 @@ -2108,7 +2108,7 @@ const char *Hlp_SOCIAL_Forums = "SOCIAL.Forums.en"; #endif -const char *Hlp_SOCIAL_Forums_threads = +const char *Hlp_MESSAGES_Forums_threads = #if L==1 "SOCIAL.Forums.es#discusiones"; #elif L==2 @@ -2129,7 +2129,7 @@ const char *Hlp_SOCIAL_Forums_threads = "SOCIAL.Forums.en#threads"; #endif -const char *Hlp_SOCIAL_Forums_new_thread = +const char *Hlp_MESSAGES_Forums_new_thread = #if L==1 "SOCIAL.Forums.es#nueva-discusi%C3%B3n"; #elif L==2 @@ -2150,7 +2150,7 @@ const char *Hlp_SOCIAL_Forums_new_thread = "SOCIAL.Forums.en#new-thread"; #endif -const char *Hlp_SOCIAL_Forums_posts = +const char *Hlp_MESSAGES_Forums_posts = #if L==1 "SOCIAL.Forums.es#comentarios"; #elif L==2 @@ -2171,7 +2171,7 @@ const char *Hlp_SOCIAL_Forums_posts = "SOCIAL.Forums.en#posts"; #endif -const char *Hlp_SOCIAL_Forums_new_post = +const char *Hlp_MESSAGES_Forums_new_post = #if L==1 "SOCIAL.Forums.es#nuevo-comentario"; #elif L==2 @@ -2194,7 +2194,7 @@ const char *Hlp_SOCIAL_Forums_new_post = /***** MESSAGES tab *****/ -const char *Hlp_MESSAGES_Notifications = +const char *Hlp_START_Notifications = #if L==1 "MESSAGES.Notifications.es"; #elif L==2 @@ -2215,7 +2215,7 @@ const char *Hlp_MESSAGES_Notifications = "MESSAGES.Notifications.en"; #endif -const char *Hlp_MESSAGES_Domains = +const char *Hlp_START_Domains = #if L==1 "MESSAGES.Domains.es"; #elif L==2 @@ -2236,7 +2236,7 @@ const char *Hlp_MESSAGES_Domains = "MESSAGES.Domains.en"; #endif -const char *Hlp_MESSAGES_Domains_edit = +const char *Hlp_START_Domains_edit = #if L==1 "MESSAGES.Domains.es#editar"; #elif L==2 diff --git a/swad_layout.c b/swad_layout.c index 16231f7f..b964669d 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -50,9 +50,9 @@ #include "swad_notification.h" #include "swad_parameter.h" #include "swad_preference.h" -#include "swad_social.h" #include "swad_tab.h" #include "swad_theme.h" +#include "swad_timeline.h" #include "swad_web_service.h" /*****************************************************************************/ @@ -685,7 +685,7 @@ static void Lay_WriteScriptInit (void) case ActRemSocComGbl: // Refresh timeline via AJAX fprintf (Gbl.F.Out," setTimeout(\"refreshNewTimeline()\",%lu);\n", - Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE); + Cfg_TIME_TO_REFRESH_TIMELINE); break; default: break; @@ -738,8 +738,8 @@ static void Lay_WriteScriptParamsAJAX (void) "var RefreshParamWhichUsrs = \"WhichUsrs=%u\";\n", Act_GetActCod (ActRefNewSocPubGbl), Act_GetActCod (ActRefOldSocPubGbl), - Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW, - (unsigned) Gbl.Social.WhichUsrs); + TL_MAX_OLD_PUBS_TO_GET_AND_SHOW, + (unsigned) Gbl.Timeline.WhichUsrs); break; case ActSeeOthPubPrf: case ActRcvSocPstUsr: @@ -759,7 +759,7 @@ static void Lay_WriteScriptParamsAJAX (void) "var RefreshParamMaxOldPubsToGetAndShow = \"%u\";\n" "var RefreshParamUsr = \"OtherUsrCod=%s\";\n", Act_GetActCod (ActRefOldSocPubUsr), - Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW, + TL_MAX_OLD_PUBS_TO_GET_AND_SHOW, Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); break; default: diff --git a/swad_mail.c b/swad_mail.c index b7cfa1f9..c208435d 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -101,7 +101,7 @@ static void Mai_InsertMailKey (const char Email[Cns_MAX_BYTES_EMAIL_ADDRESS + 1] void Mai_SeeMailDomains (void) { - extern const char *Hlp_MESSAGES_Domains; + extern const char *Hlp_START_Domains; extern const char *Txt_Email_domains_allowed_for_notifications; extern const char *Txt_EMAIL_DOMAIN_HELP_ORDER[3]; extern const char *Txt_EMAIL_DOMAIN_ORDER[3]; @@ -118,7 +118,7 @@ void Mai_SeeMailDomains (void) Box_StartBoxTable (NULL,Txt_Email_domains_allowed_for_notifications, Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM ? Mai_PutIconToEditMailDomains : NULL, - Hlp_MESSAGES_Domains,Box_NOT_CLOSABLE,2); + Hlp_START_Domains,Box_NOT_CLOSABLE,2); /***** Write heading *****/ fprintf (Gbl.F.Out,""); @@ -444,14 +444,14 @@ void Mai_FreeListMailDomains (void) static void Mai_ListMailDomainsForEdition (void) { - extern const char *Hlp_MESSAGES_Domains_edit; + extern const char *Hlp_START_Domains_edit; extern const char *Txt_Email_domains_allowed_for_notifications; unsigned NumMai; struct Mail *Mai; /***** Start box and table *****/ Box_StartBoxTable (NULL,Txt_Email_domains_allowed_for_notifications,NULL, - Hlp_MESSAGES_Domains_edit,Box_NOT_CLOSABLE,2); + Hlp_START_Domains_edit,Box_NOT_CLOSABLE,2); /***** Write heading *****/ Mai_PutHeadMailDomains (); @@ -696,7 +696,7 @@ static void Mai_UpdateMailDomainNameDB (long MaiCod,const char *FieldName,const static void Mai_PutFormToCreateMailDomain (void) { - extern const char *Hlp_MESSAGES_Domains_edit; + extern const char *Hlp_START_Domains_edit; extern const char *Txt_New_email_domain; extern const char *Txt_EMAIL_DOMAIN_ORDER[3]; extern const char *Txt_Create_email_domain; @@ -709,7 +709,7 @@ static void Mai_PutFormToCreateMailDomain (void) /***** Start box and table *****/ Box_StartBoxTable (NULL,Txt_New_email_domain,NULL, - Hlp_MESSAGES_Domains_edit,Box_NOT_CLOSABLE,2); + Hlp_START_Domains_edit,Box_NOT_CLOSABLE,2); /***** Write heading *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_notice.c b/swad_notice.c index 0676f9fa..f2ee9d99 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -38,7 +38,7 @@ #include "swad_notification.h" #include "swad_parameter.h" #include "swad_RSS.h" -#include "swad_social.h" +#include "swad_timeline.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -130,7 +130,7 @@ void Not_ReceiveNotice (void) extern const char *Txt_Notice_created; long NotCod; unsigned NumUsrsToBeNotifiedByEMail; - struct SocialPublication SocPub; + struct TL_Publication SocPub; char Content[Cns_MAX_BYTES_TEXT + 1]; /***** Get the text of the notice *****/ @@ -151,7 +151,7 @@ void Not_ReceiveNotice (void) Not_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail); /***** Create a new social note about the new notice *****/ - Soc_StoreAndPublishSocialNote (Soc_NOTE_NOTICE,NotCod,&SocPub); + TL_StoreAndPublishNote (TL_NOTE_NOTICE,NotCod,&SocPub); } /*****************************************************************************/ @@ -316,7 +316,7 @@ void Not_RemoveNotice (void) Ntf_MarkNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod); /***** Mark possible social note as unavailable *****/ - Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NOTE_NOTICE,NotCod); + TL_MarkNoteAsUnavailableUsingNoteTypeAndCod (TL_NOTE_NOTICE,NotCod); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs); diff --git a/swad_notification.c b/swad_notification.c index 801d9f5f..cfcdfc78 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -45,8 +45,8 @@ #include "swad_notice.h" #include "swad_notification.h" #include "swad_parameter.h" -#include "swad_social.h" #include "swad_table.h" +#include "swad_timeline.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -299,7 +299,7 @@ static unsigned Ntf_GetNumberOfMyNewUnseenNtfs (void); void Ntf_ShowMyNotifications (void) { - extern const char *Hlp_MESSAGES_Notifications; + extern const char *Hlp_START_Notifications; extern const char *Txt_Settings; extern const char *Txt_Domains; extern const char *Txt_Mark_all_NOTIFICATIONS_as_read; @@ -384,7 +384,7 @@ void Ntf_ShowMyNotifications (void) /***** Start box *****/ Box_StartBox (NULL,Txt_Notifications,Ntf_PutIconsNotif, - Hlp_MESSAGES_Notifications,Box_NOT_CLOSABLE); + Hlp_START_Notifications,Box_NOT_CLOSABLE); /***** List my notifications *****/ if (NumNotifications) // Notifications found @@ -744,7 +744,7 @@ static bool Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent, case Ntf_EVENT_TIMELINE_MENTION: // Cod is the code of the social publishing Frm_StartForm (ActSeeSocTmlGbl); - Soc_PutHiddenParamPubCod (Cod); + TL_PutHiddenParamPubCod (Cod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Ntf_PutHiddenParamNotifyEvent (NotifyEvent); break; @@ -896,7 +896,7 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], case Ntf_EVENT_TIMELINE_SHARE: case Ntf_EVENT_TIMELINE_MENTION: // Cod is the code of the social publishing - Soc_GetNotifSocialPublication (SummaryStr,ContentStr,Cod,GetContent); + TL_GetNotifPublication (SummaryStr,ContentStr,Cod,GetContent); break; case Ntf_EVENT_FOLLOWER: Fol_GetNotifFollower (SummaryStr,ContentStr); diff --git a/swad_profile.c b/swad_profile.c index b827ea75..5db4527a 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -44,8 +44,8 @@ #include "swad_profile.h" #include "swad_role.h" #include "swad_role_type.h" -#include "swad_social.h" #include "swad_theme.h" +#include "swad_timeline.h" #include "swad_user.h" /*****************************************************************************/ @@ -178,7 +178,7 @@ void Prf_PutLinkRequestAnotherUserProfile (void) void Prf_RequestUserProfile (void) { - extern const char *Hlp_SOCIAL_Profiles_view_public_profile; + extern const char *Hlp_START_Profiles_view_public_profile; extern const char *Txt_Another_user_s_profile; extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *Txt_Nickname; @@ -198,7 +198,7 @@ void Prf_RequestUserProfile (void) /***** Start box *****/ Box_StartBox (NULL,Txt_Another_user_s_profile,NULL, - Hlp_SOCIAL_Profiles_view_public_profile,Box_NOT_CLOSABLE); + Hlp_START_Profiles_view_public_profile,Box_NOT_CLOSABLE); /***** Form to request user's @nickname *****/ /* By default, the nickname is filled with my nickname @@ -244,8 +244,8 @@ void Prf_GetUsrDatAndShowUserProfile (void) if (Gbl.Usrs.Me.Logged) // Timeline visible only by logged users { /* Show timeline */ - Lay_StartSection (Soc_TIMELINE_SECTION_ID); - Soc_ShowTimelineUsr (); + Lay_StartSection (TL_TIMELINE_SECTION_ID); + TL_ShowTimelineUsr (); Lay_EndSection (); } } @@ -645,8 +645,8 @@ static void Prf_ShowNumSocialPublications (const struct UsrData *UsrDat, const struct UsrFigures *UsrFigures) { extern const char *Txt_Timeline; - extern const char *Txt_SOCIAL_post; - extern const char *Txt_SOCIAL_posts; + extern const char *Txt_TIMELINE_post; + extern const char *Txt_TIMELINE_posts; extern const char *Txt_day; /***** Number of social publications *****/ @@ -656,8 +656,8 @@ static void Prf_ShowNumSocialPublications (const struct UsrData *UsrDat, { fprintf (Gbl.F.Out,"%ld %s ", UsrFigures->NumSocPub, - (UsrFigures->NumSocPub == 1) ? Txt_SOCIAL_post : - Txt_SOCIAL_posts); + (UsrFigures->NumSocPub == 1) ? Txt_TIMELINE_post : + Txt_TIMELINE_posts); Prf_ShowRanking (Prf_GetRankingFigure (UsrDat->UsrCod,"NumSocPub"), Prf_GetNumUsrsWithFigure ("NumSocPub")); if (UsrFigures->NumDays > 0) @@ -1105,7 +1105,7 @@ static void Prf_GetNumSocialPubsAndStoreAsUsrFigure (long UsrCod) Prf_ResetUsrFigures (&UsrFigures); /***** Get number of forum posts from database *****/ - UsrFigures.NumSocPub = Soc_GetNumPubsUsr (UsrCod); + UsrFigures.NumSocPub = TL_GetNumPubsUsr (UsrCod); /***** Update number of forum posts in user's figures *****/ if (Prf_CheckIfUsrFiguresExists (UsrCod)) diff --git a/swad_record.c b/swad_record.c index cb386d95..a05ddeec 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2128,7 +2128,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, { extern const char *Hlp_USERS_SignUp; extern const char *Hlp_PROFILE_Record; - extern const char *Hlp_SOCIAL_Profiles_view_public_profile; + extern const char *Hlp_START_Profiles_view_public_profile; extern const char *Hlp_USERS_Guests; extern const char *Hlp_USERS_Students_shared_record_card; extern const char *Hlp_USERS_Teachers_shared_record_card; @@ -2149,7 +2149,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, NULL, // Rec_SHA_RECORD_LIST NULL, // Rec_SHA_RECORD_PRINT - Hlp_SOCIAL_Profiles_view_public_profile, // Rec_SHA_RECORD_PUBLIC + Hlp_START_Profiles_view_public_profile, // Rec_SHA_RECORD_PUBLIC }; const char *Rec_RecordListHelp[Rol_NUM_ROLES] = { diff --git a/swad_session.c b/swad_session.c index 356c84af..55bb4ee2 100644 --- a/swad_session.c +++ b/swad_session.c @@ -35,7 +35,7 @@ #include "swad_database.h" #include "swad_global.h" #include "swad_parameter.h" -#include "swad_social.h" +#include "swad_timeline.h" /*****************************************************************************/ /**************************** Internal constants *****************************/ @@ -223,7 +223,7 @@ static void Ses_RemoveSessionFromDB (void) /***** Clear old unused social timelines in database *****/ // This is necessary to prevent the table growing and growing - Soc_ClearOldTimelinesDB (); + TL_ClearOldTimelinesDB (); } /*****************************************************************************/ diff --git a/swad_social.h b/swad_social.h deleted file mode 100644 index 1fb5dd60..00000000 --- a/swad_social.h +++ /dev/null @@ -1,192 +0,0 @@ -// swad_social.c: social networking (timeline) - -#ifndef _SWAD_SOC -#define _SWAD_SOC -/* - SWAD (Shared Workspace At a Distance in Spanish), - is a web platform developed at the University of Granada (Spain), - and used to support university teaching. - - This file is part of SWAD core. - Copyright (C) 1999-2019 Antonio Cañas Vargas - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ -/*****************************************************************************/ -/********************************** Headers **********************************/ -/*****************************************************************************/ - -/*****************************************************************************/ -/****************************** Public constants *****************************/ -/*****************************************************************************/ - -#define Soc_TIMELINE_SECTION_ID "timeline" - -// Number of recent publishings got and shown the first time, before refreshing -#define Soc_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // Unlimited -#define Soc_MAX_REC_PUBS_TO_GET_AND_SHOW 20 // Recent publishings to show (first time) -#define Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW 20 // Old publishings are retrieved in packs of this size - // This constant is also used in JavaScript function readOldTimelineData - -/*****************************************************************************/ -/******************************** Public types *******************************/ -/*****************************************************************************/ - -#define Soc_NUM_WHICH_USRS 3 -typedef enum - { - Soc_USRS_UNKNOWN = 0, - Soc_USRS_FOLLOWED = 1, - Soc_USRS_ALL = 2, - } Soc_WhichUsrs_t; // Which users I want to see: only users I follow or all users -#define Soc_DEFAULT_WHICH_USRS Soc_USRS_FOLLOWED - -#define Soc_NUM_PUB_TYPES 4 -// If the numbers assigned to each event type change, -// it is necessary to change old numbers to new ones in database table social_notes -typedef enum - { - Soc_PUB_UNKNOWN = 0, - Soc_PUB_ORIGINAL_NOTE = 1, - Soc_PUB_SHARED_NOTE = 2, - Soc_PUB_COMMENT_TO_NOTE = 3, - } Soc_PubType_t; - -#define Soc_NUM_NOTE_TYPES 13 -// If the numbers assigned to each event type change, -// it is necessary to change old numbers to new ones in database table social_notes -typedef enum - { - Soc_NOTE_UNKNOWN = 0, - - /* Institution tab */ - Soc_NOTE_INS_DOC_PUB_FILE = 1, - Soc_NOTE_INS_SHA_PUB_FILE = 2, - - /* Centre tab */ - Soc_NOTE_CTR_DOC_PUB_FILE = 3, - Soc_NOTE_CTR_SHA_PUB_FILE = 4, - - /* Degree tab */ - Soc_NOTE_DEG_DOC_PUB_FILE = 5, - Soc_NOTE_DEG_SHA_PUB_FILE = 6, - - /* Course tab */ - Soc_NOTE_CRS_DOC_PUB_FILE = 7, - Soc_NOTE_CRS_SHA_PUB_FILE = 8, - - /* Assessment tab */ - Soc_NOTE_EXAM_ANNOUNCEMENT = 9, - - /* Users tab */ - - /* Social tab */ - Soc_NOTE_SOCIAL_POST = 10, - Soc_NOTE_FORUM_POST = 11, - - /* Messages tab */ - Soc_NOTE_NOTICE = 12, - - /* Statistics tab */ - - /* Profile tab */ - - } Soc_NoteType_t; - -#define Soc_NUM_TOP_MESSAGES (1 + 6) -typedef enum - { - Soc_TOP_MESSAGE_NONE = 0, - Soc_TOP_MESSAGE_COMMENTED = 1, - Soc_TOP_MESSAGE_FAVED = 2, - Soc_TOP_MESSAGE_UNFAVED = 3, - Soc_TOP_MESSAGE_SHARED = 4, - Soc_TOP_MESSAGE_UNSHARED = 5, - Soc_TOP_MESSAGE_MENTIONED = 6, - } Soc_TopMessage_t; - -struct SocialPublication - { - long PubCod; - long NotCod; - long PublisherCod; // Sharer or writer of a comment - Soc_PubType_t PubType; - time_t DateTimeUTC; - Soc_TopMessage_t TopMessage; // Used to show feedback on the action made - }; - -/*****************************************************************************/ -/****************************** Public prototypes ****************************/ -/*****************************************************************************/ - -void Soc_ShowTimelineGbl1 (void); -void Soc_ShowTimelineGbl2 (void); -void Soc_ShowTimelineUsr (void); - -void Soc_RefreshNewTimelineGbl (void); - -void Soc_RefreshOldTimelineGbl (void); -void Soc_RefreshOldTimelineUsr (void); - -void Soc_MarkMyNotifAsSeen (void); - -void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod,struct SocialPublication *SocPub); -void Soc_MarkSocialNoteAsUnavailableUsingNotCod (long NotCod); -void Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NoteType_t NoteType,long Cod); -void Soc_MarkSocialNoteOneFileAsUnavailable (const char *Path); -void Soc_MarkSocialNotesChildrenOfFolderAsUnavailable (const char *Path); - -void Soc_ReceiveSocialPostGbl (void); -void Soc_ReceiveSocialPostUsr (void); - -void Soc_PutHiddenParamPubCod (long PubCod); - -void Soc_ReceiveCommentGbl (void); -void Soc_ReceiveCommentUsr (void); - -void Soc_ShareSocialNoteGbl (void); -void Soc_ShareSocialNoteUsr (void); -void Soc_FavSocialNoteGbl (void); -void Soc_FavSocialNoteUsr (void); -void Soc_FavSocialCommentGbl (void); -void Soc_FavSocialCommentUsr (void); - -void Soc_UnshareSocialNoteGbl (void); -void Soc_UnshareSocialNoteUsr (void); -void Soc_UnfavSocialNoteGbl (void); -void Soc_UnfavSocialNoteUsr (void); -void Soc_UnfavSocialCommentGbl (void); -void Soc_UnfavSocialCommentUsr (void); - -void Soc_RequestRemSocialNoteGbl (void); -void Soc_RequestRemSocialNoteUsr (void); -void Soc_RemoveSocialNoteGbl (void); -void Soc_RemoveSocialNoteUsr (void); - -void Soc_RequestRemSocialComGbl (void); -void Soc_RequestRemSocialComUsr (void); -void Soc_RemoveSocialComGbl (void); -void Soc_RemoveSocialComUsr (void); - -void Soc_RemoveUsrSocialContent (long UsrCod); - -void Soc_ClearOldTimelinesDB (void); - -void Soc_GetNotifSocialPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], - char **ContentStr, - long PubCod,bool GetContent); - -unsigned long Soc_GetNumPubsUsr (long UsrCod); - -#endif diff --git a/swad_text.c b/swad_text.c index d9706c6c..c6ae55f0 100644 --- a/swad_text.c +++ b/swad_text.c @@ -83,12 +83,12 @@ #include "swad_project.h" #include "swad_record.h" #include "swad_role.h" -#include "swad_social.h" #include "swad_statistic.h" #include "swad_survey.h" #include "swad_syllabus.h" #include "swad_tab.h" #include "swad_test.h" +#include "swad_timeline.h" #include "swad_timetable.h" #include "swad_user.h" @@ -23958,7 +23958,7 @@ const char *Txt_New_record_field = "Novo campo de cartão"; #endif -const char *Txt_New_SOCIAL_comment = +const char *Txt_New_TIMELINE_comment = #if L==1 // ca "Nou comentari"; #elif L==2 // de @@ -23979,7 +23979,7 @@ const char *Txt_New_SOCIAL_comment = "Novo comentário"; #endif -const char *Txt_New_SOCIAL_post = +const char *Txt_New_TIMELINE_post = #if L==1 // ca "Nova publicació"; #elif L==2 // de @@ -38918,569 +38918,6 @@ const char *Txt_Size_of_photos = "Tamanho das fotos"; #endif -const char *Txt_SOCIAL_NOTE[Soc_NUM_NOTE_TYPES] = - { -#if L==1 // ca // Soc_NOTE_UNKNOWN - "Esdeveniment desconegut" -#elif L==2 // de - "Unbekannt Ereignis" -#elif L==3 // en - "Unknown event" -#elif L==4 // es - "Evento desconocido" -#elif L==5 // fr - "Événement inconnu" -#elif L==6 // gn - "Evento desconocido" // Okoteve traducción -#elif L==7 // it - "Evento sconosciuto" -#elif L==8 // pl - "Nieznane zdarzenia" -#elif L==9 // pt - "Evento desconhecido" -#endif - , -#if L==1 // ca // Soc_NOTE_INS_DOC_PUB_FILE - "Document públic (institució)" -#elif L==2 // de - "Öffentliche Dokumentdatei (Hochschule)" -#elif L==3 // en - "Public document file (institution)" -#elif L==4 // es - "Documento público (institución)" -#elif L==5 // fr - "Fichier de document public (établissement)" -#elif L==6 // gn - "Documento público (institución)" // Okoteve traducción -#elif L==7 // it - "Documento pubblico (istituzione)" -#elif L==8 // pl - "Plik dokumentu publiczne (instytucji)" -#elif L==9 // pt - "Arquivo de documento público (institução)" -#endif - , -#if L==1 // ca // Soc_NOTE_INS_SHA_PUB_FILE - "Arxiu compartit públic (institució)" -#elif L==2 // de - "Öffentliche Freigegebene Datei (Hochschule)" -#elif L==3 // en - "Public shared file (institution)" -#elif L==4 // es - "Archivo compartido público (institución)" -#elif L==5 // fr - "Fichier partagé public (établissement)" -#elif L==6 // gn - "Archivo compartido público (institución)" // Okoteve traducción -#elif L==7 // it - "File condiviso pubblico (istituzione)" -#elif L==8 // pl - "Udostępniony plik publiczne (instytucji)" -#elif L==9 // pt - "Arquivo compartilhado público (institução)" -#endif - , -#if L==1 // ca // Soc_NOTE_CTR_DOC_PUB_FILE - "Document públic (centre)" -#elif L==2 // de - "Öffentliche Dokumentdatei (Lehrinstitut)" -#elif L==3 // en - "Public document file (centre)" -#elif L==4 // es - "Documento público (centro)" -#elif L==5 // fr - "Fichier de document public (centre)" -#elif L==6 // gn - "Documento público (centro)" // Okoteve traducción -#elif L==7 // it - "Documento pubblico (centro)" -#elif L==8 // pl - "Plik dokumentu publiczne (centrum)" -#elif L==9 // pt - "Arquivo de documento público (centro)" -#endif - , -#if L==1 // ca // Soc_NOTE_CTR_SHA_PUB_FILE - "Arxiu compartit públic (centre)" -#elif L==2 // de - "Öffentliche Freigegebene Datei (Lehrinstitut)" -#elif L==3 // en - "Public shared file (centre)" -#elif L==4 // es - "Archivo compartido público (centro)" -#elif L==5 // fr - "Fichier partagé public (centre)" -#elif L==6 // gn - "Archivo compartido público (centro)" // Okoteve traducción -#elif L==7 // it - "File condiviso pubblico (centro)" -#elif L==8 // pl - "Udostępniony plik publiczne (centrum)" -#elif L==9 // pt - "Arquivo compartilhado público (centro)" -#endif - , -#if L==1 // ca // Soc_NOTE_DEG_DOC_PUB_FILE - "Document públic (titulació)" -#elif L==2 // de - "Öffentliche Dokumentdatei (Studiengang)" -#elif L==3 // en - "Public document file (degree)" -#elif L==4 // es - "Documento público (titulación)" -#elif L==5 // fr - "Fichier de document public (étude)" -#elif L==6 // gn - "Documento público (titulación)" // Okoteve traducción -#elif L==7 // it - "Documento pubblico (laurea)" -#elif L==8 // pl - "Plik dokumentu publiczne (stopień)" -#elif L==9 // pt - "Arquivo de documento público (grau)" -#endif - , -#if L==1 // ca // Soc_NOTE_DEG_SHA_PUB_FILE - "Arxiu compartit públic (titulació)" -#elif L==2 // de - "Öffentliche Freigegebene Datei (Studiengang)" -#elif L==3 // en - "Public shared file (degree)" -#elif L==4 // es - "Archivo compartido público (titulación)" -#elif L==5 // fr - "Fichier partagé public (étude)" -#elif L==6 // gn - "Archivo compartido público (titulación)" // Okoteve traducción -#elif L==7 // it - "File condiviso pubblico (laurea)" -#elif L==8 // pl - "Udostępniony plik publiczne (stopień)" -#elif L==9 // pt - "Arquivo compartilhado público (grau)" -#endif - , -#if L==1 // ca // Soc_NOTE_CRS_DOC_PUB_FILE - "Document públic (assignatura)" -#elif L==2 // de - "Öffentliche Dokumentdatei (Kurs)" -#elif L==3 // en - "Public document file (course)" -#elif L==4 // es - "Documento público (asignatura)" -#elif L==5 // fr - "Fichier de document public (matière)" -#elif L==6 // gn - "Documento público (asignatura)" // Okoteve traducción -#elif L==7 // it - "Documento pubblico (corso)" -#elif L==8 // pl - "Plik dokumentu publiczne (kurs)" -#elif L==9 // pt - "Arquivo de documento público (disciplina)" -#endif - , -#if L==1 // ca // Soc_NOTE_CRS_SHA_PUB_FILE - "Arxiu compartit públic (assignatura)" -#elif L==2 // de - "Öffentliche Freigegebene Datei (Kurs)" -#elif L==3 // en - "Public shared file (course)" -#elif L==4 // es - "Archivo compartido público (asignatura)" -#elif L==5 // fr - "Fichier partagé public (matière)" -#elif L==6 // gn - "Archivo compartido público (asignatura)" // Okoteve traducción -#elif L==7 // it - "File condiviso pubblico (corso)" -#elif L==8 // pl - "Udostępniony plik publiczne (kurs)" -#elif L==9 // pt - "Arquivo compartilhado público (disciplina)" -#endif - , -#if L==1 // ca // Soc_NOTE_EXAM_ANNOUNCEMENT - "Convocatòria d'examen" -#elif L==2 // de - "Aufrufe für Prüfung" -#elif L==3 // en - "Announcement of exam" -#elif L==4 // es - "Convocatoria de examen" -#elif L==5 // fr - "Convocation à un examen" -#elif L==6 // gn - "Convocatoria de examen" // Okoteve traducción -#elif L==7 // it - "Appello d'esame" -#elif L==8 // pl - "Ogloszenie egzamin" -#elif L==9 // pt - "Chamada para exame" -#endif - , -#if L==1 // ca // Soc_NOTE_SOCIAL_POST - "Missatge social" -#elif L==2 // de - "Social Beitrag" -#elif L==3 // en - "Social post" -#elif L==4 // es - "Mensaje social" -#elif L==5 // fr - "Message social" -#elif L==6 // gn - "Mensaje social" // Okoteve traducción -#elif L==7 // it - "Post sociale" -#elif L==8 // pl - "Post społecznej" -#elif L==9 // pt - "Post sociais" -#endif - , -#if L==1 // ca // Soc_NOTE_FORUM_POST - "Comentari en un fòrum" -#elif L==2 // de - "Beiträge in einem Forum" -#elif L==3 // en - "Post in a forum" -#elif L==4 // es - "Comentario en un foro" -#elif L==5 // fr - "Post dans un forum" -#elif L==6 // gn - "Comentario en un foro" // Okoteve traducción -#elif L==7 // it - "Post in un forum" -#elif L==8 // pl - "Post na forum" -#elif L==9 // pt - "Post em um fórum" -#endif - , -#if L==1 // ca // Soc_NOTE_NOTICE - "Avís" -#elif L==2 // de - "Ankündigungen" -#elif L==3 // en - "Notice" -#elif L==4 // es - "Aviso" -#elif L==5 // fr - "Avis" -#elif L==6 // gn - "Marandu" -#elif L==7 // it - "Avviso" -#elif L==8 // pl - "Informacja" -#elif L==9 // pt - "Anúncio" -#endif - }; - -const char *Txt_SOCIAL_NOTE_Favourite = -#if L==1 // ca - "Favorit"; -#elif L==2 // de - "Favorit"; -#elif L==3 // en - "Favourite"; -#elif L==4 // es - "Favorito"; -#elif L==5 // fr - "Favori"; -#elif L==6 // gn - "Favorito"; // Okoteve traducción -#elif L==7 // it - "Preferito"; -#elif L==8 // pl - "Ulubiony"; -#elif L==9 // pt - "Favorito"; -#endif - -const char *Txt_SOCIAL_NOTE_Favourited_by_X_USERS = // Warning: it is very important to include %u in the following sentences -#if L==1 // ca - "Marcat com favorit per %u"; -#elif L==2 // de - "Von %u vorgemerkt"; -#elif L==3 // en - "Favourited by %u"; -#elif L==4 // es - "Marcado como favorito por %u"; -#elif L==5 // fr - "Ajouté aux favoris par %u"; -#elif L==6 // gn - "Marcado como favorito por %u"; // Okoteve traducción -#elif L==7 // it - "Preferiti da %u"; -#elif L==8 // pl - "Dodane do ulubionych przez %u"; -#elif L==9 // pt - "Marcado como favorito por %u"; -#endif - -const char *Txt_SOCIAL_NOTE_Shared = -#if L==1 // ca - "Compartit"; -#elif L==2 // de - "Geteilt"; -#elif L==3 // en - "Shared"; -#elif L==4 // es - "Compartido"; -#elif L==5 // fr - "Partagé"; -#elif L==6 // gn - "Compartido"; // Okoteve traducción -#elif L==7 // it - "Condiviso"; -#elif L==8 // pl - "Udostępnione"; -#elif L==9 // pt - "Compartilhado"; -#endif - -const char *Txt_SOCIAL_NOTE_Shared_by_X_USERS = // Warning: it is very important to include %u in the following sentences -#if L==1 // ca - "Compartit per %u"; -#elif L==2 // de - "Von %u geteilt"; -#elif L==3 // en - "Shared by %u"; -#elif L==4 // es - "Compartido por %u"; -#elif L==5 // fr - "Partagé par %u"; -#elif L==6 // gn - "Compartido por %u"; // Okoteve traducción -#elif L==7 // it - "Condiviso da %u"; -#elif L==8 // pl - "Udostępnione przez %u"; -#elif L==9 // pt - "Compartilhado por %u"; -#endif - -const char *Txt_SOCIAL_NOTE_Not_favourited_by_anyone = // No longer shared -#if L==1 // ca - "No marcat com favorit per ningú"; -#elif L==2 // de - "Niemand hat sie als Favorit markiert"; -#elif L==3 // en - "Not favourited by anyone"; -#elif L==4 // es - "No marcado como favorito por nadie"; -#elif L==5 // fr - "Personne n'a marqué comme favori"; -#elif L==6 // gn - "No marcado como favorito por nadie"; // Okoteve traducción -#elif L==7 // it - "Non preferiti da chiunque"; -#elif L==8 // pl - "Nie przez nikogo ulubionych"; -#elif L==9 // pt - "Não marcado como favorito por qualquer pessoa"; -#endif - -const char *Txt_SOCIAL_NOTE_Not_shared_by_anyone = // No longer shared -#if L==1 // ca - "No compartit per ningú"; -#elif L==2 // de - "Nicht durch Dritte freigegebenen"; -#elif L==3 // en - "Not shared by anyone"; -#elif L==4 // es - "No compartido por nadie"; -#elif L==5 // fr - "Personne n'a partagé"; -#elif L==6 // gn - "No compartido por nadie"; // Okoteve traducción -#elif L==7 // it - "Non condiviso da chiunque"; -#elif L==8 // pl - "Nie jest dzielona przez nikogo"; -#elif L==9 // pt - "Não compartilhado por qualquer pessoa"; -#endif - -const char *Txt_SOCIAL_NOTE_TOP_MESSAGES[Soc_NUM_TOP_MESSAGES] = - { - // Soc_TOP_MESSAGE_NONE - "" - , - // Soc_TOP_MESSAGE_COMMENTED: -#if L==1 // ca - "ha comentat" -#elif L==2 // de - "hat kommentiert" -#elif L==3 // en - "has commented" -#elif L==4 // es - "ha comentado" -#elif L==5 // fr - "a commenté" -#elif L==6 // gn - "ha comentado" // Okoteve traducción -#elif L==7 // it - "ha commentato" -#elif L==8 // pl - "skomentował" -#elif L==9 // pt - "comentou" -#endif - , - // Soc_TOP_MESSAGE_FAVED: -#if L==1 // ca - "ha marcat com favorit" -#elif L==2 // de - "hat als Favorit markiert" -#elif L==3 // en - "has marked as favourite" -#elif L==4 // es - "ha marcado como favorito" -#elif L==5 // fr - "a marqué en tant que favori" -#elif L==6 // gn - "ha marcado como favorito" // Okoteve traducción -#elif L==7 // it - "ha segnato come preferito" -#elif L==8 // pl - "oznaczone jako ulubiony" -#elif L==9 // pt - "marcou como favorito" -#endif - , - // Soc_TOP_MESSAGE_UNFAVED: -#if L==1 // ca - "ha desmarcat com favorit" -#elif L==2 // de - "hat als Favorit unmarkiert" -#elif L==3 // en - "has unmarked as favourite" -#elif L==4 // es - "ha desmarcado como favorito" -#elif L==5 // fr - "a pas marqué en tant que favori" -#elif L==6 // gn - "ha desmarcado como favorito" // Okoteve traducción -#elif L==7 // it - "ha smarcato come preferito" -#elif L==8 // pl - "nieoznaczonych jako ulubiony" -#elif L==9 // pt - "desmarcou como favorito" -#endif - , - // Soc_TOP_MESSAGE_SHARED: -#if L==1 // ca - "ha compartit" -#elif L==2 // de - "hat sich geteilt" -#elif L==3 // en - "has shared" -#elif L==4 // es - "ha compartido" -#elif L==5 // fr - "a partagé" -#elif L==6 // gn - "ha compartido" // Okoteve traducción -#elif L==7 // it - "ha condiviso" -#elif L==8 // pl - "podzielił" -#elif L==9 // pt - "compartilhou" -#endif - , - // Soc_TOP_MESSAGE_UNSHARED: -#if L==1 // ca - "ha deixat de compartir" -#elif L==2 // de - "hat Sharing gestoppt" -#elif L==3 // en - "has stopped sharing" -#elif L==4 // es - "ha dejado de compartir" -#elif L==5 // fr - "a cessé de partage" -#elif L==6 // gn - "ha dejado de compartir" // Okoteve traducción -#elif L==7 // it - "ha smesso di condividere" -#elif L==8 // pl - "przestał udostępniania" -#elif L==9 // pt - "parou compartilhar" -#endif - , - // Soc_TOP_MESSAGE_MENTIONED: -#if L==1 // ca - "li ha esmentat" -#elif L==2 // de - "hat Sie erwähnt" -#elif L==3 // en - "has mentioned you" -#elif L==4 // es - "le ha mencionado" -#elif L==5 // fr - "vous a mentionné" -#elif L==6 // gn - "le ha mencionado" // Okoteve traducción -#elif L==7 // it - "ti ha menzionato" -#elif L==8 // pl - "wspomniał o Tobie" -#elif L==9 // pt - "mencionou você" -#endif - }; - -const char *Txt_SOCIAL_post = -#if L==1 // ca - "publicació"; -#elif L==2 // de - "Publikation"; -#elif L==3 // en - "post"; -#elif L==4 // es - "publicación"; -#elif L==5 // fr - "publication"; -#elif L==6 // gn - "marandu"; -#elif L==7 // it - "pubblicazione"; -#elif L==8 // pl - "publikacja"; -#elif L==9 // pt - "publicação"; -#endif - -const char *Txt_SOCIAL_posts = -#if L==1 // ca - "publicacions"; -#elif L==2 // de - "Publikationen"; -#elif L==3 // en - "posts"; -#elif L==4 // es - "publicaciones"; -#elif L==5 // fr - "publications"; -#elif L==6 // gn - "marandu"; -#elif L==7 // it - "pubblicazioni"; -#elif L==8 // pl - "publikacje"; -#elif L==9 // pt - "publicações"; -#endif - const char *Txt_Sort_degrees_by = #if L==1 // ca "Ordenar titulacions per"; @@ -49280,12 +48717,576 @@ const char *Txt_Timeline_OF_A_USER = // Warning: it is very important to include "Timeline de %s"; #endif -const char *Txt_TIMELINE_WHICH_USERS[Soc_NUM_WHICH_USRS] = + +const char *Txt_TIMELINE_NOTE[TL_NUM_NOTE_TYPES] = + { +#if L==1 // ca // TL_NOTE_UNKNOWN + "Esdeveniment desconegut" +#elif L==2 // de + "Unbekannt Ereignis" +#elif L==3 // en + "Unknown event" +#elif L==4 // es + "Evento desconocido" +#elif L==5 // fr + "Événement inconnu" +#elif L==6 // gn + "Evento desconocido" // Okoteve traducción +#elif L==7 // it + "Evento sconosciuto" +#elif L==8 // pl + "Nieznane zdarzenia" +#elif L==9 // pt + "Evento desconhecido" +#endif + , +#if L==1 // ca // TL_NOTE_INS_DOC_PUB_FILE + "Document públic (institució)" +#elif L==2 // de + "Öffentliche Dokumentdatei (Hochschule)" +#elif L==3 // en + "Public document file (institution)" +#elif L==4 // es + "Documento público (institución)" +#elif L==5 // fr + "Fichier de document public (établissement)" +#elif L==6 // gn + "Documento público (institución)" // Okoteve traducción +#elif L==7 // it + "Documento pubblico (istituzione)" +#elif L==8 // pl + "Plik dokumentu publiczne (instytucji)" +#elif L==9 // pt + "Arquivo de documento público (institução)" +#endif + , +#if L==1 // ca // TL_NOTE_INS_SHA_PUB_FILE + "Arxiu compartit públic (institució)" +#elif L==2 // de + "Öffentliche Freigegebene Datei (Hochschule)" +#elif L==3 // en + "Public shared file (institution)" +#elif L==4 // es + "Archivo compartido público (institución)" +#elif L==5 // fr + "Fichier partagé public (établissement)" +#elif L==6 // gn + "Archivo compartido público (institución)" // Okoteve traducción +#elif L==7 // it + "File condiviso pubblico (istituzione)" +#elif L==8 // pl + "Udostępniony plik publiczne (instytucji)" +#elif L==9 // pt + "Arquivo compartilhado público (institução)" +#endif + , +#if L==1 // ca // TL_NOTE_CTR_DOC_PUB_FILE + "Document públic (centre)" +#elif L==2 // de + "Öffentliche Dokumentdatei (Lehrinstitut)" +#elif L==3 // en + "Public document file (centre)" +#elif L==4 // es + "Documento público (centro)" +#elif L==5 // fr + "Fichier de document public (centre)" +#elif L==6 // gn + "Documento público (centro)" // Okoteve traducción +#elif L==7 // it + "Documento pubblico (centro)" +#elif L==8 // pl + "Plik dokumentu publiczne (centrum)" +#elif L==9 // pt + "Arquivo de documento público (centro)" +#endif + , +#if L==1 // ca // TL_NOTE_CTR_SHA_PUB_FILE + "Arxiu compartit públic (centre)" +#elif L==2 // de + "Öffentliche Freigegebene Datei (Lehrinstitut)" +#elif L==3 // en + "Public shared file (centre)" +#elif L==4 // es + "Archivo compartido público (centro)" +#elif L==5 // fr + "Fichier partagé public (centre)" +#elif L==6 // gn + "Archivo compartido público (centro)" // Okoteve traducción +#elif L==7 // it + "File condiviso pubblico (centro)" +#elif L==8 // pl + "Udostępniony plik publiczne (centrum)" +#elif L==9 // pt + "Arquivo compartilhado público (centro)" +#endif + , +#if L==1 // ca // TL_NOTE_DEG_DOC_PUB_FILE + "Document públic (titulació)" +#elif L==2 // de + "Öffentliche Dokumentdatei (Studiengang)" +#elif L==3 // en + "Public document file (degree)" +#elif L==4 // es + "Documento público (titulación)" +#elif L==5 // fr + "Fichier de document public (étude)" +#elif L==6 // gn + "Documento público (titulación)" // Okoteve traducción +#elif L==7 // it + "Documento pubblico (laurea)" +#elif L==8 // pl + "Plik dokumentu publiczne (stopień)" +#elif L==9 // pt + "Arquivo de documento público (grau)" +#endif + , +#if L==1 // ca // TL_NOTE_DEG_SHA_PUB_FILE + "Arxiu compartit públic (titulació)" +#elif L==2 // de + "Öffentliche Freigegebene Datei (Studiengang)" +#elif L==3 // en + "Public shared file (degree)" +#elif L==4 // es + "Archivo compartido público (titulación)" +#elif L==5 // fr + "Fichier partagé public (étude)" +#elif L==6 // gn + "Archivo compartido público (titulación)" // Okoteve traducción +#elif L==7 // it + "File condiviso pubblico (laurea)" +#elif L==8 // pl + "Udostępniony plik publiczne (stopień)" +#elif L==9 // pt + "Arquivo compartilhado público (grau)" +#endif + , +#if L==1 // ca // TL_NOTE_CRS_DOC_PUB_FILE + "Document públic (assignatura)" +#elif L==2 // de + "Öffentliche Dokumentdatei (Kurs)" +#elif L==3 // en + "Public document file (course)" +#elif L==4 // es + "Documento público (asignatura)" +#elif L==5 // fr + "Fichier de document public (matière)" +#elif L==6 // gn + "Documento público (asignatura)" // Okoteve traducción +#elif L==7 // it + "Documento pubblico (corso)" +#elif L==8 // pl + "Plik dokumentu publiczne (kurs)" +#elif L==9 // pt + "Arquivo de documento público (disciplina)" +#endif + , +#if L==1 // ca // TL_NOTE_CRS_SHA_PUB_FILE + "Arxiu compartit públic (assignatura)" +#elif L==2 // de + "Öffentliche Freigegebene Datei (Kurs)" +#elif L==3 // en + "Public shared file (course)" +#elif L==4 // es + "Archivo compartido público (asignatura)" +#elif L==5 // fr + "Fichier partagé public (matière)" +#elif L==6 // gn + "Archivo compartido público (asignatura)" // Okoteve traducción +#elif L==7 // it + "File condiviso pubblico (corso)" +#elif L==8 // pl + "Udostępniony plik publiczne (kurs)" +#elif L==9 // pt + "Arquivo compartilhado público (disciplina)" +#endif + , +#if L==1 // ca // TL_NOTE_EXAM_ANNOUNCEMENT + "Convocatòria d'examen" +#elif L==2 // de + "Aufrufe für Prüfung" +#elif L==3 // en + "Announcement of exam" +#elif L==4 // es + "Convocatoria de examen" +#elif L==5 // fr + "Convocation à un examen" +#elif L==6 // gn + "Convocatoria de examen" // Okoteve traducción +#elif L==7 // it + "Appello d'esame" +#elif L==8 // pl + "Ogloszenie egzamin" +#elif L==9 // pt + "Chamada para exame" +#endif + , +#if L==1 // ca // TL_NOTE_SOCIAL_POST + "Missatge social" +#elif L==2 // de + "Social Beitrag" +#elif L==3 // en + "Social post" +#elif L==4 // es + "Mensaje social" +#elif L==5 // fr + "Message social" +#elif L==6 // gn + "Mensaje social" // Okoteve traducción +#elif L==7 // it + "Post sociale" +#elif L==8 // pl + "Post społecznej" +#elif L==9 // pt + "Post sociais" +#endif + , +#if L==1 // ca // TL_NOTE_FORUM_POST + "Comentari en un fòrum" +#elif L==2 // de + "Beiträge in einem Forum" +#elif L==3 // en + "Post in a forum" +#elif L==4 // es + "Comentario en un foro" +#elif L==5 // fr + "Post dans un forum" +#elif L==6 // gn + "Comentario en un foro" // Okoteve traducción +#elif L==7 // it + "Post in un forum" +#elif L==8 // pl + "Post na forum" +#elif L==9 // pt + "Post em um fórum" +#endif + , +#if L==1 // ca // TL_NOTE_NOTICE + "Avís" +#elif L==2 // de + "Ankündigungen" +#elif L==3 // en + "Notice" +#elif L==4 // es + "Aviso" +#elif L==5 // fr + "Avis" +#elif L==6 // gn + "Marandu" +#elif L==7 // it + "Avviso" +#elif L==8 // pl + "Informacja" +#elif L==9 // pt + "Anúncio" +#endif + }; + +const char *Txt_TIMELINE_NOTE_Favourite = +#if L==1 // ca + "Favorit"; +#elif L==2 // de + "Favorit"; +#elif L==3 // en + "Favourite"; +#elif L==4 // es + "Favorito"; +#elif L==5 // fr + "Favori"; +#elif L==6 // gn + "Favorito"; // Okoteve traducción +#elif L==7 // it + "Preferito"; +#elif L==8 // pl + "Ulubiony"; +#elif L==9 // pt + "Favorito"; +#endif + +const char *Txt_TIMELINE_NOTE_Favourited_by_X_USERS = // Warning: it is very important to include %u in the following sentences +#if L==1 // ca + "Marcat com favorit per %u"; +#elif L==2 // de + "Von %u vorgemerkt"; +#elif L==3 // en + "Favourited by %u"; +#elif L==4 // es + "Marcado como favorito por %u"; +#elif L==5 // fr + "Ajouté aux favoris par %u"; +#elif L==6 // gn + "Marcado como favorito por %u"; // Okoteve traducción +#elif L==7 // it + "Preferiti da %u"; +#elif L==8 // pl + "Dodane do ulubionych przez %u"; +#elif L==9 // pt + "Marcado como favorito por %u"; +#endif + +const char *Txt_TIMELINE_NOTE_Shared = +#if L==1 // ca + "Compartit"; +#elif L==2 // de + "Geteilt"; +#elif L==3 // en + "Shared"; +#elif L==4 // es + "Compartido"; +#elif L==5 // fr + "Partagé"; +#elif L==6 // gn + "Compartido"; // Okoteve traducción +#elif L==7 // it + "Condiviso"; +#elif L==8 // pl + "Udostępnione"; +#elif L==9 // pt + "Compartilhado"; +#endif + +const char *Txt_TIMELINE_NOTE_Shared_by_X_USERS = // Warning: it is very important to include %u in the following sentences +#if L==1 // ca + "Compartit per %u"; +#elif L==2 // de + "Von %u geteilt"; +#elif L==3 // en + "Shared by %u"; +#elif L==4 // es + "Compartido por %u"; +#elif L==5 // fr + "Partagé par %u"; +#elif L==6 // gn + "Compartido por %u"; // Okoteve traducción +#elif L==7 // it + "Condiviso da %u"; +#elif L==8 // pl + "Udostępnione przez %u"; +#elif L==9 // pt + "Compartilhado por %u"; +#endif + +const char *Txt_TIMELINE_NOTE_Not_favourited_by_anyone = // No longer shared +#if L==1 // ca + "No marcat com favorit per ningú"; +#elif L==2 // de + "Niemand hat sie als Favorit markiert"; +#elif L==3 // en + "Not favourited by anyone"; +#elif L==4 // es + "No marcado como favorito por nadie"; +#elif L==5 // fr + "Personne n'a marqué comme favori"; +#elif L==6 // gn + "No marcado como favorito por nadie"; // Okoteve traducción +#elif L==7 // it + "Non preferiti da chiunque"; +#elif L==8 // pl + "Nie przez nikogo ulubionych"; +#elif L==9 // pt + "Não marcado como favorito por qualquer pessoa"; +#endif + +const char *Txt_TIMELINE_NOTE_Not_shared_by_anyone = // No longer shared +#if L==1 // ca + "No compartit per ningú"; +#elif L==2 // de + "Nicht durch Dritte freigegebenen"; +#elif L==3 // en + "Not shared by anyone"; +#elif L==4 // es + "No compartido por nadie"; +#elif L==5 // fr + "Personne n'a partagé"; +#elif L==6 // gn + "No compartido por nadie"; // Okoteve traducción +#elif L==7 // it + "Non condiviso da chiunque"; +#elif L==8 // pl + "Nie jest dzielona przez nikogo"; +#elif L==9 // pt + "Não compartilhado por qualquer pessoa"; +#endif + +const char *Txt_TIMELINE_NOTE_TOP_MESSAGES[TL_NUM_TOP_MESSAGES] = + { + // TL_TOP_MESSAGE_NONE + "" + , + // TL_TOP_MESSAGE_COMMENTED: +#if L==1 // ca + "ha comentat" +#elif L==2 // de + "hat kommentiert" +#elif L==3 // en + "has commented" +#elif L==4 // es + "ha comentado" +#elif L==5 // fr + "a commenté" +#elif L==6 // gn + "ha comentado" // Okoteve traducción +#elif L==7 // it + "ha commentato" +#elif L==8 // pl + "skomentował" +#elif L==9 // pt + "comentou" +#endif + , + // TL_TOP_MESSAGE_FAVED: +#if L==1 // ca + "ha marcat com favorit" +#elif L==2 // de + "hat als Favorit markiert" +#elif L==3 // en + "has marked as favourite" +#elif L==4 // es + "ha marcado como favorito" +#elif L==5 // fr + "a marqué en tant que favori" +#elif L==6 // gn + "ha marcado como favorito" // Okoteve traducción +#elif L==7 // it + "ha segnato come preferito" +#elif L==8 // pl + "oznaczone jako ulubiony" +#elif L==9 // pt + "marcou como favorito" +#endif + , + // TL_TOP_MESSAGE_UNFAVED: +#if L==1 // ca + "ha desmarcat com favorit" +#elif L==2 // de + "hat als Favorit unmarkiert" +#elif L==3 // en + "has unmarked as favourite" +#elif L==4 // es + "ha desmarcado como favorito" +#elif L==5 // fr + "a pas marqué en tant que favori" +#elif L==6 // gn + "ha desmarcado como favorito" // Okoteve traducción +#elif L==7 // it + "ha smarcato come preferito" +#elif L==8 // pl + "nieoznaczonych jako ulubiony" +#elif L==9 // pt + "desmarcou como favorito" +#endif + , + // TL_TOP_MESSAGE_SHARED: +#if L==1 // ca + "ha compartit" +#elif L==2 // de + "hat sich geteilt" +#elif L==3 // en + "has shared" +#elif L==4 // es + "ha compartido" +#elif L==5 // fr + "a partagé" +#elif L==6 // gn + "ha compartido" // Okoteve traducción +#elif L==7 // it + "ha condiviso" +#elif L==8 // pl + "podzielił" +#elif L==9 // pt + "compartilhou" +#endif + , + // TL_TOP_MESSAGE_UNSHARED: +#if L==1 // ca + "ha deixat de compartir" +#elif L==2 // de + "hat Sharing gestoppt" +#elif L==3 // en + "has stopped sharing" +#elif L==4 // es + "ha dejado de compartir" +#elif L==5 // fr + "a cessé de partage" +#elif L==6 // gn + "ha dejado de compartir" // Okoteve traducción +#elif L==7 // it + "ha smesso di condividere" +#elif L==8 // pl + "przestał udostępniania" +#elif L==9 // pt + "parou compartilhar" +#endif + , + // TL_TOP_MESSAGE_MENTIONED: +#if L==1 // ca + "li ha esmentat" +#elif L==2 // de + "hat Sie erwähnt" +#elif L==3 // en + "has mentioned you" +#elif L==4 // es + "le ha mencionado" +#elif L==5 // fr + "vous a mentionné" +#elif L==6 // gn + "le ha mencionado" // Okoteve traducción +#elif L==7 // it + "ti ha menzionato" +#elif L==8 // pl + "wspomniał o Tobie" +#elif L==9 // pt + "mencionou você" +#endif + }; + +const char *Txt_TIMELINE_post = +#if L==1 // ca + "publicació"; +#elif L==2 // de + "Publikation"; +#elif L==3 // en + "post"; +#elif L==4 // es + "publicación"; +#elif L==5 // fr + "publication"; +#elif L==6 // gn + "marandu"; +#elif L==7 // it + "pubblicazione"; +#elif L==8 // pl + "publikacja"; +#elif L==9 // pt + "publicação"; +#endif + +const char *Txt_TIMELINE_posts = +#if L==1 // ca + "publicacions"; +#elif L==2 // de + "Publikationen"; +#elif L==3 // en + "posts"; +#elif L==4 // es + "publicaciones"; +#elif L==5 // fr + "publications"; +#elif L==6 // gn + "marandu"; +#elif L==7 // it + "pubblicazioni"; +#elif L==8 // pl + "publikacje"; +#elif L==9 // pt + "publicações"; +#endif + +const char *Txt_TIMELINE_WHICH_USERS[TL_NUM_WHICH_USRS] = { - // Soc_USRS_UNKNOWN + // TL_USRS_UNKNOWN NULL , - // Soc_USRS_FOLLOWED + // TL_USRS_FOLLOWED #if L==1 // ca "Usuaris que segueixo" #elif L==2 // de @@ -49306,7 +49307,7 @@ const char *Txt_TIMELINE_WHICH_USERS[Soc_NUM_WHICH_USRS] = "Usuários que estou seguindo" #endif , - // Soc_USRS_ALL + // TL_USRS_ALL #if L==1 // ca "Tots els usuaris" #elif L==2 // de diff --git a/swad_social.c b/swad_timeline.c similarity index 66% rename from swad_social.c rename to swad_timeline.c index b05c7a46..0b46d1cd 100644 --- a/swad_social.c +++ b/swad_timeline.c @@ -1,4 +1,4 @@ -// swad_social.c: social networking (timeline) +// swad_timeline.c: social timeline /* SWAD (Shared Workspace At a Distance), @@ -47,7 +47,7 @@ #include "swad_parameter.h" #include "swad_preference.h" #include "swad_profile.h" -#include "swad_social.h" +#include "swad_timeline.h" /*****************************************************************************/ /****************************** Public constants *****************************/ @@ -57,45 +57,45 @@ /***************************** Private constants *****************************/ /*****************************************************************************/ -#define Soc_NUM_VISIBLE_COMMENTS 3 // Maximum number of comments visible before expanding them +#define TL_NUM_VISIBLE_COMMENTS 3 // Maximum number of comments visible before expanding them -#define Soc_MAX_SHARERS_FAVERS_SHOWN 7 // Maximum number of users shown who have share/fav a social note +#define TL_MAX_SHARERS_FAVERS_SHOWN 5 // Maximum number of users shown who have share/fav a note -#define Soc_MAX_CHARS_IN_POST 1000 +#define TL_MAX_CHARS_IN_POST 1000 typedef enum { - Soc_TIMELINE_USR, // Show the timeline of a user - Soc_TIMELINE_GBL, // Show the timeline of the users follwed by me - } Soc_TimelineUsrOrGbl_t; + TL_TIMELINE_USR, // Show the timeline of a user + TL_TIMELINE_GBL, // Show the timeline of the users follwed by me + } TL_TimelineUsrOrGbl_t; typedef enum { - Soc_GET_ONLY_NEW_PUBS, // New publications are retrieved via AJAX + TL_GET_ONLY_NEW_PUBS, // New publications are retrieved via AJAX // automatically from time to time - Soc_GET_RECENT_TIMELINE, // Recent timeline is shown when user clicks on action menu,... + TL_GET_RECENT_TIMELINE, // Recent timeline is shown when user clicks on action menu,... // or after editing timeline - Soc_GET_ONLY_OLD_PUBS, // Old publications are retrieved via AJAX + TL_GET_ONLY_OLD_PUBS, // Old publications are retrieved via AJAX // when user clicks on link at bottom of timeline - } Soc_WhatToGetFromTimeline_t; + } TL_WhatToGetFromTimeline_t; -// Social images will be saved with: -// - maximum width of Soc_IMAGE_SAVED_MAX_HEIGHT -// - maximum height of Soc_IMAGE_SAVED_MAX_HEIGHT +// Timeline images will be saved with: +// - maximum width of TL_IMAGE_SAVED_MAX_HEIGHT +// - maximum height of TL_IMAGE_SAVED_MAX_HEIGHT // - maintaining the original aspect ratio (aspect ratio recommended: 3:2) -#define Soc_IMAGE_SAVED_MAX_WIDTH 768 -#define Soc_IMAGE_SAVED_MAX_HEIGHT 512 -#define Soc_IMAGE_SAVED_QUALITY 75 // 1 to 100 -// in social posts, the quality should not be high in order to speed up the loading of images +#define TL_IMAGE_SAVED_MAX_WIDTH 768 +#define TL_IMAGE_SAVED_MAX_HEIGHT 512 +#define TL_IMAGE_SAVED_QUALITY 75 // 1 to 100 +// in timeline posts, the quality should not be high in order to speed up the loading of images /*****************************************************************************/ /****************************** Internal types *******************************/ /*****************************************************************************/ -struct SocialNote +struct TL_Note { long NotCod; - Soc_NoteType_t NoteType; + TL_NoteType_t NoteType; long UsrCod; long HieCod; // Hierarchy code (institution/centre/degree/course) long Cod; // Code of file, forum post, notice,... @@ -105,7 +105,7 @@ struct SocialNote unsigned NumFavs; // Number of times (users) this note has been favourited }; -struct SocialComment +struct TL_Comment { long PubCod; long UsrCod; @@ -130,214 +130,214 @@ extern struct Globals Gbl; /***************************** Private prototypes ****************************/ /*****************************************************************************/ -static void Soc_ShowTimelineGblHighlightingNot (long NotCod); -static void Soc_ShowTimelineUsrHighlightingNot (long NotCod); +static void TL_ShowTimelineGblHighlightingNot (long NotCod); +static void TL_ShowTimelineUsrHighlightingNot (long NotCod); -static void Soc_GetAndShowOldTimeline (Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl); +static void TL_GetAndShowOldTimeline (TL_TimelineUsrOrGbl_t TimelineUsrOrGbl); -static void Soc_BuildQueryToGetTimeline (char **Query, - Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl, - Soc_WhatToGetFromTimeline_t WhatToGetFromTimeline); -static long Soc_GetPubCodFromSession (const char *FieldName); -static void Soc_UpdateLastPubCodIntoSession (void); -static void Soc_UpdateFirstPubCodIntoSession (long FirstPubCod); -static void Soc_DropTemporaryTablesUsedToQueryTimeline (void); +static void TL_BuildQueryToGetTimeline (char **Query, + TL_TimelineUsrOrGbl_t TimelineUsrOrGbl, + TL_WhatToGetFromTimeline_t WhatToGetFromTimeline); +static long TL_GetPubCodFromSession (const char *FieldName); +static void TL_UpdateLastPubCodIntoSession (void); +static void TL_UpdateFirstPubCodIntoSession (long FirstPubCod); +static void TL_DropTemporaryTablesUsedToQueryTimeline (void); -static void Soc_ShowTimeline (char *Query, +static void TL_ShowTimeline (char *Query, const char *Title,long NotCodToHighlight); -static void Soc_PutIconsTimeline (void); +static void TL_PutIconsTimeline (void); -static void Soc_FormStart (Act_Action_t ActionGbl,Act_Action_t ActionUsr); -static void Soc_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr, +static void TL_FormStart (Act_Action_t ActionGbl,Act_Action_t ActionUsr); +static void TL_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr, const char *ParamCod, const char *Icon,const char *Title); -static void Soc_PutFormWhichUsrs (void); -static void Soc_PutParamWhichUsrs (void); -static void Soc_GetParamsWhichUsrs (void); -static Soc_WhichUsrs_t Soc_GetWhichUsrsFromDB (void); -static void Soc_SaveWhichUsersInDB (void); +static void TL_PutFormWhichUsrs (void); +static void TL_PutParamWhichUsrs (void); +static void TL_GetParamsWhichUsrs (void); +static TL_WhichUsrs_t TL_GetWhichUsrsFromDB (void); +static void TL_SaveWhichUsersInDB (void); -static void Soc_ShowWarningYouDontFollowAnyUser (void); +static void TL_ShowWarningYouDontFollowAnyUser (void); -static void Soc_InsertNewPubsInTimeline (char *Query); -static void Soc_ShowOldPubsInTimeline (char *Query); +static void TL_InsertNewPubsInTimeline (char *Query); +static void TL_ShowOldPubsInTimeline (char *Query); -static void Soc_GetDataOfSocialPublicationFromRow (MYSQL_ROW row,struct SocialPublication *SocPub); +static void TL_GetDataOfPublicationFromRow (MYSQL_ROW row,struct TL_Publication *SocPub); -static void Soc_PutLinkToViewNewPublications (void); -static void Soc_PutLinkToViewOldPublications (void); +static void TL_PutLinkToViewNewPublications (void); +static void TL_PutLinkToViewOldPublications (void); -static void Soc_WriteSocialNote (const struct SocialNote *SocNot, - Soc_TopMessage_t TopMessage,long UsrCod, - bool Highlight, - bool ShowNoteAlone); -static void Soc_WriteTopMessage (Soc_TopMessage_t TopMessage,long UsrCod); -static void Soc_WriteAuthorNote (const struct UsrData *UsrDat); -static void Soc_WriteDateTime (time_t TimeUTC); -static void Soc_GetAndWriteSocialPost (long PstCod); -static void Soc_PutFormGoToAction (const struct SocialNote *SocNot); -static void Soc_GetNoteSummary (const struct SocialNote *SocNot, - char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]); -static void Soc_PublishSocialNoteInTimeline (struct SocialPublication *SocPub); +static void TL_WriteNote (const struct TL_Note *SocNot, + TL_TopMessage_t TopMessage,long UsrCod, + bool Highlight, + bool ShowNoteAlone); +static void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long UsrCod); +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_GetNoteSummary (const struct TL_Note *SocNot, + char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]); +static void TL_PublishNoteInTimeline (struct TL_Publication *SocPub); -static void Soc_PutFormToWriteNewPost (void); -static void Soc_PutTextarea (const char *Placeholder, +static void TL_PutFormToWriteNewPost (void); +static void TL_PutTextarea (const char *Placeholder, const char *ClassTextArea,const char *ClassImgTit); -static long Soc_ReceiveSocialPost (void); +static long TL_ReceivePost (void); -static void Soc_PutIconToToggleCommentSocialNote (const char UniqueId[Frm_MAX_BYTES_ID + 1]); -static void Soc_PutIconCommentDisabled (void); -static void Soc_PutHiddenFormToWriteNewCommentToSocialNote (long NotCod, - const char IdNewComment[Frm_MAX_BYTES_ID + 1]); -static unsigned long Soc_GetNumCommentsInSocialNote (long NotCod); -static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot); -static void Soc_WriteOneSocialCommentInList (MYSQL_RES *mysql_res); -static void Soc_PutIconToToggleComments (const char *UniqueId, +static void TL_PutIconToToggleCommentNote (const char UniqueId[Frm_MAX_BYTES_ID + 1]); +static void TL_PutIconCommentDisabled (void); +static void TL_PutHiddenFormToWriteNewCommentToNote (long NotCod, + const char IdNewComment[Frm_MAX_BYTES_ID + 1]); +static unsigned long TL_GetNumCommentsInNote (long NotCod); +static void TL_WriteCommentsInNote (const struct TL_Note *SocNot); +static void TL_WriteOneCommentInList (MYSQL_RES *mysql_res); +static void TL_PutIconToToggleComments (const char *UniqueId, const char *Icon,const char *Text); -static void Soc_WriteSocialComment (struct SocialComment *SocCom, - Soc_TopMessage_t TopMessage,long UsrCod, - bool ShowCommentAlone); -static void Soc_WriteAuthorComment (struct UsrData *UsrDat); +static void TL_WriteComment (struct TL_Comment *SocCom, + TL_TopMessage_t TopMessage,long UsrCod, + bool ShowCommentAlone); +static void TL_WriteAuthorComment (struct UsrData *UsrDat); -static void Soc_PutFormToRemoveComment (long PubCod); +static void TL_PutFormToRemoveComment (long PubCod); -static void Soc_PutDisabledIconShare (unsigned NumShared); -static void Soc_PutDisabledIconFav (unsigned NumFavs); +static void TL_PutDisabledIconShare (unsigned NumShared); +static void TL_PutDisabledIconFav (unsigned NumFavs); -static void Soc_PutFormToShareSocialNote (const struct SocialNote *SocNot); -static void Soc_PutFormToUnshareSocialNote (const struct SocialNote *SocNot); -static void Soc_PutFormToFavSocialNote (const struct SocialNote *SocNot); -static void Soc_PutFormToUnfavSocialNote (const struct SocialNote *SocNot); -static void Soc_PutFormToFavSocialComment (struct SocialComment *SocCom); -static void Soc_PutFormToUnfavSocialComment (struct SocialComment *SocCom); +static void TL_PutFormToShareNote (const struct TL_Note *SocNot); +static void TL_PutFormToUnshareNote (const struct TL_Note *SocNot); +static void TL_PutFormToFavNote (const struct TL_Note *SocNot); +static void TL_PutFormToUnfavNote (const struct TL_Note *SocNot); +static void TL_PutFormToFavComment (struct TL_Comment *SocCom); +static void TL_PutFormToUnfavComment (struct TL_Comment *SocCom); -static void Soc_PutFormToRemoveSocialPublication (long NotCod); +static void TL_PutFormToRemovePublication (long NotCod); -static void Soc_PutHiddenParamNotCod (long NotCod); -static long Soc_GetParamNotCod (void); -static long Soc_GetParamPubCod (void); +static void TL_PutHiddenParamNotCod (long NotCod); +static long TL_GetParamNotCod (void); +static long TL_GetParamPubCod (void); -static long Soc_ReceiveComment (void); +static long TL_ReceiveComment (void); -static void Soc_ShareSocialNote (struct SocialNote *SocNot); -static void Soc_FavSocialNote (struct SocialNote *SocNot); -static void Soc_FavSocialComment (struct SocialComment *SocCom); -static void Soc_CreateNotifToAuthor (long AuthorCod,long PubCod, +static void TL_ShareNote (struct TL_Note *SocNot); +static void TL_FavNote (struct TL_Note *SocNot); +static void TL_FavComment (struct TL_Comment *SocCom); +static void TL_CreateNotifToAuthor (long AuthorCod,long PubCod, Ntf_NotifyEvent_t NotifyEvent); -static void Soc_UnshareSocialNote (struct SocialNote *SocNot); -static void Soc_UnfavSocialNote (struct SocialNote *SocNot); -static void Soc_UnfavSocialComment (struct SocialComment *SocCom); +static void TL_UnshareNote (struct TL_Note *SocNot); +static void TL_UnfavNote (struct TL_Note *SocNot); +static void TL_UnfavComment (struct TL_Comment *SocCom); -static void Soc_RequestRemovalSocialNote (void); -static void Soc_PutParamsRemoveSocialNote (void); -static void Soc_RemoveSocialNote (void); -static void Soc_RemoveImgFileFromSocialPost (long PstCod); -static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot); +static void TL_RequestRemovalNote (void); +static void TL_PutParamsRemoveNote (void); +static void TL_RemoveNote (void); +static void TL_RemoveImgFileFromPost (long PstCod); +static void TL_RemoveANoteFromDB (struct TL_Note *SocNot); -static long Soc_GetNotCodOfSocialPublication (long PubCod); -static long Soc_GetPubCodOfOriginalSocialNote (long NotCod); +static long TL_GetNotCodOfPublication (long PubCod); +static long TL_GetPubCodOfOriginalNote (long NotCod); -static void Soc_RequestRemovalSocialComment (void); -static void Soc_PutParamsRemoveSocialCommment (void); -static void Soc_RemoveSocialComment (void); -static void Soc_RemoveImgFileFromSocialComment (long PubCod); -static void Soc_RemoveASocialCommentFromDB (struct SocialComment *SocCom); +static void TL_RequestRemovalComment (void); +static void TL_PutParamsRemoveCommment (void); +static void TL_RemoveComment (void); +static void TL_RemoveImgFileFromComment (long PubCod); +static void TL_RemoveACommentFromDB (struct TL_Comment *SocCom); -static bool Soc_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod); -static bool Soc_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod); -static bool Soc_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod); +static bool TL_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod); +static bool TL_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod); +static bool TL_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod); -static void Soc_UpdateNumTimesANoteHasBeenShared (struct SocialNote *SocNot); -static void Soc_GetNumTimesANoteHasBeenFav (struct SocialNote *SocNot); -static void Soc_GetNumTimesACommHasBeenFav (struct SocialComment *SocCom); +static void TL_UpdateNumTimesANoteHasBeenShared (struct TL_Note *SocNot); +static void TL_GetNumTimesANoteHasBeenFav (struct TL_Note *SocNot); +static void TL_GetNumTimesACommHasBeenFav (struct TL_Comment *SocCom); -static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot); -static void Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (const struct SocialNote *SocNot); -static void Soc_ShowUsrsWhoHaveMarkedSocialCommAsFav (const struct SocialComment *SocCom); -static void Soc_ShowSharersOrFavers (MYSQL_RES **mysql_res, +static void TL_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot); +static void TL_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot); +static void TL_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom); +static void TL_ShowSharersOrFavers (MYSQL_RES **mysql_res, unsigned NumUsrs,unsigned NumFirstUsrs); -static void Soc_GetDataOfSocialNotByCod (struct SocialNote *SocNot); -static void Soc_GetDataOfSocialComByCod (struct SocialComment *SocCom); +static void TL_GetDataOfNoteByCod (struct TL_Note *SocNot); +static void TL_GetDataOfCommByCod (struct TL_Comment *SocCom); -static void Soc_GetDataOfSocialPublicationFromRow (MYSQL_ROW row,struct SocialPublication *SocPub); -static void Soc_GetDataOfSocialNoteFromRow (MYSQL_ROW row,struct SocialNote *SocNot); -static Soc_PubType_t Soc_GetPubTypeFromStr (const char *Str); -static Soc_NoteType_t Soc_GetNoteTypeFromStr (const char *Str); -static void Soc_GetDataOfSocialCommentFromRow (MYSQL_ROW row,struct SocialComment *SocCom); +static void TL_GetDataOfPublicationFromRow (MYSQL_ROW row,struct TL_Publication *SocPub); +static void TL_GetDataOfNoteFromRow (MYSQL_ROW row,struct TL_Note *SocNot); +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 Soc_ResetSocialNote (struct SocialNote *SocNot); -static void Soc_ResetSocialComment (struct SocialComment *SocCom); +static void TL_ResetNote (struct TL_Note *SocNot); +static void TL_ResetComment (struct TL_Comment *SocCom); -static void Soc_ClearTimelineThisSession (void); -static void Soc_AddNotesJustRetrievedToTimelineThisSession (void); +static void TL_ClearTimelineThisSession (void); +static void TL_AddNotesJustRetrievedToTimelineThisSession (void); static void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const char *Txt); /*****************************************************************************/ -/***** Show social activity (timeline) including all the users I follow ******/ +/************** Show timeline including all the users I follow ***************/ /*****************************************************************************/ -void Soc_ShowTimelineGbl1 (void) +void TL_ShowTimelineGbl1 (void) { /***** Mark all my notifications about timeline as seen *****/ - Soc_MarkMyNotifAsSeen (); + TL_MarkMyNotifAsSeen (); /***** Get which users *****/ - Soc_GetParamsWhichUsrs (); + TL_GetParamsWhichUsrs (); /***** Save which users in database *****/ if (Gbl.Action.Act == ActSeeSocTmlGbl) // Only in action to see global timeline - Soc_SaveWhichUsersInDB (); + TL_SaveWhichUsersInDB (); } -void Soc_ShowTimelineGbl2 (void) +void TL_ShowTimelineGbl2 (void) { long PubCod; - struct SocialNote SocNot; + struct TL_Note SocNot; struct UsrData UsrDat; Ntf_NotifyEvent_t NotifyEvent; - const Soc_TopMessage_t TopMessages[Ntf_NUM_NOTIFY_EVENTS] = + const TL_TopMessage_t TopMessages[Ntf_NUM_NOTIFY_EVENTS] = { - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_UNKNOWN + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_UNKNOWN /* Course tab */ - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_DOCUMENT_FILE - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_TEACHERS_FILE - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_SHARED_FILE + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_DOCUMENT_FILE + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_TEACHERS_FILE + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_SHARED_FILE /* Assessment tab */ - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_ASSIGNMENT - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_EXAM_ANNOUNCEMENT - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_MARKS_FILE + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_ASSIGNMENT + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_EXAM_ANNOUNCEMENT + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_MARKS_FILE /* Users tab */ - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_STD - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_TCH - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_REQUEST + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_STD + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_TCH + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_REQUEST - /* Social tab */ - Soc_TOP_MESSAGE_COMMENTED, // Ntf_EVENT_TIMELINE_COMMENT - Soc_TOP_MESSAGE_FAVED, // Ntf_EVENT_TIMELINE_FAV - Soc_TOP_MESSAGE_SHARED, // Ntf_EVENT_TIMELINE_SHARE - Soc_TOP_MESSAGE_MENTIONED, // Ntf_EVENT_TIMELINE_MENTION - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_FOLLOWER - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_FORUM_POST_COURSE - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_FORUM_REPLY + /* Start tab */ // TODO: Move to top + TL_TOP_MESSAGE_COMMENTED, // Ntf_EVENT_TIMELINE_COMMENT + TL_TOP_MESSAGE_FAVED, // Ntf_EVENT_TIMELINE_FAV + TL_TOP_MESSAGE_SHARED, // Ntf_EVENT_TIMELINE_SHARE + TL_TOP_MESSAGE_MENTIONED, // Ntf_EVENT_TIMELINE_MENTION + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_FOLLOWER /* Messages tab */ - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_NOTICE - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_MESSAGE + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_FORUM_POST_COURSE + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_FORUM_REPLY + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_NOTICE + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_MESSAGE /* Statistics tab */ /* Profile tab */ - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_SURVEY // TODO: Move to assessment tab (also necessary in database) !!!!!!!!! - Soc_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_NET // TODO: Move to users tab (also necessary in database) !!!!!!!!! + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_SURVEY // TODO: Move to assessment tab (also necessary in database) !!!!!!!!! + TL_TOP_MESSAGE_NONE, // Ntf_EVENT_ENROLMENT_NET // TODO: Move to users tab (also necessary in database) !!!!!!!!! }; /***** If I am been redirected from another action... *****/ @@ -354,16 +354,16 @@ void Soc_ShowTimelineGbl2 (void) break; } - /***** Initialize social note code to -1 ==> no highlighted note *****/ + /***** Initialize note code to -1 ==> no highlighted note *****/ SocNot.NotCod = -1L; - /***** Get parameter with the code of a social publication *****/ + /***** Get parameter with the code of a publication *****/ // This parameter is optional. It can be provided by a notification. - // If > 0 ==> the social note is shown highlighted above the timeline - PubCod = Soc_GetParamPubCod (); + // If > 0 ==> the note is shown highlighted above the timeline + PubCod = TL_GetParamPubCod (); if (PubCod > 0) - /***** Get code of social note from database *****/ - SocNot.NotCod = Soc_GetNotCodOfSocialPublication (PubCod); + /***** Get code of note from database *****/ + SocNot.NotCod = TL_GetNotCodOfPublication (PubCod); if (SocNot.NotCod > 0) { @@ -373,68 +373,68 @@ void Soc_ShowTimelineGbl2 (void) /* Get what he/she did */ NotifyEvent = Ntf_GetParamNotifyEvent (); - /***** Show the social note highlighted *****/ - Soc_GetDataOfSocialNotByCod (&SocNot); - Soc_WriteSocialNote (&SocNot, + /***** Show the note highlighted *****/ + TL_GetDataOfNoteByCod (&SocNot); + TL_WriteNote (&SocNot, TopMessages[NotifyEvent],UsrDat.UsrCod, true,true); } /***** Show timeline with possible highlighted note *****/ - Soc_ShowTimelineGblHighlightingNot (SocNot.NotCod); + TL_ShowTimelineGblHighlightingNot (SocNot.NotCod); } -static void Soc_ShowTimelineGblHighlightingNot (long NotCod) +static void TL_ShowTimelineGblHighlightingNot (long NotCod) { extern const char *Txt_Timeline; char *Query = NULL; /***** Build query to get timeline *****/ - Soc_BuildQueryToGetTimeline (&Query, - Soc_TIMELINE_GBL, - Soc_GET_RECENT_TIMELINE); + TL_BuildQueryToGetTimeline (&Query, + TL_TIMELINE_GBL, + TL_GET_RECENT_TIMELINE); /***** Show timeline *****/ - Soc_ShowTimeline (Query,Txt_Timeline,NotCod); + TL_ShowTimeline (Query,Txt_Timeline,NotCod); /***** Drop temporary tables *****/ - Soc_DropTemporaryTablesUsedToQueryTimeline (); + TL_DropTemporaryTablesUsedToQueryTimeline (); } /*****************************************************************************/ -/*********** Show social activity (timeline) of a selected user **************/ +/********************* Show timeline of a selected user **********************/ /*****************************************************************************/ -void Soc_ShowTimelineUsr (void) +void TL_ShowTimelineUsr (void) { - Soc_ShowTimelineUsrHighlightingNot (-1L); + TL_ShowTimelineUsrHighlightingNot (-1L); } -static void Soc_ShowTimelineUsrHighlightingNot (long NotCod) +static void TL_ShowTimelineUsrHighlightingNot (long NotCod) { extern const char *Txt_Timeline_OF_A_USER; char *Query = NULL; /***** Build query to show timeline with publications of a unique user *****/ - Soc_BuildQueryToGetTimeline (&Query, - Soc_TIMELINE_USR, - Soc_GET_RECENT_TIMELINE); + TL_BuildQueryToGetTimeline (&Query, + TL_TIMELINE_USR, + TL_GET_RECENT_TIMELINE); /***** Show timeline *****/ snprintf (Gbl.Title,sizeof (Gbl.Title), Txt_Timeline_OF_A_USER, Gbl.Usrs.Other.UsrDat.FirstName); - Soc_ShowTimeline (Query,Gbl.Title,NotCod); + TL_ShowTimeline (Query,Gbl.Title,NotCod); /***** Drop temporary tables *****/ - Soc_DropTemporaryTablesUsedToQueryTimeline (); + TL_DropTemporaryTablesUsedToQueryTimeline (); } /*****************************************************************************/ -/********** Refresh new publications in social timeline via AJAX *************/ +/************** Refresh new publications in timeline via AJAX ****************/ /*****************************************************************************/ -void Soc_RefreshNewTimelineGbl (void) +void TL_RefreshNewTimelineGbl (void) { char *Query = NULL; @@ -442,21 +442,21 @@ void Soc_RefreshNewTimelineGbl (void) { /***** Send, before the HTML, the refresh time *****/ fprintf (Gbl.F.Out,"%lu|", - Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE); + Cfg_TIME_TO_REFRESH_TIMELINE); /***** Get which users *****/ - Soc_GetParamsWhichUsrs (); + TL_GetParamsWhichUsrs (); /***** Build query to get timeline *****/ - Soc_BuildQueryToGetTimeline (&Query, - Soc_TIMELINE_GBL, - Soc_GET_ONLY_NEW_PUBS); + TL_BuildQueryToGetTimeline (&Query, + TL_TIMELINE_GBL, + TL_GET_ONLY_NEW_PUBS); /***** Show new timeline *****/ - Soc_InsertNewPubsInTimeline (Query); + TL_InsertNewPubsInTimeline (Query); /***** Drop temporary tables *****/ - Soc_DropTemporaryTablesUsedToQueryTimeline (); + TL_DropTemporaryTablesUsedToQueryTimeline (); } /***** All the output is made, so don't write anymore *****/ @@ -464,44 +464,44 @@ void Soc_RefreshNewTimelineGbl (void) } /*****************************************************************************/ -/************ View old publications in social timeline via AJAX **************/ +/**************** View old publications in timeline via AJAX *****************/ /*****************************************************************************/ -void Soc_RefreshOldTimelineGbl (void) +void TL_RefreshOldTimelineGbl (void) { /***** Get which users *****/ - Soc_GetParamsWhichUsrs (); + TL_GetParamsWhichUsrs (); /***** Show old publications *****/ - Soc_GetAndShowOldTimeline (Soc_TIMELINE_GBL); + TL_GetAndShowOldTimeline (TL_TIMELINE_GBL); } -void Soc_RefreshOldTimelineUsr (void) +void TL_RefreshOldTimelineUsr (void) { /***** Get user whom profile is displayed *****/ if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ()) // Existing user /***** If user exists, show old publications *****/ - Soc_GetAndShowOldTimeline (Soc_TIMELINE_USR); + TL_GetAndShowOldTimeline (TL_TIMELINE_USR); } /*****************************************************************************/ /**************** Get and show old publications in timeline ******************/ /*****************************************************************************/ -static void Soc_GetAndShowOldTimeline (Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl) +static void TL_GetAndShowOldTimeline (TL_TimelineUsrOrGbl_t TimelineUsrOrGbl) { char *Query = NULL; /***** Build query to get timeline *****/ - Soc_BuildQueryToGetTimeline (&Query, + TL_BuildQueryToGetTimeline (&Query, TimelineUsrOrGbl, - Soc_GET_ONLY_OLD_PUBS); + TL_GET_ONLY_OLD_PUBS); /***** Show old timeline *****/ - Soc_ShowOldPubsInTimeline (Query); + TL_ShowOldPubsInTimeline (Query); /***** Drop temporary tables *****/ - Soc_DropTemporaryTablesUsedToQueryTimeline (); + TL_DropTemporaryTablesUsedToQueryTimeline (); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -512,7 +512,7 @@ static void Soc_GetAndShowOldTimeline (Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl) /*****************************************************************************/ // Must be executed as a priori function -void Soc_MarkMyNotifAsSeen (void) +void TL_MarkMyNotifAsSeen (void) { Ntf_MarkNotifAsSeen (Ntf_EVENT_TIMELINE_COMMENT,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod); Ntf_MarkNotifAsSeen (Ntf_EVENT_TIMELINE_FAV ,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod); @@ -524,16 +524,16 @@ void Soc_MarkMyNotifAsSeen (void) /************************ Build query to get timeline ************************/ /*****************************************************************************/ -#define Soc_MAX_BYTES_SUBQUERY_ALREADY_EXISTS (256 - 1) +#define TL_MAX_BYTES_SUBQUERY_ALREADY_EXISTS (256 - 1) -static void Soc_BuildQueryToGetTimeline (char **Query, - Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl, - Soc_WhatToGetFromTimeline_t WhatToGetFromTimeline) +static void TL_BuildQueryToGetTimeline (char **Query, + TL_TimelineUsrOrGbl_t TimelineUsrOrGbl, + TL_WhatToGetFromTimeline_t WhatToGetFromTimeline) { char SubQueryPublishers[128]; char SubQueryRangeBottom[128]; char SubQueryRangeTop[128]; - char SubQueryAlreadyExists[Soc_MAX_BYTES_SUBQUERY_ALREADY_EXISTS + 1]; + char SubQueryAlreadyExists[TL_MAX_BYTES_SUBQUERY_ALREADY_EXISTS + 1]; struct { long Top; @@ -547,17 +547,17 @@ static void Soc_BuildQueryToGetTimeline (char **Query, long NotCod; const unsigned MaxPubsToGet[3] = { - Soc_MAX_NEW_PUBS_TO_GET_AND_SHOW, // Soc_GET_ONLY_NEW_PUBS - Soc_MAX_REC_PUBS_TO_GET_AND_SHOW, // Soc_GET_RECENT_TIMELINE - Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW, // Soc_GET_ONLY_OLD_PUBS + TL_MAX_NEW_PUBS_TO_GET_AND_SHOW, // TL_GET_ONLY_NEW_PUBS + TL_MAX_REC_PUBS_TO_GET_AND_SHOW, // TL_GET_RECENT_TIMELINE + TL_MAX_OLD_PUBS_TO_GET_AND_SHOW, // TL_GET_ONLY_OLD_PUBS }; - /***** Clear social timeline for this session in database *****/ - if (WhatToGetFromTimeline == Soc_GET_RECENT_TIMELINE) - Soc_ClearTimelineThisSession (); + /***** Clear timeline for this session in database *****/ + if (WhatToGetFromTimeline == TL_GET_RECENT_TIMELINE) + TL_ClearTimelineThisSession (); /***** Drop temporary tables *****/ - Soc_DropTemporaryTablesUsedToQueryTimeline (); + TL_DropTemporaryTablesUsedToQueryTimeline (); /***** Create temporary table with publication codes *****/ DB_Query ("can not create temporary table", @@ -579,14 +579,14 @@ static void Soc_BuildQueryToGetTimeline (char **Query, /***** Create temporary table and subquery with potential publishers *****/ switch (TimelineUsrOrGbl) { - case Soc_TIMELINE_USR: // Show the timeline of a user + case TL_TIMELINE_USR: // Show the timeline of a user sprintf (SubQueryPublishers,"PublisherCod=%ld AND ", Gbl.Usrs.Other.UsrDat.UsrCod); break; - case Soc_TIMELINE_GBL: // Show the global timeline - switch (Gbl.Social.WhichUsrs) + case TL_TIMELINE_GBL: // Show the global timeline + switch (Gbl.Timeline.WhichUsrs) { - case Soc_USRS_FOLLOWED: // Show the timeline of the users I follow + case TL_USRS_FOLLOWED: // Show the timeline of the users I follow DB_Query ("can not create temporary table", "CREATE TEMPORARY TABLE publishers " "(UsrCod INT NOT NULL,UNIQUE INDEX(UsrCod)) ENGINE=MEMORY" @@ -599,7 +599,7 @@ static void Soc_BuildQueryToGetTimeline (char **Query, sprintf (SubQueryPublishers,"social_pubs.PublisherCod=publishers.UsrCod AND "); break; - case Soc_USRS_ALL: // Show the timeline of all users + case TL_USRS_ALL: // Show the timeline of all users SubQueryPublishers[0] = '\0'; break; default: @@ -612,39 +612,39 @@ static void Soc_BuildQueryToGetTimeline (char **Query, /***** Create subquery to get only notes not present in timeline *****/ switch (TimelineUsrOrGbl) { - case Soc_TIMELINE_USR: // Show the timeline of a user + case TL_TIMELINE_USR: // Show the timeline of a user switch (WhatToGetFromTimeline) { - case Soc_GET_ONLY_NEW_PUBS: - case Soc_GET_RECENT_TIMELINE: + case TL_GET_ONLY_NEW_PUBS: + case TL_GET_RECENT_TIMELINE: Str_Copy (SubQueryAlreadyExists, " NotCod NOT IN" " (SELECT NotCod FROM not_codes)", - Soc_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); + TL_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); break; - case Soc_GET_ONLY_OLD_PUBS: + case TL_GET_ONLY_OLD_PUBS: Str_Copy (SubQueryAlreadyExists, " NotCod NOT IN" " (SELECT NotCod FROM current_timeline)", - Soc_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); + TL_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); break; } break; - case Soc_TIMELINE_GBL: // Show the timeline of the users I follow + case TL_TIMELINE_GBL: // Show the timeline of the users I follow switch (WhatToGetFromTimeline) { - case Soc_GET_ONLY_NEW_PUBS: - case Soc_GET_RECENT_TIMELINE: + case TL_GET_ONLY_NEW_PUBS: + case TL_GET_RECENT_TIMELINE: Str_Copy (SubQueryAlreadyExists, " social_pubs.NotCod NOT IN" " (SELECT NotCod FROM not_codes)", - Soc_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); + TL_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); break; - case Soc_GET_ONLY_OLD_PUBS: + case TL_GET_ONLY_OLD_PUBS: Str_Copy (SubQueryAlreadyExists, " social_pubs.NotCod NOT IN" " (SELECT NotCod FROM current_timeline)", - Soc_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); + TL_MAX_BYTES_SUBQUERY_ALREADY_EXISTS); break; } break; @@ -672,18 +672,18 @@ static void Soc_BuildQueryToGetTimeline (char **Query, RangePubsToGet.Bottom = 0; // -Infinite switch (WhatToGetFromTimeline) { - case Soc_GET_ONLY_NEW_PUBS: // Get the publications (without limit) newer than LastPubCod + case TL_GET_ONLY_NEW_PUBS: // Get the publications (without limit) newer than LastPubCod /* This query is made via AJAX automatically from time to time */ - RangePubsToGet.Bottom = Soc_GetPubCodFromSession ("LastPubCod"); + RangePubsToGet.Bottom = TL_GetPubCodFromSession ("LastPubCod"); break; - case Soc_GET_RECENT_TIMELINE: // Get some limited recent publications + case TL_GET_RECENT_TIMELINE: // Get some limited recent publications /* This is the first query to get initial timeline shown ==> no notes yet in current timeline table */ break; - case Soc_GET_ONLY_OLD_PUBS: // Get some limited publications older than FirstPubCod + case TL_GET_ONLY_OLD_PUBS: // Get some limited publications older than FirstPubCod /* This query is made via AJAX when I click in link to get old publications */ - RangePubsToGet.Top = Soc_GetPubCodFromSession ("FirstPubCod"); + RangePubsToGet.Top = TL_GetPubCodFromSession ("FirstPubCod"); break; } @@ -711,17 +711,19 @@ static void Soc_BuildQueryToGetTimeline (char **Query, if (RangePubsToGet.Bottom > 0) switch (TimelineUsrOrGbl) { - case Soc_TIMELINE_USR: // Show the timeline of a user + case TL_TIMELINE_USR: // Show the timeline of a user sprintf (SubQueryRangeBottom,"PubCod>%ld AND ",RangePubsToGet.Bottom); break; - case Soc_TIMELINE_GBL: // Show the global timeline - switch (Gbl.Social.WhichUsrs) + case TL_TIMELINE_GBL: // Show the global timeline + switch (Gbl.Timeline.WhichUsrs) { - case Soc_USRS_FOLLOWED: // Show the timeline of the users I follow - sprintf (SubQueryRangeBottom,"social_pubs.PubCod>%ld AND ",RangePubsToGet.Bottom); + case TL_USRS_FOLLOWED: // Show the timeline of the users I follow + sprintf (SubQueryRangeBottom,"social_pubs.PubCod>%ld AND ", + RangePubsToGet.Bottom); break; - case Soc_USRS_ALL: // Show the timeline of all users - sprintf (SubQueryRangeBottom,"PubCod>%ld AND ",RangePubsToGet.Bottom); + case TL_USRS_ALL: // Show the timeline of all users + sprintf (SubQueryRangeBottom,"PubCod>%ld AND ", + RangePubsToGet.Bottom); break; default: Lay_ShowErrorAndExit ("Wrong parameter which users."); @@ -735,17 +737,19 @@ static void Soc_BuildQueryToGetTimeline (char **Query, if (RangePubsToGet.Top > 0) switch (TimelineUsrOrGbl) { - case Soc_TIMELINE_USR: // Show the timeline of a user + case TL_TIMELINE_USR: // Show the timeline of a user sprintf (SubQueryRangeTop,"PubCod<%ld AND ",RangePubsToGet.Top); break; - case Soc_TIMELINE_GBL: // Show the global timeline - switch (Gbl.Social.WhichUsrs) + case TL_TIMELINE_GBL: // Show the global timeline + switch (Gbl.Timeline.WhichUsrs) { - case Soc_USRS_FOLLOWED: // Show the timeline of the users I follow - sprintf (SubQueryRangeTop,"social_pubs.PubCod<%ld AND ",RangePubsToGet.Top); + case TL_USRS_FOLLOWED: // Show the timeline of the users I follow + sprintf (SubQueryRangeTop,"social_pubs.PubCod<%ld AND ", + RangePubsToGet.Top); break; - case Soc_USRS_ALL: // Show the timeline of all users - sprintf (SubQueryRangeTop,"PubCod<%ld AND ",RangePubsToGet.Top); + case TL_USRS_ALL: // Show the timeline of all users + sprintf (SubQueryRangeTop,"PubCod<%ld AND ", + RangePubsToGet.Top); break; default: Lay_ShowErrorAndExit ("Wrong parameter which users."); @@ -760,33 +764,36 @@ static void Soc_BuildQueryToGetTimeline (char **Query, NumPubs = 0; // Initialized to avoid warning switch (TimelineUsrOrGbl) { - case Soc_TIMELINE_USR: // Show the timeline of a user + case TL_TIMELINE_USR: // Show the timeline of a user NumPubs = (unsigned) DB_QuerySELECT (&mysql_res,"can not get publication", - "SELECT PubCod,NotCod FROM social_pubs" + "SELECT PubCod,NotCod" + " FROM social_pubs" " WHERE %s%s%s%s" " ORDER BY PubCod DESC LIMIT 1", SubQueryRangeBottom,SubQueryRangeTop, SubQueryPublishers, SubQueryAlreadyExists); break; - case Soc_TIMELINE_GBL: // Show the global timeline - switch (Gbl.Social.WhichUsrs) + case TL_TIMELINE_GBL: // Show the global timeline + switch (Gbl.Timeline.WhichUsrs) { - case Soc_USRS_FOLLOWED: // Show the timeline of the users I follow + case TL_USRS_FOLLOWED: // Show the timeline of the users I follow NumPubs = (unsigned) DB_QuerySELECT (&mysql_res,"can not get publication", - "SELECT PubCod,NotCod FROM social_pubs,publishers" + "SELECT PubCod,NotCod" + " FROM social_pubs,publishers" " WHERE %s%s%s%s" " ORDER BY social_pubs.PubCod DESC LIMIT 1", SubQueryRangeBottom,SubQueryRangeTop, SubQueryPublishers, SubQueryAlreadyExists); break; - case Soc_USRS_ALL: // Show the timeline of all users + case TL_USRS_ALL: // Show the timeline of all users NumPubs = (unsigned) DB_QuerySELECT (&mysql_res,"can not get publication", - "SELECT PubCod,NotCod FROM social_pubs" + "SELECT PubCod,NotCod" + " FROM social_pubs" " WHERE %s%s%s" " ORDER BY PubCod DESC LIMIT 1", SubQueryRangeBottom,SubQueryRangeTop, @@ -801,7 +808,7 @@ static void Soc_BuildQueryToGetTimeline (char **Query, if (NumPubs == 1) { - /* Get code of social publication */ + /* Get code of publication */ row = mysql_fetch_row (mysql_res); PubCod = Str_ConvertStrCodToLongCod (row[0]); } @@ -821,7 +828,7 @@ static void Soc_BuildQueryToGetTimeline (char **Query, PubCod); RangePubsToGet.Top = PubCod; // Narrow the range for the next iteration - /* Get social note code (row[1]) */ + /* Get note code (row[1]) */ if (row) { NotCod = Str_ConvertStrCodToLongCod (row[1]); @@ -840,10 +847,10 @@ static void Soc_BuildQueryToGetTimeline (char **Query, /***** Update last publication code into session for next refresh *****/ // Do this inmediately after getting the publications codes... // ...in order to not lose publications - Soc_UpdateLastPubCodIntoSession (); + TL_UpdateLastPubCodIntoSession (); /***** Add notes just retrieved to current timeline for this session *****/ - Soc_AddNotesJustRetrievedToTimelineThisSession (); + TL_AddNotesJustRetrievedToTimelineThisSession (); /***** Build query to show timeline including the users I am following *****/ DB_BuildQuery (Query, @@ -860,13 +867,13 @@ static void Soc_BuildQueryToGetTimeline (char **Query, } /*****************************************************************************/ -/********* Get last/first social publication code stored in session **********/ +/************* Get last/first publication code stored in session *************/ /*****************************************************************************/ // FieldName can be: // "LastPubCod" // "FirstPubCod" -static long Soc_GetPubCodFromSession (const char *FieldName) +static long TL_GetPubCodFromSession (const char *FieldName) { extern const char *Txt_The_session_has_expired; MYSQL_RES *mysql_res; @@ -894,7 +901,7 @@ static long Soc_GetPubCodFromSession (const char *FieldName) /*********************** Update last publication code ************************/ /*****************************************************************************/ -static void Soc_UpdateLastPubCodIntoSession (void) +static void TL_UpdateLastPubCodIntoSession (void) { /***** Update last publication code *****/ DB_QueryUPDATE ("can not update last publication code into session", @@ -909,7 +916,7 @@ static void Soc_UpdateLastPubCodIntoSession (void) /*********************** Update first publication code ***********************/ /*****************************************************************************/ -static void Soc_UpdateFirstPubCodIntoSession (long FirstPubCod) +static void TL_UpdateFirstPubCodIntoSession (long FirstPubCod) { /***** Update last publication code *****/ DB_QueryUPDATE ("can not update first publication code into session", @@ -921,7 +928,7 @@ static void Soc_UpdateFirstPubCodIntoSession (long FirstPubCod) /*************** Drop temporary tables used to query timeline ****************/ /*****************************************************************************/ -static void Soc_DropTemporaryTablesUsedToQueryTimeline (void) +static void TL_DropTemporaryTablesUsedToQueryTimeline (void) { DB_Query ("can not remove temporary tables", "DROP TEMPORARY TABLE IF EXISTS" @@ -929,7 +936,7 @@ static void Soc_DropTemporaryTablesUsedToQueryTimeline (void) } /*****************************************************************************/ -/*********************** Show social activity (timeline) *********************/ +/******************************* Show timeline *******************************/ /*****************************************************************************/ /* _____ / |_____| just_now_timeline_list (Posts retrieved automatically @@ -960,16 +967,16 @@ static void Soc_DropTemporaryTablesUsedToQueryTimeline (void) | |_____| \ |_____| */ -static void Soc_ShowTimeline (char *Query, +static void TL_ShowTimeline (char *Query, const char *Title,long NotCodToHighlight) { - extern const char *Hlp_SOCIAL_Timeline; + extern const char *Hlp_START_Timeline; MYSQL_RES *mysql_res; MYSQL_ROW row; unsigned long NumPubsGot; unsigned long NumPub; - struct SocialPublication SocPub; - struct SocialNote SocNot; + struct TL_Publication SocPub; + struct TL_Note SocNot; bool GlobalTimeline = (Gbl.Usrs.Other.UsrDat.UsrCod <= 0); bool ItsMe = Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod); @@ -979,22 +986,22 @@ static void Soc_ShowTimeline (char *Query, Query); /***** Start box *****/ - Box_StartBox (NULL,Title,Soc_PutIconsTimeline, - Hlp_SOCIAL_Timeline,Box_NOT_CLOSABLE); + Box_StartBox (NULL,Title,TL_PutIconsTimeline, + Hlp_START_Timeline,Box_NOT_CLOSABLE); /***** Put form to select users whom public activity is displayed *****/ if (GlobalTimeline) - Soc_PutFormWhichUsrs (); + TL_PutFormWhichUsrs (); /***** Form to write a new post *****/ if (GlobalTimeline || ItsMe) - Soc_PutFormToWriteNewPost (); + TL_PutFormToWriteNewPost (); /***** New publications refreshed dynamically via AJAX *****/ if (GlobalTimeline) { /* Link to view new publications via AJAX */ - Soc_PutLinkToViewNewPublications (); + TL_PutLinkToViewNewPublications (); /* Hidden list where insert just received (not visible) publications via AJAX */ fprintf (Gbl.F.Out,""); @@ -1010,16 +1017,16 @@ static void Soc_ShowTimeline (char *Query, NumPub < NumPubsGot; NumPub++) { - /* Get data of social publication */ + /* Get data of publication */ row = mysql_fetch_row (mysql_res); - Soc_GetDataOfSocialPublicationFromRow (row,&SocPub); + TL_GetDataOfPublicationFromRow (row,&SocPub); - /* Get data of social note */ + /* Get data of note */ SocNot.NotCod = SocPub.NotCod; - Soc_GetDataOfSocialNotByCod (&SocNot); + TL_GetDataOfNoteByCod (&SocNot); - /* Write social note */ - Soc_WriteSocialNote (&SocNot, + /* Write note */ + TL_WriteNote (&SocNot, SocPub.TopMessage,SocPub.PublisherCod, SocNot.NotCod == NotCodToHighlight, false); @@ -1030,12 +1037,12 @@ static void Soc_ShowTimeline (char *Query, DB_FreeMySQLResult (&mysql_res); /***** Store first publication code into session *****/ - Soc_UpdateFirstPubCodIntoSession (SocPub.PubCod); + TL_UpdateFirstPubCodIntoSession (SocPub.PubCod); - if (NumPubsGot == Soc_MAX_REC_PUBS_TO_GET_AND_SHOW) + if (NumPubsGot == TL_MAX_REC_PUBS_TO_GET_AND_SHOW) { /***** Link to view old publications via AJAX *****/ - Soc_PutLinkToViewOldPublications (); + TL_PutLinkToViewOldPublications (); /***** Hidden list where insert old publications via AJAX *****/ fprintf (Gbl.F.Out,""); @@ -1049,10 +1056,10 @@ static void Soc_ShowTimeline (char *Query, /********************* Put contextual icons in timeline **********************/ /*****************************************************************************/ -static void Soc_PutIconsTimeline (void) +static void TL_PutIconsTimeline (void) { /***** Put icon to show a figure *****/ - Gbl.Figures.FigureType = Fig_SOCIAL_ACTIVITY; + Gbl.Figures.FigureType = Fig_TIMELINE; Fig_PutIconToShowFigure (); } @@ -1060,7 +1067,7 @@ static void Soc_PutIconsTimeline (void) /***************** Start a form in global or user timeline *******************/ /*****************************************************************************/ -static void Soc_FormStart (Act_Action_t ActionGbl,Act_Action_t ActionUsr) +static void TL_FormStart (Act_Action_t ActionGbl,Act_Action_t ActionUsr) { if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { @@ -1070,7 +1077,7 @@ static void Soc_FormStart (Act_Action_t ActionGbl,Act_Action_t ActionUsr) else { Frm_StartForm (ActionGbl); - Soc_PutParamWhichUsrs (); + TL_PutParamWhichUsrs (); } } @@ -1078,13 +1085,13 @@ static void Soc_FormStart (Act_Action_t ActionGbl,Act_Action_t ActionUsr) /******* Form to fav/unfav or share/unshare in global or user timeline *******/ /*****************************************************************************/ -static void Soc_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr, +static void TL_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr, const char *ParamCod, const char *Icon,const char *Title) { char *OnSubmit; - /***** Form and icon to mark social note as favourite *****/ + /***** Form and icon to mark note as favourite *****/ /* Form with icon */ if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { @@ -1120,26 +1127,26 @@ static void Soc_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr, /******** Show form to select users whom public activity is displayed ********/ /*****************************************************************************/ -static void Soc_PutFormWhichUsrs (void) +static void TL_PutFormWhichUsrs (void) { - extern const char *Txt_TIMELINE_WHICH_USERS[Soc_NUM_WHICH_USRS]; - Soc_WhichUsrs_t WhichUsrs; - static const char *Icon[Soc_NUM_WHICH_USRS] = + extern const char *Txt_TIMELINE_WHICH_USERS[TL_NUM_WHICH_USRS]; + TL_WhichUsrs_t WhichUsrs; + static const char *Icon[TL_NUM_WHICH_USRS] = { - NULL, // Soc_USRS_UNKNOWN - "user-check.svg", // Soc_USRS_FOLLOWED - "users.svg", // Soc_USRS_ALL + NULL, // TL_USRS_UNKNOWN + "user-check.svg", // TL_USRS_FOLLOWED + "users.svg", // TL_USRS_ALL }; /***** Preference selector for which users *****/ Pre_StartPrefsHead (); Pre_StartOnePrefSelector (); - for (WhichUsrs = (Soc_WhichUsrs_t) 1; - WhichUsrs < Soc_NUM_WHICH_USRS; + for (WhichUsrs = (TL_WhichUsrs_t) 1; + WhichUsrs < TL_NUM_WHICH_USRS; WhichUsrs++) { fprintf (Gbl.F.Out,"
", - WhichUsrs == Gbl.Social.WhichUsrs ? "PREF_ON" : + WhichUsrs == Gbl.Timeline.WhichUsrs ? "PREF_ON" : "PREF_OFF"); Frm_StartForm (ActSeeSocTmlGbl); Par_PutHiddenParamUnsigned ("WhichUsrs",WhichUsrs); @@ -1151,51 +1158,51 @@ static void Soc_PutFormWhichUsrs (void) Pre_EndPrefsHead (); /***** Show warning if I do not follow anyone *****/ - if (Gbl.Social.WhichUsrs == Soc_USRS_FOLLOWED) - Soc_ShowWarningYouDontFollowAnyUser (); + if (Gbl.Timeline.WhichUsrs == TL_USRS_FOLLOWED) + TL_ShowWarningYouDontFollowAnyUser (); } /*****************************************************************************/ /***** Put hidden parameter with which users to view in global timeline ******/ /*****************************************************************************/ -static void Soc_PutParamWhichUsrs (void) +static void TL_PutParamWhichUsrs (void) { - Par_PutHiddenParamUnsigned ("WhichUsrs",Gbl.Social.WhichUsrs); + Par_PutHiddenParamUnsigned ("WhichUsrs",Gbl.Timeline.WhichUsrs); } /*****************************************************************************/ /********* Get parameter with which users to view in global timeline *********/ /*****************************************************************************/ -static void Soc_GetParamsWhichUsrs (void) +static void TL_GetParamsWhichUsrs (void) { /***** Get which users I want to see *****/ - Gbl.Social.WhichUsrs = (Soc_WhichUsrs_t) + Gbl.Timeline.WhichUsrs = (TL_WhichUsrs_t) Par_GetParToUnsignedLong ("WhichUsrs", 1, - Soc_NUM_WHICH_USRS - 1, - (unsigned long) Soc_USRS_UNKNOWN); + TL_NUM_WHICH_USRS - 1, + (unsigned long) TL_USRS_UNKNOWN); /***** If parameter WhichUsrs is not present, get it from database *****/ - if (Gbl.Social.WhichUsrs == Soc_USRS_UNKNOWN) - Gbl.Social.WhichUsrs = Soc_GetWhichUsrsFromDB (); + if (Gbl.Timeline.WhichUsrs == TL_USRS_UNKNOWN) + Gbl.Timeline.WhichUsrs = TL_GetWhichUsrsFromDB (); /***** If parameter WhichUsrs is unknown, set it to default *****/ - if (Gbl.Social.WhichUsrs == Soc_USRS_UNKNOWN) - Gbl.Social.WhichUsrs = Soc_DEFAULT_WHICH_USRS; + if (Gbl.Timeline.WhichUsrs == TL_USRS_UNKNOWN) + Gbl.Timeline.WhichUsrs = TL_DEFAULT_WHICH_USRS; } /*****************************************************************************/ /********** Get user's last data from database giving a user's code **********/ /*****************************************************************************/ -static Soc_WhichUsrs_t Soc_GetWhichUsrsFromDB (void) +static TL_WhichUsrs_t TL_GetWhichUsrsFromDB (void) { MYSQL_RES *mysql_res; MYSQL_ROW row; unsigned UnsignedNum; - Soc_WhichUsrs_t WhichUsrs = Soc_USRS_UNKNOWN; + TL_WhichUsrs_t WhichUsrs = TL_USRS_UNKNOWN; /***** Get which users from database *****/ if (DB_QuerySELECT (&mysql_res,"can not get timeline users from user's last data", @@ -1207,8 +1214,8 @@ static Soc_WhichUsrs_t Soc_GetWhichUsrsFromDB (void) /* Get which users */ if (sscanf (row[0],"%u",&UnsignedNum) == 1) - if (UnsignedNum < Soc_NUM_WHICH_USRS) - WhichUsrs = (Soc_WhichUsrs_t) UnsignedNum; + if (UnsignedNum < TL_NUM_WHICH_USRS) + WhichUsrs = (TL_WhichUsrs_t) UnsignedNum; } /***** Free structure that stores the query result *****/ @@ -1221,18 +1228,18 @@ static Soc_WhichUsrs_t Soc_GetWhichUsrsFromDB (void) /********************** Save which users into database ***********************/ /*****************************************************************************/ -static void Soc_SaveWhichUsersInDB (void) +static void TL_SaveWhichUsersInDB (void) { if (Gbl.Usrs.Me.Logged) { - if (Gbl.Social.WhichUsrs == Soc_USRS_UNKNOWN) - Gbl.Social.WhichUsrs = Soc_DEFAULT_WHICH_USRS; + if (Gbl.Timeline.WhichUsrs == TL_USRS_UNKNOWN) + Gbl.Timeline.WhichUsrs = TL_DEFAULT_WHICH_USRS; /***** Update which users in database *****/ // WhichUsrs is stored in usr_last for next time I log in DB_QueryUPDATE ("can not update timeline users in user's last data", "UPDATE usr_last SET TimelineUsrs=%u WHERE UsrCod=%ld", - (unsigned) Gbl.Social.WhichUsrs, + (unsigned) Gbl.Timeline.WhichUsrs, Gbl.Usrs.Me.UsrDat.UsrCod); } } @@ -1241,7 +1248,7 @@ static void Soc_SaveWhichUsersInDB (void) /********* Get parameter with which users to view in global timeline *********/ /*****************************************************************************/ -static void Soc_ShowWarningYouDontFollowAnyUser (void) +static void TL_ShowWarningYouDontFollowAnyUser (void) { extern const char *Txt_You_dont_follow_any_user; unsigned NumFollowing; @@ -1262,18 +1269,18 @@ static void Soc_ShowWarningYouDontFollowAnyUser (void) } /*****************************************************************************/ -/********** Show new social activity (new publications in timeline) **********/ +/******************* Show new publications in timeline ***********************/ /*****************************************************************************/ // The publications are inserted as list elements of a hidden list -static void Soc_InsertNewPubsInTimeline (char *Query) +static void TL_InsertNewPubsInTimeline (char *Query) { MYSQL_RES *mysql_res; MYSQL_ROW row; unsigned long NumPubsGot; unsigned long NumPub; - struct SocialPublication SocPub; - struct SocialNote SocNot; + struct TL_Publication SocPub; + struct TL_Note SocNot; /***** Get new publications timeline from database *****/ NumPubsGot = DB_QuerySELECT (&mysql_res,"can not get timeline", @@ -1285,16 +1292,16 @@ static void Soc_InsertNewPubsInTimeline (char *Query) NumPub < NumPubsGot; NumPub++) { - /* Get data of social publication */ + /* Get data of publication */ row = mysql_fetch_row (mysql_res); - Soc_GetDataOfSocialPublicationFromRow (row,&SocPub); + TL_GetDataOfPublicationFromRow (row,&SocPub); - /* Get data of social note */ + /* Get data of note */ SocNot.NotCod = SocPub.NotCod; - Soc_GetDataOfSocialNotByCod (&SocNot); + TL_GetDataOfNoteByCod (&SocNot); - /* Write social note */ - Soc_WriteSocialNote (&SocNot, + /* Write note */ + TL_WriteNote (&SocNot, SocPub.TopMessage,SocPub.PublisherCod, false,false); } @@ -1304,18 +1311,18 @@ static void Soc_InsertNewPubsInTimeline (char *Query) } /*****************************************************************************/ -/********** Show old social activity (old publications in timeline) **********/ +/********************* Show old publications in timeline *********************/ /*****************************************************************************/ // The publications are inserted as list elements of a hidden list -static void Soc_ShowOldPubsInTimeline (char *Query) +static void TL_ShowOldPubsInTimeline (char *Query) { MYSQL_RES *mysql_res; MYSQL_ROW row; unsigned long NumPubsGot; unsigned long NumPub; - struct SocialPublication SocPub; - struct SocialNote SocNot; + struct TL_Publication SocPub; + struct TL_Note SocNot; /***** Get old publications timeline from database *****/ NumPubsGot = DB_QuerySELECT (&mysql_res,"can not get timeline", @@ -1327,16 +1334,16 @@ static void Soc_ShowOldPubsInTimeline (char *Query) NumPub < NumPubsGot; NumPub++) { - /* Get data of social publication */ + /* Get data of publication */ row = mysql_fetch_row (mysql_res); - Soc_GetDataOfSocialPublicationFromRow (row,&SocPub); + TL_GetDataOfPublicationFromRow (row,&SocPub); - /* Get data of social note */ + /* Get data of note */ SocNot.NotCod = SocPub.NotCod; - Soc_GetDataOfSocialNotByCod (&SocNot); + TL_GetDataOfNoteByCod (&SocNot); - /* Write social note */ - Soc_WriteSocialNote (&SocNot, + /* Write note */ + TL_WriteNote (&SocNot, SocPub.TopMessage,SocPub.PublisherCod, false,false); } @@ -1345,14 +1352,14 @@ static void Soc_ShowOldPubsInTimeline (char *Query) DB_FreeMySQLResult (&mysql_res); /***** Store first publication code into session *****/ - Soc_UpdateFirstPubCodIntoSession (SocPub.PubCod); + TL_UpdateFirstPubCodIntoSession (SocPub.PubCod); } /*****************************************************************************/ /***************** Put link to view new publications in timeline *************/ /*****************************************************************************/ -static void Soc_PutLinkToViewNewPublications (void) +static void TL_PutLinkToViewNewPublications (void) { extern const char *The_ClassFormInBoxBold[The_NUM_THEMES]; extern const char *Txt_See_new_activity; @@ -1375,7 +1382,7 @@ static void Soc_PutLinkToViewNewPublications (void) /***************** Put link to view old publications in timeline *************/ /*****************************************************************************/ -static void Soc_PutLinkToViewOldPublications (void) +static void TL_PutLinkToViewOldPublications (void) { extern const char *The_ClassFormInBoxBold[The_NUM_THEMES]; extern const char *Txt_See_more; @@ -1404,14 +1411,14 @@ static void Soc_PutLinkToViewOldPublications (void) } /*****************************************************************************/ -/***************************** Write social note *****************************/ +/******************************** Write note *********************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_WriteSocialNote (const struct SocialNote *SocNot, - Soc_TopMessage_t TopMessage,long UsrCod, - bool Highlight, // Highlight social note - bool ShowNoteAlone) // Social note is shown alone, not in a list +static void TL_WriteNote (const struct TL_Note *SocNot, + TL_TopMessage_t TopMessage,long UsrCod, + bool Highlight, // Highlight note + bool ShowNoteAlone) // Note is shown alone, not in a list { extern const char *Txt_Forum; extern const char *Txt_Course; @@ -1454,9 +1461,9 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, fprintf (Gbl.F.Out,"\">"); if (SocNot->NotCod <= 0 || - SocNot->NoteType == Soc_NOTE_UNKNOWN || + SocNot->NoteType == TL_NOTE_UNKNOWN || SocNot->UsrCod <= 0) - Ale_ShowAlert (Ale_ERROR,"Error in social note."); + Ale_ShowAlert (Ale_ERROR,"Error in note."); else { /***** Initialize location in hierarchy *****/ @@ -1466,7 +1473,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, Crs.CrsCod = -1L; /***** Write sharer/commenter if distinct to author *****/ - Soc_WriteTopMessage (TopMessage,UsrCod); + TL_WriteTopMessage (TopMessage,UsrCod); /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); @@ -1480,9 +1487,9 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, IAmTheAuthor = ItsMe; if (!IAmTheAuthor) { - IAmASharerOfThisSocNot = Soc_CheckIfNoteIsSharedByUsr (SocNot->NotCod, + IAmASharerOfThisSocNot = TL_CheckIfNoteIsSharedByUsr (SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); - IAmAFaverOfThisSocNot = Soc_CheckIfNoteIsFavedByUsr (SocNot->NotCod, + IAmAFaverOfThisSocNot = TL_CheckIfNoteIsFavedByUsr (SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); } } @@ -1499,48 +1506,48 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, fprintf (Gbl.F.Out,"
"); /* Write author's full name and nickname */ - Soc_WriteAuthorNote (&UsrDat); + TL_WriteAuthorNote (&UsrDat); /* Write date and time */ - Soc_WriteDateTime (SocNot->DateTimeUTC); + TL_WriteDateTime (SocNot->DateTimeUTC); /* Write content of the note */ - if (SocNot->NoteType == Soc_NOTE_SOCIAL_POST) + if (SocNot->NoteType == TL_NOTE_POST) /* Write post content */ - Soc_GetAndWriteSocialPost (SocNot->Cod); + TL_GetAndWritePost (SocNot->Cod); else { /* Get location in hierarchy */ if (!SocNot->Unavailable) switch (SocNot->NoteType) { - case Soc_NOTE_INS_DOC_PUB_FILE: - case Soc_NOTE_INS_SHA_PUB_FILE: + case TL_NOTE_INS_DOC_PUB_FILE: + case TL_NOTE_INS_SHA_PUB_FILE: /* Get institution data */ Ins.InsCod = SocNot->HieCod; Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); break; - case Soc_NOTE_CTR_DOC_PUB_FILE: - case Soc_NOTE_CTR_SHA_PUB_FILE: + case TL_NOTE_CTR_DOC_PUB_FILE: + case TL_NOTE_CTR_SHA_PUB_FILE: /* Get centre data */ Ctr.CtrCod = SocNot->HieCod; Ctr_GetDataOfCentreByCod (&Ctr); break; - case Soc_NOTE_DEG_DOC_PUB_FILE: - case Soc_NOTE_DEG_SHA_PUB_FILE: + case TL_NOTE_DEG_DOC_PUB_FILE: + case TL_NOTE_DEG_SHA_PUB_FILE: /* Get degree data */ Deg.DegCod = SocNot->HieCod; Deg_GetDataOfDegreeByCod (&Deg); break; - case Soc_NOTE_CRS_DOC_PUB_FILE: - case Soc_NOTE_CRS_SHA_PUB_FILE: - case Soc_NOTE_EXAM_ANNOUNCEMENT: - case Soc_NOTE_NOTICE: + case TL_NOTE_CRS_DOC_PUB_FILE: + case TL_NOTE_CRS_SHA_PUB_FILE: + case TL_NOTE_EXAM_ANNOUNCEMENT: + case TL_NOTE_NOTICE: /* Get course data */ Crs.CrsCod = SocNot->HieCod; Crs_GetDataOfCourseByCod (&Crs); break; - case Soc_NOTE_FORUM_POST: + case TL_NOTE_FORUM_POST: /* Get forum type of the post */ For_GetForumTypeAndLocationOfAPost (SocNot->Cod,&Gbl.Forum.ForumSelected); For_SetForumName (&Gbl.Forum.ForumSelected, @@ -1551,39 +1558,39 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, } /* Write note type */ - Soc_PutFormGoToAction (SocNot); + TL_PutFormGoToAction (SocNot); /* Write location in hierarchy */ if (!SocNot->Unavailable) switch (SocNot->NoteType) { - case Soc_NOTE_INS_DOC_PUB_FILE: - case Soc_NOTE_INS_SHA_PUB_FILE: + case TL_NOTE_INS_DOC_PUB_FILE: + case TL_NOTE_INS_SHA_PUB_FILE: /* Write location (institution) in hierarchy */ fprintf (Gbl.F.Out,"
%s: %s
", Txt_Institution,Ins.ShrtName); break; - case Soc_NOTE_CTR_DOC_PUB_FILE: - case Soc_NOTE_CTR_SHA_PUB_FILE: + case TL_NOTE_CTR_DOC_PUB_FILE: + case TL_NOTE_CTR_SHA_PUB_FILE: /* Write location (centre) in hierarchy */ fprintf (Gbl.F.Out,"
%s: %s
", Txt_Centre,Ctr.ShrtName); break; - case Soc_NOTE_DEG_DOC_PUB_FILE: - case Soc_NOTE_DEG_SHA_PUB_FILE: + case TL_NOTE_DEG_DOC_PUB_FILE: + case TL_NOTE_DEG_SHA_PUB_FILE: /* Write location (degree) in hierarchy */ fprintf (Gbl.F.Out,"
%s: %s
", Txt_Degree,Deg.ShrtName); break; - case Soc_NOTE_CRS_DOC_PUB_FILE: - case Soc_NOTE_CRS_SHA_PUB_FILE: - case Soc_NOTE_EXAM_ANNOUNCEMENT: - case Soc_NOTE_NOTICE: + case TL_NOTE_CRS_DOC_PUB_FILE: + case TL_NOTE_CRS_SHA_PUB_FILE: + case TL_NOTE_EXAM_ANNOUNCEMENT: + case TL_NOTE_NOTICE: /* Write location (course) in hierarchy */ fprintf (Gbl.F.Out,"
%s: %s
", Txt_Course,Crs.ShrtName); break; - case Soc_NOTE_FORUM_POST: + case TL_NOTE_FORUM_POST: /* Write forum name */ fprintf (Gbl.F.Out,"
%s: %s
", Txt_Forum,ForumName); @@ -1593,7 +1600,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, } /* Write note summary */ - Soc_GetNoteSummary (SocNot,SummaryStr); + TL_GetNoteSummary (SocNot,SummaryStr); fprintf (Gbl.F.Out,"
%s
",SummaryStr); } @@ -1605,83 +1612,82 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, /* Create unique id for new comment */ Frm_SetUniqueId (IdNewComment); - /* Get number of comments in this social note */ - NumComments = Soc_GetNumCommentsInSocialNote (SocNot->NotCod); + /* Get number of comments in this note */ + NumComments = TL_GetNumCommentsInNote (SocNot->NotCod); /* Put icon to add a comment */ - // if (NumComments || SocNot->Unavailable) // Unavailable social notes can not be commented - if (SocNot->Unavailable) // Unavailable social notes can not be commented - Soc_PutIconCommentDisabled (); + if (SocNot->Unavailable) // Unavailable notes can not be commented + TL_PutIconCommentDisabled (); else - Soc_PutIconToToggleCommentSocialNote (IdNewComment); + TL_PutIconToToggleCommentNote (IdNewComment); fprintf (Gbl.F.Out,"
"); fprintf (Gbl.F.Out,"
" "
"); - /* Put icon to mark this social note as favourite */ - if (SocNot->Unavailable || // Unavailable social notes can not be favourited + /* Put icon to mark this note as favourite */ + if (SocNot->Unavailable || // Unavailable notes can not be favourited IAmTheAuthor) // I am the author { /* Put disabled icon and list of users - who have marked this social note as favourite */ - Soc_PutDisabledIconFav (SocNot->NumFavs); - Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (SocNot); + who have marked this note as favourite */ + TL_PutDisabledIconFav (SocNot->NumFavs); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot); } else // Available and I am not the author { fprintf (Gbl.F.Out,"
", Gbl.UniqueNameEncrypted,NumDiv); - if (IAmAFaverOfThisSocNot) // I have favourited this social note + if (IAmAFaverOfThisSocNot) // I have favourited this note /* Put icon to unfav this publication and list of users */ - Soc_PutFormToUnfavSocialNote (SocNot); - else // I am not a faver of this social note + TL_PutFormToUnfavNote (SocNot); + else // I am not a faver of this note /* Put icon to fav this publication and list of users */ - Soc_PutFormToFavSocialNote (SocNot); + TL_PutFormToFavNote (SocNot); fprintf (Gbl.F.Out,"
"); } /* Put icon to share/unshare */ - if (SocNot->Unavailable || // Unavailable social notes can not be shared + if (SocNot->Unavailable || // Unavailable notes can not be shared IAmTheAuthor) // I am the author { /* Put disabled icon and list of users - who have shared this social note */ - Soc_PutDisabledIconShare (SocNot->NumShared); - Soc_ShowUsrsWhoHaveSharedSocialNote (SocNot); + who have shared this note */ + TL_PutDisabledIconShare (SocNot->NumShared); + TL_ShowUsrsWhoHaveSharedNote (SocNot); } else // Available and I am not the author { fprintf (Gbl.F.Out,"
", Gbl.UniqueNameEncrypted,NumDiv); - if (IAmASharerOfThisSocNot) // I am a sharer of this social note + if (IAmASharerOfThisSocNot) // I am a sharer of this note /* Put icon to unshare this publication and list of users */ - Soc_PutFormToUnshareSocialNote (SocNot); - else // I am not a sharer of this social note + TL_PutFormToUnshareNote (SocNot); + else // I am not a sharer of this note /* Put icon to share this publication and list of users */ - Soc_PutFormToShareSocialNote (SocNot); + TL_PutFormToShareNote (SocNot); fprintf (Gbl.F.Out,"
"); } - /* Put icon to remove this social note */ + /* Put icon to remove this note */ if (IAmTheAuthor) - Soc_PutFormToRemoveSocialPublication (SocNot->NotCod); + TL_PutFormToRemovePublication (SocNot->NotCod); /* End of icon bar */ fprintf (Gbl.F.Out,"
"); /* Show comments */ if (NumComments) - Soc_WriteCommentsInSocialNote (SocNot); + TL_WriteCommentsInNote (SocNot); /* End of bottom right */ fprintf (Gbl.F.Out,"
"); /* Put hidden form to write a new comment */ - Soc_PutHiddenFormToWriteNewCommentToSocialNote (SocNot->NotCod,IdNewComment); + TL_PutHiddenFormToWriteNewCommentToNote (SocNot->NotCod,IdNewComment); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); @@ -1703,15 +1709,15 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_WriteTopMessage (Soc_TopMessage_t TopMessage,long UsrCod) +static void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long UsrCod) { extern const char *Txt_My_public_profile; extern const char *Txt_Another_user_s_profile; - extern const char *Txt_SOCIAL_NOTE_TOP_MESSAGES[Soc_NUM_TOP_MESSAGES]; + extern const char *Txt_TIMELINE_NOTE_TOP_MESSAGES[TL_NUM_TOP_MESSAGES]; struct UsrData UsrDat; bool ItsMe = Usr_ItsMe (UsrCod); - if (TopMessage != Soc_TOP_MESSAGE_NONE) + if (TopMessage != TL_TOP_MESSAGE_NONE) { /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); @@ -1734,7 +1740,7 @@ static void Soc_WriteTopMessage (Soc_TopMessage_t TopMessage,long UsrCod) /***** Show action made *****/ fprintf (Gbl.F.Out," %s:
", - Txt_SOCIAL_NOTE_TOP_MESSAGES[TopMessage]); + Txt_TIMELINE_NOTE_TOP_MESSAGES[TopMessage]); } /***** Free memory used for user's data *****/ @@ -1743,11 +1749,11 @@ static void Soc_WriteTopMessage (Soc_TopMessage_t TopMessage,long UsrCod) } /*****************************************************************************/ -/************ Write name and nickname of author of a social note *************/ +/*************** Write name and nickname of author of a note *****************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_WriteAuthorNote (const struct UsrData *UsrDat) +static void TL_WriteAuthorNote (const struct UsrData *UsrDat) { extern const char *Txt_My_public_profile; extern const char *Txt_Another_user_s_profile; @@ -1777,11 +1783,11 @@ static void Soc_WriteAuthorNote (const struct UsrData *UsrDat) } /*****************************************************************************/ -/**************** Write the date of creation of a social note ****************/ +/******************* Write the date of creation of a note ********************/ /*****************************************************************************/ // TimeUTC holds UTC date and time in UNIX format (seconds since 1970) -static void Soc_WriteDateTime (time_t TimeUTC) +static void TL_WriteDateTime (time_t TimeUTC) { extern const char *Txt_Today; char IdDateTime[Frm_MAX_BYTES_ID + 1]; @@ -1809,7 +1815,7 @@ static void Soc_WriteDateTime (time_t TimeUTC) /***************** Get from database and write public post *******************/ /*****************************************************************************/ -static void Soc_GetAndWriteSocialPost (long PstCod) +static void TL_GetAndWritePost (long PstCod) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -1820,15 +1826,16 @@ static void Soc_GetAndWriteSocialPost (long PstCod) /***** Initialize image *****/ Med_MediaConstructor (&Media); - /***** Get social post from database *****/ + /***** Get post from database *****/ NumRows = DB_QuerySELECT (&mysql_res,"can not get the content" - " of a social post", + " of a post", "SELECT Content," // row[0] "MediaName," // row[1] "MediaType," // row[2] "MediaTitle," // row[3] "MediaURL" // row[4] - " FROM social_posts WHERE PstCod=%ld", + " FROM social_posts" + " WHERE PstCod=%ld", PstCod); /***** Result should have a unique row *****/ @@ -1866,85 +1873,85 @@ static void Soc_GetAndWriteSocialPost (long PstCod) } /*****************************************************************************/ -/********* Put form to go to an action depending on the social note **********/ +/************* Put form to go to an action depending on the note *************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormGoToAction (const struct SocialNote *SocNot) +static void TL_PutFormGoToAction (const struct TL_Note *SocNot) { extern const Act_Action_t For_ActionsSeeFor[For_NUM_TYPES_FORUM]; extern const char *The_ClassFormOutBoxBold[The_NUM_THEMES]; - extern const char *Txt_SOCIAL_NOTE[Soc_NUM_NOTE_TYPES]; + extern const char *Txt_TIMELINE_NOTE[TL_NUM_NOTE_TYPES]; extern const char *Txt_not_available; char Class[64]; - const Act_Action_t Soc_DefaultActions[Soc_NUM_NOTE_TYPES] = + const Act_Action_t TL_DefaultActions[TL_NUM_NOTE_TYPES] = { - ActUnk, // Soc_NOTE_UNKNOWN + ActUnk, // TL_NOTE_UNKNOWN /* Institution tab */ - ActReqDatSeeDocIns, // Soc_NOTE_INS_DOC_PUB_FILE - ActReqDatShaIns, // Soc_NOTE_INS_SHA_PUB_FILE + ActReqDatSeeDocIns, // TL_NOTE_INS_DOC_PUB_FILE + ActReqDatShaIns, // TL_NOTE_INS_SHA_PUB_FILE /* Centre tab */ - ActReqDatSeeDocCtr, // Soc_NOTE_CTR_DOC_PUB_FILE - ActReqDatShaCtr, // Soc_NOTE_CTR_SHA_PUB_FILE + ActReqDatSeeDocCtr, // TL_NOTE_CTR_DOC_PUB_FILE + ActReqDatShaCtr, // TL_NOTE_CTR_SHA_PUB_FILE /* Degree tab */ - ActReqDatSeeDocDeg, // Soc_NOTE_DEG_DOC_PUB_FILE - ActReqDatShaDeg, // Soc_NOTE_DEG_SHA_PUB_FILE + ActReqDatSeeDocDeg, // TL_NOTE_DEG_DOC_PUB_FILE + ActReqDatShaDeg, // TL_NOTE_DEG_SHA_PUB_FILE /* Course tab */ - ActReqDatSeeDocCrs, // Soc_NOTE_CRS_DOC_PUB_FILE - ActReqDatShaCrs, // Soc_NOTE_CRS_SHA_PUB_FILE + ActReqDatSeeDocCrs, // TL_NOTE_CRS_DOC_PUB_FILE + ActReqDatShaCrs, // TL_NOTE_CRS_SHA_PUB_FILE /* Assessment tab */ - ActSeeOneExaAnn, // Soc_NOTE_EXAM_ANNOUNCEMENT + ActSeeOneExaAnn, // TL_NOTE_EXAM_ANNOUNCEMENT /* Users tab */ - /* Social tab */ - ActUnk, // Soc_NOTE_SOCIAL_POST (action not used) // TODO: Move to start tab - ActSeeFor, // Soc_NOTE_FORUM_POST // TODO: Move to messages tab + /* Start tab */ + ActUnk, // TL_NOTE_SOCIAL_POST (action not used) // TODO: Move to start tab + ActSeeFor, // TL_NOTE_FORUM_POST // TODO: Move to messages tab /* Messages tab */ - ActSeeOneNot, // Soc_NOTE_NOTICE + ActSeeOneNot, // TL_NOTE_NOTICE /* Statistics tab */ /* Profile tab */ }; - const char *Soc_Icons[Soc_NUM_NOTE_TYPES] = + const char *TL_Icons[TL_NUM_NOTE_TYPES] = { - NULL, // Soc_NOTE_UNKNOWN + NULL, // TL_NOTE_UNKNOWN /* Institution tab */ - "file.svg", // Soc_NOTE_INS_DOC_PUB_FILE - "file.svg", // Soc_NOTE_INS_SHA_PUB_FILE + "file.svg", // TL_NOTE_INS_DOC_PUB_FILE + "file.svg", // TL_NOTE_INS_SHA_PUB_FILE /* Centre tab */ - "file.svg", // Soc_NOTE_CTR_DOC_PUB_FILE - "file.svg", // Soc_NOTE_CTR_SHA_PUB_FILE + "file.svg", // TL_NOTE_CTR_DOC_PUB_FILE + "file.svg", // TL_NOTE_CTR_SHA_PUB_FILE /* Degree tab */ - "file.svg", // Soc_NOTE_DEG_DOC_PUB_FILE - "file.svg", // Soc_NOTE_DEG_SHA_PUB_FILE + "file.svg", // TL_NOTE_DEG_DOC_PUB_FILE + "file.svg", // TL_NOTE_DEG_SHA_PUB_FILE /* Course tab */ - "file.svg", // Soc_NOTE_CRS_DOC_PUB_FILE - "file.svg", // Soc_NOTE_CRS_SHA_PUB_FILE + "file.svg", // TL_NOTE_CRS_DOC_PUB_FILE + "file.svg", // TL_NOTE_CRS_SHA_PUB_FILE /* Assessment tab */ - "bullhorn.svg", // Soc_NOTE_EXAM_ANNOUNCEMENT + "bullhorn.svg", // TL_NOTE_EXAM_ANNOUNCEMENT /* Users tab */ - /* Social tab */ - NULL, // Soc_NOTE_SOCIAL_POST (icon not used) - "comments.svg", // Soc_NOTE_FORUM_POST + /* Start tab */ + NULL, // TL_NOTE_SOCIAL_POST (icon not used) /* Messages tab */ - "sticky-note.svg", // Soc_NOTE_NOTICE + "comments.svg", // TL_NOTE_FORUM_POST // TODO: Move down + "sticky-note.svg", // TL_NOTE_NOTICE /* Statistics tab */ @@ -1952,12 +1959,12 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot) }; - if (SocNot->Unavailable || // File/notice... pointed by this social note is unavailable + if (SocNot->Unavailable || // File/notice... pointed by this note is unavailable Gbl.Form.Inside) // Inside another form { /***** Do not put form *****/ fprintf (Gbl.F.Out,"
%s", - Txt_SOCIAL_NOTE[SocNot->NoteType]); + Txt_TIMELINE_NOTE[SocNot->NoteType]); if (SocNot->Unavailable) fprintf (Gbl.F.Out," (%s)",Txt_not_available); fprintf (Gbl.F.Out,"
"); @@ -1969,43 +1976,43 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot) /***** Parameters depending on the type of note *****/ switch (SocNot->NoteType) { - case Soc_NOTE_INS_DOC_PUB_FILE: - case Soc_NOTE_INS_SHA_PUB_FILE: - Frm_StartFormUnique (Soc_DefaultActions[SocNot->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.CurrentIns.Ins.InsCod) // Not the current institution Ins_PutParamInsCod (SocNot->HieCod); // Go to another institution break; - case Soc_NOTE_CTR_DOC_PUB_FILE: - case Soc_NOTE_CTR_SHA_PUB_FILE: - Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]); + 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.CurrentCtr.Ctr.CtrCod) // Not the current centre Ctr_PutParamCtrCod (SocNot->HieCod); // Go to another centre break; - case Soc_NOTE_DEG_DOC_PUB_FILE: - case Soc_NOTE_DEG_SHA_PUB_FILE: - Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]); + 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.CurrentDeg.Deg.DegCod) // Not the current degree Deg_PutParamDegCod (SocNot->HieCod); // Go to another degree break; - case Soc_NOTE_CRS_DOC_PUB_FILE: - case Soc_NOTE_CRS_SHA_PUB_FILE: - Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]); + 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.CurrentCrs.Crs.CrsCod) // Not the current course Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course break; - case Soc_NOTE_EXAM_ANNOUNCEMENT: - Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]); + case TL_NOTE_EXAM_ANNOUNCEMENT: + Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]); Exa_PutHiddenParamExaCod (SocNot->Cod); if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course break; - case Soc_NOTE_SOCIAL_POST: // Not applicable + case TL_NOTE_POST: // Not applicable return; - case Soc_NOTE_FORUM_POST: + case TL_NOTE_FORUM_POST: Frm_StartFormUnique (For_ActionsSeeFor[Gbl.Forum.ForumSelected.Type]); For_PutAllHiddenParamsForum (1, // Page of threads = first 1, // Page of posts = first @@ -2017,8 +2024,8 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot) if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course break; - case Soc_NOTE_NOTICE: - Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]); + case TL_NOTE_NOTICE: + Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]); Not_PutHiddenParamNotCod (SocNot->Cod); if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course @@ -2031,16 +2038,16 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot) snprintf (Class,sizeof (Class), "%s ICO_HIGHLIGHT", The_ClassFormOutBoxBold[Gbl.Prefs.Theme]); - Frm_LinkFormSubmitUnique (Txt_SOCIAL_NOTE[SocNot->NoteType],Class); + Frm_LinkFormSubmitUnique (Txt_TIMELINE_NOTE[SocNot->NoteType],Class); fprintf (Gbl.F.Out,"\"%s\"" " %s" "", - Gbl.Prefs.URLIcons,Soc_Icons[SocNot->NoteType], - Txt_SOCIAL_NOTE[SocNot->NoteType], - Txt_SOCIAL_NOTE[SocNot->NoteType], - Txt_SOCIAL_NOTE[SocNot->NoteType]); + Gbl.Prefs.URLIcons,TL_Icons[SocNot->NoteType], + Txt_TIMELINE_NOTE[SocNot->NoteType], + Txt_TIMELINE_NOTE[SocNot->NoteType], + Txt_TIMELINE_NOTE[SocNot->NoteType]); Frm_EndForm (); fprintf (Gbl.F.Out,""); @@ -2048,70 +2055,70 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot) } /*****************************************************************************/ -/******************* Get social note summary and content *********************/ +/********************** Get note summary and content *************************/ /*****************************************************************************/ -static void Soc_GetNoteSummary (const struct SocialNote *SocNot, - char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]) +static void TL_GetNoteSummary (const struct TL_Note *SocNot, + char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]) { SummaryStr[0] = '\0'; switch (SocNot->NoteType) { - case Soc_NOTE_UNKNOWN: + case TL_NOTE_UNKNOWN: break; - case Soc_NOTE_INS_DOC_PUB_FILE: - case Soc_NOTE_INS_SHA_PUB_FILE: - case Soc_NOTE_CTR_DOC_PUB_FILE: - case Soc_NOTE_CTR_SHA_PUB_FILE: - case Soc_NOTE_DEG_DOC_PUB_FILE: - case Soc_NOTE_DEG_SHA_PUB_FILE: - case Soc_NOTE_CRS_DOC_PUB_FILE: - case Soc_NOTE_CRS_SHA_PUB_FILE: + case TL_NOTE_INS_DOC_PUB_FILE: + case TL_NOTE_INS_SHA_PUB_FILE: + case TL_NOTE_CTR_DOC_PUB_FILE: + case TL_NOTE_CTR_SHA_PUB_FILE: + case TL_NOTE_DEG_DOC_PUB_FILE: + 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); break; - case Soc_NOTE_EXAM_ANNOUNCEMENT: + case TL_NOTE_EXAM_ANNOUNCEMENT: Exa_GetSummaryAndContentExamAnnouncement (SummaryStr,NULL,SocNot->Cod,false); break; - case Soc_NOTE_SOCIAL_POST: + case TL_NOTE_POST: // Not applicable break; - case Soc_NOTE_FORUM_POST: + case TL_NOTE_FORUM_POST: For_GetSummaryAndContentForumPst (SummaryStr,NULL,SocNot->Cod,false); break; - case Soc_NOTE_NOTICE: + case TL_NOTE_NOTICE: Not_GetSummaryAndContentNotice (SummaryStr,NULL,SocNot->Cod,false); break; } } /*****************************************************************************/ -/************** Store and publish a social note into database ****************/ +/***************** Store and publish a note into database ********************/ /*****************************************************************************/ // Return the code of the new note just created -void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod,struct SocialPublication *SocPub) +void TL_StoreAndPublishNote (TL_NoteType_t NoteType,long Cod,struct TL_Publication *SocPub) { long HieCod; // Hierarchy code (institution/centre/degree/course) switch (NoteType) { - case Soc_NOTE_INS_DOC_PUB_FILE: - case Soc_NOTE_INS_SHA_PUB_FILE: + case TL_NOTE_INS_DOC_PUB_FILE: + case TL_NOTE_INS_SHA_PUB_FILE: HieCod = Gbl.CurrentIns.Ins.InsCod; break; - case Soc_NOTE_CTR_DOC_PUB_FILE: - case Soc_NOTE_CTR_SHA_PUB_FILE: + case TL_NOTE_CTR_DOC_PUB_FILE: + case TL_NOTE_CTR_SHA_PUB_FILE: HieCod = Gbl.CurrentCtr.Ctr.CtrCod; break; - case Soc_NOTE_DEG_DOC_PUB_FILE: - case Soc_NOTE_DEG_SHA_PUB_FILE: + case TL_NOTE_DEG_DOC_PUB_FILE: + case TL_NOTE_DEG_SHA_PUB_FILE: HieCod = Gbl.CurrentDeg.Deg.DegCod; break; - case Soc_NOTE_CRS_DOC_PUB_FILE: - case Soc_NOTE_CRS_SHA_PUB_FILE: - case Soc_NOTE_EXAM_ANNOUNCEMENT: - case Soc_NOTE_NOTICE: + case TL_NOTE_CRS_DOC_PUB_FILE: + case TL_NOTE_CRS_SHA_PUB_FILE: + case TL_NOTE_EXAM_ANNOUNCEMENT: + case TL_NOTE_NOTICE: HieCod = Gbl.CurrentCrs.Crs.CrsCod; break; default: @@ -2119,9 +2126,9 @@ void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod,struct Soci break; } - /***** Store social note *****/ + /***** Store note *****/ SocPub->NotCod = - DB_QueryINSERTandReturnCode ("can not create new social note", + DB_QueryINSERTandReturnCode ("can not create new note", "INSERT INTO social_notes" " (NoteType,Cod,UsrCod,HieCod,Unavailable,TimeNote)" " VALUES" @@ -2129,44 +2136,44 @@ void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod,struct Soci (unsigned) NoteType, Cod,Gbl.Usrs.Me.UsrDat.UsrCod,HieCod); - /***** Publish social note in timeline *****/ + /***** Publish note in timeline *****/ SocPub->PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; - SocPub->PubType = Soc_PUB_ORIGINAL_NOTE; - Soc_PublishSocialNoteInTimeline (SocPub); + SocPub->PubType = TL_PUB_ORIGINAL_NOTE; + TL_PublishNoteInTimeline (SocPub); } /*****************************************************************************/ -/********************** Mark a social note as unavailable ********************/ +/************************* Mark a note as unavailable ************************/ /*****************************************************************************/ -void Soc_MarkSocialNoteAsUnavailableUsingNotCod (long NotCod) +void TL_MarkNoteAsUnavailableUsingNotCod (long NotCod) { - /***** Mark the social note as unavailable *****/ - DB_QueryUPDATE ("can not mark social note as unavailable", + /***** Mark the note as unavailable *****/ + DB_QueryUPDATE ("can not mark note as unavailable", "UPDATE social_notes SET Unavailable='Y'" " WHERE NotCod=%ld", NotCod); } -void Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NoteType_t NoteType,long Cod) +void TL_MarkNoteAsUnavailableUsingNoteTypeAndCod (TL_NoteType_t NoteType,long Cod) { - /***** Mark the social note as unavailable *****/ - DB_QueryUPDATE ("can not mark social note as unavailable", + /***** Mark the note as unavailable *****/ + DB_QueryUPDATE ("can not mark note as unavailable", "UPDATE social_notes SET Unavailable='Y'" " WHERE NoteType=%u AND Cod=%ld", (unsigned) NoteType,Cod); } /*****************************************************************************/ -/************** Mark social notes of one file as unavailable *****************/ +/****************** Mark notes of one file as unavailable ********************/ /*****************************************************************************/ -void Soc_MarkSocialNoteOneFileAsUnavailable (const char *Path) +void TL_MarkNoteOneFileAsUnavailable (const char *Path) { extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER]; Brw_FileBrowser_t FileBrowser = Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type]; long FilCod; - Soc_NoteType_t NoteType; + TL_NoteType_t NoteType; switch (FileBrowser) { @@ -2182,37 +2189,37 @@ void Soc_MarkSocialNoteOneFileAsUnavailable (const char *Path) FilCod = Brw_GetFilCodByPath (Path,true); // Only if file is public if (FilCod > 0) { - /***** Mark possible social note as unavailable *****/ + /***** Mark possible note as unavailable *****/ switch (FileBrowser) { case Brw_ADMI_DOC_INS: - NoteType = Soc_NOTE_INS_DOC_PUB_FILE; + NoteType = TL_NOTE_INS_DOC_PUB_FILE; break; case Brw_ADMI_SHR_INS: - NoteType = Soc_NOTE_INS_SHA_PUB_FILE; + NoteType = TL_NOTE_INS_SHA_PUB_FILE; break; case Brw_ADMI_DOC_CTR: - NoteType = Soc_NOTE_CTR_DOC_PUB_FILE; + NoteType = TL_NOTE_CTR_DOC_PUB_FILE; break; case Brw_ADMI_SHR_CTR: - NoteType = Soc_NOTE_CTR_SHA_PUB_FILE; + NoteType = TL_NOTE_CTR_SHA_PUB_FILE; break; case Brw_ADMI_DOC_DEG: - NoteType = Soc_NOTE_DEG_DOC_PUB_FILE; + NoteType = TL_NOTE_DEG_DOC_PUB_FILE; break; case Brw_ADMI_SHR_DEG: - NoteType = Soc_NOTE_DEG_SHA_PUB_FILE; + NoteType = TL_NOTE_DEG_SHA_PUB_FILE; break; case Brw_ADMI_DOC_CRS: - NoteType = Soc_NOTE_CRS_DOC_PUB_FILE; + NoteType = TL_NOTE_CRS_DOC_PUB_FILE; break; case Brw_ADMI_SHR_CRS: - NoteType = Soc_NOTE_CRS_SHA_PUB_FILE; + NoteType = TL_NOTE_CRS_SHA_PUB_FILE; break; default: return; } - Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (NoteType,FilCod); + TL_MarkNoteAsUnavailableUsingNoteTypeAndCod (NoteType,FilCod); } break; default: @@ -2221,15 +2228,15 @@ void Soc_MarkSocialNoteOneFileAsUnavailable (const char *Path) } /*****************************************************************************/ -/** Mark possible social notes involving children of a folder as unavailable */ +/***** Mark possible notes involving children of a folder as unavailable *****/ /*****************************************************************************/ -void Soc_MarkSocialNotesChildrenOfFolderAsUnavailable (const char *Path) +void TL_MarkNotesChildrenOfFolderAsUnavailable (const char *Path) { extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER]; Brw_FileBrowser_t FileBrowser = Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type]; long Cod = Brw_GetCodForFiles (); - Soc_NoteType_t NoteType; + TL_NoteType_t NoteType; switch (FileBrowser) { @@ -2241,37 +2248,37 @@ void Soc_MarkSocialNotesChildrenOfFolderAsUnavailable (const char *Path) case Brw_ADMI_SHR_DEG: case Brw_ADMI_DOC_CRS: case Brw_ADMI_SHR_CRS: - /***** Mark possible social note as unavailable *****/ + /***** Mark possible note as unavailable *****/ switch (FileBrowser) { case Brw_ADMI_DOC_INS: - NoteType = Soc_NOTE_INS_DOC_PUB_FILE; + NoteType = TL_NOTE_INS_DOC_PUB_FILE; break; case Brw_ADMI_SHR_INS: - NoteType = Soc_NOTE_INS_SHA_PUB_FILE; + NoteType = TL_NOTE_INS_SHA_PUB_FILE; break; case Brw_ADMI_DOC_CTR: - NoteType = Soc_NOTE_CTR_DOC_PUB_FILE; + NoteType = TL_NOTE_CTR_DOC_PUB_FILE; break; case Brw_ADMI_SHR_CTR: - NoteType = Soc_NOTE_CTR_SHA_PUB_FILE; + NoteType = TL_NOTE_CTR_SHA_PUB_FILE; break; case Brw_ADMI_DOC_DEG: - NoteType = Soc_NOTE_DEG_DOC_PUB_FILE; + NoteType = TL_NOTE_DEG_DOC_PUB_FILE; break; case Brw_ADMI_SHR_DEG: - NoteType = Soc_NOTE_DEG_SHA_PUB_FILE; + NoteType = TL_NOTE_DEG_SHA_PUB_FILE; break; case Brw_ADMI_DOC_CRS: - NoteType = Soc_NOTE_CRS_DOC_PUB_FILE; + NoteType = TL_NOTE_CRS_DOC_PUB_FILE; break; case Brw_ADMI_SHR_CRS: - NoteType = Soc_NOTE_CRS_SHA_PUB_FILE; + NoteType = TL_NOTE_CRS_SHA_PUB_FILE; break; default: return; } - DB_QueryUPDATE ("can not mark social notes as unavailable", + DB_QueryUPDATE ("can not mark notes as unavailable", "UPDATE social_notes SET Unavailable='Y'" " WHERE NoteType=%u AND Cod IN" " (SELECT FilCod FROM files" @@ -2287,15 +2294,15 @@ void Soc_MarkSocialNotesChildrenOfFolderAsUnavailable (const char *Path) } /*****************************************************************************/ -/********************** Publish social note in timeline **********************/ +/************************* Publish note in timeline **************************/ /*****************************************************************************/ // SocPub->PubCod is set by the function -static void Soc_PublishSocialNoteInTimeline (struct SocialPublication *SocPub) +static void TL_PublishNoteInTimeline (struct TL_Publication *SocPub) { - /***** Publish social note in timeline *****/ + /***** Publish note in timeline *****/ SocPub->PubCod = - DB_QueryINSERTandReturnCode ("can not publish social note", + DB_QueryINSERTandReturnCode ("can not publish note", "INSERT INTO social_pubs" " (NotCod,PublisherCod,PubType,TimePublish)" " VALUES" @@ -2304,17 +2311,17 @@ static void Soc_PublishSocialNoteInTimeline (struct SocialPublication *SocPub) SocPub->PublisherCod, (unsigned) SocPub->PubType); - /***** Increment number of social publications in user's figures *****/ + /***** Increment number of publications in user's figures *****/ Prf_IncrementNumSocPubUsr (SocPub->PublisherCod); } /*****************************************************************************/ -/****************** Form to write a new social publication *******************/ +/********************** Form to write a new publication **********************/ /*****************************************************************************/ -static void Soc_PutFormToWriteNewPost (void) +static void TL_PutFormToWriteNewPost (void) { - extern const char *Txt_New_SOCIAL_post; + extern const char *Txt_New_TIMELINE_post; bool ShowPhoto; char PhotoURL[PATH_MAX + 1]; @@ -2345,10 +2352,10 @@ static void Soc_PutFormToWriteNewPost (void) fprintf (Gbl.F.Out,"
"); /* Start form to write the post */ - Soc_FormStart (ActRcvSocPstGbl,ActRcvSocPstUsr); + TL_FormStart (ActRcvSocPstGbl,ActRcvSocPstUsr); /* Textarea and button */ - Soc_PutTextarea (Txt_New_SOCIAL_post, + TL_PutTextarea (Txt_New_TIMELINE_post, "TL_POST_TEXTAREA TL_RIGHT_WIDTH", "TL_POST_IMG_TIT_URL TL_POST_IMG_WIDTH"); @@ -2367,7 +2374,7 @@ static void Soc_PutFormToWriteNewPost (void) /*** Put textarea and button inside a form to submit a new post or comment ***/ /*****************************************************************************/ -static void Soc_PutTextarea (const char *Placeholder, +static void TL_PutTextarea (const char *Placeholder, const char *ClassTextArea,const char *ClassImgTit) { extern const char *Txt_Post; @@ -2382,7 +2389,7 @@ static void Soc_PutTextarea (const char *Placeholder, " class=\"%s\"" " onfocus=\"expandTextarea(this,'%s','5');\">" "", - Soc_MAX_CHARS_IN_POST, + TL_MAX_CHARS_IN_POST, Placeholder,ClassTextArea, IdDivImgButton); @@ -2411,18 +2418,18 @@ static void Soc_PutTextarea (const char *Placeholder, /******************* Receive and store a new public post *********************/ /*****************************************************************************/ -void Soc_ReceiveSocialPostGbl (void) +void TL_ReceivePostGbl (void) { long NotCod; - /***** Receive and store social post *****/ - NotCod = Soc_ReceiveSocialPost (); + /***** Receive and store post *****/ + NotCod = TL_ReceivePost (); /***** Write updated timeline after publication (global) *****/ - Soc_ShowTimelineGblHighlightingNot (NotCod); + TL_ShowTimelineGblHighlightingNot (NotCod); } -void Soc_ReceiveSocialPostUsr (void) +void TL_ReceivePostUsr (void) { long NotCod; @@ -2433,25 +2440,25 @@ void Soc_ReceiveSocialPostUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Start section *****/ - Lay_StartSection (Soc_TIMELINE_SECTION_ID); + Lay_StartSection (TL_TIMELINE_SECTION_ID); - /***** Receive and store social post *****/ - NotCod = Soc_ReceiveSocialPost (); + /***** Receive and store post *****/ + NotCod = TL_ReceivePost (); /***** Write updated timeline after publication (user) *****/ - Soc_ShowTimelineUsrHighlightingNot (NotCod); + TL_ShowTimelineUsrHighlightingNot (NotCod); /***** End section *****/ Lay_EndSection (); } -// Returns the code of the social note just created -static long Soc_ReceiveSocialPost (void) +// Returns the code of the note just created +static long TL_ReceivePost (void) { char Content[Cns_MAX_BYTES_LONG_TEXT + 1]; struct Media Media; long PstCod; - struct SocialPublication SocPub; + struct TL_Publication SocPub; /***** Get the content of the new post *****/ Par_GetParAndChangeFormat ("Content",Content,Cns_MAX_BYTES_LONG_TEXT, @@ -2461,9 +2468,9 @@ static long Soc_ReceiveSocialPost (void) Med_MediaConstructor (&Media); /***** Get attached image (action, file and title) *****/ - Media.Width = Soc_IMAGE_SAVED_MAX_WIDTH; - Media.Height = Soc_IMAGE_SAVED_MAX_HEIGHT; - Media.Quality = Soc_IMAGE_SAVED_QUALITY; + Media.Width = TL_IMAGE_SAVED_MAX_WIDTH; + Media.Height = TL_IMAGE_SAVED_MAX_HEIGHT; + Media.Quality = TL_IMAGE_SAVED_QUALITY; Med_GetMediaFromForm (-1,&Media,NULL); if (Content[0] || // Text not empty @@ -2493,8 +2500,8 @@ static long Soc_ReceiveSocialPost (void) (Media.Name[0] && // Save image URL only if image attached Media.URL ) ? Media.URL : ""); - /* Insert post in social notes */ - Soc_StoreAndPublishSocialNote (Soc_NOTE_SOCIAL_POST,PstCod,&SocPub); + /* Insert post in notes */ + TL_StoreAndPublishNote (TL_NOTE_POST,PstCod,&SocPub); /***** Analyze content and store notifications about mentions *****/ Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (SocPub.PubCod,Content); @@ -2509,14 +2516,14 @@ static long Soc_ReceiveSocialPost (void) } /*****************************************************************************/ -/****** Put an icon to toggle on/off the form to comment a social note *******/ +/********* Put an icon to toggle on/off the form to comment a note ***********/ /*****************************************************************************/ -static void Soc_PutIconToToggleCommentSocialNote (const char UniqueId[Frm_MAX_BYTES_ID + 1]) +static void TL_PutIconToToggleCommentNote (const char UniqueId[Frm_MAX_BYTES_ID + 1]) { extern const char *Txt_Comment; - /***** Link to toggle on/off the form to comment a social note *****/ + /***** Link to toggle on/off the form to comment a note *****/ fprintf (Gbl.F.Out,"
" "" @@ -2531,14 +2538,14 @@ static void Soc_PutIconToToggleCommentSocialNote (const char UniqueId[Frm_MAX_BY } /*****************************************************************************/ -/****** Put an icon to toggle on/off the form to comment a social note *******/ +/********** Put an icon to toggle on/off the form to comment a note **********/ /*****************************************************************************/ -static void Soc_PutIconCommentDisabled (void) +static void TL_PutIconCommentDisabled (void) { extern const char *Txt_Comment; - /***** Disabled icon to comment a social note *****/ + /***** Disabled icon to comment a note *****/ fprintf (Gbl.F.Out,"
" "\"%s\""); /* Start form to write the post */ - Soc_FormStart (ActRcvSocComGbl,ActRcvSocComUsr); - Soc_PutHiddenParamNotCod (NotCod); + TL_FormStart (ActRcvSocComGbl,ActRcvSocComUsr); + TL_PutHiddenParamNotCod (NotCod); /* Textarea and button */ - Soc_PutTextarea (Txt_New_SOCIAL_comment, + TL_PutTextarea (Txt_New_TIMELINE_comment, "TL_COMMENT_TEXTAREA TL_COMMENT_WIDTH", "TL_COMMENT_IMG_TIT_URL TL_COMMENT_WIDTH"); @@ -2598,23 +2605,23 @@ static void Soc_PutHiddenFormToWriteNewCommentToSocialNote (long NotCod, } /*****************************************************************************/ -/****************** Get number of comments in a social note ******************/ +/********************* Get number of comments in a note **********************/ /*****************************************************************************/ -static unsigned long Soc_GetNumCommentsInSocialNote (long NotCod) +static unsigned long TL_GetNumCommentsInNote (long NotCod) { - return DB_QueryCOUNT ("can not get number of comments in a social note", + return DB_QueryCOUNT ("can not get number of comments in a note", "SELECT COUNT(*) FROM social_pubs" " WHERE NotCod=%ld AND PubType=%u", - NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + NotCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); } /*****************************************************************************/ -/********************* Write comments in a social note ***********************/ +/*********************** Write comments in a note ****************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) +static void TL_WriteCommentsInNote (const struct TL_Note *SocNot) { extern const char *Txt_See_the_previous_X_COMMENTS; extern const char *Txt_See_only_the_latest_COMMENTS; @@ -2624,8 +2631,8 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) unsigned long NumCom; char IdComments[Frm_MAX_BYTES_ID + 1]; - /***** Get comments of this social note from database *****/ - NumComments = DB_QuerySELECT (&mysql_res,"can not get social comments", + /***** Get comments of this note from database *****/ + NumComments = DB_QuerySELECT (&mysql_res,"can not get comments", "SELECT social_pubs.PubCod," // row[0] "social_pubs.PublisherCod," // row[1] "social_pubs.NotCod," // row[2] @@ -2641,15 +2648,15 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments.PubCod" " ORDER BY social_pubs.PubCod", - SocNot->NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + SocNot->NotCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); /***** List comments *****/ - if (NumComments) // Comments to this social note found + if (NumComments) // Comments to this note found { // Never hide only one comment // So, the number of comments initially hidden must be 0 or >= 2 - NumCommentsInitiallyHidden = (NumComments <= Soc_NUM_VISIBLE_COMMENTS + 1) ? 0 : // Show all - NumComments - Soc_NUM_VISIBLE_COMMENTS; + NumCommentsInitiallyHidden = (NumComments <= TL_NUM_VISIBLE_COMMENTS + 1) ? 0 : // Show all + NumComments - TL_NUM_VISIBLE_COMMENTS; if (NumCommentsInitiallyHidden) { /***** Create unique id for list of hidden comments *****/ @@ -2660,7 +2667,7 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) " class=\"TL_EXPAND_COMMENTS TL_RIGHT_WIDTH\"" " style=\"display:none;\">", // Initially hidden IdComments); - Soc_PutIconToToggleComments (IdComments,"angle-down.svg", + TL_PutIconToToggleComments (IdComments,"angle-down.svg", Txt_See_only_the_latest_COMMENTS); fprintf (Gbl.F.Out,"
"); @@ -2671,7 +2678,7 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) for (NumCom = 0; NumCom < NumCommentsInitiallyHidden; NumCom++) - Soc_WriteOneSocialCommentInList (mysql_res); + TL_WriteOneCommentInList (mysql_res); fprintf (Gbl.F.Out,""); /***** Link to toggle on/off comments *****/ @@ -2681,7 +2688,7 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) snprintf (Gbl.Title,sizeof (Gbl.Title), Txt_See_the_previous_X_COMMENTS, NumCommentsInitiallyHidden); - Soc_PutIconToToggleComments (IdComments,"angle-up.svg",Gbl.Title); + TL_PutIconToToggleComments (IdComments,"angle-up.svg",Gbl.Title); fprintf (Gbl.F.Out,"
"); } @@ -2690,7 +2697,7 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) for (NumCom = NumCommentsInitiallyHidden; NumCom < NumComments; NumCom++) - Soc_WriteOneSocialCommentInList (mysql_res); + TL_WriteOneCommentInList (mysql_res); fprintf (Gbl.F.Out,""); } @@ -2698,21 +2705,21 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot) DB_FreeMySQLResult (&mysql_res); } -static void Soc_WriteOneSocialCommentInList (MYSQL_RES *mysql_res) +static void TL_WriteOneCommentInList (MYSQL_RES *mysql_res) { MYSQL_ROW row; - struct SocialComment SocCom; + struct TL_Comment SocCom; /***** Initialize image *****/ Med_MediaConstructor (&SocCom.Media); - /***** Get data of social comment *****/ + /***** Get data of comment *****/ row = mysql_fetch_row (mysql_res); - Soc_GetDataOfSocialCommentFromRow (row,&SocCom); + TL_GetDataOfCommentFromRow (row,&SocCom); - /***** Write social comment *****/ - Soc_WriteSocialComment (&SocCom, - Soc_TOP_MESSAGE_NONE,-1L, + /***** Write comment *****/ + TL_WriteComment (&SocCom, + TL_TOP_MESSAGE_NONE,-1L, false); /***** Free image *****/ @@ -2720,10 +2727,10 @@ static void Soc_WriteOneSocialCommentInList (MYSQL_RES *mysql_res) } /*****************************************************************************/ -/******* Put an icon to toggle on/off comments in a social publication *******/ +/********** Put an icon to toggle on/off comments in a publication ***********/ /*****************************************************************************/ -static void Soc_PutIconToToggleComments (const char *UniqueId, +static void TL_PutIconToToggleComments (const char *UniqueId, const char *Icon,const char *Text) { extern const char *The_ClassFormInBox[The_NUM_THEMES]; @@ -2739,13 +2746,13 @@ static void Soc_PutIconToToggleComments (const char *UniqueId, } /*****************************************************************************/ -/**************************** Write social comment ***************************/ +/******************************** Write comment ******************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_WriteSocialComment (struct SocialComment *SocCom, - Soc_TopMessage_t TopMessage,long UsrCod, - bool ShowCommentAlone) // Social comment is shown alone, not in a list +static void TL_WriteComment (struct TL_Comment *SocCom, + TL_TopMessage_t TopMessage,long UsrCod, + bool ShowCommentAlone) // Comment is shown alone, not in a list { extern const char *Txt_Forum; extern const char *Txt_Course; @@ -2768,7 +2775,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom, NULL,Box_NOT_CLOSABLE); /***** Write sharer/commenter if distinct to author *****/ - Soc_WriteTopMessage (TopMessage,UsrCod); + TL_WriteTopMessage (TopMessage,UsrCod); fprintf (Gbl.F.Out,"
" "
" @@ -2785,7 +2792,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom, if (SocCom->PubCod <= 0 || SocCom->NotCod <= 0 || SocCom->UsrCod <= 0) - Ale_ShowAlert (Ale_ERROR,"Error in social comment."); + Ale_ShowAlert (Ale_ERROR,"Error in comment."); else { /***** Get author's data *****/ @@ -2795,7 +2802,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom, ItsMe = Usr_ItsMe (UsrDat.UsrCod); IAmTheAuthor = ItsMe; if (!IAmTheAuthor) - IAmAFaverOfThisSocCom = Soc_CheckIfCommIsFavedByUsr (SocCom->PubCod, + IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod); /***** Left: write author's photo *****/ @@ -2810,12 +2817,12 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom, fprintf (Gbl.F.Out,"
"); /* Write author's full name and nickname */ - Soc_WriteAuthorComment (&UsrDat); + TL_WriteAuthorComment (&UsrDat); /* Write date and time */ - Soc_WriteDateTime (SocCom->DateTimeUTC); + TL_WriteDateTime (SocCom->DateTimeUTC); - /* Write content of the social comment */ + /* Write content of the comment */ fprintf (Gbl.F.Out,"
"); Msg_WriteMsgContent (SocCom->Content,Cns_MAX_BYTES_LONG_TEXT,true,false); fprintf (Gbl.F.Out,"
"); @@ -2824,31 +2831,31 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom, Med_ShowMedia (&SocCom->Media,"TL_COMMENT_IMG_CONTAINER TL_COMMENT_WIDTH", "TL_COMMENT_IMG TL_COMMENT_WIDTH"); - /* Put icon to mark this social comment as favourite */ + /* Put icon to mark this comment as favourite */ if (IAmTheAuthor) // I am the author { /* Put disabled icon and list of users - who have marked this social comment as favourite */ - Soc_PutDisabledIconFav (SocCom->NumFavs); - Soc_ShowUsrsWhoHaveMarkedSocialCommAsFav (SocCom); + who have marked this comment as favourite */ + TL_PutDisabledIconFav (SocCom->NumFavs); + TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom); } else // I am not the author { fprintf (Gbl.F.Out,"
", Gbl.UniqueNameEncrypted,NumDiv); - if (IAmAFaverOfThisSocCom) // I have favourited this social comment + if (IAmAFaverOfThisSocCom) // I have favourited this comment /* Put icon to unfav this publication and list of users */ - Soc_PutFormToUnfavSocialComment (SocCom); + TL_PutFormToUnfavComment (SocCom); else // I am not a favouriter /* Put icon to fav this publication and list of users */ - Soc_PutFormToFavSocialComment (SocCom); + TL_PutFormToFavComment (SocCom); fprintf (Gbl.F.Out,"
"); } - /* Put icon to remove this social comment */ + /* Put icon to remove this comment */ if (IAmTheAuthor && !ShowCommentAlone) - Soc_PutFormToRemoveComment (SocCom->PubCod); + TL_PutFormToRemoveComment (SocCom->PubCod); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); @@ -2866,11 +2873,11 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom, } /*****************************************************************************/ -/****** Write name and nickname of author of a comment to a social note ******/ +/********* Write name and nickname of author of a comment to a note **********/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_WriteAuthorComment (struct UsrData *UsrDat) +static void TL_WriteAuthorComment (struct UsrData *UsrDat) { extern const char *Txt_My_public_profile; extern const char *Txt_Another_user_s_profile; @@ -2900,17 +2907,17 @@ static void Soc_WriteAuthorComment (struct UsrData *UsrDat) } /*****************************************************************************/ -/********************** Form to remove social comment ************************/ +/************************* Form to remove comment ****************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToRemoveComment (long PubCod) +static void TL_PutFormToRemoveComment (long PubCod) { extern const char *Txt_Remove; - /***** Form to remove social publication *****/ - Soc_FormStart (ActReqRemSocComGbl,ActReqRemSocComUsr); - Soc_PutHiddenParamPubCod (PubCod); + /***** Form to remove publication *****/ + TL_FormStart (ActReqRemSocComGbl,ActReqRemSocComUsr); + TL_PutHiddenParamPubCod (PubCod); Ico_PutDivIconLink ("TL_ICO_REM", "trash.svg",Txt_Remove); Frm_EndForm (); @@ -2920,17 +2927,17 @@ static void Soc_PutFormToRemoveComment (long PubCod) /*********************** Put disabled icon to share **************************/ /*****************************************************************************/ -static void Soc_PutDisabledIconShare (unsigned NumShared) +static void TL_PutDisabledIconShare (unsigned NumShared) { - extern const char *Txt_SOCIAL_NOTE_Shared_by_X_USERS; - extern const char *Txt_SOCIAL_NOTE_Not_shared_by_anyone; + extern const char *Txt_TIMELINE_NOTE_Shared_by_X_USERS; + extern const char *Txt_TIMELINE_NOTE_Not_shared_by_anyone; if (NumShared) snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_SOCIAL_NOTE_Shared_by_X_USERS, + Txt_TIMELINE_NOTE_Shared_by_X_USERS, NumShared); else - Str_Copy (Gbl.Title,Txt_SOCIAL_NOTE_Not_shared_by_anyone, + Str_Copy (Gbl.Title,Txt_TIMELINE_NOTE_Not_shared_by_anyone, Lay_MAX_BYTES_TITLE); /***** Disabled icon to share *****/ @@ -2942,17 +2949,17 @@ static void Soc_PutDisabledIconShare (unsigned NumShared) /****************** Put disabled icon to mark as favourite *******************/ /*****************************************************************************/ -static void Soc_PutDisabledIconFav (unsigned NumFavs) +static void TL_PutDisabledIconFav (unsigned NumFavs) { - extern const char *Txt_SOCIAL_NOTE_Favourited_by_X_USERS; - extern const char *Txt_SOCIAL_NOTE_Not_favourited_by_anyone; + extern const char *Txt_TIMELINE_NOTE_Favourited_by_X_USERS; + extern const char *Txt_TIMELINE_NOTE_Not_favourited_by_anyone; if (NumFavs) snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_SOCIAL_NOTE_Favourited_by_X_USERS, + Txt_TIMELINE_NOTE_Favourited_by_X_USERS, NumFavs); else - Str_Copy (Gbl.Title,Txt_SOCIAL_NOTE_Not_favourited_by_anyone, + Str_Copy (Gbl.Title,Txt_TIMELINE_NOTE_Not_favourited_by_anyone, Lay_MAX_BYTES_TITLE); /***** Disabled icon to mark as favourite *****/ @@ -2961,190 +2968,190 @@ static void Soc_PutDisabledIconFav (unsigned NumFavs) } /*****************************************************************************/ -/************************* Form to share social note *************************/ +/***************************** Form to share note ****************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToShareSocialNote (const struct SocialNote *SocNot) +static void TL_PutFormToShareNote (const struct TL_Note *SocNot) { extern const char *Txt_Share; char ParamCod[6 + 1 + 10 + 1]; - /***** Form and icon to mark social note as favourite *****/ + /***** Form and icon to mark note as favourite *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); - Soc_FormFavSha (ActShaSocNotGbl,ActShaSocNotUsr,ParamCod, + TL_FormFavSha (ActShaSocNotGbl,ActShaSocNotUsr,ParamCod, "share-alt.svg",Txt_Share); - /***** Who have shared this social note *****/ - Soc_ShowUsrsWhoHaveSharedSocialNote (SocNot); + /***** Who have shared this note *****/ + TL_ShowUsrsWhoHaveSharedNote (SocNot); } /*****************************************************************************/ -/*************** Form to unshare (stop sharing) social note ******************/ +/****************** Form to unshare (stop sharing) note **********************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToUnshareSocialNote (const struct SocialNote *SocNot) +static void TL_PutFormToUnshareNote (const struct TL_Note *SocNot) { - extern const char *Txt_SOCIAL_NOTE_Shared; + extern const char *Txt_TIMELINE_NOTE_Shared; char ParamCod[6 + 1 + 10 + 1]; - /***** Form and icon to mark social note as favourite *****/ + /***** Form and icon to mark note as favourite *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); - Soc_FormFavSha (ActUnsSocNotGbl,ActUnsSocNotUsr,ParamCod, - "share-alt-green.svg",Txt_SOCIAL_NOTE_Shared); + TL_FormFavSha (ActUnsSocNotGbl,ActUnsSocNotUsr,ParamCod, + "share-alt-green.svg",Txt_TIMELINE_NOTE_Shared); - /***** Who have shared this social note *****/ - Soc_ShowUsrsWhoHaveSharedSocialNote (SocNot); + /***** Who have shared this note *****/ + TL_ShowUsrsWhoHaveSharedNote (SocNot); } /*****************************************************************************/ -/*************** Form to fav (mark as favourite) social note *****************/ +/******************* Form to fav (mark as favourite) note ********************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToFavSocialNote (const struct SocialNote *SocNot) +static void TL_PutFormToFavNote (const struct TL_Note *SocNot) { extern const char *Txt_Mark_as_favourite; char ParamCod[6 + 1 + 10 + 1]; - /***** Form and icon to mark social note as favourite *****/ + /***** Form and icon to mark note as favourite *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); - Soc_FormFavSha (ActFavSocNotGbl,ActFavSocNotUsr,ParamCod, + TL_FormFavSha (ActFavSocNotGbl,ActFavSocNotUsr,ParamCod, "heart.svg",Txt_Mark_as_favourite); - /***** Who have marked this social note as favourite *****/ - Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (SocNot); + /***** Who have marked this note as favourite *****/ + TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot); } /*****************************************************************************/ -/*********** Form to unfav (remove mark as favourite) social note ************/ +/*************** Form to unfav (remove mark as favourite) note ***************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToUnfavSocialNote (const struct SocialNote *SocNot) +static void TL_PutFormToUnfavNote (const struct TL_Note *SocNot) { - extern const char *Txt_SOCIAL_NOTE_Favourite; + extern const char *Txt_TIMELINE_NOTE_Favourite; char ParamCod[6 + 1 + 10 + 1]; - /***** Form and icon to unfav (remove mark as favourite) social note *****/ + /***** Form and icon to unfav (remove mark as favourite) note *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); - Soc_FormFavSha (ActUnfSocNotGbl,ActUnfSocNotUsr,ParamCod, - "heart-red.svg",Txt_SOCIAL_NOTE_Favourite); + TL_FormFavSha (ActUnfSocNotGbl,ActUnfSocNotUsr,ParamCod, + "heart-red.svg",Txt_TIMELINE_NOTE_Favourite); - /***** Who have marked this social note as favourite *****/ - Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (SocNot); + /***** Who have marked this note as favourite *****/ + TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot); } /*****************************************************************************/ -/***************** Form to mark a social comment as favourite ****************/ +/********************* Form to mark a comment as favourite *******************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToFavSocialComment (struct SocialComment *SocCom) +static void TL_PutFormToFavComment (struct TL_Comment *SocCom) { extern const char *Txt_Mark_as_favourite; char ParamCod[6 + 1 + 10 + 1]; - /***** Form and icon to mark social comment as favourite *****/ + /***** Form and icon to mark comment as favourite *****/ sprintf (ParamCod,"PubCod=%ld",SocCom->PubCod); - Soc_FormFavSha (ActFavSocComGbl,ActFavSocComUsr,ParamCod, + TL_FormFavSha (ActFavSocComGbl,ActFavSocComUsr,ParamCod, "heart.svg",Txt_Mark_as_favourite); - /***** Show who have marked this social comment as favourite *****/ - Soc_ShowUsrsWhoHaveMarkedSocialCommAsFav (SocCom); + /***** Show who have marked this comment as favourite *****/ + TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom); } /*****************************************************************************/ -/********* Form to unfav (remove mark as favourite) social comment ***********/ +/************* Form to unfav (remove mark as favourite) comment **************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToUnfavSocialComment (struct SocialComment *SocCom) +static void TL_PutFormToUnfavComment (struct TL_Comment *SocCom) { - extern const char *Txt_SOCIAL_NOTE_Favourite; + extern const char *Txt_TIMELINE_NOTE_Favourite; char ParamCod[6 + 1 + 10 + 1]; - /***** Form and icon to unfav (remove mark as favourite) social comment *****/ + /***** Form and icon to unfav (remove mark as favourite) comment *****/ sprintf (ParamCod,"PubCod=%ld",SocCom->PubCod); - Soc_FormFavSha (ActUnfSocComGbl,ActUnfSocComUsr,ParamCod, - "heart-red.svg",Txt_SOCIAL_NOTE_Favourite); + TL_FormFavSha (ActUnfSocComGbl,ActUnfSocComUsr,ParamCod, + "heart-red.svg",Txt_TIMELINE_NOTE_Favourite); - /***** Show who have marked this social comment as favourite *****/ - Soc_ShowUsrsWhoHaveMarkedSocialCommAsFav (SocCom); + /***** Show who have marked this comment as favourite *****/ + TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom); } /*****************************************************************************/ -/******************** Form to remove social publication **********************/ +/************************ Form to remove publication *************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_PutFormToRemoveSocialPublication (long NotCod) +static void TL_PutFormToRemovePublication (long NotCod) { extern const char *Txt_Remove; - /***** Form to remove social publication *****/ - Soc_FormStart (ActReqRemSocPubGbl,ActReqRemSocPubUsr); - Soc_PutHiddenParamNotCod (NotCod); + /***** Form to remove publication *****/ + TL_FormStart (ActReqRemSocPubGbl,ActReqRemSocPubUsr); + TL_PutHiddenParamNotCod (NotCod); Ico_PutDivIconLink ("TL_ICO_REM", "trash.svg",Txt_Remove); Frm_EndForm (); } /*****************************************************************************/ -/************** Put parameter with the code of a social note *****************/ +/****************** Put parameter with the code of a note ********************/ /*****************************************************************************/ -static void Soc_PutHiddenParamNotCod (long NotCod) +static void TL_PutHiddenParamNotCod (long NotCod) { Par_PutHiddenParamLong ("NotCod",NotCod); } /*****************************************************************************/ -/*********** Put parameter with the code of a social publication *************/ +/*************** Put parameter with the code of a publication ****************/ /*****************************************************************************/ -void Soc_PutHiddenParamPubCod (long PubCod) +void TL_PutHiddenParamPubCod (long PubCod) { Par_PutHiddenParamLong ("PubCod",PubCod); } /*****************************************************************************/ -/************** Get parameter with the code of a social note *****************/ +/****************** Get parameter with the code of a note ********************/ /*****************************************************************************/ -static long Soc_GetParamNotCod (void) +static long TL_GetParamNotCod (void) { - /***** Get social note code *****/ + /***** Get note code *****/ return Par_GetParToLong ("NotCod"); } /*****************************************************************************/ -/************ Get parameter with the code of a social publication ************/ +/**************** Get parameter with the code of a publication ***************/ /*****************************************************************************/ -static long Soc_GetParamPubCod (void) +static long TL_GetParamPubCod (void) { - /***** Get social comment code *****/ + /***** Get comment code *****/ return Par_GetParToLong ("PubCod"); } /*****************************************************************************/ -/*************************** Comment a social note ***************************/ +/******************************* Comment a note ******************************/ /*****************************************************************************/ -void Soc_ReceiveCommentGbl (void) +void TL_ReceiveCommentGbl (void) { long NotCod; - /***** Receive comment in a social note *****/ - NotCod = Soc_ReceiveComment (); + /***** Receive comment in a note *****/ + NotCod = TL_ReceiveComment (); /***** Write updated timeline after commenting (global) *****/ - Soc_ShowTimelineGblHighlightingNot (NotCod); + TL_ShowTimelineGblHighlightingNot (NotCod); } -void Soc_ReceiveCommentUsr (void) +void TL_ReceiveCommentUsr (void) { long NotCod; @@ -3155,29 +3162,29 @@ void Soc_ReceiveCommentUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Start section *****/ - Lay_StartSection (Soc_TIMELINE_SECTION_ID); + Lay_StartSection (TL_TIMELINE_SECTION_ID); - /***** Receive comment in a social note *****/ - NotCod = Soc_ReceiveComment (); + /***** Receive comment in a note *****/ + NotCod = TL_ReceiveComment (); /***** Write updated timeline after commenting (user) *****/ - Soc_ShowTimelineUsrHighlightingNot (NotCod); + TL_ShowTimelineUsrHighlightingNot (NotCod); /***** End section *****/ Lay_EndSection (); } -static long Soc_ReceiveComment (void) +static long TL_ReceiveComment (void) { extern const char *Txt_The_original_post_no_longer_exists; char Content[Cns_MAX_BYTES_LONG_TEXT + 1]; struct Media Media; - struct SocialNote SocNot; - struct SocialPublication SocPub; + struct TL_Note SocNot; + struct TL_Publication SocPub; - /***** Get data of social note *****/ - SocNot.NotCod = Soc_GetParamNotCod (); - Soc_GetDataOfSocialNotByCod (&SocNot); + /***** Get data of note *****/ + SocNot.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&SocNot); if (SocNot.NotCod > 0) { @@ -3189,9 +3196,9 @@ static long Soc_ReceiveComment (void) Med_MediaConstructor (&Media); /***** Get attached image (action, file and title) *****/ - Media.Width = Soc_IMAGE_SAVED_MAX_WIDTH; - Media.Height = Soc_IMAGE_SAVED_MAX_HEIGHT; - Media.Quality = Soc_IMAGE_SAVED_QUALITY; + Media.Width = TL_IMAGE_SAVED_MAX_WIDTH; + Media.Height = TL_IMAGE_SAVED_MAX_HEIGHT; + Media.Quality = TL_IMAGE_SAVED_QUALITY; Med_GetMediaFromForm (-1,&Media,NULL); if (Content[0] || // Text not empty @@ -3207,8 +3214,8 @@ static long Soc_ReceiveComment (void) /* Insert into publications */ SocPub.NotCod = SocNot.NotCod; SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; - SocPub.PubType = Soc_PUB_COMMENT_TO_NOTE; - Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod + SocPub.PubType = TL_PUB_COMMENT_TO_NOTE; + TL_PublishNoteInTimeline (&SocPub); // Set SocPub.PubCod /* Insert comment content in the database */ DB_QueryINSERT ("can not store comment content", @@ -3233,9 +3240,9 @@ static long Soc_ReceiveComment (void) /***** Analyze content and store notifications about mentions *****/ Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (SocPub.PubCod,Content); - /***** Show the social note just commented *****/ - Soc_WriteSocialNote (&SocNot, - Soc_TOP_MESSAGE_COMMENTED,Gbl.Usrs.Me.UsrDat.UsrCod, + /***** Show the note just commented *****/ + TL_WriteNote (&SocNot, + TL_TOP_MESSAGE_COMMENTED,Gbl.Usrs.Me.UsrDat.UsrCod, true,true); } @@ -3249,129 +3256,129 @@ static long Soc_ReceiveComment (void) } /*****************************************************************************/ -/**************************** Share a social note ****************************/ +/******************************** Share a note *******************************/ /*****************************************************************************/ -void Soc_ShareSocialNoteGbl (void) +void TL_ShareNoteGbl (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; - /***** Mark social note as favourite *****/ - Soc_ShareSocialNote (&SocNot); + /***** Share note *****/ + TL_ShareNote (&SocNot); /***** Write HTML inside DIV with form to unshare *****/ - Soc_PutFormToUnshareSocialNote (&SocNot); + TL_PutFormToUnshareNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -void Soc_ShareSocialNoteUsr (void) +void TL_ShareNoteUsr (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); - /***** Share social note *****/ - Soc_ShareSocialNote (&SocNot); + /***** Share note *****/ + TL_ShareNote (&SocNot); /***** Write HTML inside DIV with form to unshare *****/ - Soc_PutFormToUnshareSocialNote (&SocNot); + TL_PutFormToUnshareNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -static void Soc_ShareSocialNote (struct SocialNote *SocNot) +static void TL_ShareNote (struct TL_Note *SocNot) { extern const char *Txt_The_original_post_no_longer_exists; - struct SocialPublication SocPub; + struct TL_Publication SocPub; bool ItsMe; long OriginalPubCod; - /***** Get data of social note *****/ - SocNot->NotCod = Soc_GetParamNotCod (); - Soc_GetDataOfSocialNotByCod (SocNot); + /***** Get data of note *****/ + SocNot->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (SocNot); if (SocNot->NotCod > 0) { ItsMe = Usr_ItsMe (SocNot->UsrCod); if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (!Soc_CheckIfNoteIsSharedByUsr (SocNot->NotCod, + if (!TL_CheckIfNoteIsSharedByUsr (SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // Not yet shared by me { - /***** Share (publish social note in timeline) *****/ + /***** Share (publish note in timeline) *****/ SocPub.NotCod = SocNot->NotCod; SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; - SocPub.PubType = Soc_PUB_SHARED_NOTE; - Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod + SocPub.PubType = TL_PUB_SHARED_NOTE; + TL_PublishNoteInTimeline (&SocPub); // Set SocPub.PubCod - /* Update number of times this social note is shared */ - Soc_UpdateNumTimesANoteHasBeenShared (SocNot); + /* Update number of times this note is shared */ + TL_UpdateNumTimesANoteHasBeenShared (SocNot); /**** Create notification about shared post for the author of the post ***/ - OriginalPubCod = Soc_GetPubCodOfOriginalSocialNote (SocNot->NotCod); + OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); if (OriginalPubCod > 0) - Soc_CreateNotifToAuthor (SocNot->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_SHARE); + TL_CreateNotifToAuthor (SocNot->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_SHARE); } } } /*****************************************************************************/ -/********************** Mark a social note as favourite **********************/ +/************************** Mark a note as favourite *************************/ /*****************************************************************************/ -void Soc_FavSocialNoteGbl (void) +void TL_FavNoteGbl (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; - /***** Mark social note as favourite *****/ - Soc_FavSocialNote (&SocNot); + /***** Mark note as favourite *****/ + TL_FavNote (&SocNot); /***** Write HTML inside DIV with form to unfav *****/ - Soc_PutFormToUnfavSocialNote (&SocNot); + TL_PutFormToUnfavNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -void Soc_FavSocialNoteUsr (void) +void TL_FavNoteUsr (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); - /***** Mark social note as favourite *****/ - Soc_FavSocialNote (&SocNot); + /***** Mark note as favourite *****/ + TL_FavNote (&SocNot); /***** Write HTML inside DIV with form to unfav *****/ - Soc_PutFormToUnfavSocialNote (&SocNot); + TL_PutFormToUnfavNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -static void Soc_FavSocialNote (struct SocialNote *SocNot) +static void TL_FavNote (struct TL_Note *SocNot) { bool ItsMe; long OriginalPubCod; - /***** Get data of social note *****/ - SocNot->NotCod = Soc_GetParamNotCod (); - Soc_GetDataOfSocialNotByCod (SocNot); + /***** Get data of note *****/ + SocNot->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (SocNot); if (SocNot->NotCod > 0) { ItsMe = Usr_ItsMe (SocNot->UsrCod); if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (!Soc_CheckIfNoteIsFavedByUsr (SocNot->NotCod, + if (!TL_CheckIfNoteIsFavedByUsr (SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the note { /***** Mark as favourite in database *****/ - DB_QueryINSERT ("can not favourite social note", + DB_QueryINSERT ("can not favourite note", "INSERT IGNORE INTO social_notes_fav" " (NotCod,UsrCod,TimeFav)" " VALUES" @@ -3379,73 +3386,73 @@ static void Soc_FavSocialNote (struct SocialNote *SocNot) SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); - /***** Update number of times this social note is favourited**** */ - Soc_GetNumTimesANoteHasBeenFav (SocNot); + /***** Update number of times this note is favourited *****/ + TL_GetNumTimesANoteHasBeenFav (SocNot); /***** Create notification about favourite post for the author of the post *****/ - OriginalPubCod = Soc_GetPubCodOfOriginalSocialNote (SocNot->NotCod); + OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); if (OriginalPubCod > 0) - Soc_CreateNotifToAuthor (SocNot->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_FAV); + TL_CreateNotifToAuthor (SocNot->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_FAV); } } } /*****************************************************************************/ -/********************* Mark a social comment as favourite ********************/ +/************************ Mark a comment as favourite ************************/ /*****************************************************************************/ -void Soc_FavSocialCommentGbl (void) +void TL_FavCommentGbl (void) { - struct SocialComment SocCom; + struct TL_Comment SocCom; - /***** Mark social comment as favourite *****/ - Soc_FavSocialComment (&SocCom); + /***** Mark comment as favourite *****/ + TL_FavComment (&SocCom); /***** Write HTML inside DIV with form to unfav *****/ - Soc_PutFormToUnfavSocialComment (&SocCom); + TL_PutFormToUnfavComment (&SocCom); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -void Soc_FavSocialCommentUsr (void) +void TL_FavCommentUsr (void) { - struct SocialComment SocCom; + struct TL_Comment SocCom; /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); - /***** Mark social comment as favourite *****/ - Soc_FavSocialComment (&SocCom); + /***** Mark comment as favourite *****/ + TL_FavComment (&SocCom); /***** Write HTML inside DIV with form to unfav *****/ - Soc_PutFormToUnfavSocialComment (&SocCom); + TL_PutFormToUnfavComment (&SocCom); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -static void Soc_FavSocialComment (struct SocialComment *SocCom) +static void TL_FavComment (struct TL_Comment *SocCom) { bool ItsMe; /***** Initialize image *****/ Med_MediaConstructor (&SocCom->Media); - /***** Get data of social comment *****/ - SocCom->PubCod = Soc_GetParamPubCod (); - Soc_GetDataOfSocialComByCod (SocCom); + /***** Get data of comment *****/ + SocCom->PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (SocCom); if (SocCom->PubCod > 0) { ItsMe = Usr_ItsMe (SocCom->UsrCod); if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (!Soc_CheckIfCommIsFavedByUsr (SocCom->PubCod, + if (!TL_CheckIfCommIsFavedByUsr (SocCom->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the comment { /***** Mark as favourite in database *****/ - DB_QueryINSERT ("can not favourite social comment", + DB_QueryINSERT ("can not favourite comment", "INSERT IGNORE INTO social_comments_fav" " (PubCod,UsrCod,TimeFav)" " VALUES" @@ -3453,12 +3460,12 @@ static void Soc_FavSocialComment (struct SocialComment *SocCom) SocCom->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod); - /* Update number of times this social comment is favourited */ - Soc_GetNumTimesACommHasBeenFav (SocCom); + /* Update number of times this comment is favourited */ + TL_GetNumTimesACommHasBeenFav (SocCom); /**** Create notification about favourite post for the author of the post ***/ - Soc_CreateNotifToAuthor (SocCom->UsrCod,SocCom->PubCod,Ntf_EVENT_TIMELINE_FAV); + TL_CreateNotifToAuthor (SocCom->UsrCod,SocCom->PubCod,Ntf_EVENT_TIMELINE_FAV); } } @@ -3470,7 +3477,7 @@ static void Soc_FavSocialComment (struct SocialComment *SocCom) /*********** Create a notification for the author of a post/comment **********/ /*****************************************************************************/ -static void Soc_CreateNotifToAuthor (long AuthorCod,long PubCod, +static void TL_CreateNotifToAuthor (long AuthorCod,long PubCod, Ntf_NotifyEvent_t NotifyEvent) { struct UsrData UsrDat; @@ -3502,73 +3509,73 @@ static void Soc_CreateNotifToAuthor (long AuthorCod,long PubCod, } /*****************************************************************************/ -/***************** Unshare a previously shared social note *******************/ +/******************** Unshare a previously shared note ***********************/ /*****************************************************************************/ -void Soc_UnshareSocialNoteGbl (void) +void TL_UnshareNoteGbl (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; - /***** Unshare social note *****/ - Soc_UnshareSocialNote (&SocNot); + /***** Unshare note *****/ + TL_UnshareNote (&SocNot); /***** Write HTML inside DIV with form to share *****/ - Soc_PutFormToShareSocialNote (&SocNot); + TL_PutFormToShareNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -void Soc_UnshareSocialNoteUsr (void) +void TL_UnshareNoteUsr (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); - /***** Share social note *****/ - Soc_UnshareSocialNote (&SocNot); + /***** Share note *****/ + TL_UnshareNote (&SocNot); /***** Write HTML inside DIV with form to share *****/ - Soc_PutFormToShareSocialNote (&SocNot); + TL_PutFormToShareNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -static void Soc_UnshareSocialNote (struct SocialNote *SocNot) +static void TL_UnshareNote (struct TL_Note *SocNot) { extern const char *Txt_The_original_post_no_longer_exists; long OriginalPubCod; bool ItsMe; - /***** Get data of social note *****/ - SocNot->NotCod = Soc_GetParamNotCod (); - Soc_GetDataOfSocialNotByCod (SocNot); + /***** Get data of note *****/ + SocNot->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (SocNot); if (SocNot->NotCod > 0) { ItsMe = Usr_ItsMe (SocNot->UsrCod); if (SocNot->NumShared && Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (Soc_CheckIfNoteIsSharedByUsr (SocNot->NotCod, + if (TL_CheckIfNoteIsSharedByUsr (SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I am a sharer { - /***** Delete social publication from database *****/ - DB_QueryDELETE ("can not remove a social publication", + /***** Delete publication from database *****/ + DB_QueryDELETE ("can not remove a publication", "DELETE FROM social_pubs" " WHERE NotCod=%ld" " AND PublisherCod=%ld" " AND PubType=%u", SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod, - (unsigned) Soc_PUB_SHARED_NOTE); + (unsigned) TL_PUB_SHARED_NOTE); - /***** Update number of times this social note is shared *****/ - Soc_UpdateNumTimesANoteHasBeenShared (SocNot); + /***** Update number of times this note is shared *****/ + TL_UpdateNumTimesANoteHasBeenShared (SocNot); - /***** Mark possible notifications on this social note as removed *****/ - OriginalPubCod = Soc_GetPubCodOfOriginalSocialNote (SocNot->NotCod); + /***** Mark possible notifications on this note as removed *****/ + OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); if (OriginalPubCod > 0) Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE,OriginalPubCod); } @@ -3576,69 +3583,69 @@ static void Soc_UnshareSocialNote (struct SocialNote *SocNot) } /*****************************************************************************/ -/******* Stop marking as favourite a previously favourited social note *******/ +/*********** Stop marking as favourite a previously favourited note **********/ /*****************************************************************************/ -void Soc_UnfavSocialNoteGbl (void) +void TL_UnfavNoteGbl (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; - /***** Stop marking as favourite a previously favourited social note *****/ - Soc_UnfavSocialNote (&SocNot); + /***** Stop marking as favourite a previously favourited note *****/ + TL_UnfavNote (&SocNot); /***** Write HTML inside DIV with form to fav *****/ - Soc_PutFormToFavSocialNote (&SocNot); + TL_PutFormToFavNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -void Soc_UnfavSocialNoteUsr (void) +void TL_UnfavNoteUsr (void) { - struct SocialNote SocNot; + struct TL_Note SocNot; /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); - /***** Unfav a social note previously marked as favourite *****/ - Soc_UnfavSocialNote (&SocNot); + /***** Unfav a note previously marked as favourite *****/ + TL_UnfavNote (&SocNot); /***** Write HTML inside DIV with form to fav *****/ - Soc_PutFormToFavSocialNote (&SocNot); + TL_PutFormToFavNote (&SocNot); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -static void Soc_UnfavSocialNote (struct SocialNote *SocNot) +static void TL_UnfavNote (struct TL_Note *SocNot) { long OriginalPubCod; bool ItsMe; - /***** Get data of social note *****/ - SocNot->NotCod = Soc_GetParamNotCod (); - Soc_GetDataOfSocialNotByCod (SocNot); + /***** Get data of note *****/ + SocNot->NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (SocNot); if (SocNot->NotCod > 0) { ItsMe = Usr_ItsMe (SocNot->UsrCod); if (SocNot->NumFavs && Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (Soc_CheckIfNoteIsFavedByUsr (SocNot->NotCod, + if (TL_CheckIfNoteIsFavedByUsr (SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the note { /***** Delete the mark as favourite from database *****/ - DB_QueryDELETE ("can not unfavourite social note", + DB_QueryDELETE ("can not unfavourite note", "DELETE FROM social_notes_fav" " WHERE NotCod=%ld AND UsrCod=%ld", SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); - /***** Update number of times this social note is favourited *****/ - Soc_GetNumTimesANoteHasBeenFav (SocNot); + /***** Update number of times this note is favourited *****/ + TL_GetNumTimesANoteHasBeenFav (SocNot); - /***** Mark possible notifications on this social note as removed *****/ - OriginalPubCod = Soc_GetPubCodOfOriginalSocialNote (SocNot->NotCod); + /***** Mark possible notifications on this note as removed *****/ + OriginalPubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); if (OriginalPubCod > 0) Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,OriginalPubCod); } @@ -3646,70 +3653,70 @@ static void Soc_UnfavSocialNote (struct SocialNote *SocNot) } /*****************************************************************************/ -/***** Stop marking as favourite a previously favourited social comment *****/ +/********* Stop marking as favourite a previously favourited comment *********/ /*****************************************************************************/ -void Soc_UnfavSocialCommentGbl (void) +void TL_UnfavCommentGbl (void) { - struct SocialComment SocCom; + struct TL_Comment SocCom; - /***** Stop marking as favourite a previously favourited social comment *****/ - Soc_UnfavSocialComment (&SocCom); + /***** Stop marking as favourite a previously favourited comment *****/ + TL_UnfavComment (&SocCom); /***** Write HTML inside DIV with form to fav *****/ - Soc_PutFormToFavSocialComment (&SocCom); + TL_PutFormToFavComment (&SocCom); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -void Soc_UnfavSocialCommentUsr (void) +void TL_UnfavCommentUsr (void) { - struct SocialComment SocCom; + struct TL_Comment SocCom; /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); - /***** Unfav a social comment previously marked as favourite *****/ - Soc_UnfavSocialComment (&SocCom); + /***** Unfav a comment previously marked as favourite *****/ + TL_UnfavComment (&SocCom); /***** Write HTML inside DIV with form to fav *****/ - Soc_PutFormToFavSocialComment (&SocCom); + TL_PutFormToFavComment (&SocCom); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; } -static void Soc_UnfavSocialComment (struct SocialComment *SocCom) +static void TL_UnfavComment (struct TL_Comment *SocCom) { bool ItsMe; /***** Initialize image *****/ Med_MediaConstructor (&SocCom->Media); - /***** Get data of social comment *****/ - SocCom->PubCod = Soc_GetParamPubCod (); - Soc_GetDataOfSocialComByCod (SocCom); + /***** Get data of comment *****/ + SocCom->PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (SocCom); if (SocCom->PubCod > 0) { ItsMe = Usr_ItsMe (SocCom->UsrCod); if (SocCom->NumFavs && Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author - if (Soc_CheckIfCommIsFavedByUsr (SocCom->PubCod, + if (TL_CheckIfCommIsFavedByUsr (SocCom->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the comment { /***** Delete the mark as favourite from database *****/ - DB_QueryDELETE ("can not unfavourite social comment", + DB_QueryDELETE ("can not unfavourite comment", "DELETE FROM social_comments_fav" " WHERE PubCod=%ld AND UsrCod=%ld", SocCom->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod); - /***** Update number of times this social comment is favourited *****/ - Soc_GetNumTimesACommHasBeenFav (SocCom); + /***** Update number of times this comment is favourited *****/ + TL_GetNumTimesACommHasBeenFav (SocCom); - /***** Mark possible notifications on this social comment as removed *****/ + /***** Mark possible notifications on this comment as removed *****/ Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,SocCom->PubCod); } } @@ -3719,19 +3726,19 @@ static void Soc_UnfavSocialComment (struct SocialComment *SocCom) } /*****************************************************************************/ -/******************* Request the removal of a social note ********************/ +/*********************** Request the removal of a note ***********************/ /*****************************************************************************/ -void Soc_RequestRemSocialNoteGbl (void) +void TL_RequestRemNoteGbl (void) { - /***** Request the removal of social note *****/ - Soc_RequestRemovalSocialNote (); + /***** Request the removal of note *****/ + TL_RequestRemovalNote (); /***** Write timeline again (global) *****/ - Soc_ShowTimelineGbl2 (); + TL_ShowTimelineGbl2 (); } -void Soc_RequestRemSocialNoteUsr (void) +void TL_RequestRemNoteUsr (void) { /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); @@ -3740,53 +3747,53 @@ void Soc_RequestRemSocialNoteUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Start section *****/ - Lay_StartSection (Soc_TIMELINE_SECTION_ID); + Lay_StartSection (TL_TIMELINE_SECTION_ID); - /***** Request the removal of social note *****/ - Soc_RequestRemovalSocialNote (); + /***** Request the removal of note *****/ + TL_RequestRemovalNote (); /***** Write timeline again (user) *****/ - Soc_ShowTimelineUsr (); + TL_ShowTimelineUsr (); /***** End section *****/ Lay_EndSection (); } -static void Soc_RequestRemovalSocialNote (void) +static void TL_RequestRemovalNote (void) { 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 SocialNote SocNot; + struct TL_Note SocNot; bool ItsMe; - /***** Get data of social note *****/ - SocNot.NotCod = Soc_GetParamNotCod (); - Soc_GetDataOfSocialNotByCod (&SocNot); + /***** Get data of note *****/ + SocNot.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&SocNot); if (SocNot.NotCod > 0) { ItsMe = Usr_ItsMe (SocNot.UsrCod); if (ItsMe) // I am the author of this note { - /***** Show question and button to remove social note *****/ + /***** Show question and button to remove note *****/ /* Start alert */ Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_post); - /* Show social note */ - Soc_WriteSocialNote (&SocNot, - Soc_TOP_MESSAGE_NONE,-1L, + /* Show note */ + TL_WriteNote (&SocNot, + TL_TOP_MESSAGE_NONE,-1L, false,true); /* End alert */ - Gbl.Social.NotCod = SocNot.NotCod; // Social note to be removed + Gbl.Timeline.NotCod = SocNot.NotCod; // Note to be removed if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) Ale_ShowAlertAndButton2 (ActRemSocPubUsr,"timeline",NULL, - Soc_PutParamsRemoveSocialNote, + TL_PutParamsRemoveNote, Btn_REMOVE_BUTTON,Txt_Remove); else Ale_ShowAlertAndButton2 (ActRemSocPubGbl,NULL,NULL, - Soc_PutParamsRemoveSocialNote, + TL_PutParamsRemoveNote, Btn_REMOVE_BUTTON,Txt_Remove); } } @@ -3795,32 +3802,32 @@ static void Soc_RequestRemovalSocialNote (void) } /*****************************************************************************/ -/****************** Put parameters to remove a social note *******************/ +/********************* Put parameters to remove a note ***********************/ /*****************************************************************************/ -static void Soc_PutParamsRemoveSocialNote (void) +static void TL_PutParamsRemoveNote (void) { if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) Usr_PutParamOtherUsrCodEncrypted (); else - Soc_PutParamWhichUsrs (); - Soc_PutHiddenParamNotCod (Gbl.Social.NotCod); + TL_PutParamWhichUsrs (); + TL_PutHiddenParamNotCod (Gbl.Timeline.NotCod); } /*****************************************************************************/ -/*************************** Remove a social note ****************************/ +/******************************* Remove a note *******************************/ /*****************************************************************************/ -void Soc_RemoveSocialNoteGbl (void) +void TL_RemoveNoteGbl (void) { - /***** Remove a social note *****/ - Soc_RemoveSocialNote (); + /***** Remove a note *****/ + TL_RemoveNote (); /***** Write updated timeline after removing (global) *****/ - Soc_ShowTimelineGbl2 (); + TL_ShowTimelineGbl2 (); } -void Soc_RemoveSocialNoteUsr (void) +void TL_RemoveNoteUsr (void) { /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); @@ -3829,40 +3836,40 @@ void Soc_RemoveSocialNoteUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Start section *****/ - Lay_StartSection (Soc_TIMELINE_SECTION_ID); + Lay_StartSection (TL_TIMELINE_SECTION_ID); - /***** Remove a social note *****/ - Soc_RemoveSocialNote (); + /***** Remove a note *****/ + TL_RemoveNote (); /***** Write updated timeline after removing (user) *****/ - Soc_ShowTimelineUsr (); + TL_ShowTimelineUsr (); /***** End section *****/ Lay_EndSection (); } -static void Soc_RemoveSocialNote (void) +static void TL_RemoveNote (void) { extern const char *Txt_The_original_post_no_longer_exists; extern const char *Txt_FORUM_Post_removed; - struct SocialNote SocNot; + struct TL_Note SocNot; bool ItsMe; - /***** Get data of social note *****/ - SocNot.NotCod = Soc_GetParamNotCod (); - Soc_GetDataOfSocialNotByCod (&SocNot); + /***** Get data of note *****/ + SocNot.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&SocNot); if (SocNot.NotCod > 0) { ItsMe = Usr_ItsMe (SocNot.UsrCod); if (ItsMe) // I am the author of this note { - if (SocNot.NoteType == Soc_NOTE_SOCIAL_POST) - /***** Remove image file associated to social post *****/ - Soc_RemoveImgFileFromSocialPost (SocNot.Cod); + if (SocNot.NoteType == TL_NOTE_POST) + /***** Remove image file associated to post *****/ + TL_RemoveImgFileFromPost (SocNot.Cod); - /***** Delete social note from database *****/ - Soc_RemoveASocialNoteFromDB (&SocNot); + /***** Delete note from database *****/ + TL_RemoveANoteFromDB (&SocNot); /***** Message of success *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_FORUM_Post_removed); @@ -3873,14 +3880,14 @@ static void Soc_RemoveSocialNote (void) } /*****************************************************************************/ -/************** Remove one file associated to a social post ******************/ +/***************** Remove one file associated to a post **********************/ /*****************************************************************************/ -static void Soc_RemoveImgFileFromSocialPost (long PstCod) +static void TL_RemoveImgFileFromPost (long PstCod) { MYSQL_RES *mysql_res; - /***** Get name of image associated to a social post from database *****/ + /***** Get name of image associated to a post from database *****/ if (DB_QuerySELECT (&mysql_res,"can not get image", "SELECT MediaName," // row[0] "MediaType" // row[1] @@ -3895,10 +3902,10 @@ static void Soc_RemoveImgFileFromSocialPost (long PstCod) } /*****************************************************************************/ -/******************* Remove a social note from database **********************/ +/*********************** Remove a note from database *************************/ /*****************************************************************************/ -static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot) +static void TL_RemoveANoteFromDB (struct TL_Note *SocNot) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -3907,9 +3914,9 @@ static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot) unsigned long NumCom; /***** Mark possible notifications on the publications - of this social note as removed *****/ - /* Mark notifications of the original social note as removed */ - PubCod = Soc_GetPubCodOfOriginalSocialNote (SocNot->NotCod); + of this note as removed *****/ + /* Mark notifications of the original note as removed */ + PubCod = TL_GetPubCodOfOriginalNote (SocNot->NotCod); if (PubCod > 0) { Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_COMMENT,PubCod); @@ -3918,19 +3925,20 @@ static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot) Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_MENTION,PubCod); } - /* Get comments of this social note */ - NumComments = DB_QuerySELECT (&mysql_res,"can not get social comments", - "SELECT PubCod FROM social_pubs" + /* Get comments of this note */ + NumComments = DB_QuerySELECT (&mysql_res,"can not get comments", + "SELECT PubCod" + " FROM social_pubs" " WHERE NotCod=%ld AND PubType=%u", SocNot->NotCod, - (unsigned) Soc_PUB_COMMENT_TO_NOTE); + (unsigned) TL_PUB_COMMENT_TO_NOTE); /* For each comment... */ for (NumCom = 0; NumCom < NumComments; NumCom++) { - /* Get code of social comment **/ + /* Get code of comment **/ row = mysql_fetch_row (mysql_res); PubCod = Str_ConvertStrCodToLongCod (row[0]); @@ -3948,67 +3956,71 @@ static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot) /***** Remove favs *****/ /* Remove favs for all comments in this note */ - DB_QueryDELETE ("can not remove favs for social note", + DB_QueryDELETE ("can not remove favs for note", "DELETE FROM social_comments_fav" " USING social_pubs,social_comments_fav" " WHERE social_pubs.NotCod=%ld" " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments_fav.PubCod", - SocNot->NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + SocNot->NotCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); /* Remove favs for this note */ - DB_QueryDELETE ("can not remove favs for social note", - "DELETE FROM social_notes_fav WHERE NotCod=%ld", + DB_QueryDELETE ("can not remove favs for note", + "DELETE FROM social_notes_fav" + " WHERE NotCod=%ld", SocNot->NotCod); - /***** Remove content of the comments of this social note *****/ - DB_QueryDELETE ("can not remove social comments", + /***** Remove content of the comments of this note *****/ + DB_QueryDELETE ("can not remove comments", "DELETE FROM social_comments" " USING social_pubs,social_comments" " WHERE social_pubs.NotCod=%ld" " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments.PubCod", - SocNot->NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + SocNot->NotCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); - /***** Remove all the social publications of this note *****/ - DB_QueryDELETE ("can not remove a social publication", - "DELETE FROM social_pubs WHERE NotCod=%ld", + /***** Remove all the publications of this note *****/ + DB_QueryDELETE ("can not remove a publication", + "DELETE FROM social_pubs" + " WHERE NotCod=%ld", SocNot->NotCod); - /***** Remove social note *****/ - DB_QueryDELETE ("can not remove a social note", + /***** Remove note *****/ + DB_QueryDELETE ("can not remove a note", "DELETE FROM social_notes" " WHERE NotCod=%ld" " AND UsrCod=%ld", // Extra check: I am the author SocNot->NotCod, Gbl.Usrs.Me.UsrDat.UsrCod); - if (SocNot->NoteType == Soc_NOTE_SOCIAL_POST) - /***** Remove social post *****/ - DB_QueryDELETE ("can not remove a social post", - "DELETE FROM social_posts WHERE PstCod=%ld", + if (SocNot->NoteType == TL_NOTE_POST) + /***** Remove post *****/ + DB_QueryDELETE ("can not remove a post", + "DELETE FROM social_posts" + " WHERE PstCod=%ld", SocNot->Cod); - /***** Reset social note *****/ - Soc_ResetSocialNote (SocNot); + /***** Reset note *****/ + TL_ResetNote (SocNot); } /*****************************************************************************/ -/******************* Get code of social note of a publication ****************/ +/*********************** Get code of note of a publication *******************/ /*****************************************************************************/ -static long Soc_GetNotCodOfSocialPublication (long PubCod) +static long TL_GetNotCodOfPublication (long PubCod) { MYSQL_RES *mysql_res; MYSQL_ROW row; long NotCod = -1L; - /***** Get code of social note from database *****/ - if (DB_QuerySELECT (&mysql_res,"can not get code of social note", - "SELECT NotCod FROM social_pubs WHERE PubCod=%ld", + /***** Get code of note from database *****/ + if (DB_QuerySELECT (&mysql_res,"can not get code of note", + "SELECT NotCod FROM social_pubs" + " WHERE PubCod=%ld", PubCod) == 1) // Result should have a unique row { - /* Get code of social note */ + /* Get code of note */ row = mysql_fetch_row (mysql_res); NotCod = Str_ConvertStrCodToLongCod (row[0]); } @@ -4020,22 +4032,22 @@ static long Soc_GetNotCodOfSocialPublication (long PubCod) } /*****************************************************************************/ -/************ Get code of social publication of the original note ************/ +/*************** Get code of publication of the original note ****************/ /*****************************************************************************/ -static long Soc_GetPubCodOfOriginalSocialNote (long NotCod) +static long TL_GetPubCodOfOriginalNote (long NotCod) { MYSQL_RES *mysql_res; MYSQL_ROW row; long OriginalPubCod = -1L; - /***** Get code of social publication of the original note *****/ - if (DB_QuerySELECT (&mysql_res,"can not get code of social publication", + /***** Get code of publication of the original note *****/ + if (DB_QuerySELECT (&mysql_res,"can not get code of publication", "SELECT PubCod FROM social_pubs" " WHERE NotCod=%ld AND PubType=%u", - NotCod,(unsigned) Soc_PUB_ORIGINAL_NOTE) == 1) // Result should have a unique row + NotCod,(unsigned) TL_PUB_ORIGINAL_NOTE) == 1) // Result should have a unique row { - /* Get code of social publication (row[0]) */ + /* Get code of publication (row[0]) */ row = mysql_fetch_row (mysql_res); OriginalPubCod = Str_ConvertStrCodToLongCod (row[0]); } @@ -4047,19 +4059,19 @@ static long Soc_GetPubCodOfOriginalSocialNote (long NotCod) } /*****************************************************************************/ -/************* Request the removal of a comment in a social note *************/ +/**************** Request the removal of a comment in a note *****************/ /*****************************************************************************/ -void Soc_RequestRemSocialComGbl (void) +void TL_RequestRemComGbl (void) { - /***** Request the removal of comment in social note *****/ - Soc_RequestRemovalSocialComment (); + /***** Request the removal of comment in note *****/ + TL_RequestRemovalComment (); /***** Write timeline again (global) *****/ - Soc_ShowTimelineGbl2 (); + TL_ShowTimelineGbl2 (); } -void Soc_RequestRemSocialComUsr (void) +void TL_RequestRemComUsr (void) { /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); @@ -4068,56 +4080,56 @@ void Soc_RequestRemSocialComUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Start section *****/ - Lay_StartSection (Soc_TIMELINE_SECTION_ID); + Lay_StartSection (TL_TIMELINE_SECTION_ID); - /***** Request the removal of comment in social note *****/ - Soc_RequestRemovalSocialComment (); + /***** Request the removal of comment in note *****/ + TL_RequestRemovalComment (); /***** Write timeline again (user) *****/ - Soc_ShowTimelineUsr (); + TL_ShowTimelineUsr (); /***** End section *****/ Lay_EndSection (); } -static void Soc_RequestRemovalSocialComment (void) +static void TL_RequestRemovalComment (void) { 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 SocialComment SocCom; + struct TL_Comment SocCom; bool ItsMe; /***** Initialize image *****/ Med_MediaConstructor (&SocCom.Media); - /***** Get data of social comment *****/ - SocCom.PubCod = Soc_GetParamPubCod (); - Soc_GetDataOfSocialComByCod (&SocCom); + /***** Get data of comment *****/ + SocCom.PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (&SocCom); if (SocCom.PubCod > 0) { ItsMe = Usr_ItsMe (SocCom.UsrCod); if (ItsMe) // I am the author of this comment { - /***** Show question and button to remove social comment *****/ + /***** Show question and button to remove comment *****/ /* Start alert */ Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_comment); - /* Show social comment */ - Soc_WriteSocialComment (&SocCom, - Soc_TOP_MESSAGE_NONE,-1L, + /* Show comment */ + TL_WriteComment (&SocCom, + TL_TOP_MESSAGE_NONE,-1L, true); /* End alert */ - Gbl.Social.PubCod = SocCom.PubCod; // Social publication to be removed + Gbl.Timeline.PubCod = SocCom.PubCod; // Publication to be removed if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) Ale_ShowAlertAndButton2 (ActRemSocComUsr,"timeline",NULL, - Soc_PutParamsRemoveSocialCommment, + TL_PutParamsRemoveCommment, Btn_REMOVE_BUTTON,Txt_Remove); else Ale_ShowAlertAndButton2 (ActRemSocComGbl,NULL,NULL, - Soc_PutParamsRemoveSocialCommment, + TL_PutParamsRemoveCommment, Btn_REMOVE_BUTTON,Txt_Remove); } } @@ -4129,32 +4141,32 @@ static void Soc_RequestRemovalSocialComment (void) } /*****************************************************************************/ -/***************** Put parameters to remove a social comment *****************/ +/******************** Put parameters to remove a comment *********************/ /*****************************************************************************/ -static void Soc_PutParamsRemoveSocialCommment (void) +static void TL_PutParamsRemoveCommment (void) { if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) Usr_PutParamOtherUsrCodEncrypted (); else - Soc_PutParamWhichUsrs (); - Soc_PutHiddenParamPubCod (Gbl.Social.PubCod); + TL_PutParamWhichUsrs (); + TL_PutHiddenParamPubCod (Gbl.Timeline.PubCod); } /*****************************************************************************/ -/************************** Remove a social comment **************************/ +/***************************** Remove a comment ******************************/ /*****************************************************************************/ -void Soc_RemoveSocialComGbl (void) +void TL_RemoveComGbl (void) { - /***** Remove a social comment *****/ - Soc_RemoveSocialComment (); + /***** Remove a comment *****/ + TL_RemoveComment (); /***** Write updated timeline after removing (global) *****/ - Soc_ShowTimelineGbl2 (); + TL_ShowTimelineGbl2 (); } -void Soc_RemoveSocialComUsr (void) +void TL_RemoveComUsr (void) { /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); @@ -4163,42 +4175,42 @@ void Soc_RemoveSocialComUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Start section *****/ - Lay_StartSection (Soc_TIMELINE_SECTION_ID); + Lay_StartSection (TL_TIMELINE_SECTION_ID); - /***** Remove a social comment *****/ - Soc_RemoveSocialComment (); + /***** Remove a comment *****/ + TL_RemoveComment (); /***** Write updated timeline after removing (user) *****/ - Soc_ShowTimelineUsr (); + TL_ShowTimelineUsr (); /***** End section *****/ Lay_EndSection (); } -static void Soc_RemoveSocialComment (void) +static void TL_RemoveComment (void) { extern const char *Txt_The_comment_no_longer_exists; extern const char *Txt_Comment_removed; - struct SocialComment SocCom; + struct TL_Comment SocCom; bool ItsMe; /***** Initialize image *****/ Med_MediaConstructor (&SocCom.Media); - /***** Get data of social comment *****/ - SocCom.PubCod = Soc_GetParamPubCod (); - Soc_GetDataOfSocialComByCod (&SocCom); + /***** Get data of comment *****/ + SocCom.PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (&SocCom); if (SocCom.PubCod > 0) { ItsMe = Usr_ItsMe (SocCom.UsrCod); if (ItsMe) // I am the author of this comment { - /***** Remove image file associated to social post *****/ - Soc_RemoveImgFileFromSocialComment (SocCom.PubCod); + /***** Remove image file associated to post *****/ + TL_RemoveImgFileFromComment (SocCom.PubCod); - /***** Delete social comment from database *****/ - Soc_RemoveASocialCommentFromDB (&SocCom); + /***** Delete comment from database *****/ + TL_RemoveACommentFromDB (&SocCom); /***** Message of success *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_Comment_removed); @@ -4212,14 +4224,14 @@ static void Soc_RemoveSocialComment (void) } /*****************************************************************************/ -/************* Remove one file associated to a social comment ****************/ +/**************** Remove one file associated to a comment ********************/ /*****************************************************************************/ -static void Soc_RemoveImgFileFromSocialComment (long PubCod) +static void TL_RemoveImgFileFromComment (long PubCod) { MYSQL_RES *mysql_res; - /***** Get name of media associated to a social post from database *****/ + /***** Get name of media associated to a post from database *****/ if (DB_QuerySELECT (&mysql_res,"can not get media", "SELECT MediaName," // row[0] "MediaType" // row[1] @@ -4234,10 +4246,10 @@ static void Soc_RemoveImgFileFromSocialComment (long PubCod) } /*****************************************************************************/ -/****************** Remove a social comment from database ********************/ +/********************* Remove a comment from database ************************/ /*****************************************************************************/ -static void Soc_RemoveASocialCommentFromDB (struct SocialComment *SocCom) +static void TL_RemoveACommentFromDB (struct TL_Comment *SocCom) { /***** Mark possible notifications on this comment as removed *****/ Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_COMMENT,SocCom->PubCod); @@ -4245,39 +4257,42 @@ static void Soc_RemoveASocialCommentFromDB (struct SocialComment *SocCom) Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_MENTION,SocCom->PubCod); /***** Remove favs for this comment *****/ - DB_QueryDELETE ("can not remove favs for social comment", - "DELETE FROM social_comments_fav WHERE PubCod=%ld", + DB_QueryDELETE ("can not remove favs for comment", + "DELETE FROM social_comments_fav" + " WHERE PubCod=%ld", SocCom->PubCod); - /***** Remove content of this social comment *****/ - DB_QueryDELETE ("can not remove a social comment", - "DELETE FROM social_comments WHERE PubCod=%ld", + /***** Remove content of this comment *****/ + DB_QueryDELETE ("can not remove a comment", + "DELETE FROM social_comments" + " WHERE PubCod=%ld", SocCom->PubCod); - /***** Remove this social comment *****/ - DB_QueryDELETE ("can not remove a social comment", + /***** Remove this comment *****/ + DB_QueryDELETE ("can not remove a comment", "DELETE FROM social_pubs" " WHERE PubCod=%ld" " AND PublisherCod=%ld" // Extra check: I am the author " AND PubType=%u", // Extra check: it's a comment SocCom->PubCod, Gbl.Usrs.Me.UsrDat.UsrCod, - (unsigned) Soc_PUB_COMMENT_TO_NOTE); + (unsigned) TL_PUB_COMMENT_TO_NOTE); - /***** Reset social comment *****/ - Soc_ResetSocialComment (SocCom); + /***** Reset comment *****/ + TL_ResetComment (SocCom); } /*****************************************************************************/ -/********** Remove all the social content of a user from database ************/ +/************* Remove all the content of a user from database ****************/ /*****************************************************************************/ -void Soc_RemoveUsrSocialContent (long UsrCod) +void TL_RemoveUsrContent (long UsrCod) { /***** Remove favs for comments *****/ - /* Remove all favs made by this user in any social comment */ + /* Remove all favs made by this user in any comment */ DB_QueryDELETE ("can not remove favs", - "DELETE FROM social_comments_fav WHERE UsrCod=%ld", + "DELETE FROM social_comments_fav" + " WHERE UsrCod=%ld", UsrCod); /* Remove all favs for all comments of this user */ @@ -4287,22 +4302,23 @@ void Soc_RemoveUsrSocialContent (long UsrCod) " WHERE social_pubs.PublisherCod=%ld" // Author of the comment " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments_fav.PubCod", - UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + UsrCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); - /* Remove all favs for all comments in all the social notes of the user */ - DB_QueryDELETE ("can not remove social comments", + /* Remove all favs for all comments in all the notes of the user */ + DB_QueryDELETE ("can not remove comments", "DELETE FROM social_comments_fav" " USING social_notes,social_pubs,social_comments_fav" " WHERE social_notes.UsrCod=%ld" // Author of the note " AND social_notes.NotCod=social_pubs.NotCod" " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments_fav.PubCod", - UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + UsrCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); /***** Remove favs for notes *****/ - /* Remove all favs made by this user in any social note */ + /* Remove all favs made by this user in any note */ DB_QueryDELETE ("can not remove favs", - "DELETE FROM social_notes_fav WHERE UsrCod=%ld", + "DELETE FROM social_notes_fav" + " WHERE UsrCod=%ld", UsrCod); /* Remove all favs for all notes of this user */ @@ -4313,109 +4329,111 @@ void Soc_RemoveUsrSocialContent (long UsrCod) " AND social_notes.NotCod=social_notes_fav.NotCod", UsrCod); - /***** Remove social comments *****/ - /* Remove content of all the comments in all the social notes of the user */ - DB_QueryDELETE ("can not remove social comments", + /***** Remove comments *****/ + /* Remove content of all the comments in all the notes of the user */ + DB_QueryDELETE ("can not remove comments", "DELETE FROM social_comments" " USING social_notes,social_pubs,social_comments" " WHERE social_notes.UsrCod=%ld" " AND social_notes.NotCod=social_pubs.NotCod" " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments.PubCod", - UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + UsrCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); - /* Remove all the comments from any user in any social note of the user */ - DB_QueryDELETE ("can not remove social comments", + /* Remove all the comments from any user in any note of the user */ + DB_QueryDELETE ("can not remove comments", "DELETE FROM social_pubs" " USING social_notes,social_pubs" " WHERE social_notes.UsrCod=%ld" " AND social_notes.NotCod=social_pubs.NotCod" " AND social_pubs.PubType=%u", - UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + UsrCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); - /* Remove content of all the comments of the user in any social note */ - DB_QueryDELETE ("can not remove social comments", + /* Remove content of all the comments of the user in any note */ + DB_QueryDELETE ("can not remove comments", "DELETE FROM social_comments" " USING social_pubs,social_comments" " WHERE social_pubs.PublisherCod=%ld" " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments.PubCod", - UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); + UsrCod,(unsigned) TL_PUB_COMMENT_TO_NOTE); - /***** Remove all the social posts of the user *****/ - DB_QueryDELETE ("can not remove social posts", + /***** Remove all the posts of the user *****/ + DB_QueryDELETE ("can not remove posts", "DELETE FROM social_posts" " WHERE PstCod IN" " (SELECT Cod FROM social_notes" " WHERE UsrCod=%ld AND NoteType=%u)", - UsrCod,(unsigned) Soc_NOTE_SOCIAL_POST); + UsrCod,(unsigned) TL_NOTE_POST); - /***** Remove all the social publications of any user authored by the user *****/ - DB_QueryDELETE ("can not remove social publications", + /***** Remove all the publications of any user authored by the user *****/ + DB_QueryDELETE ("can not remove publications", "DELETE FROM social_pubs" " USING social_notes,social_pubs" " WHERE social_notes.UsrCod=%ld" " AND social_notes.NotCod=social_pubs.NotCod", UsrCod); - /***** Remove all the social publications of the user *****/ - DB_QueryDELETE ("can not remove social publications", - "DELETE FROM social_pubs WHERE PublisherCod=%ld", + /***** Remove all the publications of the user *****/ + DB_QueryDELETE ("can not remove publications", + "DELETE FROM social_pubs" + " WHERE PublisherCod=%ld", UsrCod); - /***** Remove all the social notes of the user *****/ - DB_QueryDELETE ("can not remove social notes", - "DELETE FROM social_notes WHERE UsrCod=%ld", + /***** Remove all the notes of the user *****/ + DB_QueryDELETE ("can not remove notes", + "DELETE FROM social_notes" + " WHERE UsrCod=%ld", UsrCod); } /*****************************************************************************/ -/**************** Check if a user has published a social note ****************/ +/****************** Check if a user has published a note *********************/ /*****************************************************************************/ -static bool Soc_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod) +static bool TL_CheckIfNoteIsSharedByUsr (long NotCod,long UsrCod) { - return (DB_QueryCOUNT ("can not check if a user has shared a social note", + return (DB_QueryCOUNT ("can not check if a user has shared a note", "SELECT COUNT(*) FROM social_pubs" " WHERE NotCod=%ld" " AND PublisherCod=%ld" " AND PubType=%u", NotCod, UsrCod, - (unsigned) Soc_PUB_SHARED_NOTE) != 0); + (unsigned) TL_PUB_SHARED_NOTE) != 0); } /*****************************************************************************/ -/*************** Check if a user has favourited a social note ****************/ +/****************** Check if a user has favourited a note ********************/ /*****************************************************************************/ -static bool Soc_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod) +static bool TL_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod) { return (DB_QueryCOUNT ("can not check if a user" - " has favourited a social note", + " has favourited a note", "SELECT COUNT(*) FROM social_notes_fav" " WHERE NotCod=%ld AND UsrCod=%ld", NotCod,UsrCod) != 0); } /*****************************************************************************/ -/************* Check if a user has favourited a social comment ***************/ +/**************** Check if a user has favourited a comment *******************/ /*****************************************************************************/ -static bool Soc_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod) +static bool TL_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod) { return (DB_QueryCOUNT ("can not check if a user" - " has favourited a social comment", + " has favourited a comment", "SELECT COUNT(*) FROM social_comments_fav" " WHERE PubCod=%ld AND UsrCod=%ld", PubCod,UsrCod) != 0); } /*****************************************************************************/ -/******* Get number of times a social note has been shared in timeline *******/ +/********** Get number of times a note has been shared in timeline ***********/ /*****************************************************************************/ -static void Soc_UpdateNumTimesANoteHasBeenShared (struct SocialNote *SocNot) +static void TL_UpdateNumTimesANoteHasBeenShared (struct TL_Note *SocNot) { /***** Get number of times (users) this note has been shared *****/ SocNot->NumShared = @@ -4427,14 +4445,14 @@ static void Soc_UpdateNumTimesANoteHasBeenShared (struct SocialNote *SocNot) " AND PubType=%u", SocNot->NotCod, SocNot->UsrCod, // The author - (unsigned) Soc_PUB_SHARED_NOTE); + (unsigned) TL_PUB_SHARED_NOTE); } /*****************************************************************************/ -/*********** Get number of times a social note has been favourited ***********/ +/*************** Get number of times a note has been favourited **************/ /*****************************************************************************/ -static void Soc_GetNumTimesANoteHasBeenFav (struct SocialNote *SocNot) +static void TL_GetNumTimesANoteHasBeenFav (struct TL_Note *SocNot) { /***** Get number of times (users) this note has been favourited *****/ SocNot->NumFavs = @@ -4448,10 +4466,10 @@ static void Soc_GetNumTimesANoteHasBeenFav (struct SocialNote *SocNot) } /*****************************************************************************/ -/********* Get number of times a social comment has been favourited **********/ +/************ Get number of times a comment has been favourited **************/ /*****************************************************************************/ -static void Soc_GetNumTimesACommHasBeenFav (struct SocialComment *SocCom) +static void TL_GetNumTimesACommHasBeenFav (struct TL_Comment *SocCom) { /***** Get number of times (users) this comment has been favourited *****/ SocCom->NumFavs = @@ -4465,10 +4483,10 @@ static void Soc_GetNumTimesACommHasBeenFav (struct SocialComment *SocCom) } /*****************************************************************************/ -/**************** Show users who have shared this social note ****************/ +/******************* Show users who have shared this note ********************/ /*****************************************************************************/ -static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot) +static void TL_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs = 0; @@ -4484,11 +4502,11 @@ static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot " ORDER BY PubCod LIMIT %u", SocNot->NotCod, SocNot->UsrCod, - (unsigned) Soc_PUB_SHARED_NOTE, - Soc_MAX_SHARERS_FAVERS_SHOWN); + (unsigned) TL_PUB_SHARED_NOTE, + TL_MAX_SHARERS_FAVERS_SHOWN); /***** Show users *****/ - Soc_ShowSharersOrFavers (&mysql_res,SocNot->NumShared,NumFirstUsrs); + TL_ShowSharersOrFavers (&mysql_res,SocNot->NumShared,NumFirstUsrs); /***** Free structure that stores the query result *****/ if (SocNot->NumShared) @@ -4496,10 +4514,10 @@ static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot } /*****************************************************************************/ -/********* Show users who have marked this social note as favourite **********/ +/************ Show users who have marked this note as favourite **************/ /*****************************************************************************/ -static void Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (const struct SocialNote *SocNot) +static void TL_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs = 0; @@ -4516,11 +4534,11 @@ static void Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (const struct SocialNote *S " ORDER BY FavCod LIMIT %u", SocNot->NotCod, SocNot->UsrCod, - Soc_MAX_SHARERS_FAVERS_SHOWN); + TL_MAX_SHARERS_FAVERS_SHOWN); } /***** Show users *****/ - Soc_ShowSharersOrFavers (&mysql_res,SocNot->NumFavs,NumFirstUsrs); + TL_ShowSharersOrFavers (&mysql_res,SocNot->NumFavs,NumFirstUsrs); /***** Free structure that stores the query result *****/ if (SocNot->NumFavs) @@ -4528,10 +4546,10 @@ static void Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (const struct SocialNote *S } /*****************************************************************************/ -/********* Show users who have marked this social note as favourite **********/ +/************ Show users who have marked this note as favourite **************/ /*****************************************************************************/ -static void Soc_ShowUsrsWhoHaveMarkedSocialCommAsFav (const struct SocialComment *SocCom) +static void TL_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs = 0; @@ -4547,10 +4565,10 @@ static void Soc_ShowUsrsWhoHaveMarkedSocialCommAsFav (const struct SocialComment " ORDER BY FavCod LIMIT %u", SocCom->PubCod, SocCom->UsrCod, - Soc_MAX_SHARERS_FAVERS_SHOWN); + TL_MAX_SHARERS_FAVERS_SHOWN); /***** Show users *****/ - Soc_ShowSharersOrFavers (&mysql_res,SocCom->NumFavs,NumFirstUsrs); + TL_ShowSharersOrFavers (&mysql_res,SocCom->NumFavs,NumFirstUsrs); /***** Free structure that stores the query result *****/ if (SocCom->NumFavs) @@ -4562,7 +4580,7 @@ static void Soc_ShowUsrsWhoHaveMarkedSocialCommAsFav (const struct SocialComment /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers -static void Soc_ShowSharersOrFavers (MYSQL_RES **mysql_res, +static void TL_ShowSharersOrFavers (MYSQL_RES **mysql_res, unsigned NumUsrs,unsigned NumFirstUsrs) { MYSQL_ROW row; @@ -4572,7 +4590,7 @@ static void Soc_ShowSharersOrFavers (MYSQL_RES **mysql_res, bool ShowPhoto; char PhotoURL[PATH_MAX + 1]; - /***** Show number of users who have marked this social note as favourite *****/ + /***** Show number of users who have marked this note as favourite *****/ fprintf (Gbl.F.Out," %u", NumUsrs); @@ -4626,18 +4644,18 @@ static void Soc_ShowSharersOrFavers (MYSQL_RES **mysql_res, } /*****************************************************************************/ -/**************** Get data of social note using its code *********************/ +/******************** Get data of note using its code ************************/ /*****************************************************************************/ -static void Soc_GetDataOfSocialNotByCod (struct SocialNote *SocNot) +static void TL_GetDataOfNoteByCod (struct TL_Note *SocNot) { MYSQL_RES *mysql_res; MYSQL_ROW row; if (SocNot->NotCod > 0) { - /***** Get data of social note from database *****/ - if (DB_QuerySELECT (&mysql_res,"can not get data of social note", + /***** Get data of note from database *****/ + if (DB_QuerySELECT (&mysql_res,"can not get data of note", "SELECT NotCod," // row[0] "NoteType," // row[1] "Cod," // row[2] @@ -4649,35 +4667,35 @@ static void Soc_GetDataOfSocialNotByCod (struct SocialNote *SocNot) " WHERE NotCod=%ld", SocNot->NotCod)) { - /***** Get data of social note *****/ + /***** Get data of note *****/ row = mysql_fetch_row (mysql_res); - Soc_GetDataOfSocialNoteFromRow (row,SocNot); + TL_GetDataOfNoteFromRow (row,SocNot); } else - /***** Reset fields of social note *****/ - Soc_ResetSocialNote (SocNot); + /***** Reset fields of note *****/ + TL_ResetNote (SocNot); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); } else - /***** Reset fields of social note *****/ - Soc_ResetSocialNote (SocNot); + /***** Reset fields of note *****/ + TL_ResetNote (SocNot); } /*****************************************************************************/ -/*************** Get data of social comment using its code *******************/ +/******************* Get data of comment using its code **********************/ /*****************************************************************************/ -static void Soc_GetDataOfSocialComByCod (struct SocialComment *SocCom) +static void TL_GetDataOfCommByCod (struct TL_Comment *SocCom) { MYSQL_RES *mysql_res; MYSQL_ROW row; if (SocCom->PubCod > 0) { - /***** Get data of social comment from database *****/ - if (DB_QuerySELECT (&mysql_res,"can not get data of social comment", + /***** Get data of comment from database *****/ + if (DB_QuerySELECT (&mysql_res,"can not get data of comment", "SELECT social_pubs.PubCod," // row[0] "social_pubs.PublisherCod," // row[1] "social_pubs.NotCod," // row[2] @@ -4691,49 +4709,49 @@ static void Soc_GetDataOfSocialComByCod (struct SocialComment *SocCom) " WHERE social_pubs.PubCod=%ld" " AND social_pubs.PubType=%u" " AND social_pubs.PubCod=social_comments.PubCod", - SocCom->PubCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE)) + SocCom->PubCod,(unsigned) TL_PUB_COMMENT_TO_NOTE)) { - /***** Get data of social comment *****/ + /***** Get data of comment *****/ row = mysql_fetch_row (mysql_res); - Soc_GetDataOfSocialCommentFromRow (row,SocCom); + TL_GetDataOfCommentFromRow (row,SocCom); } else - /***** Reset fields of social comment *****/ - Soc_ResetSocialComment (SocCom); + /***** Reset fields of comment *****/ + TL_ResetComment (SocCom); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); } else - /***** Reset fields of social comment *****/ - Soc_ResetSocialComment (SocCom); + /***** Reset fields of comment *****/ + TL_ResetComment (SocCom); } /*****************************************************************************/ -/************** Get data of social publication using its code ****************/ +/****************** Get data of publication using its code *******************/ /*****************************************************************************/ -static void Soc_GetDataOfSocialPublicationFromRow (MYSQL_ROW row,struct SocialPublication *SocPub) +static void TL_GetDataOfPublicationFromRow (MYSQL_ROW row,struct TL_Publication *SocPub) { - const Soc_TopMessage_t TopMessages[Soc_NUM_PUB_TYPES] = + const TL_TopMessage_t TopMessages[TL_NUM_PUB_TYPES] = { - Soc_TOP_MESSAGE_NONE, // Soc_PUB_UNKNOWN - Soc_TOP_MESSAGE_NONE, // Soc_PUB_ORIGINAL_NOTE - Soc_TOP_MESSAGE_SHARED, // Soc_PUB_SHARED_NOTE - Soc_TOP_MESSAGE_COMMENTED, // Soc_PUB_COMMENT_TO_NOTE + TL_TOP_MESSAGE_NONE, // TL_PUB_UNKNOWN + TL_TOP_MESSAGE_NONE, // TL_PUB_ORIGINAL_NOTE + TL_TOP_MESSAGE_SHARED, // TL_PUB_SHARED_NOTE + TL_TOP_MESSAGE_COMMENTED, // TL_PUB_COMMENT_TO_NOTE }; - /***** Get code of social publication (row[0]) *****/ + /***** Get code of publication (row[0]) *****/ SocPub->PubCod = Str_ConvertStrCodToLongCod (row[0]); - /***** Get social note code (row[1]) *****/ + /***** Get note code (row[1]) *****/ SocPub->NotCod = Str_ConvertStrCodToLongCod (row[1]); /***** Get publisher's code (row[2]) *****/ SocPub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]); /***** Get type of publication (row[3]) *****/ - SocPub->PubType = Soc_GetPubTypeFromStr ((const char *) row[3]); + SocPub->PubType = TL_GetPubTypeFromStr ((const char *) row[3]); SocPub->TopMessage = TopMessages[SocPub->PubType]; /***** Get time of the note (row[4]) *****/ @@ -4741,16 +4759,16 @@ static void Soc_GetDataOfSocialPublicationFromRow (MYSQL_ROW row,struct SocialPu } /*****************************************************************************/ -/******************** Get data of social note from row ***********************/ +/************************ Get data of note from row **************************/ /*****************************************************************************/ -static void Soc_GetDataOfSocialNoteFromRow (MYSQL_ROW row,struct SocialNote *SocNot) +static void TL_GetDataOfNoteFromRow (MYSQL_ROW row,struct TL_Note *SocNot) { - /***** Get social code (row[0]) *****/ + /***** Get code (row[0]) *****/ SocNot->NotCod = Str_ConvertStrCodToLongCod (row[0]); /***** Get note type (row[1]) *****/ - SocNot->NoteType = Soc_GetNoteTypeFromStr ((const char *) row[1]); + SocNot->NoteType = TL_GetNoteTypeFromStr ((const char *) row[1]); /***** Get file/post... code (row[2]) *****/ SocNot->Cod = Str_ConvertStrCodToLongCod (row[2]); @@ -4767,48 +4785,48 @@ static void Soc_GetDataOfSocialNoteFromRow (MYSQL_ROW row,struct SocialNote *Soc /***** Get time of the note (row[6]) *****/ SocNot->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[6]); - /***** Get number of times this social note has been shared *****/ - Soc_UpdateNumTimesANoteHasBeenShared (SocNot); + /***** Get number of times this note has been shared *****/ + TL_UpdateNumTimesANoteHasBeenShared (SocNot); - /***** Get number of times this social note has been favourited *****/ - Soc_GetNumTimesANoteHasBeenFav (SocNot); + /***** Get number of times this note has been favourited *****/ + TL_GetNumTimesANoteHasBeenFav (SocNot); } /*****************************************************************************/ -/**** Get social publication type from string number coming from database ****/ +/******** Get publication type from string number coming from database *******/ /*****************************************************************************/ -static Soc_PubType_t Soc_GetPubTypeFromStr (const char *Str) +static TL_PubType_t TL_GetPubTypeFromStr (const char *Str) { unsigned UnsignedNum; if (sscanf (Str,"%u",&UnsignedNum) == 1) - if (UnsignedNum < Soc_NUM_PUB_TYPES) - return (Soc_PubType_t) UnsignedNum; + if (UnsignedNum < TL_NUM_PUB_TYPES) + return (TL_PubType_t) UnsignedNum; - return Soc_PUB_UNKNOWN; + return TL_PUB_UNKNOWN; } /*****************************************************************************/ -/****** Get social note type from string number coming from database *********/ +/********* Get note type from string number coming from database *************/ /*****************************************************************************/ -static Soc_NoteType_t Soc_GetNoteTypeFromStr (const char *Str) +static TL_NoteType_t TL_GetNoteTypeFromStr (const char *Str) { unsigned UnsignedNum; if (sscanf (Str,"%u",&UnsignedNum) == 1) - if (UnsignedNum < Soc_NUM_NOTE_TYPES) - return (Soc_NoteType_t) UnsignedNum; + if (UnsignedNum < TL_NUM_NOTE_TYPES) + return (TL_NoteType_t) UnsignedNum; - return Soc_NOTE_UNKNOWN; + return TL_NOTE_UNKNOWN; } /*****************************************************************************/ -/****************** Get data of social comment from row **********************/ +/********************** Get data of comment from row *************************/ /*****************************************************************************/ -static void Soc_GetDataOfSocialCommentFromRow (MYSQL_ROW row,struct SocialComment *SocCom) +static void TL_GetDataOfCommentFromRow (MYSQL_ROW row,struct TL_Comment *SocCom) { /* row[0]: PubCod @@ -4821,13 +4839,13 @@ static void Soc_GetDataOfSocialCommentFromRow (MYSQL_ROW row,struct SocialCommen row[7]: MediaTitle row[8]: MediaURL */ - /***** Get code of social comment (row[0]) *****/ + /***** Get code of comment (row[0]) *****/ SocCom->PubCod = Str_ConvertStrCodToLongCod (row[0]); /***** Get (from) user code (row[1]) *****/ SocCom->UsrCod = Str_ConvertStrCodToLongCod (row[1]); - /***** Get code of social note (row[2]) *****/ + /***** Get code of note (row[2]) *****/ SocCom->NotCod = Str_ConvertStrCodToLongCod (row[2]); /***** Get time of the note (row[3]) *****/ @@ -4838,20 +4856,20 @@ static void Soc_GetDataOfSocialCommentFromRow (MYSQL_ROW row,struct SocialCommen Cns_MAX_BYTES_LONG_TEXT); /***** Get number of times this comment has been favourited *****/ - Soc_GetNumTimesACommHasBeenFav (SocCom); + TL_GetNumTimesACommHasBeenFav (SocCom); /****** Get media data (row[5], row[6], row[7], row[8]) *****/ Med_GetMediaDataFromRow (row[5],row[6],row[7],row[8],&SocCom->Media); } /*****************************************************************************/ -/*********************** Reset fields of social note *************************/ +/*************************** Reset fields of note ****************************/ /*****************************************************************************/ -static void Soc_ResetSocialNote (struct SocialNote *SocNot) +static void TL_ResetNote (struct TL_Note *SocNot) { SocNot->NotCod = -1L; - SocNot->NoteType = Soc_NOTE_UNKNOWN; + SocNot->NoteType = TL_NOTE_UNKNOWN; SocNot->UsrCod = -1L; SocNot->HieCod = -1L; SocNot->Cod = -1L; @@ -4861,10 +4879,10 @@ static void Soc_ResetSocialNote (struct SocialNote *SocNot) } /*****************************************************************************/ -/********************** Reset fields of social comment ***********************/ +/************************** Reset fields of comment **************************/ /*****************************************************************************/ -static void Soc_ResetSocialComment (struct SocialComment *SocCom) +static void TL_ResetComment (struct TL_Comment *SocCom) { SocCom->PubCod = -1L; SocCom->UsrCod = -1L; @@ -4874,26 +4892,27 @@ static void Soc_ResetSocialComment (struct SocialComment *SocCom) } /*****************************************************************************/ -/**************** Clear unused old social timelines in database **************/ +/******************* Clear unused old timelines in database ******************/ /*****************************************************************************/ -void Soc_ClearOldTimelinesDB (void) +void TL_ClearOldTimelinesDB (void) { - /***** Remove social timelines for expired sessions *****/ - DB_QueryDELETE ("can not remove old social timelines", + /***** Remove timelines for expired sessions *****/ + DB_QueryDELETE ("can not remove old timelines", "DELETE LOW_PRIORITY FROM social_timelines" " WHERE SessionId NOT IN (SELECT SessionId FROM sessions)"); } /*****************************************************************************/ -/************* Clear social timeline for this session in database ************/ +/**************** Clear timeline for this session in database ****************/ /*****************************************************************************/ -static void Soc_ClearTimelineThisSession (void) +static void TL_ClearTimelineThisSession (void) { - /***** Remove social timeline for this session *****/ - DB_QueryDELETE ("can not remove social timeline", - "DELETE FROM social_timelines WHERE SessionId='%s'", + /***** Remove timeline for this session *****/ + DB_QueryDELETE ("can not remove timeline", + "DELETE FROM social_timelines" + " WHERE SessionId='%s'", Gbl.Session.Id); } @@ -4901,9 +4920,9 @@ static void Soc_ClearTimelineThisSession (void) /****** Add just retrieved notes to current timeline for this session ********/ /*****************************************************************************/ -static void Soc_AddNotesJustRetrievedToTimelineThisSession (void) +static void TL_AddNotesJustRetrievedToTimelineThisSession (void) { - DB_QueryINSERT ("can not insert social notes in timeline", + DB_QueryINSERT ("can not insert notes in timeline", "INSERT IGNORE INTO social_timelines" " (SessionId,NotCod)" " SELECT DISTINCTROW '%s',NotCod FROM not_codes", @@ -4911,28 +4930,28 @@ static void Soc_AddNotesJustRetrievedToTimelineThisSession (void) } /*****************************************************************************/ -/*************** Get notification of a new social publication ****************/ +/****************** Get notification of a new publication ********************/ /*****************************************************************************/ -void Soc_GetNotifSocialPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], - char **ContentStr, - long PubCod,bool GetContent) +void TL_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], + char **ContentStr, + long PubCod,bool GetContent) { MYSQL_RES *mysql_res; MYSQL_ROW row; - struct SocialPublication SocPub; - struct SocialNote SocNot; + struct TL_Publication SocPub; + struct TL_Note SocNot; char Content[Cns_MAX_BYTES_LONG_TEXT + 1]; size_t Length; bool ContentCopied = false; /***** Return nothing on error *****/ - SocPub.PubType = Soc_PUB_UNKNOWN; + SocPub.PubType = TL_PUB_UNKNOWN; SummaryStr[0] = '\0'; // Return nothing on error Content[0] = '\0'; - /***** Get summary and content from social post from database *****/ - if (DB_QuerySELECT (&mysql_res,"can not get data of social publication", + /***** Get summary and content from post from database *****/ + if (DB_QuerySELECT (&mysql_res,"can not get data of publication", "SELECT PubCod," // row[0] "NotCod," // row[1] "PublisherCod," // row[2] @@ -4941,9 +4960,9 @@ void Soc_GetNotifSocialPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], " FROM social_pubs WHERE PubCod=%ld", PubCod) == 1) // Result should have a unique row { - /* Get data of social publication */ + /* Get data of publication */ row = mysql_fetch_row (mysql_res); - Soc_GetDataOfSocialPublicationFromRow (row,&SocPub); + TL_GetDataOfPublicationFromRow (row,&SocPub); } /***** Free structure that stores the query result *****/ @@ -4952,20 +4971,19 @@ void Soc_GetNotifSocialPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], /***** Get summary and content *****/ switch (SocPub.PubType) { - case Soc_PUB_UNKNOWN: + case TL_PUB_UNKNOWN: break; - case Soc_PUB_ORIGINAL_NOTE: - case Soc_PUB_SHARED_NOTE: - /* Get data of social note */ + case TL_PUB_ORIGINAL_NOTE: + case TL_PUB_SHARED_NOTE: + /* Get data of note */ SocNot.NotCod = SocPub.NotCod; - Soc_GetDataOfSocialNotByCod (&SocNot); + TL_GetDataOfNoteByCod (&SocNot); - if (SocNot.NoteType == Soc_NOTE_SOCIAL_POST) + if (SocNot.NoteType == TL_NOTE_POST) { - /***** Get content of social post from database *****/ + /***** Get content of post from database *****/ // TODO: What happens if content is empty and an image is attached? - if (DB_QuerySELECT (&mysql_res,"can not get the content" - " of a social post", + if (DB_QuerySELECT (&mysql_res,"can not get the content of a post", "SELECT Content FROM social_posts" " WHERE PstCod=%ld", SocNot.Cod) == 1) // Result should have a unique row @@ -4999,13 +5017,13 @@ void Soc_GetNotifSocialPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], Ntf_MAX_BYTES_SUMMARY); } else - Soc_GetNoteSummary (&SocNot,SummaryStr); + TL_GetNoteSummary (&SocNot,SummaryStr); break; - case Soc_PUB_COMMENT_TO_NOTE: - /***** Get content of social post from database *****/ + case TL_PUB_COMMENT_TO_NOTE: + /***** Get content of post from database *****/ // TODO: What happens if content is empty and an image is attached? if (DB_QuerySELECT (&mysql_res,"can not get the content" - " of a comment to a social note", + " of a comment to a note", "SELECT Content FROM social_comments" " WHERE PubCod=%ld", SocPub.PubCod) == 1) // Result should have a unique row @@ -5137,13 +5155,13 @@ static void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const } /*****************************************************************************/ -/*************** Get number of social publications from a user ***************/ +/****************** Get number of publications from a user *******************/ /*****************************************************************************/ -unsigned long Soc_GetNumPubsUsr (long UsrCod) +unsigned long TL_GetNumPubsUsr (long UsrCod) { /***** Get number of posts from a user from database *****/ - return DB_QueryCOUNT ("can not get number of social publications from a user", + return DB_QueryCOUNT ("can not get number of publications from a user", "SELECT COUNT(*) FROM social_pubs" " WHERE PublisherCod=%ld", UsrCod); diff --git a/swad_timeline.h b/swad_timeline.h new file mode 100644 index 00000000..e308104a --- /dev/null +++ b/swad_timeline.h @@ -0,0 +1,192 @@ +// swad_timeline.c: social timeline + +#ifndef _SWAD_TL +#define _SWAD_TL +/* + SWAD (Shared Workspace At a Distance in Spanish), + is a web platform developed at the University of Granada (Spain), + and used to support university teaching. + + This file is part of SWAD core. + Copyright (C) 1999-2019 Antonio Cañas Vargas + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*****************************************************************************/ +/********************************** Headers **********************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/****************************** Public constants *****************************/ +/*****************************************************************************/ + +#define TL_TIMELINE_SECTION_ID "timeline" + +// Number of recent publishings got and shown the first time, before refreshing +#define TL_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // Unlimited +#define TL_MAX_REC_PUBS_TO_GET_AND_SHOW 10 // Recent publishings to show (first time) +#define TL_MAX_OLD_PUBS_TO_GET_AND_SHOW 10 // Old publishings are retrieved in packs of this size + // This constant is also used in JavaScript function readOldTimelineData + +/*****************************************************************************/ +/******************************** Public types *******************************/ +/*****************************************************************************/ + +#define TL_NUM_WHICH_USRS 3 +typedef enum + { + TL_USRS_UNKNOWN = 0, + TL_USRS_FOLLOWED = 1, + TL_USRS_ALL = 2, + } TL_WhichUsrs_t; // Which users I want to see: only users I follow or all users +#define TL_DEFAULT_WHICH_USRS TL_USRS_FOLLOWED + +#define TL_NUM_PUB_TYPES 4 +// If the numbers assigned to each event type change, +// it is necessary to change old numbers to new ones in database table social_notes +typedef enum + { + TL_PUB_UNKNOWN = 0, + TL_PUB_ORIGINAL_NOTE = 1, + TL_PUB_SHARED_NOTE = 2, + TL_PUB_COMMENT_TO_NOTE = 3, + } TL_PubType_t; + +#define TL_NUM_NOTE_TYPES 13 +// If the numbers assigned to each event type change, +// it is necessary to change old numbers to new ones in database table social_notes +typedef enum + { + TL_NOTE_UNKNOWN = 0, + + /* Institution tab */ + TL_NOTE_INS_DOC_PUB_FILE = 1, + TL_NOTE_INS_SHA_PUB_FILE = 2, + + /* Centre tab */ + TL_NOTE_CTR_DOC_PUB_FILE = 3, + TL_NOTE_CTR_SHA_PUB_FILE = 4, + + /* Degree tab */ + TL_NOTE_DEG_DOC_PUB_FILE = 5, + TL_NOTE_DEG_SHA_PUB_FILE = 6, + + /* Course tab */ + TL_NOTE_CRS_DOC_PUB_FILE = 7, + TL_NOTE_CRS_SHA_PUB_FILE = 8, + + /* Assessment tab */ + TL_NOTE_EXAM_ANNOUNCEMENT = 9, + + /* Users tab */ + + /* Start tab */ // TODO: Move to the top + TL_NOTE_POST = 10, + TL_NOTE_FORUM_POST = 11, + + /* Messages tab */ + TL_NOTE_NOTICE = 12, + + /* Statistics tab */ + + /* Profile tab */ + + } TL_NoteType_t; + +#define TL_NUM_TOP_MESSAGES (1 + 6) +typedef enum + { + TL_TOP_MESSAGE_NONE = 0, + TL_TOP_MESSAGE_COMMENTED = 1, + TL_TOP_MESSAGE_FAVED = 2, + TL_TOP_MESSAGE_UNFAVED = 3, + TL_TOP_MESSAGE_SHARED = 4, + TL_TOP_MESSAGE_UNSHARED = 5, + TL_TOP_MESSAGE_MENTIONED = 6, + } TL_TopMessage_t; + +struct TL_Publication + { + long PubCod; + long NotCod; + long PublisherCod; // Sharer or writer of a comment + TL_PubType_t PubType; + time_t DateTimeUTC; + TL_TopMessage_t TopMessage; // Used to show feedback on the action made + }; + +/*****************************************************************************/ +/****************************** Public prototypes ****************************/ +/*****************************************************************************/ + +void TL_ShowTimelineGbl1 (void); +void TL_ShowTimelineGbl2 (void); +void TL_ShowTimelineUsr (void); + +void TL_RefreshNewTimelineGbl (void); + +void TL_RefreshOldTimelineGbl (void); +void TL_RefreshOldTimelineUsr (void); + +void TL_MarkMyNotifAsSeen (void); + +void TL_StoreAndPublishNote (TL_NoteType_t NoteType,long Cod,struct TL_Publication *SocPub); +void TL_MarkNoteAsUnavailableUsingNotCod (long NotCod); +void TL_MarkNoteAsUnavailableUsingNoteTypeAndCod (TL_NoteType_t NoteType,long Cod); +void TL_MarkNoteOneFileAsUnavailable (const char *Path); +void TL_MarkNotesChildrenOfFolderAsUnavailable (const char *Path); + +void TL_ReceivePostGbl (void); +void TL_ReceivePostUsr (void); + +void TL_PutHiddenParamPubCod (long PubCod); + +void TL_ReceiveCommentGbl (void); +void TL_ReceiveCommentUsr (void); + +void TL_ShareNoteGbl (void); +void TL_ShareNoteUsr (void); +void TL_FavNoteGbl (void); +void TL_FavNoteUsr (void); +void TL_FavCommentGbl (void); +void TL_FavCommentUsr (void); + +void TL_UnshareNoteGbl (void); +void TL_UnshareNoteUsr (void); +void TL_UnfavNoteGbl (void); +void TL_UnfavNoteUsr (void); +void TL_UnfavCommentGbl (void); +void TL_UnfavCommentUsr (void); + +void TL_RequestRemNoteGbl (void); +void TL_RequestRemNoteUsr (void); +void TL_RemoveNoteGbl (void); +void TL_RemoveNoteUsr (void); + +void TL_RequestRemComGbl (void); +void TL_RequestRemComUsr (void); +void TL_RemoveComGbl (void); +void TL_RemoveComUsr (void); + +void TL_RemoveUsrContent (long UsrCod); + +void TL_ClearOldTimelinesDB (void); + +void TL_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], + char **ContentStr, + long PubCod,bool GetContent); + +unsigned long TL_GetNumPubsUsr (long UsrCod); + +#endif