diff --git a/css/swad18.89.5.css b/css/swad18.89.5.css index 557faf1a..f1401ef0 100644 --- a/css/swad18.89.5.css +++ b/css/swad18.89.5.css @@ -3102,7 +3102,6 @@ a:hover img.CENTRE_PHOTO_SHOW .TL_ICO_SHA { display:inline-block; - padding-left:20px; vertical-align:bottom; } .TL_ICO_FAV_DISABLED diff --git a/sql/cambios.sql b/sql/cambios.sql index 2350e542..e4aecfd2 100644 --- a/sql/cambios.sql +++ b/sql/cambios.sql @@ -12851,4 +12851,14 @@ ALTER TABLE usr_data DROP COLUMN ExtendedProfileVisibility; ) ) AS UsrsToFollow ORDER BY RAND() LIMIT 3; + + + + + + +INSERT INTO social_pubs (NotCod,PublisherCod,PubType,TimePublish) VALUES (600,7140,2,NOW()); + +INSERT IGNORE INTO social_comments_fav (PubCod,UsrCod,TimeFav) VALUES (1294,7140,NOW()); + diff --git a/swad_action.c b/swad_action.c index bd55fd9a..adb145ad 100644 --- a/swad_action.c +++ b/swad_action.c @@ -119,6 +119,9 @@ Start: 23. ActRcvSocPstGbl Receive a public social post to be displayed in the timeline (global) 24. ActRcvSocComGbl Comment a social note in the timeline (global) + NEW. ActAllShaSocNotGbl Show all users who have shared a note in the timeline (global) + NEW. ActAllFavSocNotGbl Show all users who have favourited a note in the timeline (global) + NEW. ActAllFavSocComGbl Show all users who have favourited a comment in the timeline (global) 25. ActShaSocNotGbl Share a social note in the timeline (global) 26. ActUnsSocNotGbl Unshare a previously shared social note in the timeline (global) 27. ActFavSocNotGbl Favourite a social note in the timeline (global) @@ -134,6 +137,9 @@ Start: 36. ActRcvSocPstUsr Receive a public social post to be displayed in the timeline (user) 37. ActRcvSocComUsr Comment a social note in the timeline (user) + NEW. ActAllShaSocNotUsr Show all users who have shared a note in the timeline (user) + NEW. ActAllFavSocNotUsr Show all users who have favourited a note in the timeline (user) + NEW. ActAllFavSocComUsr Show all users who have favourited a comment in the timeline (user) 38. ActShaSocNotUsr Share a social note in the timeline (user) 39. ActUnsSocNotUsr Unshare a previously shared social note in the timeline (user) 40. ActFavSocNotUsr Favourite a social note in the timeline (user) @@ -1624,6 +1630,9 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* 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}, + /* ActAllShaSocNotGbl*/{1766,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShowAllSharersNoteGbl ,NULL}, + /* ActAllFavSocNotGbl*/{1767,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShowAllFaversNoteGbl ,NULL}, + /* ActAllFavSocComGbl*/{1768,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShowAllFaversComGbl ,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}, @@ -1639,6 +1648,9 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* 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}, + /* ActAllShaSocNotUsr*/{1769,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShowAllSharersNoteUsr ,NULL}, + /* ActAllFavSocNotUsr*/{1770,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShowAllFaversNoteUsr ,NULL}, + /* ActAllFavSocComUsr*/{1771,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,TL_ShowAllFaversComUsr ,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}, @@ -4925,6 +4937,12 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActUnfSevTch, // #1763 ActChgCooPrf, // #1764 ActChgExtPriPrf, // #1765 + ActAllShaSocNotGbl, // #1766 + ActAllFavSocNotGbl, // #1767 + ActAllFavSocComGbl, // #1768 + ActAllShaSocNotUsr, // #1769 + ActAllFavSocNotUsr, // #1770 + ActAllFavSocComUsr, // #1771 }; /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index 243ced39..152a39ec 100644 --- a/swad_action.h +++ b/swad_action.h @@ -61,9 +61,9 @@ typedef enum typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1 + 8 + 55 + 38 + 12 + 42 + 36 + 19 + 110 + 157 + 437 + 176 + 168 + 15 + 67) +#define Act_NUM_ACTIONS (1 + 8 + 61 + 38 + 12 + 42 + 36 + 19 + 110 + 157 + 437 + 176 + 168 + 15 + 67) -#define Act_MAX_ACTION_COD 1765 +#define Act_MAX_ACTION_COD 1771 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13 @@ -108,51 +108,57 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to #define ActRcvSocPstGbl (ActWebSvc + 15) #define ActRcvSocComGbl (ActWebSvc + 16) -#define ActShaSocNotGbl (ActWebSvc + 17) -#define ActUnsSocNotGbl (ActWebSvc + 18) -#define ActFavSocNotGbl (ActWebSvc + 19) -#define ActUnfSocNotGbl (ActWebSvc + 20) -#define ActFavSocComGbl (ActWebSvc + 21) -#define ActUnfSocComGbl (ActWebSvc + 22) -#define ActReqRemSocPubGbl (ActWebSvc + 23) -#define ActRemSocPubGbl (ActWebSvc + 24) -#define ActReqRemSocComGbl (ActWebSvc + 25) -#define ActRemSocComGbl (ActWebSvc + 26) +#define ActAllShaSocNotGbl (ActWebSvc + 17) +#define ActAllFavSocNotGbl (ActWebSvc + 18) +#define ActAllFavSocComGbl (ActWebSvc + 19) +#define ActShaSocNotGbl (ActWebSvc + 20) +#define ActUnsSocNotGbl (ActWebSvc + 21) +#define ActFavSocNotGbl (ActWebSvc + 22) +#define ActUnfSocNotGbl (ActWebSvc + 23) +#define ActFavSocComGbl (ActWebSvc + 24) +#define ActUnfSocComGbl (ActWebSvc + 25) +#define ActReqRemSocPubGbl (ActWebSvc + 26) +#define ActRemSocPubGbl (ActWebSvc + 27) +#define ActReqRemSocComGbl (ActWebSvc + 28) +#define ActRemSocComGbl (ActWebSvc + 29) -#define ActReqOthPubPrf (ActWebSvc + 27) +#define ActReqOthPubPrf (ActWebSvc + 30) -#define ActRcvSocPstUsr (ActWebSvc + 28) -#define ActRcvSocComUsr (ActWebSvc + 29) -#define ActShaSocNotUsr (ActWebSvc + 30) -#define ActUnsSocNotUsr (ActWebSvc + 31) -#define ActFavSocNotUsr (ActWebSvc + 32) -#define ActUnfSocNotUsr (ActWebSvc + 33) -#define ActFavSocComUsr (ActWebSvc + 34) -#define ActUnfSocComUsr (ActWebSvc + 35) -#define ActReqRemSocPubUsr (ActWebSvc + 36) -#define ActRemSocPubUsr (ActWebSvc + 37) -#define ActReqRemSocComUsr (ActWebSvc + 38) -#define ActRemSocComUsr (ActWebSvc + 39) +#define ActRcvSocPstUsr (ActWebSvc + 31) +#define ActRcvSocComUsr (ActWebSvc + 32) +#define ActAllShaSocNotUsr (ActWebSvc + 33) +#define ActAllFavSocNotUsr (ActWebSvc + 34) +#define ActAllFavSocComUsr (ActWebSvc + 35) +#define ActShaSocNotUsr (ActWebSvc + 36) +#define ActUnsSocNotUsr (ActWebSvc + 37) +#define ActFavSocNotUsr (ActWebSvc + 38) +#define ActUnfSocNotUsr (ActWebSvc + 39) +#define ActFavSocComUsr (ActWebSvc + 40) +#define ActUnfSocComUsr (ActWebSvc + 41) +#define ActReqRemSocPubUsr (ActWebSvc + 42) +#define ActRemSocPubUsr (ActWebSvc + 43) +#define ActReqRemSocComUsr (ActWebSvc + 44) +#define ActRemSocComUsr (ActWebSvc + 45) -#define ActSeeOthPubPrf (ActWebSvc + 40) -#define ActCalFig (ActWebSvc + 41) +#define ActSeeOthPubPrf (ActWebSvc + 46) +#define ActCalFig (ActWebSvc + 47) -#define ActFolUsr (ActWebSvc + 42) -#define ActUnfUsr (ActWebSvc + 43) -#define ActSeeFlg (ActWebSvc + 44) -#define ActSeeFlr (ActWebSvc + 45) +#define ActFolUsr (ActWebSvc + 48) +#define ActUnfUsr (ActWebSvc + 49) +#define ActSeeFlg (ActWebSvc + 50) +#define ActSeeFlr (ActWebSvc + 51) -#define ActPrnCal (ActWebSvc + 46) -#define ActChgCal1stDay (ActWebSvc + 47) +#define ActPrnCal (ActWebSvc + 52) +#define ActChgCal1stDay (ActWebSvc + 53) -#define ActSeeNewNtf (ActWebSvc + 48) -#define ActMrkNtfSee (ActWebSvc + 49) -#define ActSeeMai (ActWebSvc + 50) -#define ActEdiMai (ActWebSvc + 51) -#define ActNewMai (ActWebSvc + 52) -#define ActRemMai (ActWebSvc + 53) -#define ActRenMaiSho (ActWebSvc + 54) -#define ActRenMaiFul (ActWebSvc + 55) +#define ActSeeNewNtf (ActWebSvc + 54) +#define ActMrkNtfSee (ActWebSvc + 55) +#define ActSeeMai (ActWebSvc + 56) +#define ActEdiMai (ActWebSvc + 57) +#define ActNewMai (ActWebSvc + 58) +#define ActRemMai (ActWebSvc + 59) +#define ActRenMaiSho (ActWebSvc + 60) +#define ActRenMaiFul (ActWebSvc + 61) /*****************************************************************************/ /******************************** System tab *********************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 0ed49769..bb1d8817 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -464,10 +464,20 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.89.6 (2019-03-28)" +#define Log_PLATFORM_VERSION "SWAD 18.90 (2019-03-28)" #define CSS_FILE "swad18.89.5.css" #define JS_FILE "swad18.89.5.js" /* + * TODO: Ver todos los favoritos de una pub. mía + Version 18.90: Mar 28, 2019 Show all users who have shared/faved social notes and comments. Not finished. (241360 lines) + 6 changes necessary in database: +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1766','es','N','Ver quiénes comp. public. social (global)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1767','es','N','Ver quiénes fav. public. social (global)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1768','es','N','Ver quiénes fav. coment. social (global)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1769','es','N','Ver quiénes comp. public. social (usuario)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1770','es','N','Ver quiénes fav. public. social (usuario)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1771','es','N','Ver quiénes fav. coment. social (usuario)'); + Version 18.89.6: Mar 28, 2019 Code refactoring in timeline related to favers and sharers. (241151 lines) Version 18.89.5: Mar 28, 2019 Code refactoring in media uploader. Changes in design of media uploader. (241146 lines) diff --git a/swad_layout.c b/swad_layout.c index 6d7c7d09..258935f9 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -663,8 +663,8 @@ static void Lay_WriteScriptInit (void) case ActSeeSocTmlGbl: case ActRcvSocPstGbl: case ActRcvSocComGbl: - case ActShaSocNotGbl: - case ActUnsSocNotGbl: + case ActShaSocNotGbl: // TODO: Remove? + case ActUnsSocNotGbl: // TODO: Remove? case ActReqRemSocPubGbl: case ActRemSocPubGbl: case ActReqRemSocComGbl: diff --git a/swad_parameter.c b/swad_parameter.c index 9d200f66..d1e62ebf 100644 --- a/swad_parameter.c +++ b/swad_parameter.c @@ -732,6 +732,9 @@ void Par_GetMainParameters (void) Gbl.Action.IsAJAXAutoRefresh = true; } else if (Gbl.Action.Act == ActRefOldSocPubGbl || Gbl.Action.Act == ActRefOldSocPubUsr || + Gbl.Action.Act == ActAllShaSocNotGbl || Gbl.Action.Act == ActAllShaSocNotUsr || + Gbl.Action.Act == ActAllFavSocNotGbl || Gbl.Action.Act == ActAllFavSocNotUsr || + Gbl.Action.Act == ActAllFavSocComGbl || Gbl.Action.Act == ActAllFavSocComUsr || Gbl.Action.Act == ActShaSocNotGbl || Gbl.Action.Act == ActShaSocNotUsr || Gbl.Action.Act == ActUnsSocNotGbl || Gbl.Action.Act == ActUnsSocNotUsr || Gbl.Action.Act == ActFavSocNotGbl || Gbl.Action.Act == ActFavSocNotUsr || diff --git a/swad_timeline.c b/swad_timeline.c index dcf97afe..62d97d9f 100644 --- a/swad_timeline.c +++ b/swad_timeline.c @@ -59,7 +59,7 @@ #define TL_NUM_VISIBLE_COMMENTS 3 // Maximum number of comments visible before expanding them -#define TL_MAX_SHARERS_FAVERS_SHOWN 5 // Maximum number of users shown who have share/fav a note +#define TL_MAX_SHARERS_FAVERS_SHOWN 3 // Maximum number of users shown who have share/fav a note #define TL_MAX_CHARS_IN_POST 1000 @@ -115,7 +115,14 @@ struct TL_Comment char Content[Cns_MAX_BYTES_LONG_TEXT + 1]; struct Media Media; }; - +/* +typedef enum + { + TL_FAVERS_NOTE, // Show users who have marked a note as favourite + TL_SHARERS_NOTE, // Show users who have shared a note + TL_FAVERS_COMMENT, // Show users who have marked a comment as favourite + } TL_FaversSharers_t; +*/ /*****************************************************************************/ /************** External global variables from others modules ****************/ /*****************************************************************************/ @@ -205,10 +212,15 @@ static void TL_PutFormToRemoveComment (long PubCod); static void TL_PutDisabledIconShare (unsigned NumShared); static void TL_PutDisabledIconFav (unsigned NumFavs); +static void TL_PutFormToSeeAllSharersNote (const struct TL_Note *SocNot); static void TL_PutFormToShareNote (const struct TL_Note *SocNot); static void TL_PutFormToUnshareNote (const struct TL_Note *SocNot); + +static void TL_PutFormToSeeAllFaversNote (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_PutFormToSeeAllFaversComment (const struct TL_Comment *SocCom); static void TL_PutFormToFavComment (struct TL_Comment *SocCom); static void TL_PutFormToUnfavComment (struct TL_Comment *SocCom); @@ -251,9 +263,12 @@ 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 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_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot, + unsigned Limit); +static void TL_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot, + unsigned Limit); +static void TL_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom, + unsigned Limit); static void TL_ShowSharersOrFavers (MYSQL_RES **mysql_res, unsigned NumUsrs,unsigned NumFirstUsrs); @@ -1484,9 +1499,9 @@ static void TL_WriteNote (const struct TL_Note *SocNot, if (!IAmTheAuthor) { IAmASharerOfThisSocNot = TL_CheckIfNoteIsSharedByUsr (SocNot->NotCod, - Gbl.Usrs.Me.UsrDat.UsrCod); + Gbl.Usrs.Me.UsrDat.UsrCod); IAmAFaverOfThisSocNot = TL_CheckIfNoteIsFavedByUsr (SocNot->NotCod, - Gbl.Usrs.Me.UsrDat.UsrCod); + Gbl.Usrs.Me.UsrDat.UsrCod); } } @@ -1629,7 +1644,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot, /* Put disabled icon and list of users who have marked this note as favourite */ TL_PutDisabledIconFav (SocNot->NumFavs); - TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); } else // Available and I am not the author { @@ -1643,7 +1658,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot, /* Put icon to fav this publication and list of users */ TL_PutFormToFavNote (SocNot); /* Show who have marked this note as favourite */ - TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); fprintf (Gbl.F.Out,""); } @@ -1654,7 +1669,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot, /* Put disabled icon and list of users who have shared this note */ TL_PutDisabledIconShare (SocNot->NumShared); - TL_ShowUsrsWhoHaveSharedNote (SocNot); + TL_ShowUsrsWhoHaveSharedNote (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); } else // Available and I am not the author { @@ -1668,7 +1683,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot, /* Put icon to share this publication and list of users */ TL_PutFormToShareNote (SocNot); /* Show who have shared this note */ - TL_ShowUsrsWhoHaveSharedNote (SocNot); + TL_ShowUsrsWhoHaveSharedNote (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); fprintf (Gbl.F.Out,""); } @@ -2793,7 +2808,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom, IAmTheAuthor = ItsMe; if (!IAmTheAuthor) IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom->PubCod, - Gbl.Usrs.Me.UsrDat.UsrCod); + Gbl.Usrs.Me.UsrDat.UsrCod); /***** Left: write author's photo *****/ fprintf (Gbl.F.Out,"
"); @@ -2827,7 +2842,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom, /* Put disabled icon and list of users who have marked this comment as favourite */ TL_PutDisabledIconFav (SocCom->NumFavs); - TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom); + TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom,TL_MAX_SHARERS_FAVERS_SHOWN); } else // I am not the author { @@ -2840,6 +2855,8 @@ static void TL_WriteComment (struct TL_Comment *SocCom, else // I am not a favouriter /* Put icon to fav this publication and list of users */ TL_PutFormToFavComment (SocCom); + /* Show who have marked this comment as favourite */ + TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom,TL_MAX_SHARERS_FAVERS_SHOWN); fprintf (Gbl.F.Out,"
"); } @@ -2958,10 +2975,20 @@ static void TL_PutDisabledIconFav (unsigned NumFavs) } /*****************************************************************************/ -/***************************** Form to share note ****************************/ +/*********************** Form to share/unshare note **************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers +static void TL_PutFormToSeeAllSharersNote (const struct TL_Note *SocNot) + { + char ParamCod[6 + 1 + 10 + 1]; + + /***** Form and icon to mark note as favourite *****/ + sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); + TL_FormFavSha (ActAllShaSocNotGbl,ActAllShaSocNotUsr,ParamCod, + "ellipsis-h.svg","Ver todos"); // TODO: Need translation!!!! + } + static void TL_PutFormToShareNote (const struct TL_Note *SocNot) { extern const char *Txt_Share; @@ -2970,14 +2997,9 @@ static void TL_PutFormToShareNote (const struct TL_Note *SocNot) /***** Form and icon to mark note as favourite *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); TL_FormFavSha (ActShaSocNotGbl,ActShaSocNotUsr,ParamCod, - "share-alt.svg",Txt_Share); + "share-alt.svg",Txt_Share); } -/*****************************************************************************/ -/****************** Form to unshare (stop sharing) note **********************/ -/*****************************************************************************/ -// All forms in this function and nested functions must have unique identifiers - static void TL_PutFormToUnshareNote (const struct TL_Note *SocNot) { extern const char *Txt_TIMELINE_NOTE_Shared; @@ -2986,14 +3008,24 @@ static void TL_PutFormToUnshareNote (const struct TL_Note *SocNot) /***** Form and icon to mark note as favourite *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); TL_FormFavSha (ActUnsSocNotGbl,ActUnsSocNotUsr,ParamCod, - "share-alt-green.svg",Txt_TIMELINE_NOTE_Shared); + "share-alt-green.svg",Txt_TIMELINE_NOTE_Shared); } /*****************************************************************************/ -/******************* Form to fav (mark as favourite) note ********************/ +/************************** Form to fav/unfav note ***************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers +static void TL_PutFormToSeeAllFaversNote (const struct TL_Note *SocNot) + { + char ParamCod[6 + 1 + 10 + 1]; + + /***** Form and icon to mark note as favourite *****/ + sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); + TL_FormFavSha (ActAllFavSocNotGbl,ActAllFavSocNotUsr,ParamCod, + "ellipsis-h.svg","Ver todos"); // TODO: Need translation!!!! + } + static void TL_PutFormToFavNote (const struct TL_Note *SocNot) { extern const char *Txt_Mark_as_favourite; @@ -3002,14 +3034,9 @@ static void TL_PutFormToFavNote (const struct TL_Note *SocNot) /***** Form and icon to mark note as favourite *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); TL_FormFavSha (ActFavSocNotGbl,ActFavSocNotUsr,ParamCod, - "heart.svg",Txt_Mark_as_favourite); + "heart.svg",Txt_Mark_as_favourite); } -/*****************************************************************************/ -/*************** Form to unfav (remove mark as favourite) note ***************/ -/*****************************************************************************/ -// All forms in this function and nested functions must have unique identifiers - static void TL_PutFormToUnfavNote (const struct TL_Note *SocNot) { extern const char *Txt_TIMELINE_NOTE_Favourite; @@ -3018,14 +3045,25 @@ static void TL_PutFormToUnfavNote (const struct TL_Note *SocNot) /***** Form and icon to unfav (remove mark as favourite) note *****/ sprintf (ParamCod,"NotCod=%ld",SocNot->NotCod); TL_FormFavSha (ActUnfSocNotGbl,ActUnfSocNotUsr,ParamCod, - "heart-red.svg",Txt_TIMELINE_NOTE_Favourite); + "heart-red.svg",Txt_TIMELINE_NOTE_Favourite); } /*****************************************************************************/ -/********************* Form to mark a comment as favourite *******************/ +/************************** Form to fav/unfav comment ************************/ /*****************************************************************************/ // All forms in this function and nested functions must have unique identifiers +static void TL_PutFormToSeeAllFaversComment (const struct TL_Comment *SocCom) + { + extern const char *Txt_Mark_as_favourite; + char ParamCod[6 + 1 + 10 + 1]; + + /***** Form and icon to mark comment as favourite *****/ + sprintf (ParamCod,"PubCod=%ld",SocCom->PubCod); + TL_FormFavSha (ActAllFavSocComGbl,ActAllFavSocComUsr,ParamCod, + "ellipsis-h.svg","Ver todos"); // TODO: Need translation!!!! + } + static void TL_PutFormToFavComment (struct TL_Comment *SocCom) { extern const char *Txt_Mark_as_favourite; @@ -3034,17 +3072,9 @@ static void TL_PutFormToFavComment (struct TL_Comment *SocCom) /***** Form and icon to mark comment as favourite *****/ sprintf (ParamCod,"PubCod=%ld",SocCom->PubCod); TL_FormFavSha (ActFavSocComGbl,ActFavSocComUsr,ParamCod, - "heart.svg",Txt_Mark_as_favourite); - - /***** Show who have marked this comment as favourite *****/ - TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom); + "heart.svg",Txt_Mark_as_favourite); } -/*****************************************************************************/ -/************* Form to unfav (remove mark as favourite) comment **************/ -/*****************************************************************************/ -// All forms in this function and nested functions must have unique identifiers - static void TL_PutFormToUnfavComment (struct TL_Comment *SocCom) { extern const char *Txt_TIMELINE_NOTE_Favourite; @@ -3053,10 +3083,7 @@ static void TL_PutFormToUnfavComment (struct TL_Comment *SocCom) /***** Form and icon to unfav (remove mark as favourite) comment *****/ sprintf (ParamCod,"PubCod=%ld",SocCom->PubCod); TL_FormFavSha (ActUnfSocComGbl,ActUnfSocComUsr,ParamCod, - "heart-red.svg",Txt_TIMELINE_NOTE_Favourite); - - /***** Show who have marked this comment as favourite *****/ - TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom); + "heart-red.svg",Txt_TIMELINE_NOTE_Favourite); } /*****************************************************************************/ @@ -3223,6 +3250,53 @@ static long TL_ReceiveComment (void) /******************************** Share a note *******************************/ /*****************************************************************************/ +void TL_ShowAllSharersNoteGbl (void) + { + struct TL_Note SocNot; + bool IAmASharerOfThisSocNot; + + /***** Get data of note *****/ + SocNot.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&SocNot); + IAmASharerOfThisSocNot = TL_CheckIfNoteIsSharedByUsr (SocNot.NotCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + + /***** Write HTML inside DIV with form to share/unshare *****/ + if (IAmASharerOfThisSocNot) + TL_PutFormToUnshareNote (&SocNot); + else + TL_PutFormToShareNote (&SocNot); + TL_ShowUsrsWhoHaveSharedNote (&SocNot,INT_MAX); + + /***** All the output is made, so don't write anymore *****/ + Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; + } + +void TL_ShowAllSharersNoteUsr (void) + { + struct TL_Note SocNot; + bool IAmASharerOfThisSocNot; + + /***** Get user whom profile is displayed *****/ + Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); + + /***** Get data of note *****/ + SocNot.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&SocNot); + IAmASharerOfThisSocNot = TL_CheckIfNoteIsSharedByUsr (SocNot.NotCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + + /***** Write HTML inside DIV with form to share/unshare *****/ + if (IAmASharerOfThisSocNot) + TL_PutFormToUnshareNote (&SocNot); + else + TL_PutFormToShareNote (&SocNot); + TL_ShowUsrsWhoHaveSharedNote (&SocNot,INT_MAX); + + /***** All the output is made, so don't write anymore *****/ + Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; + } + void TL_ShareNoteGbl (void) { struct TL_Note SocNot; @@ -3232,7 +3306,7 @@ void TL_ShareNoteGbl (void) /***** Write HTML inside DIV with form to unshare *****/ TL_PutFormToUnshareNote (&SocNot); - TL_ShowUsrsWhoHaveSharedNote (&SocNot); + TL_ShowUsrsWhoHaveSharedNote (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3250,7 +3324,7 @@ void TL_ShareNoteUsr (void) /***** Write HTML inside DIV with form to unshare *****/ TL_PutFormToUnshareNote (&SocNot); - TL_ShowUsrsWhoHaveSharedNote (&SocNot); + TL_ShowUsrsWhoHaveSharedNote (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3296,6 +3370,53 @@ static void TL_ShareNote (struct TL_Note *SocNot) /************************** Mark a note as favourite *************************/ /*****************************************************************************/ +void TL_ShowAllFaversNoteGbl (void) + { + struct TL_Note SocNot; + bool IAmAFaverOfThisSocNot; + + /***** Get data of note *****/ + SocNot.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&SocNot); + IAmAFaverOfThisSocNot = TL_CheckIfNoteIsFavedByUsr (SocNot.NotCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + + /***** Write HTML inside DIV with form to fav/unfav *****/ + if (IAmAFaverOfThisSocNot) + TL_PutFormToUnfavNote (&SocNot); + else + TL_PutFormToFavNote (&SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,INT_MAX); + + /***** All the output is made, so don't write anymore *****/ + Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; + } + +void TL_ShowAllFaversNoteUsr (void) + { + struct TL_Note SocNot; + bool IAmAFaverOfThisSocNot; + + /***** Get user whom profile is displayed *****/ + Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); + + /***** Get data of note *****/ + SocNot.NotCod = TL_GetParamNotCod (); + TL_GetDataOfNoteByCod (&SocNot); + IAmAFaverOfThisSocNot = TL_CheckIfNoteIsFavedByUsr (SocNot.NotCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + + /***** Write HTML inside DIV with form to fav/unfav *****/ + if (IAmAFaverOfThisSocNot) + TL_PutFormToUnfavNote (&SocNot); + else + TL_PutFormToFavNote (&SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,INT_MAX); + + /***** All the output is made, so don't write anymore *****/ + Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; + } + void TL_FavNoteGbl (void) { struct TL_Note SocNot; @@ -3305,7 +3426,7 @@ void TL_FavNoteGbl (void) /***** Write HTML inside DIV with form to unfav *****/ TL_PutFormToUnfavNote (&SocNot); - TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3323,7 +3444,7 @@ void TL_FavNoteUsr (void) /***** Write HTML inside DIV with form to unfav *****/ TL_PutFormToUnfavNote (&SocNot); - TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3343,7 +3464,7 @@ static void TL_FavNote (struct TL_Note *SocNot) ItsMe = Usr_ItsMe (SocNot->UsrCod); if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author if (!TL_CheckIfNoteIsFavedByUsr (SocNot->NotCod, - Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the note + Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the note { /***** Mark as favourite in database *****/ DB_QueryINSERT ("can not favourite note", @@ -3370,6 +3491,59 @@ static void TL_FavNote (struct TL_Note *SocNot) /************************ Mark a comment as favourite ************************/ /*****************************************************************************/ +void TL_ShowAllFaversComGbl (void) + { + struct TL_Comment SocCom; + bool IAmAFaverOfThisSocCom; + + /***** Initialize image *****/ + Med_MediaConstructor (&SocCom.Media); + + /***** Get data of comment *****/ + SocCom.PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (&SocCom); + IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom.PubCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + + /***** Free image *****/ + Med_MediaDestructor (&SocCom.Media); + + /***** Write HTML inside DIV with form to fav/unfav *****/ + if (IAmAFaverOfThisSocCom) + TL_PutFormToUnfavComment (&SocCom); + else + TL_PutFormToFavComment (&SocCom); + TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,INT_MAX); + + /***** All the output is made, so don't write anymore *****/ + Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; + } + +void TL_ShowAllFaversComUsr (void) + { + struct TL_Comment SocCom; + bool IAmAFaverOfThisSocCom; + + /***** Get user whom profile is displayed *****/ + Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); + + /***** Get data of comment *****/ + SocCom.PubCod = TL_GetParamPubCod (); + TL_GetDataOfCommByCod (&SocCom); + IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom.PubCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + + /***** Write HTML inside DIV with form to fav/unfav *****/ + if (IAmAFaverOfThisSocCom) + TL_PutFormToUnfavComment (&SocCom); + else + TL_PutFormToFavComment (&SocCom); + TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,INT_MAX); + + /***** All the output is made, so don't write anymore *****/ + Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; + } + void TL_FavCommentGbl (void) { struct TL_Comment SocCom; @@ -3379,6 +3553,7 @@ void TL_FavCommentGbl (void) /***** Write HTML inside DIV with form to unfav *****/ TL_PutFormToUnfavComment (&SocCom); + TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3396,6 +3571,7 @@ void TL_FavCommentUsr (void) /***** Write HTML inside DIV with form to unfav *****/ TL_PutFormToUnfavComment (&SocCom); + TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3417,7 +3593,7 @@ static void TL_FavComment (struct TL_Comment *SocCom) ItsMe = Usr_ItsMe (SocCom->UsrCod); if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author if (!TL_CheckIfCommIsFavedByUsr (SocCom->PubCod, - Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the comment + Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the comment { /***** Mark as favourite in database *****/ DB_QueryINSERT ("can not favourite comment", @@ -3489,7 +3665,7 @@ void TL_UnshareNoteGbl (void) /***** Write HTML inside DIV with form to share *****/ TL_PutFormToShareNote (&SocNot); - TL_ShowUsrsWhoHaveSharedNote (&SocNot); + TL_ShowUsrsWhoHaveSharedNote (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3507,7 +3683,7 @@ void TL_UnshareNoteUsr (void) /***** Write HTML inside DIV with form to share *****/ TL_PutFormToShareNote (&SocNot); - TL_ShowUsrsWhoHaveSharedNote (&SocNot); + TL_ShowUsrsWhoHaveSharedNote (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3565,7 +3741,7 @@ void TL_UnfavNoteGbl (void) /***** Write HTML inside DIV with form to fav *****/ TL_PutFormToFavNote (&SocNot); - TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3583,7 +3759,7 @@ void TL_UnfavNoteUsr (void) /***** Write HTML inside DIV with form to fav *****/ TL_PutFormToFavNote (&SocNot); - TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot); + TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3637,6 +3813,7 @@ void TL_UnfavCommentGbl (void) /***** Write HTML inside DIV with form to fav *****/ TL_PutFormToFavComment (&SocCom); + TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -3654,6 +3831,7 @@ void TL_UnfavCommentUsr (void) /***** Write HTML inside DIV with form to fav *****/ TL_PutFormToFavComment (&SocCom); + TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN); /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; @@ -4430,7 +4608,8 @@ static void TL_GetNumTimesACommHasBeenFav (struct TL_Comment *SocCom) /******************* Show users who have shared this note ********************/ /*****************************************************************************/ -static void TL_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot) +static void TL_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot, + unsigned Limit) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs = 0; @@ -4447,10 +4626,12 @@ static void TL_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot) SocNot->NotCod, SocNot->UsrCod, (unsigned) TL_PUB_SHARED_NOTE, - TL_MAX_SHARERS_FAVERS_SHOWN); + Limit); /***** Show users *****/ TL_ShowSharersOrFavers (&mysql_res,SocNot->NumShared,NumFirstUsrs); + if (NumFirstUsrs < SocNot->NumShared) + TL_PutFormToSeeAllSharersNote (SocNot); /***** Free structure that stores the query result *****/ if (SocNot->NumShared) @@ -4461,7 +4642,8 @@ static void TL_ShowUsrsWhoHaveSharedNote (const struct TL_Note *SocNot) /************ Show users who have marked this note as favourite **************/ /*****************************************************************************/ -static void TL_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot) +static void TL_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot, + unsigned Limit) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs = 0; @@ -4478,11 +4660,16 @@ static void TL_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot) " ORDER BY FavCod LIMIT %u", SocNot->NotCod, SocNot->UsrCod, - TL_MAX_SHARERS_FAVERS_SHOWN); + Limit); } /***** Show users *****/ TL_ShowSharersOrFavers (&mysql_res,SocNot->NumFavs,NumFirstUsrs); + if (NumFirstUsrs < SocNot->NumFavs) + TL_PutFormToSeeAllFaversNote (SocNot); + + /***** Separator between favs and shared *****/ + fprintf (Gbl.F.Out,"   "); /***** Free structure that stores the query result *****/ if (SocNot->NumFavs) @@ -4493,7 +4680,8 @@ static void TL_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Note *SocNot) /************ Show users who have marked this note as favourite **************/ /*****************************************************************************/ -static void TL_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom) +static void TL_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom, + unsigned Limit) { MYSQL_RES *mysql_res; unsigned NumFirstUsrs = 0; @@ -4509,10 +4697,12 @@ static void TL_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom) " ORDER BY FavCod LIMIT %u", SocCom->PubCod, SocCom->UsrCod, - TL_MAX_SHARERS_FAVERS_SHOWN); + Limit); /***** Show users *****/ TL_ShowSharersOrFavers (&mysql_res,SocCom->NumFavs,NumFirstUsrs); + if (NumFirstUsrs < SocCom->NumFavs) + TL_PutFormToSeeAllFaversComment (SocCom); /***** Free structure that stores the query result *****/ if (SocCom->NumFavs) @@ -4574,16 +4764,27 @@ static void TL_ShowSharersOrFavers (MYSQL_RES **mysql_res, /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); } - +/* if (NumUsrs > NumUsrsShown) - fprintf (Gbl.F.Out,"" + { + fprintf (Gbl.F.Out,"" + + "" + "%s (0)" + "" + "\"%u\"" "", + Gbl.UniqueNameEncrypted,NumDiv, Cfg_URL_ICON_PUBLIC, NumUsrs - NumUsrsShown, NumUsrs - NumUsrsShown); + } +*/ } } diff --git a/swad_timeline.h b/swad_timeline.h index aa05ad94..25d69207 100644 --- a/swad_timeline.h +++ b/swad_timeline.h @@ -154,10 +154,18 @@ void TL_PutHiddenParamPubCod (long PubCod); void TL_ReceiveCommentGbl (void); void TL_ReceiveCommentUsr (void); +void TL_ShowAllSharersNoteGbl (void); +void TL_ShowAllSharersNoteUsr (void); void TL_ShareNoteGbl (void); void TL_ShareNoteUsr (void); + +void TL_ShowAllFaversNoteGbl (void); +void TL_ShowAllFaversNoteUsr (void); void TL_FavNoteGbl (void); void TL_FavNoteUsr (void); + +void TL_ShowAllFaversComGbl (void); +void TL_ShowAllFaversComUsr (void); void TL_FavCommentGbl (void); void TL_FavCommentUsr (void);