From 9929a4ebb7b2afc386fa68aaaafe1ea80441b7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 29 Dec 2015 14:57:38 +0100 Subject: [PATCH] Version 15.79.2 --- swad_changelog.h | 3 ++- swad_social.c | 36 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 988590184..93f4f0a6e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -115,13 +115,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.79.1 (2015-12-29)" +#define Log_PLATFORM_VERSION "SWAD 15.79.2 (2015-12-29)" #define CSS_FILE "swad15.79.css" #define JS_FILE "swad15.77.7.js" // 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 15.79.2: Dec 29, 2015 Include my public activity in timeline. (188838 lines) Version 15.79.1: Dec 29, 2015 Changes in layout of user's profile. (188836 lines) Version 15.79: Dec 29, 2015 Show timeline of a selected user. Changes in CSS related to social activity. (188834 lines) diff --git a/swad_social.c b/swad_social.c index b34039fb5..aedbf3650 100644 --- a/swad_social.c +++ b/swad_social.c @@ -141,24 +141,26 @@ void Soc_ShowFollowingTimeline (void) { char Query[512]; - if (Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod)) // I follow people - { - /***** Build query to show timeline including the users I am following *****/ - sprintf (Query,"SELECT SocialEvent,UsrCod," - "CtyCod,InsCod,CtrCod,DegCod,CrsCod," - "Cod,UNIX_TIMESTAMP(TimeEvent)" - " FROM social,usr_follow" - " WHERE usr_follow.FollowerCod='%ld'" - " AND usr_follow.FollowedCod=social.UsrCod" - " ORDER BY SocCod DESC LIMIT 10", - Gbl.Usrs.Me.UsrDat.UsrCod); - - /***** Show timeline *****/ - if (!Soc_ShowTimeline (Query)) - Lay_ShowAlert (Lay_INFO,"No hay actividad pública de los usuarios a los que sigue."); // Need translation!!! - } - else // I do not follow people + /***** Show warning if I do not follow anyone *****/ + if (!Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod)) Lay_ShowAlert (Lay_INFO,"Usted no sigue a ningún usuario."); // Need translation!!! + + /***** Build query to show timeline including the users I am following *****/ + sprintf (Query,"SELECT SocialEvent,UsrCod," + "CtyCod,InsCod,CtrCod,DegCod,CrsCod," + "Cod,UNIX_TIMESTAMP(TimeEvent)" + " FROM social" + " WHERE UsrCod IN" + " (SELECT '%ld'" + " UNION" + " SELECT FollowedCod FROM usr_follow WHERE FollowerCod='%ld')" + " ORDER BY SocCod DESC LIMIT 10", + Gbl.Usrs.Me.UsrDat.UsrCod, + Gbl.Usrs.Me.UsrDat.UsrCod); + + /***** Show timeline *****/ + if (!Soc_ShowTimeline (Query)) + Lay_ShowAlert (Lay_INFO,"No hay actividad pública."); // Need translation!!! } /*****************************************************************************/