diff --git a/css/swad_desktop.css b/css/swad_desktop.css index 7bc3aef5f..8b67fc200 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -820,10 +820,10 @@ a:hover img.CENTRE_PHOTO_SHOW .CONV_IMPR {font-family:Garamond, "DejaVu LGC Serif", "Bitstream Vera Serif", serif; color:#202020; font-size:11pt;} /***************************** Public user's profile *************************/ -.RANK +.FOLLOW { color:#808080; - font-size:11pt; + font-size:24pt; font-weight:bold; } diff --git a/css/swad_mobile.css b/css/swad_mobile.css index 1feaabe90..95f46c32a 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -633,10 +633,10 @@ a:hover img.CENTRE_PHOTO_SHOW .CONV_IMPR {font-Family:Garamond, "DejaVu LGC Serif", "Bitstream Vera Serif", serif; color:#202020; font-size:11pt;} /***************************** Public user's profile *************************/ -.RANK +.FOLLOW { color:#808080; - font-size:16pt; + font-size:28pt; font-weight:bold; } diff --git a/swad_changelog.h b/swad_changelog.h index 864f79c50..997657d54 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.96.3 (2015/03/18)" +#define Log_PLATFORM_VERSION "SWAD 14.97 (2015/03/18)" // 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.97: Mar 18, 2015 Show number of following and followers in user's profile. (183130 lines) Version 14.96.3: Mar 18, 2015 Changes in record cards. (183017 lines) Version 14.96.2: Mar 18, 2015 Changes in record cards. (183011 lines) Version 14.96.1: Mar 18, 2015 Changes in user's profile. (183015 lines) diff --git a/swad_follow.c b/swad_follow.c index ed650d2fc..47ac04ba7 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -60,6 +60,9 @@ extern struct Globals Gbl; /***************************** Private prototypes ****************************/ /*****************************************************************************/ +static unsigned Fol_GetNumFollowing (long UsrCod); +static unsigned Fol_GetNumFollowers (long UsrCod); + /*****************************************************************************/ /*************** Check if a user is a follower of another user ***************/ /*****************************************************************************/ @@ -78,6 +81,82 @@ bool Fol_CheckUsrIsFollowerOf (long FollowerCod,long FollowedCod) return (DB_QueryCOUNT (Query,"can not get if a user is a follower of another one") != 0); } +/*****************************************************************************/ +/**************** Show following and followers of a user *********************/ +/*****************************************************************************/ + +void Fol_ShowFollowingAndFollowers (long UsrCod) + { + extern const char *The_ClassFormul[The_NUM_THEMES]; + extern const char *Txt_Following; + extern const char *Txt_Followers; + unsigned Following = Fol_GetNumFollowing (UsrCod); + unsigned Followers = Fol_GetNumFollowers (UsrCod); + + /***** Start table *****/ + fprintf (Gbl.F.Out,"
"
+ " "
+ "%u"
+ " "
+ ""
+ "%s"
+ " "
+ " | ",
+ Following,
+ The_ClassFormul[Gbl.Prefs.Theme],
+ Txt_Following);
+
+ /***** Followers *****/
+ fprintf (Gbl.F.Out,""
+ " "
+ "%u"
+ " "
+ ""
+ "%s"
+ " "
+ " | ",
+ Followers,
+ The_ClassFormul[Gbl.Prefs.Theme],
+ Txt_Followers);
+
+ /***** End table *****/
+ fprintf (Gbl.F.Out,"
"); /***** Common record *****/ Rec_ShowSharedUsrRecord (Rec_RECORD_PUBLIC,&Gbl.Usrs.Other.UsrDat); + /***** Show following and followers *****/ + if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM) + Fol_ShowFollowingAndFollowers (Gbl.Usrs.Other.UsrDat.UsrCod); + fprintf (Gbl.F.Out," | " ""); @@ -739,7 +744,7 @@ static unsigned long Prf_GetNumUsrsWithNumClicksPerDay (void) static void Prf_ShowRanking (unsigned long Rank,unsigned long NumUsrs) { - // extern const char *Txt_Ranking; + extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_of_PART_OF_A_TOTAL; /***** Part of a total and end container *****/ @@ -750,7 +755,7 @@ static void Prf_ShowRanking (unsigned long Rank,unsigned long NumUsrs) Act_FormStart (ActSeeUseGbl); Sco_PutParamScope (Sco_SCOPE_SYS); Par_PutHiddenParamUnsigned ("UseStatType",(unsigned) Sta_USRS_RANKING); - Act_LinkFormSubmit (Gbl.Title,"RANK"); + Act_LinkFormSubmit (Gbl.Title,The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"#%lu",Rank); Act_FormEnd (); } diff --git a/swad_text.c b/swad_text.c index ca3cb9412..1f93c9725 100644 --- a/swad_text.c +++ b/swad_text.c @@ -11859,6 +11859,48 @@ const char *Txt_Follow = "Seguir"; #endif +const char *Txt_Followers = +#if L==0 + "Seguidors"; +#elif L==1 + "Anhänger"; +#elif L==2 + "Followers"; +#elif L==3 + "Seguidores"; +#elif L==4 + "Suiveurs"; +#elif L==5 + "Seguidores"; // Okoteve traducción +#elif L==6 + "Followers"; +#elif L==7 + "Obserwują"; +#elif L==8 + "Seguidores"; +#endif + +const char *Txt_Following = +#if L==0 + "Següent"; +#elif L==1 + "Folgende"; +#elif L==2 + "Following"; +#elif L==3 + "Siguiendo"; +#elif L==4 + "Suivant"; +#elif L==5 + "Siguiendo"; // Okoteve traducción +#elif L==6 + "Following"; +#elif L==7 + "Następujący"; +#elif L==8 + "Seguinte"; +#endif + const char *Txt_For_security_enter_your_password = #if L==0 "Per a més seguretat, introdueixi la seva contrasenya"; |