2021-10-07 01:21:23 +02:00
|
|
|
|
// swad_profile_database.h: user's public profile, operations with database
|
|
|
|
|
|
|
|
|
|
#ifndef _SWAD_PRF_DB
|
|
|
|
|
#define _SWAD_PRF_DB
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance in Spanish),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2024-02-07 00:40:28 +01:00
|
|
|
|
Copyright (C) 1999-2024 Antonio Ca<EFBFBD>as Vargas
|
2021-10-07 01:21:23 +02:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************************** Headers **********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-10-07 23:29:41 +02:00
|
|
|
|
#include "swad_profile.h"
|
|
|
|
|
|
2021-10-07 01:21:23 +02:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****************************** Public prototypes ****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-10-13 10:42:08 +02:00
|
|
|
|
void Prf_DB_CreateUsrFigures (long UsrCod,const struct Prf_UsrFigures *UsrFigures,
|
2023-05-30 22:29:29 +02:00
|
|
|
|
Usr_MeOrOther_t MeOrOther);
|
2021-10-07 01:21:23 +02:00
|
|
|
|
void Prf_DB_UpdateFirstClickTimeUsr (long UsrCod,time_t FirstClickTimeUTC);
|
|
|
|
|
void Prf_DB_UpdateNumClicksUsr (long UsrCod,int NumClicks);
|
|
|
|
|
void Prf_DB_UpdateNumTimelinePubsUsr (long UsrCod,int NumTimelinePubs);
|
|
|
|
|
void Prf_DB_UpdateNumFileViewsUsr (long UsrCod,int NumFileViews);
|
|
|
|
|
void Prf_DB_UpdateNumForumPostsUsr (long UsrCod,int NumForumPosts);
|
|
|
|
|
void Prf_DB_UpdateNumMessagesSentUsr (long UsrCod,int NumMessagesSent);
|
|
|
|
|
void Prf_DB_IncrementNumClicksUsr (long UsrCod);
|
|
|
|
|
void Prf_DB_IncrementNumTimelinePubsUsr (long UsrCod);
|
|
|
|
|
void Prf_DB_IncrementNumFileViewsUsr (long UsrCod);
|
|
|
|
|
void Prf_DB_IncrementNumForPstUsr (long UsrCod);
|
|
|
|
|
void Prf_DB_IncrementNumMsgSntUsr (long UsrCod);
|
|
|
|
|
|
2023-03-10 00:13:55 +01:00
|
|
|
|
unsigned Prf_DB_GetUsrRankingFigure (long UsrCod,const char *FldName);
|
|
|
|
|
unsigned Prf_DB_GetRankingFigure (MYSQL_RES **mysql_res,const char *FldName);
|
2021-10-07 23:29:41 +02:00
|
|
|
|
unsigned Prf_DB_GetRankingClicksPerDay (MYSQL_RES **mysql_res);
|
2023-03-10 00:13:55 +01:00
|
|
|
|
unsigned Prf_DB_GetNumUsrsWithFigure (const char *FldName);
|
2021-10-07 01:21:23 +02:00
|
|
|
|
unsigned Prf_DB_GetRankingNumClicksPerDay (long UsrCod);
|
|
|
|
|
unsigned Prf_DB_GetNumUsrsWithNumClicksPerDay (void);
|
|
|
|
|
bool Prf_DB_CheckIfUsrFiguresExists (long UsrCod);
|
|
|
|
|
unsigned Prf_DB_GetUsrFigures (MYSQL_RES **mysql_res,long UsrCod);
|
2021-11-03 21:31:16 +01:00
|
|
|
|
bool Prf_DB_CheckIfUsrBanned (long UsrCod);
|
2021-10-07 01:21:23 +02:00
|
|
|
|
|
|
|
|
|
void Prf_DB_RemoveUsrFigures (long UsrCod);
|
2021-11-03 21:31:16 +01:00
|
|
|
|
void Prf_DB_RemoveUsrFromBanned (long UsrCod);
|
2021-10-07 01:21:23 +02:00
|
|
|
|
|
|
|
|
|
#endif
|