Version 14.93.4

This commit is contained in:
Antonio Cañas Vargas 2015-03-17 00:54:03 +01:00
parent 6adf5a04e0
commit c5dde0ef53
3 changed files with 58 additions and 21 deletions

View File

@ -103,11 +103,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.93.3 (2015/03/16)"
#define Log_PLATFORM_VERSION "SWAD 14.93.4 (2015/03/17)"
// 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
/*
Version 14.93.4: Mar 17, 2015 Links in user's figures to ranking. (182661 lines)
Version 14.93.3: Mar 16, 2015 Changes in rankings. (182630 lines)
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)

View File

@ -86,6 +86,7 @@ static unsigned long Prf_GetRankingNumClicks (long UsrCod);
static unsigned long Prf_GetNumUsrsWithNumClicks (void);
static unsigned long Prf_GetRankingNumClicksPerDay (long UsrCod);
static unsigned long Prf_GetNumUsrsWithNumClicksPerDay (void);
static void Prf_ShowRanking (unsigned long Rank,unsigned long NumUsrs);
static void Prf_GetFirstClickFromLogAndStoreAsUsrFigure (long UsrCod);
static void Prf_GetNumClicksAndStoreAsUsrFigure (long UsrCod);
@ -396,7 +397,6 @@ static void Prf_ShowHistoricUserProfile (const struct UsrData *UsrDat)
extern const char *Txt_days;
extern const char *Txt_Calculate;
extern const char *Txt_Clicks;
extern const char *Txt_of_PART_OF_A_TOTAL;
extern const char *Txt_clicks;
extern const char *Txt_Downloads;
extern const char *Txt_download;
@ -461,28 +461,17 @@ static void Prf_ShowHistoricUserProfile (const struct UsrData *UsrDat)
Txt_Clicks);
if (UsrFigures.NumClicks >= 0)
{
fprintf (Gbl.F.Out,"%ld %s"
"<div style=\"vertical-align:middle;\">"
"<span class=\"RANK\">#%ld</span>"
"&nbsp;%s&nbsp;%ld"
"</div>",
UsrFigures.NumClicks,Txt_clicks,
Prf_GetRankingNumClicks (UsrDat->UsrCod),
Txt_of_PART_OF_A_TOTAL,
Prf_GetNumUsrsWithNumClicks ());
fprintf (Gbl.F.Out,"%ld&nbsp;%s",
UsrFigures.NumClicks,Txt_clicks);
Prf_ShowRanking (Prf_GetRankingNumClicks (UsrDat->UsrCod),
Prf_GetNumUsrsWithNumClicks ());
if (UsrFigures.NumDays >= 0)
{
Str_WriteFloatNum ((float) UsrFigures.NumClicks /
(float) (UsrFigures.NumDays + 1));
fprintf (Gbl.F.Out,"&nbsp;/&nbsp;%s"
"<div style=\"vertical-align:middle;\">"
"<span class=\"RANK\">#%ld</span>"
"&nbsp;%s&nbsp;%ld"
"</div>",
Txt_day,
Prf_GetRankingNumClicksPerDay (UsrDat->UsrCod),
Txt_of_PART_OF_A_TOTAL,
Prf_GetNumUsrsWithNumClicksPerDay ());
fprintf (Gbl.F.Out,"&nbsp;/&nbsp;%s",Txt_day);
Prf_ShowRanking (Prf_GetRankingNumClicksPerDay (UsrDat->UsrCod),
Prf_GetNumUsrsWithNumClicksPerDay ());
}
}
else // Number of clicks is unknown
@ -747,6 +736,32 @@ static unsigned long Prf_GetNumUsrsWithNumClicksPerDay (void)
return DB_QueryCOUNT (Query,"can not get number of users with number of clicks per day");
}
/*****************************************************************************/
/************************* Show position in ranking **************************/
/*****************************************************************************/
static void Prf_ShowRanking (unsigned long Rank,unsigned long NumUsrs)
{
extern const char *Txt_Ranking;
extern const char *Txt_of_PART_OF_A_TOTAL;
/***** Start container *****/
fprintf (Gbl.F.Out,"<div style=\"vertical-align:middle;\">");
/***** Rank in form to go to ranking *****/
Act_FormStart (ActSeeUseGbl);
Sco_PutParamScope (Sco_SCOPE_SYS);
Par_PutHiddenParamUnsigned ("UseStatType",(unsigned) Sta_USRS_RANKING);
Act_LinkFormSubmit (Txt_Ranking,"RANK");
fprintf (Gbl.F.Out,"#%ld</a>",Rank);
Act_FormEnd ();
/***** Part of a total and end container *****/
fprintf (Gbl.F.Out,"&nbsp;%s&nbsp;%ld"
"</div>",
Txt_of_PART_OF_A_TOTAL,NumUsrs);
}
/*****************************************************************************/
/********* Calculate first click time and show user's profile again **********/
/*****************************************************************************/
@ -1445,7 +1460,7 @@ static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO18x24",Pho_ZOOM);
"PHOTO15x20",Pho_ZOOM);
/***** Put form to go to public profile *****/
if (UsrDat->Nickname[0])

View File

@ -27448,6 +27448,27 @@ const char *Txt_Quota_exceeded =
"Quota excedida!";
#endif
const char *Txt_Ranking =
#if L==0
"R&agrave;nquing";
#elif L==1
"Rang";
#elif L==2
"Ranking";
#elif L==3
"Ranking";
#elif L==4
"Classement";
#elif L==5
"Ranking"; // Okoteve traducción
#elif L==6
"Posto";
#elif L==7
"Ranking";
#elif L==8
"Posi&ccedil;&atilde;o";
#endif
const char *Txt_ReaBRders =
#if L==0
"Lec-<br />tores"; // Necessita traduccio