diff --git a/swad_changelog.h b/swad_changelog.h
index 357f6f156..1537860be 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -117,13 +117,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 15.88.1 (2016-01-01)"
+#define Log_PLATFORM_VERSION "SWAD 15.88.2 (2016-01-01)"
#define CSS_FILE "swad15.88.1.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.88.2: Jan 01, 2016 Messages translated. (189902 lines)
Version 15.88.1: Jan 01, 2016 Changes in layout of social timeline. (189854 lines)
Version 15.88: Jan 01, 2016 New buttons in social timeline to share/unshare a social publishing. (189841 lines)
2 changes necessary in database:
diff --git a/swad_course.c b/swad_course.c
index f47aeab6a..02c091680 100644
--- a/swad_course.c
+++ b/swad_course.c
@@ -3136,7 +3136,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
if (NumStds + NumTchs)
{
Style = "DAT_N";
- StyleNoBR = "DAT_N_NOBR";
+ StyleNoBR = "DAT_NOBR_N";
}
else
{
diff --git a/swad_profile.c b/swad_profile.c
index b35918605..44021fc3b 100644
--- a/swad_profile.c
+++ b/swad_profile.c
@@ -331,7 +331,7 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
/***** Start left list *****/
fprintf (Gbl.F.Out,"
"
- "
");
+ "");
/***** Number of courses in which the user is teacher *****/
NumCrssUsrIsTeacher = Usr_GetNumCrssOfUsrWithARole (UsrDat->UsrCod,Rol_TEACHER);
@@ -415,7 +415,7 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
/***** Start left list *****/
fprintf (Gbl.F.Out,""
- "
");
+ "");
UsrIsBannedFromRanking = Usr_CheckIfUsrBanned (UsrDat->UsrCod);
if (!UsrIsBannedFromRanking)
diff --git a/swad_social.c b/swad_social.c
index ff172be3e..f83d98b55 100644
--- a/swad_social.c
+++ b/swad_social.c
@@ -130,7 +130,7 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/
/*****************************************************************************/
-static unsigned long Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction);
+static void Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction);
static void Soc_GetDataOfSocialPublishingFromRow (MYSQL_ROW row,struct SocialPublishing *SocPub);
static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
const struct SocialNote *SocNot,
@@ -188,59 +188,64 @@ void Soc_ShowUsrTimeline (long UsrCod)
void Soc_ShowFollowingTimeline (void)
{
+ extern const char *Txt_You_dont_follow_any_user;
char Query[512];
/***** Link to write a new social post (public comment) *****/
if (Gbl.CurrentAct != ActReqSocPst)
Soc_PutLinkToWriteANewPost ();
- /***** 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!!!
+ /***** If I follow someone... *****/
+ if (Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod))
+ {
+ /***** Create temporary table with publishing codes *****/
+ sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS pub_cods");
+ if (mysql_query (&Gbl.mysql,Query))
+ DB_ExitOnMySQLError ("can not remove temporary tables");
- /***** Create temporary table with all the publishing codes *****/
- sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS pub_cods");
- if (mysql_query (&Gbl.mysql,Query))
- DB_ExitOnMySQLError ("can not remove temporary tables");
+ sprintf (Query,"CREATE TEMPORARY TABLE pub_cods (PubCod BIGINT NOT NULL,UNIQUE INDEX(PubCod)) ENGINE=MEMORY"
+ " SELECT MIN(PubCod) AS PubCod"
+ " FROM social_timeline"
+ " WHERE PublisherCod IN"
+ " (SELECT '%ld'"
+ " UNION"
+ " SELECT FollowedCod FROM usr_follow WHERE FollowerCod='%ld')"
+ " GROUP BY NotCod"
+ " ORDER BY PubCod DESC LIMIT %u",
+ Gbl.Usrs.Me.UsrDat.UsrCod,
+ Gbl.Usrs.Me.UsrDat.UsrCod,
+ Soc_NUM_PUBS_IN_TIMELINE);
+ if (mysql_query (&Gbl.mysql,Query))
+ DB_ExitOnMySQLError ("can not create temporary table");
- sprintf (Query,"CREATE TEMPORARY TABLE pub_cods (PubCod BIGINT NOT NULL,UNIQUE INDEX(PubCod)) ENGINE=MEMORY"
- " SELECT MIN(PubCod) AS PubCod"
- " FROM social_timeline"
- " WHERE PublisherCod IN"
- " (SELECT '%ld'"
- " UNION"
- " SELECT FollowedCod FROM usr_follow WHERE FollowerCod='%ld')"
- " GROUP BY NotCod"
- " ORDER BY PubCod DESC LIMIT %u",
- Gbl.Usrs.Me.UsrDat.UsrCod,
- Gbl.Usrs.Me.UsrDat.UsrCod,
- Soc_NUM_PUBS_IN_TIMELINE);
- if (mysql_query (&Gbl.mysql,Query))
- DB_ExitOnMySQLError ("can not create temporary table");
+ /***** Build query to show timeline including the users I am following *****/
+ sprintf (Query,"SELECT PubCod,AuthorCod,PublisherCod,NotCod,UNIX_TIMESTAMP(TimePublish)"
+ " FROM social_timeline WHERE PubCod IN "
+ "(SELECT PubCod FROM pub_cods)"
+ " ORDER BY PubCod DESC");
- /***** Build query to show timeline including the users I am following *****/
- sprintf (Query,"SELECT PubCod,AuthorCod,PublisherCod,NotCod,UNIX_TIMESTAMP(TimePublish)"
- " FROM social_timeline WHERE PubCod IN "
- "(SELECT PubCod FROM pub_cods)"
- " ORDER BY PubCod DESC");
+ /***** Show timeline *****/
+ Soc_ShowTimeline (Query,ActSeeSocAct);
- /***** Show timeline *****/
- if (!Soc_ShowTimeline (Query,ActSeeSocAct))
- Lay_ShowAlert (Lay_INFO,"No hay actividad pública."); // Need translation!!!
-
- sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS pub_cods");
- if (mysql_query (&Gbl.mysql,Query))
- DB_ExitOnMySQLError ("can not remove temporary tables");
+ /***** Drop temporary table with publishing codes *****/
+ sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS pub_cods");
+ if (mysql_query (&Gbl.mysql,Query))
+ DB_ExitOnMySQLError ("can not remove temporary tables");
+ }
+ else // I do not follow anyone
+ /***** Show warning if I do not follow anyone *****/
+ Lay_ShowAlert (Lay_INFO,Txt_You_dont_follow_any_user);
}
/*****************************************************************************/
/*********************** Show social activity (timeline) *********************/
/*****************************************************************************/
-// UpdateAction == ActUnk ==> no form to update is displayed
+// If UpdateAction == ActUnk ==> no form to update is displayed
-static unsigned long Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction)
+static void Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction)
{
extern const char *Txt_Public_activity;
+ extern const char *Txt_No_public_activity;
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumPublishings;
@@ -292,11 +297,11 @@ static unsigned long Soc_ShowTimeline (const char *Query,Act_Action_t UpdateActi
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
+ else // No publishing found in timeline
+ Lay_ShowAlert (Lay_INFO,Txt_No_public_activity);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
-
- return NumPublishings;
}
/*****************************************************************************/
diff --git a/swad_text.c b/swad_text.c
index 9db1127e1..9b71246ef 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -23877,6 +23877,27 @@ const char *Txt_No_of_users_who_will_be_notified_by_e_mail =
"Nº de utilizadores que serão notificados por e-mail";
#endif
+const char *Txt_No_public_activity =
+#if L==1
+ "No hi ha activitat pública";
+#elif L==2
+ "Keine öffentliche Aktivität";
+#elif L==3
+ "No public activity";
+#elif L==4
+ "No hay actividad pública";
+#elif L==5
+ "Aucune activité public";
+#elif L==6
+ "No hay actividad pública"; // Okoteve traducción
+#elif L==7
+ "Nessuna attività pubblica";
+#elif L==8
+ "Brak aktywność publiczne";
+#elif L==9
+ "Sem atividade pública";
+#endif
+
const char *Txt_No_questions_found_matching_your_search_criteria =
#if L==1
"No hay preguntas con el criterio de búsqueda seleccionado."; // Necessita traduccio
@@ -50567,6 +50588,27 @@ const char *Txt_You_can_send_a_file_with_an_image_in_jpg_format_and_size_X_Y = /
" and size %u×%u pixels."; // Necessita de tradução
#endif
+const char *Txt_You_dont_follow_any_user =
+#if L==1
+ "Vostè no segueix a cap usuari.";
+#elif L==2
+ "Sie haben noch keine Benutzer folgen.";
+#elif L==3
+ "You don't follow any user.";
+#elif L==4
+ "Usted no sigue a ningún usuario.";
+#elif L==5
+ "Vous ne suivez pas aucun utilisateur.";
+#elif L==6
+ "Usted no sigue a ningún usuario."; // Okoteve traducción
+#elif L==7
+ "Non si seguono gli utenti.";
+#elif L==8
+ "Nie po żadnej użytkownika.";
+#elif L==9
+ "Você não segue nenhum usuário.";
+#endif
+
const char *Txt_You_dont_have_permission_to_access_to_this_forum =
#if L==1
"No té permís per accedir a aquest fòrum.";