diff --git a/swad_changelog.h b/swad_changelog.h index c3f2e87e..8e5e7c3e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.93.2 (2015/03/16)" +#define Log_PLATFORM_VERSION "SWAD 14.93.3 (2015/03/16)" // 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.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) Version 14.93: Mar 16, 2015 Users' ranking. (182527 lines) diff --git a/swad_global.c b/swad_global.c index ec75a7a4..5e6f8d34 100644 --- a/swad_global.c +++ b/swad_global.c @@ -405,7 +405,7 @@ void Gbl_InitializeGlobals (void) Gbl.Stat.Role = Sta_IDENTIFIED_USRS; Gbl.Stat.NumAction = ActAll; Gbl.Stat.RowsPerPage = 50; - Gbl.Stat.UseStatType = Sta_USERS; + Gbl.Stat.UseStatType = Sta_USRS_RANKING; Gbl.Scope.Current = Sco_SCOPE_CRS; diff --git a/swad_profile.c b/swad_profile.c index 6171f836..b2d45656 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -1267,18 +1267,15 @@ static void Prf_GetAndShowRankingFigure (const char *FieldName) } /***** Show row *****/ - if (UsrDat.Nickname[0]) - { - fprintf (Gbl.F.Out,"" - "#%u" - "", - Rank); - Prf_ShowUsrInRanking (&UsrDat); - fprintf (Gbl.F.Out,"" - "%ld" - "", - Figure); - } + fprintf (Gbl.F.Out,"" + "#%u" + "", + Rank); + Prf_ShowUsrInRanking (&UsrDat); + fprintf (Gbl.F.Out,"" + "%ld" + "", + Figure); } fprintf (Gbl.F.Out,""); @@ -1352,7 +1349,7 @@ void Prf_GetAndShowRankingClicksPerDay (void) " AND degrees.DegCod=courses.DegCod" " AND courses.CrsCod=crs_usr.CrsCod" " AND crs_usr.UsrCod=usr_figures.UsrCod" - " AND usr_figures.FirstClickTime>0'" + " AND usr_figures.FirstClickTime>0" " ORDER BY NumClicksPerDay DESC,usr_figures.UsrCod LIMIT 100", Gbl.CurrentCtr.Ctr.CtrCod); break; @@ -1409,19 +1406,16 @@ void Prf_GetAndShowRankingClicksPerDay (void) } /***** Show row *****/ - if (UsrDat.Nickname[0]) - { - fprintf (Gbl.F.Out,"" - "#%u" - "", - Rank); - Prf_ShowUsrInRanking (&UsrDat); - fprintf (Gbl.F.Out,"" - ""); - Str_WriteFloatNum (NumClicksPerDay); - fprintf (Gbl.F.Out,"" - ""); - } + fprintf (Gbl.F.Out,"" + "#%u" + "", + Rank); + Prf_ShowUsrInRanking (&UsrDat); + fprintf (Gbl.F.Out,"" + ""); + Str_WriteFloatNum (NumClicksPerDay); + fprintf (Gbl.F.Out,"" + ""); } fprintf (Gbl.F.Out,""); @@ -1444,17 +1438,24 @@ static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat) bool ShowPhoto; char PhotoURL[PATH_MAX+1]; - /***** User's photo *****/ - ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); - Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : - NULL, - "PHOTO18x24",Pho_ZOOM); + /***** Check if I can see the public profile *****/ + if (Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod)) + { + /***** 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_SMALL"); - fprintf (Gbl.F.Out,"@%s",UsrDat->Nickname); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); + /***** Put form to go to public profile *****/ + if (UsrDat->Nickname[0]) + { + Act_FormStart (ActSeePubPrf); + Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); + Act_LinkFormSubmit (Txt_View_public_profile,"DAT_SMALL"); + fprintf (Gbl.F.Out,"@%s",UsrDat->Nickname); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } + } } diff --git a/swad_statistic.c b/swad_statistic.c index dbe3ff9a..53664909 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -3673,14 +3673,14 @@ void Sta_ShowUseOfPlatform (void) /***** Show the stat of use selected by user *****/ switch (Gbl.Stat.UseStatType) { - case Sta_USERS: - /***** Number of users *****/ - Sta_GetAndShowUsersStats (); - break; case Sta_USRS_RANKING: /***** Users ranking *****/ Sta_GetAndShowUsersRanking (); break; + case Sta_USERS: + /***** Number of users *****/ + Sta_GetAndShowUsersStats (); + break; case Sta_DEGREES_AND_COURSES: /***** Number of degrees and courses *****/ Sta_GetAndShowDegCrsStats ();