mirror of https://github.com/acanas/swad-core.git
Version 14.93.2
This commit is contained in:
parent
289caba5d9
commit
b76839cc86
|
@ -103,11 +103,12 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 14.93.1 (2015/03/16)"
|
#define Log_PLATFORM_VERSION "SWAD 14.93.2 (2015/03/16)"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 14.93.2: Mar 16, 2015 New rankings for downloads, forum posts and messages sent. (182628 lines)
|
||||||
Version 14.93.1: Mar 16, 2015 Photos and links to users' profiles in users' ranking. (182560 lines)
|
Version 14.93.1: Mar 16, 2015 Photos and links to users' profiles in users' ranking. (182560 lines)
|
||||||
Version 14.93: Mar 16, 2015 Users' ranking. (182527 lines)
|
Version 14.93: Mar 16, 2015 Users' ranking. (182527 lines)
|
||||||
Version 14.92.2: Mar 15, 2015 Fixed minor bug in photo edition. (182208 lines)
|
Version 14.92.2: Mar 15, 2015 Fixed minor bug in photo edition. (182208 lines)
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
/** Uncomment one of the following installations of SWAD or create your own **/
|
/** Uncomment one of the following installations of SWAD or create your own **/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define LOCALHOST_UBUNTU // Comment this line if not applicable
|
//#define LOCALHOST_UBUNTU // Comment this line if not applicable
|
||||||
//#define OPENSWAD_ORG // Comment this line if not applicable
|
#define OPENSWAD_ORG // Comment this line if not applicable
|
||||||
//#define SWAD_UGR_ES // Comment this line if not applicable
|
//#define SWAD_UGR_ES // Comment this line if not applicable
|
||||||
//#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable
|
//#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable
|
||||||
|
|
||||||
|
|
|
@ -775,7 +775,7 @@ void Pho_RemoveUsrFromTableClicksWithoutPhoto (long UsrCod)
|
||||||
// Returns true if the photo can be shown and false if not.
|
// Returns true if the photo can be shown and false if not.
|
||||||
// Public photo means two different things depending on the user's type
|
// Public photo means two different things depending on the user's type
|
||||||
|
|
||||||
bool Pho_ShowUsrPhotoIsAllowed (struct UsrData *UsrDat,char *PhotoURL)
|
bool Pho_ShowUsrPhotoIsAllowed (const struct UsrData *UsrDat,char *PhotoURL)
|
||||||
{
|
{
|
||||||
bool ICanSeePhoto;
|
bool ICanSeePhoto;
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ void Pho_UpdateUsrPhoto2 (void);
|
||||||
unsigned Pho_UpdateMyClicksWithoutPhoto (void);
|
unsigned Pho_UpdateMyClicksWithoutPhoto (void);
|
||||||
void Pho_RemoveUsrFromTableClicksWithoutPhoto (long UsrCod);
|
void Pho_RemoveUsrFromTableClicksWithoutPhoto (long UsrCod);
|
||||||
|
|
||||||
bool Pho_ShowUsrPhotoIsAllowed (struct UsrData *UsrDat,char *PhotoURL);
|
bool Pho_ShowUsrPhotoIsAllowed (const struct UsrData *UsrDat,char *PhotoURL);
|
||||||
bool Pho_BuildLinkToPhoto (const struct UsrData *UsrDat,char *PhotoURL,bool HTTPS);
|
bool Pho_BuildLinkToPhoto (const struct UsrData *UsrDat,char *PhotoURL,bool HTTPS);
|
||||||
bool Pho_CheckIfPrivPhotoExists (long UsrCod,char *PathPrivRelPhoto);
|
bool Pho_CheckIfPrivPhotoExists (long UsrCod,char *PathPrivRelPhoto);
|
||||||
bool Pho_RemovePhoto (struct UsrData *UsrDat);
|
bool Pho_RemovePhoto (struct UsrData *UsrDat);
|
||||||
|
|
181
swad_profile.c
181
swad_profile.c
|
@ -97,6 +97,9 @@ static void Prf_ResetUsrFigures (struct UsrFigures *UsrFigures);
|
||||||
static void Prf_CreateUsrFigures (long UsrCod,const struct UsrFigures *UsrFigures);
|
static void Prf_CreateUsrFigures (long UsrCod,const struct UsrFigures *UsrFigures);
|
||||||
static bool Prf_CheckIfUsrFiguresExists (long UsrCod);
|
static bool Prf_CheckIfUsrFiguresExists (long UsrCod);
|
||||||
|
|
||||||
|
static void Prf_GetAndShowRankingFigure (const char *FieldName);
|
||||||
|
static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** Get public profile URL ***************************/
|
/************************** Get public profile URL ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1124,28 +1127,49 @@ void Prf_IncrementNumMsgSntUsr (long UsrCod)
|
||||||
|
|
||||||
void Prf_GetAndShowRankingClicks (void)
|
void Prf_GetAndShowRankingClicks (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_View_public_profile;
|
Prf_GetAndShowRankingFigure ("NumClicks");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Prf_GetAndShowRankingFileViews (void)
|
||||||
|
{
|
||||||
|
Prf_GetAndShowRankingFigure ("NumFileViews");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Prf_GetAndShowRankingForPst (void)
|
||||||
|
{
|
||||||
|
Prf_GetAndShowRankingFigure ("NumForPst");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Prf_GetAndShowRankingMsgSnt (void)
|
||||||
|
{
|
||||||
|
Prf_GetAndShowRankingFigure ("NumMsgSnt");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Prf_GetAndShowRankingFigure (const char *FieldName)
|
||||||
|
{
|
||||||
char Query[512];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned NumUsrs;
|
unsigned NumUsrs;
|
||||||
unsigned NumUsr;
|
unsigned NumUsr;
|
||||||
|
unsigned Rank;
|
||||||
struct UsrData UsrDat;
|
struct UsrData UsrDat;
|
||||||
unsigned long NumClicks;
|
long FigureHigh = LONG_MAX;
|
||||||
bool ShowPhoto;
|
long Figure;
|
||||||
char PhotoURL[PATH_MAX+1];
|
|
||||||
|
|
||||||
/***** Get ranking from database *****/
|
/***** Get ranking from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_SYS:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT UsrCod,NumClicks"
|
sprintf (Query,"SELECT UsrCod,%s"
|
||||||
" FROM usr_figures"
|
" FROM usr_figures"
|
||||||
" WHERE NumClicks>='0'"
|
" WHERE %s>='0'"
|
||||||
" ORDER BY NumClicks DESC LIMIT 100");
|
" ORDER BY %s DESC LIMIT 100",
|
||||||
|
FieldName,
|
||||||
|
FieldName,FieldName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CTY:
|
case Sco_SCOPE_CTY:
|
||||||
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.NumClicks"
|
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.%s"
|
||||||
" FROM institutions,centres,degrees,courses,crs_usr,usr_figures"
|
" FROM institutions,centres,degrees,courses,crs_usr,usr_figures"
|
||||||
" WHERE institutions.CtyCod='%ld'"
|
" WHERE institutions.CtyCod='%ld'"
|
||||||
" AND institutions.InsCod=centres.InsCod"
|
" AND institutions.InsCod=centres.InsCod"
|
||||||
|
@ -1153,51 +1177,61 @@ void Prf_GetAndShowRankingClicks (void)
|
||||||
" AND degrees.DegCod=courses.DegCod"
|
" AND degrees.DegCod=courses.DegCod"
|
||||||
" AND courses.CrsCod=crs_usr.CrsCod"
|
" AND courses.CrsCod=crs_usr.CrsCod"
|
||||||
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
||||||
" AND usr_figures.NumClicks>='0'"
|
" AND usr_figures.%s>='0'"
|
||||||
" ORDER BY usr_figures.NumClicks DESC LIMIT 100",
|
" ORDER BY usr_figures.%s DESC LIMIT 100",
|
||||||
Gbl.CurrentCty.Cty.CtyCod);
|
FieldName,
|
||||||
|
Gbl.CurrentCty.Cty.CtyCod,
|
||||||
|
FieldName,FieldName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INS:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.NumClicks"
|
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.%s"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_figures"
|
" FROM centres,degrees,courses,crs_usr,usr_figures"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
" AND centres.CtrCod=degrees.CtrCod"
|
" AND centres.CtrCod=degrees.CtrCod"
|
||||||
" AND degrees.DegCod=courses.DegCod"
|
" AND degrees.DegCod=courses.DegCod"
|
||||||
" AND courses.CrsCod=crs_usr.CrsCod"
|
" AND courses.CrsCod=crs_usr.CrsCod"
|
||||||
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
||||||
" AND usr_figures.NumClicks>='0'"
|
" AND usr_figures.%s>='0'"
|
||||||
" ORDER BY usr_figures.NumClicks DESC LIMIT 100",
|
" ORDER BY usr_figures.%s DESC LIMIT 100",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
FieldName,
|
||||||
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
|
FieldName,FieldName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CTR:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.NumClicks"
|
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.%s"
|
||||||
" FROM degrees,courses,crs_usr,usr_figures"
|
" FROM degrees,courses,crs_usr,usr_figures"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
" AND degrees.DegCod=courses.DegCod"
|
" AND degrees.DegCod=courses.DegCod"
|
||||||
" AND courses.CrsCod=crs_usr.CrsCod"
|
" AND courses.CrsCod=crs_usr.CrsCod"
|
||||||
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
||||||
" AND usr_figures.NumClicks>='0'"
|
" AND usr_figures.%s>='0'"
|
||||||
" ORDER BY usr_figures.NumClicks DESC LIMIT 100",
|
" ORDER BY usr_figures.%s DESC LIMIT 100",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
FieldName,
|
||||||
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
|
FieldName,FieldName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEG:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.NumClicks"
|
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.%s"
|
||||||
" FROM courses,crs_usr,usr_figures"
|
" FROM courses,crs_usr,usr_figures"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
" AND courses.CrsCod=crs_usr.CrsCod"
|
" AND courses.CrsCod=crs_usr.CrsCod"
|
||||||
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
||||||
" AND usr_figures.NumClicks>='0'"
|
" AND usr_figures.%s>='0'"
|
||||||
" ORDER BY usr_figures.NumClicks DESC LIMIT 100",
|
" ORDER BY usr_figures.%s DESC LIMIT 100",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
FieldName,
|
||||||
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
|
FieldName,FieldName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CRS:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.NumClicks"
|
sprintf (Query,"SELECT DISTINCTROW usr_figures.UsrCod,usr_figures.%s"
|
||||||
" FROM crs_usr,usr_figures"
|
" FROM crs_usr,usr_figures"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
" AND crs_usr.UsrCod=usr_figures.UsrCod"
|
||||||
" AND usr_figures.NumClicks>='0'"
|
" AND usr_figures.%s>='0'"
|
||||||
" ORDER BY usr_figures.NumClicks DESC LIMIT 100",
|
" ORDER BY usr_figures.%s DESC LIMIT 100",
|
||||||
Gbl.CurrentCrs.Crs.CrsCod);
|
FieldName,
|
||||||
|
Gbl.CurrentCrs.Crs.CrsCod,
|
||||||
|
FieldName,FieldName);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong scope.");
|
Lay_ShowErrorAndExit ("Wrong scope.");
|
||||||
|
@ -1211,8 +1245,8 @@ void Prf_GetAndShowRankingClicks (void)
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<table>");
|
fprintf (Gbl.F.Out,"<table>");
|
||||||
|
|
||||||
for (NumUsr = 1;
|
for (NumUsr = 0, Rank = 0;
|
||||||
NumUsr <= NumUsrs;
|
NumUsr < NumUsrs;
|
||||||
NumUsr++)
|
NumUsr++)
|
||||||
{
|
{
|
||||||
/***** Get user and number of clicks *****/
|
/***** Get user and number of clicks *****/
|
||||||
|
@ -1222,9 +1256,15 @@ void Prf_GetAndShowRankingClicks (void)
|
||||||
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
Usr_GetAllUsrDataFromUsrCod (&UsrDat);
|
Usr_GetAllUsrDataFromUsrCod (&UsrDat);
|
||||||
|
|
||||||
/* Get number of clicks (row[1]) */
|
/* Get figure (row[1]) */
|
||||||
if (sscanf (row[1],"%ld",&NumClicks) != 1)
|
if (sscanf (row[1],"%ld",&Figure) != 1)
|
||||||
NumClicks = -1L;
|
Lay_ShowErrorAndExit ("Error reading user's figure.");
|
||||||
|
|
||||||
|
if (Figure < FigureHigh)
|
||||||
|
{
|
||||||
|
Rank++;
|
||||||
|
FigureHigh = Figure;
|
||||||
|
}
|
||||||
|
|
||||||
/***** Show row *****/
|
/***** Show row *****/
|
||||||
if (UsrDat.Nickname[0])
|
if (UsrDat.Nickname[0])
|
||||||
|
@ -1232,26 +1272,12 @@ void Prf_GetAndShowRankingClicks (void)
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td style=\"text-align:right;\">#%u</td>"
|
"<td style=\"text-align:right;\">#%u</td>"
|
||||||
"<td style=\"text-align:left;\">",
|
"<td style=\"text-align:left;\">",
|
||||||
NumUsr);
|
Rank);
|
||||||
|
Prf_ShowUsrInRanking (&UsrDat);
|
||||||
/* User's photo */
|
|
||||||
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
|
|
||||||
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
|
|
||||||
NULL,
|
|
||||||
"PHOTO18x24",Pho_ZOOM);
|
|
||||||
|
|
||||||
/* Put form to go to public profile */
|
|
||||||
Act_FormStart (ActSeePubPrf);
|
|
||||||
Usr_PutParamOtherUsrCodEncrypted (UsrDat.EncryptedUsrCod);
|
|
||||||
Act_LinkFormSubmit (Txt_View_public_profile,"DAT");
|
|
||||||
fprintf (Gbl.F.Out,"@%s",UsrDat.Nickname);
|
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
|
||||||
Act_FormEnd ();
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"<td style=\"text-align:right;\">%ld</td>"
|
"<td style=\"text-align:right;\">%ld</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
NumClicks);
|
Figure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1271,16 +1297,15 @@ void Prf_GetAndShowRankingClicks (void)
|
||||||
|
|
||||||
void Prf_GetAndShowRankingClicksPerDay (void)
|
void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_View_public_profile;
|
|
||||||
char Query[512];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned NumUsrs;
|
unsigned NumUsrs;
|
||||||
unsigned NumUsr;
|
unsigned NumUsr;
|
||||||
|
unsigned Rank;
|
||||||
struct UsrData UsrDat;
|
struct UsrData UsrDat;
|
||||||
|
float NumClicksPerDayHigh = (float) LONG_MAX;
|
||||||
float NumClicksPerDay;
|
float NumClicksPerDay;
|
||||||
bool ShowPhoto;
|
|
||||||
char PhotoURL[PATH_MAX+1];
|
|
||||||
|
|
||||||
/***** Get ranking from database *****/
|
/***** Get ranking from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
|
@ -1364,8 +1389,8 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<table>");
|
fprintf (Gbl.F.Out,"<table>");
|
||||||
|
|
||||||
for (NumUsr = 1;
|
for (NumUsr = 0, Rank = 0;
|
||||||
NumUsr <= NumUsrs;
|
NumUsr < NumUsrs;
|
||||||
NumUsr++)
|
NumUsr++)
|
||||||
{
|
{
|
||||||
/***** Get user and number of clicks *****/
|
/***** Get user and number of clicks *****/
|
||||||
|
@ -1377,6 +1402,11 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
|
|
||||||
/* Get number of clicks per day (row[1]) */
|
/* Get number of clicks per day (row[1]) */
|
||||||
NumClicksPerDay = Str_GetFloatNumFromStr (row[1]);
|
NumClicksPerDay = Str_GetFloatNumFromStr (row[1]);
|
||||||
|
if (NumClicksPerDay < NumClicksPerDayHigh)
|
||||||
|
{
|
||||||
|
Rank++;
|
||||||
|
NumClicksPerDayHigh = NumClicksPerDay;
|
||||||
|
}
|
||||||
|
|
||||||
/***** Show row *****/
|
/***** Show row *****/
|
||||||
if (UsrDat.Nickname[0])
|
if (UsrDat.Nickname[0])
|
||||||
|
@ -1384,22 +1414,8 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td style=\"text-align:right;\">#%u</td>"
|
"<td style=\"text-align:right;\">#%u</td>"
|
||||||
"<td style=\"text-align:left;\">",
|
"<td style=\"text-align:left;\">",
|
||||||
NumUsr);
|
Rank);
|
||||||
|
Prf_ShowUsrInRanking (&UsrDat);
|
||||||
/* User's photo */
|
|
||||||
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
|
|
||||||
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
|
|
||||||
NULL,
|
|
||||||
"PHOTO18x24",Pho_ZOOM);
|
|
||||||
|
|
||||||
/* Put form to go to public profile */
|
|
||||||
Act_FormStart (ActSeePubPrf);
|
|
||||||
Usr_PutParamOtherUsrCodEncrypted (UsrDat.EncryptedUsrCod);
|
|
||||||
Act_LinkFormSubmit (Txt_View_public_profile,"DAT");
|
|
||||||
fprintf (Gbl.F.Out,"@%s",UsrDat.Nickname);
|
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
|
||||||
Act_FormEnd ();
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"<td style=\"text-align:right;\">");
|
"<td style=\"text-align:right;\">");
|
||||||
Str_WriteFloatNum (NumClicksPerDay);
|
Str_WriteFloatNum (NumClicksPerDay);
|
||||||
|
@ -1417,3 +1433,28 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Show user's photo and nickname in ranking list ***************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat)
|
||||||
|
{
|
||||||
|
extern const char *Txt_View_public_profile;
|
||||||
|
bool ShowPhoto;
|
||||||
|
char PhotoURL[PATH_MAX+1];
|
||||||
|
|
||||||
|
/***** User's photo *****/
|
||||||
|
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
||||||
|
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
|
||||||
|
NULL,
|
||||||
|
"PHOTO18x24",Pho_ZOOM);
|
||||||
|
|
||||||
|
/***** Put form to go to public profile *****/
|
||||||
|
Act_FormStart (ActSeePubPrf);
|
||||||
|
Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||||
|
Act_LinkFormSubmit (Txt_View_public_profile,"DAT");
|
||||||
|
fprintf (Gbl.F.Out,"@%s",UsrDat->Nickname);
|
||||||
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
Act_FormEnd ();
|
||||||
|
}
|
||||||
|
|
|
@ -55,6 +55,9 @@ void Prf_IncrementNumForPstUsr (long UsrCod);
|
||||||
void Prf_IncrementNumMsgSntUsr (long UsrCod);
|
void Prf_IncrementNumMsgSntUsr (long UsrCod);
|
||||||
|
|
||||||
void Prf_GetAndShowRankingClicks (void);
|
void Prf_GetAndShowRankingClicks (void);
|
||||||
|
void Prf_GetAndShowRankingFileViews (void);
|
||||||
|
void Prf_GetAndShowRankingForPst (void);
|
||||||
|
void Prf_GetAndShowRankingMsgSnt (void);
|
||||||
void Prf_GetAndShowRankingClicksPerDay (void);
|
void Prf_GetAndShowRankingClicksPerDay (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3806,11 +3806,23 @@ static void Sta_GetAndShowUsersRanking (void)
|
||||||
extern const char *Txt_STAT_USE_STAT_TYPES[Sta_NUM_TYPES_USE_STATS];
|
extern const char *Txt_STAT_USE_STAT_TYPES[Sta_NUM_TYPES_USE_STATS];
|
||||||
extern const char *Txt_Clicks;
|
extern const char *Txt_Clicks;
|
||||||
extern const char *Txt_Clicks_per_day;
|
extern const char *Txt_Clicks_per_day;
|
||||||
|
extern const char *Txt_Downloads;
|
||||||
|
extern const char *Txt_Forums;
|
||||||
|
extern const char *Txt_Messages;
|
||||||
|
|
||||||
Lay_StartRoundFrameTable10 (NULL,2,Txt_STAT_USE_STAT_TYPES[Sta_USRS_RANKING]);
|
Lay_StartRoundFrameTable10 (NULL,2,Txt_STAT_USE_STAT_TYPES[Sta_USRS_RANKING]);
|
||||||
|
|
||||||
/***** Header *****/
|
/***** Header *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<th class=\"TIT_TBL\" style=\"text-align:center;\">"
|
||||||
|
"%s"
|
||||||
|
"</th>"
|
||||||
|
"<th class=\"TIT_TBL\" style=\"text-align:center;\">"
|
||||||
|
"%s"
|
||||||
|
"</th>"
|
||||||
|
"<th class=\"TIT_TBL\" style=\"text-align:center;\">"
|
||||||
|
"%s"
|
||||||
|
"</th>"
|
||||||
"<th class=\"TIT_TBL\" style=\"text-align:center;\">"
|
"<th class=\"TIT_TBL\" style=\"text-align:center;\">"
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
|
@ -3819,7 +3831,10 @@ static void Sta_GetAndShowUsersRanking (void)
|
||||||
"</th>"
|
"</th>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Clicks,
|
Txt_Clicks,
|
||||||
Txt_Clicks_per_day);
|
Txt_Clicks_per_day,
|
||||||
|
Txt_Downloads,
|
||||||
|
Txt_Forums,
|
||||||
|
Txt_Messages);
|
||||||
|
|
||||||
/***** Rankings *****/
|
/***** Rankings *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
@ -3830,6 +3845,18 @@ static void Sta_GetAndShowUsersRanking (void)
|
||||||
"<td class=\"DAT\" style=\"text-align:left;"
|
"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
" vertical-align:top;\">");
|
" vertical-align:top;\">");
|
||||||
Prf_GetAndShowRankingClicksPerDay ();
|
Prf_GetAndShowRankingClicksPerDay ();
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
|
" vertical-align:top;\">");
|
||||||
|
Prf_GetAndShowRankingFileViews ();
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
|
" vertical-align:top;\">");
|
||||||
|
Prf_GetAndShowRankingForPst ();
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
|
" vertical-align:top;\">");
|
||||||
|
Prf_GetAndShowRankingMsgSnt ();
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue