2021-02-08 16:24:58 +01:00
|
|
|
|
// swad_timeline_favourite.c: social timeline favourites
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2021-02-09 12:43:45 +01:00
|
|
|
|
Copyright (C) 1999-2021 Antonio Ca<EFBFBD>as Vargas
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General 3 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*********************************** Headers *********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "swad_database.h"
|
|
|
|
|
#include "swad_global.h"
|
|
|
|
|
#include "swad_timeline.h"
|
|
|
|
|
#include "swad_timeline_favourite.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****************************** Public constants *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Private constants and types ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#define TL_ICON_FAV "heart.svg"
|
|
|
|
|
#define TL_ICON_FAVED "heart-red.svg"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************** External global variables from others modules ****************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
extern struct Globals Gbl;
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Private global variables **************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Private prototypes ****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
static void TL_Fav_PutDisabledIconFav (unsigned NumFavs);
|
|
|
|
|
|
2021-02-08 20:16:00 +01:00
|
|
|
|
static void TL_Fav_PutFormToFavNote (long ParamCod);
|
|
|
|
|
static void TL_Fav_PutFormToUnfNote (long ParamCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
2021-02-08 20:16:00 +01:00
|
|
|
|
static void TL_Fav_PutFormToFavComment (long ParamCod);
|
|
|
|
|
static void TL_Fav_PutFormToUnfComment (long ParamCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_FavNote (struct TL_Not_Note *Not);
|
|
|
|
|
static void TL_Fav_UnfNote (struct TL_Not_Note *Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_FavComment (struct TL_Com_Comment *Com);
|
|
|
|
|
static void TL_Fav_UnfComment (struct TL_Com_Comment *Com);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
static bool TL_Fav_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod);
|
|
|
|
|
static bool TL_Fav_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod);
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Not_Note *Not,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_HowManyUsrs_t HowManyUsrs);
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Com_Comment *Com,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_HowManyUsrs_t HowManyUsrs);
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****************** Put disabled icon to mark as favourite *******************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
static void TL_Fav_PutDisabledIconFav (unsigned NumFavs)
|
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_TIMELINE_NOTE_Favourited_by_X_USERS;
|
|
|
|
|
extern const char *Txt_TIMELINE_NOTE_Not_favourited_by_anyone;
|
|
|
|
|
|
|
|
|
|
/***** Disabled icon to mark as favourite *****/
|
|
|
|
|
if (NumFavs)
|
|
|
|
|
{
|
|
|
|
|
Ico_PutDivIcon ("TL_ICO_DISABLED",TL_ICON_FAV,
|
|
|
|
|
Str_BuildStringLong (Txt_TIMELINE_NOTE_Favourited_by_X_USERS,
|
|
|
|
|
(long) NumFavs));
|
|
|
|
|
Str_FreeString ();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
Ico_PutDivIcon ("TL_ICO_DISABLED",TL_ICON_FAV,
|
|
|
|
|
Txt_TIMELINE_NOTE_Not_favourited_by_anyone);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2021-02-08 20:16:00 +01:00
|
|
|
|
/************************** Form to fav/unfav note ***************************/
|
2021-02-08 16:24:58 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-02-08 20:16:00 +01:00
|
|
|
|
static void TL_Fav_PutFormToFavNote (long ParamCod)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Mark_as_favourite;
|
|
|
|
|
|
|
|
|
|
/***** Form and icon to mark note as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_FormFavSha (ActFavTL_NotGbl,ActFavTL_NotUsr,
|
2021-02-08 20:16:00 +01:00
|
|
|
|
"NotCod=%ld",ParamCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_ICON_FAV,Txt_Mark_as_favourite);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-08 20:16:00 +01:00
|
|
|
|
static void TL_Fav_PutFormToUnfNote (long ParamCod)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_TIMELINE_NOTE_Favourite;
|
|
|
|
|
|
|
|
|
|
/***** Form and icon to unfav (remove mark as favourite) note *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_FormFavSha (ActUnfTL_NotGbl,ActUnfTL_NotUsr,
|
2021-02-08 20:16:00 +01:00
|
|
|
|
"NotCod=%ld",ParamCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_ICON_FAVED,Txt_TIMELINE_NOTE_Favourite);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************** Form to fav/unfav comment ************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-02-08 20:16:00 +01:00
|
|
|
|
static void TL_Fav_PutFormToFavComment (long ParamCod)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Mark_as_favourite;
|
|
|
|
|
|
|
|
|
|
/***** Form and icon to mark comment as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_FormFavSha (ActFavTL_ComGbl,ActFavTL_ComUsr,
|
2021-02-08 20:16:00 +01:00
|
|
|
|
"PubCod=%ld",ParamCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_ICON_FAV,Txt_Mark_as_favourite);
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-08 20:16:00 +01:00
|
|
|
|
static void TL_Fav_PutFormToUnfComment (long ParamCod)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_TIMELINE_NOTE_Favourite;
|
|
|
|
|
|
|
|
|
|
/***** Form and icon to unfav (remove mark as favourite) comment *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_FormFavSha (ActUnfTL_ComGbl,ActUnfTL_ComUsr,
|
2021-02-08 20:16:00 +01:00
|
|
|
|
"PubCod=%ld",ParamCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_ICON_FAVED,Txt_TIMELINE_NOTE_Favourite);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************** Mark/unmark a note as favourite **********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_Fav_ShowAllFaversNoteUsr (void)
|
|
|
|
|
{
|
|
|
|
|
/***** Get user whom profile is displayed *****/
|
|
|
|
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
|
|
|
|
|
|
|
|
|
/***** Show all favers *****/
|
|
|
|
|
TL_Fav_ShowAllFaversNoteGbl ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_ShowAllFaversNoteGbl (void)
|
|
|
|
|
{
|
2021-02-11 00:58:53 +01:00
|
|
|
|
struct TL_Not_Note Not;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Get data of note *****/
|
2021-02-11 00:58:53 +01:00
|
|
|
|
Not.NotCod = TL_Not_GetParamNotCod ();
|
|
|
|
|
TL_Not_GetDataOfNoteByCod (&Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Write HTML inside DIV with form to fav/unfav *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_ALL_USRS);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_FavNoteUsr (void)
|
|
|
|
|
{
|
|
|
|
|
/***** Get user whom profile is displayed *****/
|
|
|
|
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
|
|
|
|
|
|
|
|
|
/***** Mark note as favourite *****/
|
|
|
|
|
TL_Fav_FavNoteGbl ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_FavNoteGbl (void)
|
|
|
|
|
{
|
2021-02-11 00:58:53 +01:00
|
|
|
|
struct TL_Not_Note Not;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Mark note as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_FavNote (&Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Write HTML inside DIV with form to unfav *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_FEW_USRS);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_UnfNoteUsr (void)
|
|
|
|
|
{
|
|
|
|
|
/***** Get user whom profile is displayed *****/
|
|
|
|
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
|
|
|
|
|
|
|
|
|
/***** Unfav a note previously marked as favourite *****/
|
|
|
|
|
TL_Fav_UnfNoteGbl ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_UnfNoteGbl (void)
|
|
|
|
|
{
|
2021-02-11 00:58:53 +01:00
|
|
|
|
struct TL_Not_Note Not;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Stop marking as favourite a previously favourited note *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_UnfNote (&Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Write HTML inside DIV with form to fav *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavUnfNote (&Not,TL_SHOW_FEW_USRS);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
void TL_Fav_PutFormToFavUnfNote (const struct TL_Not_Note *Not,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_HowManyUsrs_t HowManyUsrs)
|
|
|
|
|
{
|
|
|
|
|
bool IAmTheAuthor;
|
2021-02-10 19:53:57 +01:00
|
|
|
|
bool IAmAFaverOfThisNot;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Put form to fav/unfav this note *****/
|
|
|
|
|
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
2021-02-10 19:53:57 +01:00
|
|
|
|
IAmTheAuthor = Usr_ItsMe (Not->UsrCod);
|
|
|
|
|
if (Not->Unavailable || // Unavailable notes can not be favourited
|
2021-02-08 16:24:58 +01:00
|
|
|
|
IAmTheAuthor) // I am the author
|
|
|
|
|
/* Put disabled icon */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutDisabledIconFav (Not->NumFavs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
else // Available and I am not the author
|
|
|
|
|
{
|
|
|
|
|
/* Put icon to fav/unfav */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
IAmAFaverOfThisNot = TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (IAmAFaverOfThisNot) // I have favourited this note
|
|
|
|
|
TL_Fav_PutFormToUnfNote (Not->NotCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
else // I am not a faver of this note
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavNote (Not->NotCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
|
|
|
|
|
/***** Show who have marked this note as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (Not,HowManyUsrs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_FavNote (struct TL_Not_Note *Not)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
bool ItsMe;
|
|
|
|
|
long OriginalPubCod;
|
|
|
|
|
|
|
|
|
|
/***** Get data of note *****/
|
2021-02-11 00:58:53 +01:00
|
|
|
|
Not->NotCod = TL_Not_GetParamNotCod ();
|
|
|
|
|
TL_Not_GetDataOfNoteByCod (Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Not->NotCod > 0)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
2021-02-10 19:53:57 +01:00
|
|
|
|
ItsMe = Usr_ItsMe (Not->UsrCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (!TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the note
|
|
|
|
|
{
|
|
|
|
|
/***** Mark as favourite in database *****/
|
|
|
|
|
DB_QueryINSERT ("can not favourite note",
|
|
|
|
|
"INSERT IGNORE INTO tl_notes_fav"
|
|
|
|
|
" (NotCod,UsrCod,TimeFav)"
|
|
|
|
|
" VALUES"
|
|
|
|
|
" (%ld,%ld,NOW())",
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Not->NotCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
|
|
|
|
|
|
|
|
/***** Update number of times this note is favourited *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_GetNumTimesANoteHasBeenFav (Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Create notification about favourite post
|
|
|
|
|
for the author of the post *****/
|
2021-02-11 00:58:53 +01:00
|
|
|
|
OriginalPubCod = TL_Not_GetPubCodOfOriginalNote (Not->NotCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
if (OriginalPubCod > 0)
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TIMELINE_FAV);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
long OriginalPubCod;
|
|
|
|
|
bool ItsMe;
|
|
|
|
|
|
|
|
|
|
/***** Get data of note *****/
|
2021-02-11 00:58:53 +01:00
|
|
|
|
Not->NotCod = TL_Not_GetParamNotCod ();
|
|
|
|
|
TL_Not_GetDataOfNoteByCod (Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Not->NotCod > 0)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
2021-02-10 19:53:57 +01:00
|
|
|
|
ItsMe = Usr_ItsMe (Not->UsrCod);
|
|
|
|
|
if (Not->NumFavs &&
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the note
|
|
|
|
|
{
|
|
|
|
|
/***** Delete the mark as favourite from database *****/
|
|
|
|
|
DB_QueryDELETE ("can not unfavourite note",
|
|
|
|
|
"DELETE FROM tl_notes_fav"
|
|
|
|
|
" WHERE NotCod=%ld AND UsrCod=%ld",
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Not->NotCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
|
|
|
|
|
|
|
|
/***** Update number of times this note is favourited *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_GetNumTimesANoteHasBeenFav (Not);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Mark possible notifications on this note as removed *****/
|
2021-02-11 00:58:53 +01:00
|
|
|
|
OriginalPubCod = TL_Not_GetPubCodOfOriginalNote (Not->NotCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
if (OriginalPubCod > 0)
|
|
|
|
|
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,OriginalPubCod);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************* Mark/unmark a comment as favourite ************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void TL_Fav_ShowAllFaversComUsr (void)
|
|
|
|
|
{
|
|
|
|
|
/***** Get user whom profile is displayed *****/
|
|
|
|
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
|
|
|
|
|
|
|
|
|
/***** Show all favers *****/
|
|
|
|
|
TL_Fav_ShowAllFaversComGbl ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_ShowAllFaversComGbl (void)
|
|
|
|
|
{
|
2021-02-11 00:58:53 +01:00
|
|
|
|
struct TL_Com_Comment Com;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Get data of comment *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Med_MediaConstructor (&Com.Content.Media);
|
|
|
|
|
Com.PubCod = TL_GetParamPubCod ();
|
2021-02-11 00:58:53 +01:00
|
|
|
|
TL_Com_GetDataOfCommByCod (&Com);
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Med_MediaDestructor (&Com.Content.Media);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Write HTML inside DIV with form to fav/unfav *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavUnfComment (&Com,TL_SHOW_ALL_USRS);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_FavCommentUsr (void)
|
|
|
|
|
{
|
|
|
|
|
/***** Get user whom profile is displayed *****/
|
|
|
|
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
|
|
|
|
|
|
|
|
|
/***** Mark comment as favourite *****/
|
|
|
|
|
TL_Fav_FavCommentGbl ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_FavCommentGbl (void)
|
|
|
|
|
{
|
2021-02-11 00:58:53 +01:00
|
|
|
|
struct TL_Com_Comment Com;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Mark comment as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_FavComment (&Com);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Write HTML inside DIV with form to unfav *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavUnfComment (&Com,TL_SHOW_FEW_USRS);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_UnfCommentUsr (void)
|
|
|
|
|
{
|
|
|
|
|
/***** Get user whom profile is displayed *****/
|
|
|
|
|
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
|
|
|
|
|
|
|
|
|
|
/***** Unfav a comment previously marked as favourite *****/
|
|
|
|
|
TL_Fav_UnfCommentGbl ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TL_Fav_UnfCommentGbl (void)
|
|
|
|
|
{
|
2021-02-11 00:58:53 +01:00
|
|
|
|
struct TL_Com_Comment Com;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Stop marking as favourite a previously favourited comment *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_UnfComment (&Com);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Write HTML inside DIV with form to fav *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavUnfComment (&Com,TL_SHOW_FEW_USRS);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
void TL_Fav_PutFormToFavUnfComment (const struct TL_Com_Comment *Com,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_HowManyUsrs_t HowManyUsrs)
|
|
|
|
|
{
|
|
|
|
|
bool IAmTheAuthor;
|
2021-02-10 19:53:57 +01:00
|
|
|
|
bool IAmAFaverOfThisCom;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Put form to fav/unfav this comment *****/
|
|
|
|
|
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
2021-02-10 19:53:57 +01:00
|
|
|
|
IAmTheAuthor = Usr_ItsMe (Com->UsrCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
if (IAmTheAuthor) // I am the author
|
|
|
|
|
/* Put disabled icon */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutDisabledIconFav (Com->NumFavs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
else // I am not the author
|
|
|
|
|
{
|
|
|
|
|
/* Put icon to mark this comment as favourite */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
IAmAFaverOfThisCom = TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (IAmAFaverOfThisCom) // I have favourited this comment
|
2021-02-08 16:24:58 +01:00
|
|
|
|
/* Put icon to unfav this publication and list of users */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToUnfComment (Com->PubCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
else // I am not a favouriter
|
|
|
|
|
/* Put icon to fav this publication and list of users */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_PutFormToFavComment (Com->PubCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
|
|
|
|
|
/***** Show who have marked this comment as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (Com,HowManyUsrs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_FavComment (struct TL_Com_Comment *Com)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
bool IAmTheAuthor;
|
|
|
|
|
|
|
|
|
|
/***** Initialize image *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Med_MediaConstructor (&Com->Content.Media);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Get data of comment *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Com->PubCod = TL_GetParamPubCod ();
|
2021-02-11 00:58:53 +01:00
|
|
|
|
TL_Com_GetDataOfCommByCod (Com);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Com->PubCod > 0)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
2021-02-10 19:53:57 +01:00
|
|
|
|
IAmTheAuthor = Usr_ItsMe (Com->UsrCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
if (!IAmTheAuthor) // I am not the author
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (!TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the comment
|
|
|
|
|
{
|
|
|
|
|
/***** Mark as favourite in database *****/
|
|
|
|
|
DB_QueryINSERT ("can not favourite comment",
|
|
|
|
|
"INSERT IGNORE INTO tl_comments_fav"
|
|
|
|
|
" (PubCod,UsrCod,TimeFav)"
|
|
|
|
|
" VALUES"
|
|
|
|
|
" (%ld,%ld,NOW())",
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Com->PubCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
|
|
|
|
|
|
|
|
/* Update number of times this comment is favourited */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_GetNumTimesACommHasBeenFav (Com);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/**** Create notification about favourite post
|
|
|
|
|
for the author of the post ***/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TIMELINE_FAV);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***** Free image *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Med_MediaDestructor (&Com->Content.Media);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_UnfComment (struct TL_Com_Comment *Com)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
bool IAmTheAuthor;
|
|
|
|
|
|
|
|
|
|
/***** Initialize image *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Med_MediaConstructor (&Com->Content.Media);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Get data of comment *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Com->PubCod = TL_GetParamPubCod ();
|
2021-02-11 00:58:53 +01:00
|
|
|
|
TL_Com_GetDataOfCommByCod (Com);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Com->PubCod > 0)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
2021-02-10 19:53:57 +01:00
|
|
|
|
IAmTheAuthor = Usr_ItsMe (Com->UsrCod);
|
|
|
|
|
if (Com->NumFavs &&
|
2021-02-08 16:24:58 +01:00
|
|
|
|
!IAmTheAuthor) // I am not the author
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the comment
|
|
|
|
|
{
|
|
|
|
|
/***** Delete the mark as favourite from database *****/
|
|
|
|
|
DB_QueryDELETE ("can not unfavourite comment",
|
|
|
|
|
"DELETE FROM tl_comments_fav"
|
|
|
|
|
" WHERE PubCod=%ld AND UsrCod=%ld",
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Com->PubCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
|
|
|
|
|
|
|
|
/***** Update number of times this comment is favourited *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_Fav_GetNumTimesACommHasBeenFav (Com);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Mark possible notifications on this comment as removed *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,Com->PubCod);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***** Free image *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Med_MediaDestructor (&Com->Content.Media);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****************** Check if a user has favourited a note ********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
static bool TL_Fav_CheckIfNoteIsFavedByUsr (long NotCod,long UsrCod)
|
|
|
|
|
{
|
|
|
|
|
return (DB_QueryCOUNT ("can not check if a user"
|
|
|
|
|
" has favourited a note",
|
|
|
|
|
"SELECT COUNT(*) FROM tl_notes_fav"
|
|
|
|
|
" WHERE NotCod=%ld AND UsrCod=%ld",
|
|
|
|
|
NotCod,UsrCod) != 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/**************** Check if a user has favourited a comment *******************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
static bool TL_Fav_CheckIfCommIsFavedByUsr (long PubCod,long UsrCod)
|
|
|
|
|
{
|
|
|
|
|
return (DB_QueryCOUNT ("can not check if a user"
|
|
|
|
|
" has favourited a comment",
|
|
|
|
|
"SELECT COUNT(*) FROM tl_comments_fav"
|
|
|
|
|
" WHERE PubCod=%ld AND UsrCod=%ld",
|
|
|
|
|
PubCod,UsrCod) != 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*************** Get number of times a note has been favourited **************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
void TL_Fav_GetNumTimesANoteHasBeenFav (struct TL_Not_Note *Not)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
/***** Get number of times (users) this note has been favourited *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Not->NumFavs =
|
2021-02-08 16:24:58 +01:00
|
|
|
|
(unsigned) DB_QueryCOUNT ("can not get number of times"
|
|
|
|
|
" a note has been favourited",
|
|
|
|
|
"SELECT COUNT(*) FROM tl_notes_fav"
|
|
|
|
|
" WHERE NotCod=%ld"
|
|
|
|
|
" AND UsrCod<>%ld", // Extra check
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Not->NotCod,
|
|
|
|
|
Not->UsrCod); // The author
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************ Get number of times a comment has been favourited **************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
void TL_Fav_GetNumTimesACommHasBeenFav (struct TL_Com_Comment *Com)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
/***** Get number of times (users) this comment has been favourited *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Com->NumFavs =
|
2021-02-08 16:24:58 +01:00
|
|
|
|
(unsigned) DB_QueryCOUNT ("can not get number of times"
|
|
|
|
|
" a comment has been favourited",
|
|
|
|
|
"SELECT COUNT(*) FROM tl_comments_fav"
|
|
|
|
|
" WHERE PubCod=%ld"
|
|
|
|
|
" AND UsrCod<>%ld", // Extra check
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Com->PubCod,
|
|
|
|
|
Com->UsrCod); // The author
|
2021-02-08 16:24:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************ Show users who have marked this note as favourite **************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_ShowUsrsWhoHaveMarkedNoteAsFav (const struct TL_Not_Note *Not,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
TL_HowManyUsrs_t HowManyUsrs)
|
|
|
|
|
{
|
|
|
|
|
MYSQL_RES *mysql_res;
|
2021-02-08 19:04:47 +01:00
|
|
|
|
unsigned NumFirstUsrs;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Get users who have marked this note as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Not->NumFavs)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
/***** Get list of users from database *****/
|
|
|
|
|
NumFirstUsrs =
|
|
|
|
|
(unsigned) DB_QuerySELECT (&mysql_res,"can not get users",
|
|
|
|
|
"SELECT UsrCod FROM tl_notes_fav"
|
|
|
|
|
" WHERE NotCod=%ld"
|
|
|
|
|
" AND UsrCod<>%ld" // Extra check
|
|
|
|
|
" ORDER BY FavCod LIMIT %u",
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Not->NotCod,
|
|
|
|
|
Not->UsrCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HowManyUsrs == TL_SHOW_FEW_USRS ? TL_DEF_USRS_SHOWN :
|
|
|
|
|
TL_MAX_USRS_SHOWN);
|
2021-02-08 19:04:47 +01:00
|
|
|
|
else
|
|
|
|
|
NumFirstUsrs = 0;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Show users *****/
|
2021-02-08 19:04:47 +01:00
|
|
|
|
/* Number of users */
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_Begin ("class=\"TL_NUM_USRS\"");
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_ShowNumSharersOrFavers (Not->NumFavs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
|
2021-02-08 19:04:47 +01:00
|
|
|
|
/* List users one by one */
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_Begin ("class=\"TL_USRS\"");
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_ShowSharersOrFavers (&mysql_res,Not->NumFavs,NumFirstUsrs);
|
|
|
|
|
if (NumFirstUsrs < Not->NumFavs) // Not all are shown
|
2021-02-08 19:04:47 +01:00
|
|
|
|
/* Clickable ellipsis to show all users */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_PutFormToSeeAllFaversSharers (ActAllFavTL_NotGbl,ActAllFavTL_NotUsr,
|
|
|
|
|
"NotCod=%ld",Not->NotCod,
|
2021-02-08 20:16:00 +01:00
|
|
|
|
HowManyUsrs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
|
|
|
|
|
/***** Free structure that stores the query result *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Not->NumFavs)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
DB_FreeMySQLResult (&mysql_res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************ Show users who have marked this note as favourite **************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-02-11 00:58:53 +01:00
|
|
|
|
static void TL_Fav_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Com_Comment *Com,
|
2021-02-08 19:04:47 +01:00
|
|
|
|
TL_HowManyUsrs_t HowManyUsrs)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
{
|
|
|
|
|
MYSQL_RES *mysql_res;
|
2021-02-08 19:04:47 +01:00
|
|
|
|
unsigned NumFirstUsrs;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Get users who have marked this comment as favourite *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Com->NumFavs)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
/***** Get list of users from database *****/
|
|
|
|
|
NumFirstUsrs =
|
|
|
|
|
(unsigned) DB_QuerySELECT (&mysql_res,"can not get users",
|
|
|
|
|
"SELECT UsrCod FROM tl_comments_fav"
|
|
|
|
|
" WHERE PubCod=%ld"
|
|
|
|
|
" AND UsrCod<>%ld" // Extra check
|
|
|
|
|
" ORDER BY FavCod LIMIT %u",
|
2021-02-10 19:53:57 +01:00
|
|
|
|
Com->PubCod,
|
|
|
|
|
Com->UsrCod,
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HowManyUsrs == TL_SHOW_FEW_USRS ? TL_DEF_USRS_SHOWN :
|
2021-02-08 19:04:47 +01:00
|
|
|
|
TL_MAX_USRS_SHOWN);
|
|
|
|
|
else
|
|
|
|
|
NumFirstUsrs = 0;
|
2021-02-08 16:24:58 +01:00
|
|
|
|
|
|
|
|
|
/***** Show users *****/
|
2021-02-08 19:04:47 +01:00
|
|
|
|
/* Number of users */
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_Begin ("class=\"TL_NUM_USRS\"");
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_ShowNumSharersOrFavers (Com->NumFavs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
|
2021-02-08 19:04:47 +01:00
|
|
|
|
/* List users one by one */
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_Begin ("class=\"TL_USRS\"");
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_ShowSharersOrFavers (&mysql_res,Com->NumFavs,NumFirstUsrs);
|
|
|
|
|
if (NumFirstUsrs < Com->NumFavs)
|
2021-02-08 19:04:47 +01:00
|
|
|
|
/* Clickable ellipsis to show all users */
|
2021-02-10 19:53:57 +01:00
|
|
|
|
TL_PutFormToSeeAllFaversSharers (ActAllFavTL_ComGbl,ActAllFavTL_ComUsr,
|
|
|
|
|
"PubCod=%ld",Com->PubCod,
|
2021-02-08 20:16:00 +01:00
|
|
|
|
HowManyUsrs);
|
2021-02-08 16:24:58 +01:00
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
|
|
|
|
|
/***** Free structure that stores the query result *****/
|
2021-02-10 19:53:57 +01:00
|
|
|
|
if (Com->NumFavs)
|
2021-02-08 16:24:58 +01:00
|
|
|
|
DB_FreeMySQLResult (&mysql_res);
|
|
|
|
|
}
|