diff --git a/swad_changelog.h b/swad_changelog.h
index 167c6a29c..1581c6bc2 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -124,13 +124,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 15.113.15 (2016-01-16)"
+#define Log_PLATFORM_VERSION "SWAD 15.113.16 (2016-01-16)"
#define CSS_FILE "swad15.113.8.css"
#define JS_FILE "swad15.113.8.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.113.16:Jan 16, 2016 Removed unused code and messages. (192743 lines)
Version 15.113.15:Jan 16, 2016 Changes in feedback on request to remove a social note. (192871 lines)
Version 15.113.14:Jan 16, 2016 Changes in feedback when a social comment is published. (192850 lines)
Version 15.113.13:Jan 16, 2016 Changes in feedback when a social note is unshared. (192846 lines)
diff --git a/swad_social.c b/swad_social.c
index a75e6150d..f2bda298c 100644
--- a/swad_social.c
+++ b/swad_social.c
@@ -279,7 +279,6 @@ static long Soc_GetParamNotCod (void);
static long Soc_GetParamComCod (void);
static long Soc_ReceiveComment (void);
-static bool Soc_CheckIfICanCommentNote (long NotCod);
static long Soc_ShareSocialNote (void);
static long Soc_UnshareSocialNote (void);
@@ -1785,7 +1784,6 @@ void Soc_ReceiveSocialPostUsr (void)
// Returns the code of the social note just created
static long Soc_ReceiveSocialPost (void)
{
- // extern const char *Txt_SOCIAL_PUBLISHING_Published;
char Content[Cns_MAX_BYTES_LONG_TEXT+1];
char Query[128+Cns_MAX_BYTES_LONG_TEXT];
long PstCod;
@@ -1805,9 +1803,6 @@ static long Soc_ReceiveSocialPost (void)
/* Insert post in social notes */
NotCod = Soc_StoreAndPublishSocialNote (Soc_NOTE_SOCIAL_POST,PstCod);
-
- /***** Message of success *****/
- // Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Published);
}
else
NotCod = -1L;
@@ -2109,13 +2104,13 @@ static void Soc_PutFormToRemoveComment (long ComCod)
static void Soc_PutDisabledIconShare (unsigned NumShared)
{
- extern const char *Txt_SOCIAL_PUBLISHING_Shared_by_X_USERS;
- extern const char *Txt_SOCIAL_PUBLISHING_Not_shared_by_anyone;
+ extern const char *Txt_SOCIAL_NOTE_Shared_by_X_USERS;
+ extern const char *Txt_SOCIAL_NOTE_Not_shared_by_anyone;
if (NumShared)
- sprintf (Gbl.Title,Txt_SOCIAL_PUBLISHING_Shared_by_X_USERS,NumShared);
+ sprintf (Gbl.Title,Txt_SOCIAL_NOTE_Shared_by_X_USERS,NumShared);
else
- strcpy (Gbl.Title,Txt_SOCIAL_PUBLISHING_Not_shared_by_anyone);
+ strcpy (Gbl.Title,Txt_SOCIAL_NOTE_Not_shared_by_anyone);
/***** Disabled icon to share *****/
fprintf (Gbl.F.Out,"
"
@@ -2308,7 +2303,6 @@ void Soc_ReceiveCommentUsr (void)
static long Soc_ReceiveComment (void)
{
- // extern const char *Txt_SOCIAL_PUBLISHING_Published;
extern const char *Txt_The_original_post_no_longer_exists;
char Content[Cns_MAX_BYTES_LONG_TEXT+1];
char Query[128+Cns_MAX_BYTES_LONG_TEXT];
@@ -2327,31 +2321,22 @@ static long Soc_ReceiveComment (void)
if (Content[0])
{
- /***** Check if I can comment *****/
- if (Soc_CheckIfICanCommentNote (SocNot.NotCod))
- {
- /***** Publish *****/
- /* Insert into publishings */
- SocPub.NotCod = SocNot.NotCod;
- SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
- SocPub.PubType = Soc_PUB_COMMENT_TO_NOTE;
- Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod
+ /***** Publish *****/
+ /* Insert into publishings */
+ SocPub.NotCod = SocNot.NotCod;
+ SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
+ SocPub.PubType = Soc_PUB_COMMENT_TO_NOTE;
+ Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod
- /* Insert comment content in the database */
- sprintf (Query,"INSERT INTO social_comments (ComCod,Content)"
- " VALUES ('%ld','%s')",
- SocPub.PubCod,
- Content);
- DB_QueryINSERT (Query,"can not store comment content");
+ /* Insert comment content in the database */
+ sprintf (Query,"INSERT INTO social_comments (ComCod,Content)"
+ " VALUES ('%ld','%s')",
+ SocPub.PubCod,
+ Content);
+ DB_QueryINSERT (Query,"can not store comment content");
- /***** Message of success *****/
- // Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Published);
-
- /***** Show the social note just commented *****/
- Soc_WriteSocialNote (&SocNot,&SocPub,true,true);
- }
- else
- Lay_ShowErrorAndExit ("You can not comment this note.");
+ /***** Show the social note just commented *****/
+ Soc_WriteSocialNote (&SocNot,&SocPub,true,true);
}
}
else
@@ -2360,35 +2345,6 @@ static long Soc_ReceiveComment (void)
return SocNot.NotCod;
}
-/*****************************************************************************/
-/******************* Check if I can comment a social note ********************/
-/*****************************************************************************/
-// I can comment a social note <=>
-// <=> if I can view the note <=>
-// <=> if I am a publisher (author or sharer)
-// or I follow at least one publisher (author or sharer)
-
-static bool Soc_CheckIfICanCommentNote (long NotCod)
- {
- // char Query[256];
-
- /***** Check if I am the author of this note
- or I follow the author of this note *****/
- /*
- sprintf (Query,"SELECT COUNT(*) FROM social_notes"
- " WHERE NotCod='%ld' AND UsrCod IN"
- " (SELECT '%ld'"
- " UNION"
- " SELECT FollowedCod FROM usr_follow WHERE FollowerCod='%ld')",
- NotCod,
- Gbl.Usrs.Me.UsrDat.UsrCod,
- Gbl.Usrs.Me.UsrDat.UsrCod);
- return (DB_QueryCOUNT (Query,"can not check if I can comment a social note") != 0);
- */
- // TODO: Remove this function if not used in future
- return (NotCod > 0); // Anyone can comment
- }
-
/*****************************************************************************/
/**************************** Share a social note ****************************/
/*****************************************************************************/
@@ -2429,7 +2385,6 @@ void Soc_ShareSocialNoteUsr (void)
static long Soc_ShareSocialNote (void)
{
- // extern const char *Txt_SOCIAL_PUBLISHING_Shared;
extern const char *Txt_The_original_post_no_longer_exists;
struct SocialNote SocNot;
struct SocialPublishing SocPub;
@@ -2464,12 +2419,6 @@ static long Soc_ShareSocialNote (void)
/* Update number of times this social note is shared */
Soc_UpdateNumTimesANoteHasBeenShared (&SocNot);
-
- /***** Message of success *****/
- // Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Shared);
-
- /***** Show the social note just shared *****/
- // Soc_WriteSocialNote (&SocNot,NULL,true,true);
}
}
else
@@ -2518,7 +2467,6 @@ void Soc_UnshareSocialNoteUsr (void)
static long Soc_UnshareSocialNote (void)
{
- // extern const char *Txt_SOCIAL_PUBLISHING_Unshared;
struct SocialNote SocNot;
struct SocialPublishing SocPub; // Used to print message indicating that I have unshared
bool IAmTheAuthor;
@@ -2546,9 +2494,6 @@ static long Soc_UnshareSocialNote (void)
/***** Update number of times this social note is shared *****/
Soc_UpdateNumTimesANoteHasBeenShared (&SocNot);
- /***** Message of success *****/
- // Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Unshared);
-
/***** Show the social note corresponding
to the publishing just unshared *****/
SocPub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
@@ -2690,7 +2635,7 @@ void Soc_RemoveSocialNoteUsr (void)
static void Soc_RemoveSocialNote (void)
{
- extern const char *Txt_SOCIAL_PUBLISHING_Removed;
+ extern const char *Txt_Post_removed;
struct SocialNote SocNot;
bool ICanRemove;
@@ -2706,7 +2651,7 @@ static void Soc_RemoveSocialNote (void)
Soc_RemoveASocialNoteFromDB (&SocNot);
/***** Message of success *****/
- Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Removed);
+ Lay_ShowAlert (Lay_SUCCESS,Txt_Post_removed);
}
}
@@ -2864,7 +2809,7 @@ void Soc_RemoveSocialComUsr (void)
static void Soc_RemoveSocialComment (void)
{
- extern const char *Txt_SOCIAL_PUBLISHING_Removed;
+ extern const char *Txt_Comment_removed;
struct SocialComment SocCom;
struct SocialNote SocNot;
bool ICanRemove;
@@ -2887,7 +2832,7 @@ static void Soc_RemoveSocialComment (void)
Soc_RemoveASocialCommentFromDB (&SocCom);
/***** Message of success *****/
- Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Removed);
+ Lay_ShowAlert (Lay_SUCCESS,Txt_Comment_removed);
}
}
diff --git a/swad_text.c b/swad_text.c
index 7ae82d35e..3f1b8da16 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -4624,6 +4624,27 @@ const char *Txt_Comment = // As a verb
"Comentar";
#endif
+const char *Txt_Comment_removed =
+#if L==1
+ "Comentari eliminat.";
+#elif L==2
+ "Kommentar entfernt.";
+#elif L==3
+ "Comment removed.";
+#elif L==4
+ "Comentario eliminado.";
+#elif L==5
+ "Commentaire supprimé.";
+#elif L==6
+ "Comentario eliminado."; // Okoteve traducción
+#elif L==7
+ "Commento rimosso.";
+#elif L==8
+ "Komentarz usuniety.";
+#elif L==9
+ "Comentário removido.";
+#endif
+
const char *Txt_Comments =
#if L==1
"Comentaris";
@@ -27514,7 +27535,7 @@ const char *Txt_Post_sent =
const char *Txt_Post_removed =
#if L==1
- "Mensaje eliminado."; // Necessita traduccio
+ "Missatge eliminat.";
#elif L==2
"Nachricht entfernt.";
#elif L==3
@@ -27522,7 +27543,7 @@ const char *Txt_Post_removed =
#elif L==4
"Mensaje eliminado.";
#elif L==5
- "Post removed."; // Besoin de traduction
+ "Message supprimé.";
#elif L==6
"Mensaje eliminado."; // Okoteve traducción
#elif L==7
@@ -27530,7 +27551,7 @@ const char *Txt_Post_removed =
#elif L==8
"Post usuniety.";
#elif L==9
- "Post removed."; // Necessita de tradução
+ "Post removido.";
#endif
const char *Txt_Post_unbanned =
@@ -34345,28 +34366,7 @@ const char *Txt_Set_password =
#elif L==9
"Definir senha";
#endif
-/*
-const char *Txt_Send_comment =
-#if L==1
- "Enviar comentari";
-#elif L==2
- "Senden Kommentar";
-#elif L==3
- "Send comment";
-#elif L==4
- "Enviar comentario";
-#elif L==5
- "Envoyer commentaire";
-#elif L==6
- "Enviar comentario"; // Okoteve traducción
-#elif L==7
- "Invia commento";
-#elif L==8
- "Wyślij komentarz";
-#elif L==9
- "Enviar comentário";
-#endif
-*/
+
const char *Txt_Send_message =
#if L==1
"Enviar missatge";
@@ -35699,70 +35699,7 @@ const char *Txt_SOCIAL_NOTE[Soc_NUM_NOTE_TYPES] =
#endif
};
-const char *Txt_SOCIAL_PUBLISHING_Published =
-#if L==1
- "Publicat.";
-#elif L==2
- "Veröffentlicht.";
-#elif L==3
- "Published.";
-#elif L==4
- "Publicado.";
-#elif L==5
- "Publié.";
-#elif L==6
- "Publicado."; // Okoteve traducción
-#elif L==7
- "Pubblicato.";
-#elif L==8
- "Opublikowany.";
-#elif L==9
- "Publicado.";
-#endif
-
-const char *Txt_SOCIAL_PUBLISHING_Removed =
-#if L==1
- "Eliminat.";
-#elif L==2
- "Entfernt.";
-#elif L==3
- "Removed.";
-#elif L==4
- "Eliminado.";
-#elif L==5
- "Supprimé.";
-#elif L==6
- "Eliminado."; // Okoteve traducción
-#elif L==7
- "Rimosso.";
-#elif L==8
- "Usuniete.";
-#elif L==9
- "Removido.";
-#endif
-
-const char *Txt_SOCIAL_PUBLISHING_Shared =
-#if L==1
- "Compartit.";
-#elif L==2
- "Geteilt.";
-#elif L==3
- "Shared.";
-#elif L==4
- "Compartido.";
-#elif L==5
- "Partagé.";
-#elif L==6
- "Compartido."; // Okoteve traducción
-#elif L==7
- "Condiviso.";
-#elif L==8
- "Dzielone.";
-#elif L==9
- "Compartilhado.";
-#endif
-
-const char *Txt_SOCIAL_PUBLISHING_Shared_by_X_USERS = // Warning: it is very important to include %u in the following sentences
+const char *Txt_SOCIAL_NOTE_Shared_by_X_USERS = // Warning: it is very important to include %u in the following sentences
#if L==1
"Compartit per %u";
#elif L==2
@@ -35783,28 +35720,7 @@ const char *Txt_SOCIAL_PUBLISHING_Shared_by_X_USERS = // Warning: it is very imp
"Compartilhado por %u";
#endif
-const char *Txt_SOCIAL_PUBLISHING_Unshared = // No longer shared
-#if L==1
- "No compartit.";
-#elif L==2
- "Kein geteilt.";
-#elif L==3
- "Unshared.";
-#elif L==4
- "No compartido.";
-#elif L==5
- "Non partagé.";
-#elif L==6
- "No compartido."; // Okoteve traducción
-#elif L==7
- "Non condiviso.";
-#elif L==8
- "Niedzieloną.";
-#elif L==9
- "Não compartilhado.";
-#endif
-
-const char *Txt_SOCIAL_PUBLISHING_Not_shared_by_anyone = // No longer shared
+const char *Txt_SOCIAL_NOTE_Not_shared_by_anyone = // No longer shared
#if L==1
"No compartit per ningú";
#elif L==2