mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-10 18:55:24 +02:00
Version18.90.1
This commit is contained in:
parent
492f38a5b9
commit
c0aa6913c0
|
@ -3097,23 +3097,27 @@ a:hover img.CENTRE_PHOTO_SHOW
|
||||||
.TL_ICO_FAV
|
.TL_ICO_FAV
|
||||||
{
|
{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
vertical-align:bottom;
|
width:50%;
|
||||||
|
vertical-align:top;
|
||||||
|
background:pink;
|
||||||
}
|
}
|
||||||
.TL_ICO_SHA
|
.TL_ICO_SHA
|
||||||
{
|
{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
vertical-align:bottom;
|
width:50%;
|
||||||
|
vertical-align:top;
|
||||||
|
background:lightgreen;
|
||||||
}
|
}
|
||||||
.TL_ICO_FAV_DISABLED
|
.TL_ICO_FAV_DISABLED
|
||||||
{
|
{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
vertical-align:bottom;
|
vertical-align:bottom;
|
||||||
opacity:0.1;
|
opacity:0.1;
|
||||||
|
background:pink;
|
||||||
}
|
}
|
||||||
.TL_ICO_SHA_DISABLED
|
.TL_ICO_SHA_DISABLED
|
||||||
{
|
{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
padding-left:20px;
|
|
||||||
vertical-align:bottom;
|
vertical-align:bottom;
|
||||||
opacity:0.1;
|
opacity:0.1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,11 +464,11 @@ En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 18.90 (2019-03-28)"
|
#define Log_PLATFORM_VERSION "SWAD 18.90.1 (2019-03-28)"
|
||||||
#define CSS_FILE "swad18.89.5.css"
|
#define CSS_FILE "swad18.89.5.css"
|
||||||
#define JS_FILE "swad18.89.5.js"
|
#define JS_FILE "swad18.89.5.js"
|
||||||
/*
|
/*
|
||||||
* TODO: Ver todos los favoritos de una pub. mía
|
Version 18.90.1: Mar 28, 2019 Show all users who have shared/faved social notes and comments. Not finished. (241358 lines)
|
||||||
Version 18.90: Mar 28, 2019 Show all users who have shared/faved social notes and comments. Not finished. (241360 lines)
|
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:
|
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 ('1766','es','N','Ver quiénes comp. public. social (global)');
|
||||||
|
|
341
swad_timeline.c
341
swad_timeline.c
|
@ -234,13 +234,16 @@ static long TL_ReceiveComment (void);
|
||||||
|
|
||||||
static void TL_ShareNote (struct TL_Note *SocNot);
|
static void TL_ShareNote (struct TL_Note *SocNot);
|
||||||
static void TL_FavNote (struct TL_Note *SocNot);
|
static void TL_FavNote (struct TL_Note *SocNot);
|
||||||
|
|
||||||
|
static void TL_PutFormToFavUnfavComment (struct TL_Comment *SocCom,unsigned Limit);
|
||||||
static void TL_FavComment (struct TL_Comment *SocCom);
|
static void TL_FavComment (struct TL_Comment *SocCom);
|
||||||
|
static void TL_UnfavComment (struct TL_Comment *SocCom);
|
||||||
|
|
||||||
static void TL_CreateNotifToAuthor (long AuthorCod,long PubCod,
|
static void TL_CreateNotifToAuthor (long AuthorCod,long PubCod,
|
||||||
Ntf_NotifyEvent_t NotifyEvent);
|
Ntf_NotifyEvent_t NotifyEvent);
|
||||||
|
|
||||||
static void TL_UnshareNote (struct TL_Note *SocNot);
|
static void TL_UnshareNote (struct TL_Note *SocNot);
|
||||||
static void TL_UnfavNote (struct TL_Note *SocNot);
|
static void TL_UnfavNote (struct TL_Note *SocNot);
|
||||||
static void TL_UnfavComment (struct TL_Comment *SocCom);
|
|
||||||
|
|
||||||
static void TL_RequestRemovalNote (void);
|
static void TL_RequestRemovalNote (void);
|
||||||
static void TL_PutParamsRemoveNote (void);
|
static void TL_PutParamsRemoveNote (void);
|
||||||
|
@ -1638,54 +1641,46 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
|
||||||
"<div class=\"TL_ICO_FAV_SHA_REM\">");
|
"<div class=\"TL_ICO_FAV_SHA_REM\">");
|
||||||
|
|
||||||
/* Put icon to mark this note as favourite */
|
/* Put icon to mark this note as favourite */
|
||||||
|
fprintf (Gbl.F.Out,"<div id=\"fav_not_%s_%u\" class=\"TL_ICO_FAV\">",
|
||||||
|
Gbl.UniqueNameEncrypted,NumDiv);
|
||||||
if (SocNot->Unavailable || // Unavailable notes can not be favourited
|
if (SocNot->Unavailable || // Unavailable notes can not be favourited
|
||||||
IAmTheAuthor) // I am the author
|
IAmTheAuthor) // I am the author
|
||||||
{
|
|
||||||
/* Put disabled icon and list of users
|
/* Put disabled icon and list of users
|
||||||
who have marked this note as favourite */
|
who have marked this note as favourite */
|
||||||
TL_PutDisabledIconFav (SocNot->NumFavs);
|
TL_PutDisabledIconFav (SocNot->NumFavs);
|
||||||
TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN);
|
|
||||||
}
|
|
||||||
else // Available and I am not the author
|
else // Available and I am not the author
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div id=\"fav_not_%s_%u\""
|
|
||||||
" class=\"TL_ICO_FAV\">",
|
|
||||||
Gbl.UniqueNameEncrypted,NumDiv);
|
|
||||||
if (IAmAFaverOfThisSocNot) // I have favourited this note
|
if (IAmAFaverOfThisSocNot) // I have favourited this note
|
||||||
/* Put icon to unfav this publication and list of users */
|
/* Put icon to unfav this publication and list of users */
|
||||||
TL_PutFormToUnfavNote (SocNot);
|
TL_PutFormToUnfavNote (SocNot);
|
||||||
else // I am not a faver of this note
|
else // I am not a faver of this note
|
||||||
/* Put icon to fav this publication and list of users */
|
/* Put icon to fav this publication and list of users */
|
||||||
TL_PutFormToFavNote (SocNot);
|
TL_PutFormToFavNote (SocNot);
|
||||||
/* Show who have marked this note as favourite */
|
|
||||||
TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN);
|
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
|
||||||
}
|
}
|
||||||
|
/* Show who have marked this note as favourite */
|
||||||
|
TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN);
|
||||||
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
|
||||||
/* Put icon to share/unshare */
|
/* Put icon to share/unshare */
|
||||||
|
fprintf (Gbl.F.Out,"<div id=\"sha_not_%s_%u\" class=\"TL_ICO_SHA\">",
|
||||||
|
Gbl.UniqueNameEncrypted,NumDiv);
|
||||||
if (SocNot->Unavailable || // Unavailable notes can not be shared
|
if (SocNot->Unavailable || // Unavailable notes can not be shared
|
||||||
IAmTheAuthor) // I am the author
|
IAmTheAuthor) // I am the author
|
||||||
{
|
|
||||||
/* Put disabled icon and list of users
|
/* Put disabled icon and list of users
|
||||||
who have shared this note */
|
who have shared this note */
|
||||||
TL_PutDisabledIconShare (SocNot->NumShared);
|
TL_PutDisabledIconShare (SocNot->NumShared);
|
||||||
TL_ShowUsrsWhoHaveSharedNote (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN);
|
|
||||||
}
|
|
||||||
else // Available and I am not the author
|
else // Available and I am not the author
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div id=\"sha_not_%s_%u\""
|
|
||||||
" class=\"TL_ICO_SHA\">",
|
|
||||||
Gbl.UniqueNameEncrypted,NumDiv);
|
|
||||||
if (IAmASharerOfThisSocNot) // I am a sharer of this note
|
if (IAmASharerOfThisSocNot) // I am a sharer of this note
|
||||||
/* Put icon to unshare this publication and list of users */
|
/* Put icon to unshare this publication and list of users */
|
||||||
TL_PutFormToUnshareNote (SocNot);
|
TL_PutFormToUnshareNote (SocNot);
|
||||||
else // I am not a sharer of this note
|
else // I am not a sharer of this note
|
||||||
/* Put icon to share this publication and list of users */
|
/* Put icon to share this publication and list of users */
|
||||||
TL_PutFormToShareNote (SocNot);
|
TL_PutFormToShareNote (SocNot);
|
||||||
/* Show who have shared this note */
|
|
||||||
TL_ShowUsrsWhoHaveSharedNote (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN);
|
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
|
||||||
}
|
}
|
||||||
|
/* Show who have shared this note */
|
||||||
|
TL_ShowUsrsWhoHaveSharedNote (SocNot,TL_MAX_SHARERS_FAVERS_SHOWN);
|
||||||
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
|
||||||
/* Put icon to remove this note */
|
/* Put icon to remove this note */
|
||||||
if (IAmTheAuthor)
|
if (IAmTheAuthor)
|
||||||
|
@ -2724,8 +2719,8 @@ static void TL_WriteOneCommentInList (MYSQL_RES *mysql_res)
|
||||||
|
|
||||||
/***** Write comment *****/
|
/***** Write comment *****/
|
||||||
TL_WriteComment (&SocCom,
|
TL_WriteComment (&SocCom,
|
||||||
TL_TOP_MESSAGE_NONE,-1L,
|
TL_TOP_MESSAGE_NONE,-1L,
|
||||||
false);
|
false); // Not alone
|
||||||
|
|
||||||
/***** Free image *****/
|
/***** Free image *****/
|
||||||
Med_MediaDestructor (&SocCom.Media);
|
Med_MediaDestructor (&SocCom.Media);
|
||||||
|
@ -2765,9 +2760,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
|
||||||
extern const char *Txt_Centre;
|
extern const char *Txt_Centre;
|
||||||
extern const char *Txt_Institution;
|
extern const char *Txt_Institution;
|
||||||
struct UsrData UsrDat;
|
struct UsrData UsrDat;
|
||||||
bool ItsMe;
|
|
||||||
bool IAmTheAuthor;
|
bool IAmTheAuthor;
|
||||||
bool IAmAFaverOfThisSocCom = false;
|
|
||||||
bool ShowPhoto = false;
|
bool ShowPhoto = false;
|
||||||
char PhotoURL[PATH_MAX + 1];
|
char PhotoURL[PATH_MAX + 1];
|
||||||
static unsigned NumDiv = 0; // Used to create unique div id for fav
|
static unsigned NumDiv = 0; // Used to create unique div id for fav
|
||||||
|
@ -2804,11 +2797,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
|
||||||
Usr_UsrDataConstructor (&UsrDat);
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
UsrDat.UsrCod = SocCom->UsrCod;
|
UsrDat.UsrCod = SocCom->UsrCod;
|
||||||
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS);
|
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS);
|
||||||
ItsMe = Usr_ItsMe (UsrDat.UsrCod);
|
IAmTheAuthor = Usr_ItsMe (UsrDat.UsrCod);
|
||||||
IAmTheAuthor = ItsMe;
|
|
||||||
if (!IAmTheAuthor)
|
|
||||||
IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom->PubCod,
|
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Left: write author's photo *****/
|
/***** Left: write author's photo *****/
|
||||||
fprintf (Gbl.F.Out,"<div class=\"TL_COMMENT_PHOTO\">");
|
fprintf (Gbl.F.Out,"<div class=\"TL_COMMENT_PHOTO\">");
|
||||||
|
@ -2836,29 +2825,15 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
|
||||||
Med_ShowMedia (&SocCom->Media,"TL_COMMENT_MED_CONTAINER TL_COMMENT_WIDTH",
|
Med_ShowMedia (&SocCom->Media,"TL_COMMENT_MED_CONTAINER TL_COMMENT_WIDTH",
|
||||||
"TL_COMMENT_MED TL_COMMENT_WIDTH");
|
"TL_COMMENT_MED TL_COMMENT_WIDTH");
|
||||||
|
|
||||||
/* Put icon to mark this comment as favourite */
|
/* Start favs container */
|
||||||
if (IAmTheAuthor) // I am the author
|
fprintf (Gbl.F.Out,"<div id=\"fav_com_%s_%u\" class=\"TL_ICO_FAV\">",
|
||||||
{
|
Gbl.UniqueNameEncrypted,NumDiv);
|
||||||
/* Put disabled icon and list of users
|
|
||||||
who have marked this comment as favourite */
|
/* Write HTML inside DIV with form to fav/unfav */
|
||||||
TL_PutDisabledIconFav (SocCom->NumFavs);
|
TL_PutFormToFavUnfavComment (SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
||||||
TL_ShowUsrsWhoHaveMarkedCommAsFav (SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
|
||||||
}
|
/* End favs container */
|
||||||
else // I am not the author
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<div id=\"fav_com_%s_%u\""
|
|
||||||
" class=\"TL_ICO_FAV\">",
|
|
||||||
Gbl.UniqueNameEncrypted,NumDiv);
|
|
||||||
if (IAmAFaverOfThisSocCom) // I have favourited this comment
|
|
||||||
/* Put icon to unfav this publication and list of users */
|
|
||||||
TL_PutFormToUnfavComment (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,"</div>");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Put icon to remove this comment */
|
/* Put icon to remove this comment */
|
||||||
if (IAmTheAuthor && !ShowCommentAlone)
|
if (IAmTheAuthor && !ShowCommentAlone)
|
||||||
|
@ -3253,19 +3228,31 @@ static long TL_ReceiveComment (void)
|
||||||
void TL_ShowAllSharersNoteGbl (void)
|
void TL_ShowAllSharersNoteGbl (void)
|
||||||
{
|
{
|
||||||
struct TL_Note SocNot;
|
struct TL_Note SocNot;
|
||||||
|
bool IAmTheAuthor;
|
||||||
bool IAmASharerOfThisSocNot;
|
bool IAmASharerOfThisSocNot;
|
||||||
|
|
||||||
/***** Get data of note *****/
|
/***** Get data of note *****/
|
||||||
SocNot.NotCod = TL_GetParamNotCod ();
|
SocNot.NotCod = TL_GetParamNotCod ();
|
||||||
TL_GetDataOfNoteByCod (&SocNot);
|
TL_GetDataOfNoteByCod (&SocNot);
|
||||||
IAmASharerOfThisSocNot = TL_CheckIfNoteIsSharedByUsr (SocNot.NotCod,
|
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to share/unshare *****/
|
/***** Write HTML inside DIV with form to share/unshare *****/
|
||||||
if (IAmASharerOfThisSocNot)
|
IAmTheAuthor = Usr_ItsMe (SocNot.UsrCod);
|
||||||
TL_PutFormToUnshareNote (&SocNot);
|
if (SocNot.Unavailable || // Unavailable notes can not be shared
|
||||||
else
|
IAmTheAuthor) // I am the author
|
||||||
TL_PutFormToShareNote (&SocNot);
|
/* Put disabled icon */
|
||||||
|
TL_PutDisabledIconShare (SocNot.NumShared);
|
||||||
|
else // Available and I am not the author
|
||||||
|
{
|
||||||
|
/* Put icon to share/unshare */
|
||||||
|
IAmASharerOfThisSocNot = TL_CheckIfNoteIsSharedByUsr (SocNot.NotCod,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
|
if (IAmASharerOfThisSocNot) // I have shared this note
|
||||||
|
TL_PutFormToUnshareNote (&SocNot);
|
||||||
|
else // I have not shared this note
|
||||||
|
TL_PutFormToShareNote (&SocNot);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show list of users who have shared this note */
|
||||||
TL_ShowUsrsWhoHaveSharedNote (&SocNot,INT_MAX);
|
TL_ShowUsrsWhoHaveSharedNote (&SocNot,INT_MAX);
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
|
@ -3373,19 +3360,31 @@ static void TL_ShareNote (struct TL_Note *SocNot)
|
||||||
void TL_ShowAllFaversNoteGbl (void)
|
void TL_ShowAllFaversNoteGbl (void)
|
||||||
{
|
{
|
||||||
struct TL_Note SocNot;
|
struct TL_Note SocNot;
|
||||||
|
bool IAmTheAuthor;
|
||||||
bool IAmAFaverOfThisSocNot;
|
bool IAmAFaverOfThisSocNot;
|
||||||
|
|
||||||
/***** Get data of note *****/
|
/***** Get data of note *****/
|
||||||
SocNot.NotCod = TL_GetParamNotCod ();
|
SocNot.NotCod = TL_GetParamNotCod ();
|
||||||
TL_GetDataOfNoteByCod (&SocNot);
|
TL_GetDataOfNoteByCod (&SocNot);
|
||||||
IAmAFaverOfThisSocNot = TL_CheckIfNoteIsFavedByUsr (SocNot.NotCod,
|
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to fav/unfav *****/
|
/***** Write HTML inside DIV with form to fav/unfav *****/
|
||||||
if (IAmAFaverOfThisSocNot)
|
IAmTheAuthor = Usr_ItsMe (SocNot.UsrCod);
|
||||||
TL_PutFormToUnfavNote (&SocNot);
|
if (SocNot.Unavailable || // Unavailable notes can not be favourited
|
||||||
else
|
IAmTheAuthor) // I am the author
|
||||||
TL_PutFormToFavNote (&SocNot);
|
/* Put disabled icon */
|
||||||
|
TL_PutDisabledIconFav (SocNot.NumFavs);
|
||||||
|
else // Available and I am not the author
|
||||||
|
{
|
||||||
|
/* Put icon to fav/unfav */
|
||||||
|
IAmAFaverOfThisSocNot = TL_CheckIfNoteIsFavedByUsr (SocNot.NotCod,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
|
if (IAmAFaverOfThisSocNot) // I have favourited this note
|
||||||
|
TL_PutFormToUnfavNote (&SocNot);
|
||||||
|
else // I am not a faver of this note
|
||||||
|
TL_PutFormToFavNote (&SocNot);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show list of users who have marked this note as favourite */
|
||||||
TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,INT_MAX);
|
TL_ShowUsrsWhoHaveMarkedNoteAsFav (&SocNot,INT_MAX);
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
|
@ -3488,32 +3487,21 @@ static void TL_FavNote (struct TL_Note *SocNot)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************ Mark a comment as favourite ************************/
|
/********************* Mark/unmark a comment as favourite ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void TL_ShowAllFaversComGbl (void)
|
void TL_ShowAllFaversComGbl (void)
|
||||||
{
|
{
|
||||||
struct TL_Comment SocCom;
|
struct TL_Comment SocCom;
|
||||||
bool IAmAFaverOfThisSocCom;
|
|
||||||
|
|
||||||
/***** Initialize image *****/
|
|
||||||
Med_MediaConstructor (&SocCom.Media);
|
|
||||||
|
|
||||||
/***** Get data of comment *****/
|
/***** Get data of comment *****/
|
||||||
|
Med_MediaConstructor (&SocCom.Media);
|
||||||
SocCom.PubCod = TL_GetParamPubCod ();
|
SocCom.PubCod = TL_GetParamPubCod ();
|
||||||
TL_GetDataOfCommByCod (&SocCom);
|
TL_GetDataOfCommByCod (&SocCom);
|
||||||
IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom.PubCod,
|
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Free image *****/
|
|
||||||
Med_MediaDestructor (&SocCom.Media);
|
Med_MediaDestructor (&SocCom.Media);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to fav/unfav *****/
|
/***** Write HTML inside DIV with form to fav/unfav *****/
|
||||||
if (IAmAFaverOfThisSocCom)
|
TL_PutFormToFavUnfavComment (&SocCom,INT_MAX);
|
||||||
TL_PutFormToUnfavComment (&SocCom);
|
|
||||||
else
|
|
||||||
TL_PutFormToFavComment (&SocCom);
|
|
||||||
TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,INT_MAX);
|
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
|
@ -3522,23 +3510,18 @@ void TL_ShowAllFaversComGbl (void)
|
||||||
void TL_ShowAllFaversComUsr (void)
|
void TL_ShowAllFaversComUsr (void)
|
||||||
{
|
{
|
||||||
struct TL_Comment SocCom;
|
struct TL_Comment SocCom;
|
||||||
bool IAmAFaverOfThisSocCom;
|
|
||||||
|
|
||||||
/***** Get user whom profile is displayed *****/
|
/***** Get user whom profile is displayed *****/
|
||||||
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
||||||
|
|
||||||
/***** Get data of comment *****/
|
/***** Get data of comment *****/
|
||||||
|
Med_MediaConstructor (&SocCom.Media);
|
||||||
SocCom.PubCod = TL_GetParamPubCod ();
|
SocCom.PubCod = TL_GetParamPubCod ();
|
||||||
TL_GetDataOfCommByCod (&SocCom);
|
TL_GetDataOfCommByCod (&SocCom);
|
||||||
IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom.PubCod,
|
Med_MediaDestructor (&SocCom.Media);
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to fav/unfav *****/
|
/***** Write HTML inside DIV with form to fav/unfav *****/
|
||||||
if (IAmAFaverOfThisSocCom)
|
TL_PutFormToFavUnfavComment (&SocCom,INT_MAX);
|
||||||
TL_PutFormToUnfavComment (&SocCom);
|
|
||||||
else
|
|
||||||
TL_PutFormToFavComment (&SocCom);
|
|
||||||
TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,INT_MAX);
|
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
|
@ -3552,8 +3535,7 @@ void TL_FavCommentGbl (void)
|
||||||
TL_FavComment (&SocCom);
|
TL_FavComment (&SocCom);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to unfav *****/
|
/***** Write HTML inside DIV with form to unfav *****/
|
||||||
TL_PutFormToUnfavComment (&SocCom);
|
TL_PutFormToFavUnfavComment (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
||||||
TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
|
@ -3570,16 +3552,72 @@ void TL_FavCommentUsr (void)
|
||||||
TL_FavComment (&SocCom);
|
TL_FavComment (&SocCom);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to unfav *****/
|
/***** Write HTML inside DIV with form to unfav *****/
|
||||||
TL_PutFormToUnfavComment (&SocCom);
|
TL_PutFormToFavUnfavComment (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
||||||
TL_ShowUsrsWhoHaveMarkedCommAsFav (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TL_UnfavCommentGbl (void)
|
||||||
|
{
|
||||||
|
struct TL_Comment SocCom;
|
||||||
|
|
||||||
|
/***** Stop marking as favourite a previously favourited comment *****/
|
||||||
|
TL_UnfavComment (&SocCom);
|
||||||
|
|
||||||
|
/***** Write HTML inside DIV with form to fav *****/
|
||||||
|
TL_PutFormToFavUnfavComment (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
||||||
|
|
||||||
|
/***** All the output is made, so don't write anymore *****/
|
||||||
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TL_UnfavCommentUsr (void)
|
||||||
|
{
|
||||||
|
struct TL_Comment SocCom;
|
||||||
|
|
||||||
|
/***** Get user whom profile is displayed *****/
|
||||||
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
||||||
|
|
||||||
|
/***** Unfav a comment previously marked as favourite *****/
|
||||||
|
TL_UnfavComment (&SocCom);
|
||||||
|
|
||||||
|
/***** Write HTML inside DIV with form to fav *****/
|
||||||
|
TL_PutFormToFavUnfavComment (&SocCom,TL_MAX_SHARERS_FAVERS_SHOWN);
|
||||||
|
|
||||||
|
/***** All the output is made, so don't write anymore *****/
|
||||||
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void TL_PutFormToFavUnfavComment (struct TL_Comment *SocCom,unsigned Limit)
|
||||||
|
{
|
||||||
|
bool IAmTheAuthor;
|
||||||
|
bool IAmAFaverOfThisSocCom;
|
||||||
|
|
||||||
|
IAmTheAuthor = Usr_ItsMe (SocCom->UsrCod);
|
||||||
|
if (IAmTheAuthor) // I am the author
|
||||||
|
/* Put disabled icon */
|
||||||
|
TL_PutDisabledIconFav (SocCom->NumFavs);
|
||||||
|
else // I am not the author
|
||||||
|
{
|
||||||
|
/* Put icon to mark this comment as favourite */
|
||||||
|
IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom->PubCod,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
|
if (IAmAFaverOfThisSocCom) // I have favourited this comment
|
||||||
|
/* Put icon to unfav this publication and list of users */
|
||||||
|
TL_PutFormToUnfavComment (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,Limit);
|
||||||
|
}
|
||||||
|
|
||||||
static void TL_FavComment (struct TL_Comment *SocCom)
|
static void TL_FavComment (struct TL_Comment *SocCom)
|
||||||
{
|
{
|
||||||
bool ItsMe;
|
bool IAmTheAuthor;
|
||||||
|
|
||||||
/***** Initialize image *****/
|
/***** Initialize image *****/
|
||||||
Med_MediaConstructor (&SocCom->Media);
|
Med_MediaConstructor (&SocCom->Media);
|
||||||
|
@ -3590,8 +3628,8 @@ static void TL_FavComment (struct TL_Comment *SocCom)
|
||||||
|
|
||||||
if (SocCom->PubCod > 0)
|
if (SocCom->PubCod > 0)
|
||||||
{
|
{
|
||||||
ItsMe = Usr_ItsMe (SocCom->UsrCod);
|
IAmTheAuthor = Usr_ItsMe (SocCom->UsrCod);
|
||||||
if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
|
if (!IAmTheAuthor) // I am not the author
|
||||||
if (!TL_CheckIfCommIsFavedByUsr (SocCom->PubCod,
|
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
|
||||||
{
|
{
|
||||||
|
@ -3617,6 +3655,44 @@ static void TL_FavComment (struct TL_Comment *SocCom)
|
||||||
Med_MediaDestructor (&SocCom->Media);
|
Med_MediaDestructor (&SocCom->Media);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void TL_UnfavComment (struct TL_Comment *SocCom)
|
||||||
|
{
|
||||||
|
bool IAmTheAuthor;
|
||||||
|
|
||||||
|
/***** Initialize image *****/
|
||||||
|
Med_MediaConstructor (&SocCom->Media);
|
||||||
|
|
||||||
|
/***** Get data of comment *****/
|
||||||
|
SocCom->PubCod = TL_GetParamPubCod ();
|
||||||
|
TL_GetDataOfCommByCod (SocCom);
|
||||||
|
|
||||||
|
if (SocCom->PubCod > 0)
|
||||||
|
{
|
||||||
|
IAmTheAuthor = Usr_ItsMe (SocCom->UsrCod);
|
||||||
|
if (SocCom->NumFavs &&
|
||||||
|
!IAmTheAuthor) // I am not the author
|
||||||
|
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 comment",
|
||||||
|
"DELETE FROM social_comments_fav"
|
||||||
|
" WHERE PubCod=%ld AND UsrCod=%ld",
|
||||||
|
SocCom->PubCod,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
|
|
||||||
|
/***** Update number of times this comment is favourited *****/
|
||||||
|
TL_GetNumTimesACommHasBeenFav (SocCom);
|
||||||
|
|
||||||
|
/***** Mark possible notifications on this comment as removed *****/
|
||||||
|
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,SocCom->PubCod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Free image *****/
|
||||||
|
Med_MediaDestructor (&SocCom->Media);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********** Create a notification for the author of a post/comment **********/
|
/*********** Create a notification for the author of a post/comment **********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3800,81 +3876,6 @@ static void TL_UnfavNote (struct TL_Note *SocNot)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/********* Stop marking as favourite a previously favourited comment *********/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void TL_UnfavCommentGbl (void)
|
|
||||||
{
|
|
||||||
struct TL_Comment SocCom;
|
|
||||||
|
|
||||||
/***** Stop marking as favourite a previously favourited comment *****/
|
|
||||||
TL_UnfavComment (&SocCom);
|
|
||||||
|
|
||||||
/***** 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TL_UnfavCommentUsr (void)
|
|
||||||
{
|
|
||||||
struct TL_Comment SocCom;
|
|
||||||
|
|
||||||
/***** Get user whom profile is displayed *****/
|
|
||||||
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
|
||||||
|
|
||||||
/***** Unfav a comment previously marked as favourite *****/
|
|
||||||
TL_UnfavComment (&SocCom);
|
|
||||||
|
|
||||||
/***** 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void TL_UnfavComment (struct TL_Comment *SocCom)
|
|
||||||
{
|
|
||||||
bool ItsMe;
|
|
||||||
|
|
||||||
/***** Initialize image *****/
|
|
||||||
Med_MediaConstructor (&SocCom->Media);
|
|
||||||
|
|
||||||
/***** 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 (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 comment",
|
|
||||||
"DELETE FROM social_comments_fav"
|
|
||||||
" WHERE PubCod=%ld AND UsrCod=%ld",
|
|
||||||
SocCom->PubCod,
|
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Update number of times this comment is favourited *****/
|
|
||||||
TL_GetNumTimesACommHasBeenFav (SocCom);
|
|
||||||
|
|
||||||
/***** Mark possible notifications on this comment as removed *****/
|
|
||||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,SocCom->PubCod);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Free image *****/
|
|
||||||
Med_MediaDestructor (&SocCom->Media);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Request the removal of a note ***********************/
|
/*********************** Request the removal of a note ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -4242,8 +4243,8 @@ static void TL_RequestRemovalComment (void)
|
||||||
|
|
||||||
/* Show comment */
|
/* Show comment */
|
||||||
TL_WriteComment (&SocCom,
|
TL_WriteComment (&SocCom,
|
||||||
TL_TOP_MESSAGE_NONE,-1L,
|
TL_TOP_MESSAGE_NONE,-1L,
|
||||||
true);
|
true); // Alone
|
||||||
|
|
||||||
/* End alert */
|
/* End alert */
|
||||||
Gbl.Timeline.PubCod = SocCom.PubCod; // Publication to be removed
|
Gbl.Timeline.PubCod = SocCom.PubCod; // Publication to be removed
|
||||||
|
|
Loading…
Reference in New Issue
Block a user