Version 15.88.2

This commit is contained in:
Antonio Cañas Vargas 2016-01-01 21:18:44 +01:00
parent 375ef86888
commit faf94c6a94
5 changed files with 90 additions and 42 deletions

View File

@ -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:

View File

@ -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
{

View File

@ -331,7 +331,7 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
/***** Start left list *****/
fprintf (Gbl.F.Out,"<div id=\"prf_fig_left_container\">"
"<ul class=\"PRF_FIG_UL DAT_N_NOBR\">");
"<ul class=\"PRF_FIG_UL DAT_NOBR_N\">");
/***** 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,"<div id=\"prf_fig_right_container\">"
"<ul class=\"PRF_FIG_UL DAT_N_NOBR\">");
"<ul class=\"PRF_FIG_UL DAT_NOBR_N\">");
UsrIsBannedFromRanking = Usr_CheckIfUsrBanned (UsrDat->UsrCod);
if (!UsrIsBannedFromRanking)

View File

@ -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&uacute;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&uacute;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;
}
/*****************************************************************************/

View File

@ -23877,6 +23877,27 @@ const char *Txt_No_of_users_who_will_be_notified_by_e_mail =
"N&ordm; de utilizadores que ser&atilde;o notificados por e-mail";
#endif
const char *Txt_No_public_activity =
#if L==1
"No hi ha activitat p&uacute;blica";
#elif L==2
"Keine &ouml;ffentliche Aktivit&auml;t";
#elif L==3
"No public activity";
#elif L==4
"No hay actividad p&uacute;blica";
#elif L==5
"Aucune activit&eacute; public";
#elif L==6
"No hay actividad p&uacute;blica"; // Okoteve traducción
#elif L==7
"Nessuna attivit&agrave; pubblica";
#elif L==8
"Brak aktywno&sacute;&cacute; publiczne";
#elif L==9
"Sem atividade p&uacute;blica";
#endif
const char *Txt_No_questions_found_matching_your_search_criteria =
#if L==1
"No hay preguntas con el criterio de b&uacute;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&times;%u pixels."; // Necessita de tradução
#endif
const char *Txt_You_dont_follow_any_user =
#if L==1
"Vost&egrave; 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&uacute;n usuario.";
#elif L==5
"Vous ne suivez pas aucun utilisateur.";
#elif L==6
"Usted no sigue a ning&uacute;n usuario."; // Okoteve traducción
#elif L==7
"Non si seguono gli utenti.";
#elif L==8
"Nie po &zdot;adnej u&zdot;ytkownika.";
#elif L==9
"Voc&ecirc; n&atilde;o segue nenhum usu&aacute;rio.";
#endif
const char *Txt_You_dont_have_permission_to_access_to_this_forum =
#if L==1
"No t&eacute; perm&iacute;s per accedir a aquest f&ograve;rum.";