Version 15.110.4

This commit is contained in:
Antonio Cañas Vargas 2016-01-12 19:24:29 +01:00
parent 665d9bbc05
commit 683d00554c
4 changed files with 28 additions and 23 deletions

View File

@ -917,7 +917,7 @@ CREATE TABLE IF NOT EXISTS sessions (
-- --
-- Table social_notes: stores the content of comments to social notes -- Table social_notes: stores the content of comments to social notes
-- --
CREATE TABLE IF NOT EXISTS social_comments_content ( CREATE TABLE IF NOT EXISTS social_comments (
ComCod BIGINT NOT NULL, ComCod BIGINT NOT NULL,
Content LONGTEXT NOT NULL, Content LONGTEXT NOT NULL,
UNIQUE INDEX(ComCod), UNIQUE INDEX(ComCod),

View File

@ -122,14 +122,19 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.110.3 (2016-01-12)" #define Log_PLATFORM_VERSION "SWAD 15.110.4 (2016-01-12)"
#define CSS_FILE "swad15.110.2.css" #define CSS_FILE "swad15.110.2.css"
#define JS_FILE "swad15.107.2.js" #define JS_FILE "swad15.107.2.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.110.3: Jan 12, 2016 Database table with publishings renamed. (192259 lines) Version 15.110.4: Jan 12, 2016 Database table with social comments renamed. (192263 lines)
2 changes necessary in database:
DROP TABLE social_comments;
RENAME TABLE social_comments_content TO social_comments;
Version 15.110.3: Jan 12, 2016 Database table with social publishings renamed. (192259 lines)
1 change necessary in database: 1 change necessary in database:
RENAME TABLE social_timeline TO social_pubs; RENAME TABLE social_timeline TO social_pubs;

View File

@ -1940,9 +1940,9 @@ mysql> DESCRIBE sessions;
"UNIQUE INDEX(SessionId)," "UNIQUE INDEX(SessionId),"
"INDEX(UsrCod))"); "INDEX(UsrCod))");
/***** Table social_comments_content *****/ /***** Table social_comments *****/
/* /*
mysql> DESCRIBE social_comments_content; mysql> DESCRIBE social_comments;
+---------+------------+------+-----+---------+-------+ +---------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
+---------+------------+------+-----+---------+-------+ +---------+------------+------+-----+---------+-------+
@ -1951,7 +1951,7 @@ mysql> DESCRIBE social_comments_content;
+---------+------------+------+-----+---------+-------+ +---------+------------+------+-----+---------+-------+
2 rows in set (0.00 sec) 2 rows in set (0.00 sec)
*/ */
DB_CreateTable ("CREATE TABLE IF NOT EXISTS social_comments_content (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS social_comments ("
"ComCod BIGINT NOT NULL," "ComCod BIGINT NOT NULL,"
"Content LONGTEXT NOT NULL," "Content LONGTEXT NOT NULL,"
"UNIQUE INDEX(ComCod)," "UNIQUE INDEX(ComCod),"

View File

@ -1620,11 +1620,11 @@ static void Soc_WriteCommentsInSocialNote (long NotCod,
sprintf (Query,"SELECT social_pubs.PubCod,social_pubs.PublisherCod," sprintf (Query,"SELECT social_pubs.PubCod,social_pubs.PublisherCod,"
"social_pubs.NotCod," "social_pubs.NotCod,"
"UNIX_TIMESTAMP(social_pubs.TimePublish)," "UNIX_TIMESTAMP(social_pubs.TimePublish),"
"social_comments_content.Content" "social_comments.Content"
" FROM social_pubs,social_comments_content" " FROM social_pubs,social_comments"
" WHERE social_pubs.NotCod='%ld'" " WHERE social_pubs.NotCod='%ld'"
" AND social_pubs.PubType='%u'" " AND social_pubs.PubType='%u'"
" AND social_pubs.PubCod=social_comments_content.ComCod" " AND social_pubs.PubCod=social_comments.ComCod"
" ORDER BY social_pubs.PubCod", " ORDER BY social_pubs.PubCod",
NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE);
NumComments = DB_QuerySELECT (Query,&mysql_res,"can not get social comments"); NumComments = DB_QuerySELECT (Query,&mysql_res,"can not get social comments");
@ -2010,7 +2010,7 @@ static void Soc_ReceiveComment (void)
Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod Soc_PublishSocialNoteInTimeline (&SocPub); // Set SocPub.PubCod
/* Insert comment content in the database */ /* Insert comment content in the database */
sprintf (Query,"INSERT INTO social_comments_content (ComCod,Content)" sprintf (Query,"INSERT INTO social_comments (ComCod,Content)"
" VALUES ('%ld','%s')", " VALUES ('%ld','%s')",
SocPub.PubCod, SocPub.PubCod,
Content); Content);
@ -2374,11 +2374,11 @@ static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot)
char Query[256]; char Query[256];
/***** Remove content of the comments of this social note *****/ /***** Remove content of the comments of this social note *****/
sprintf (Query,"DELETE FROM social_comments_content" sprintf (Query,"DELETE FROM social_comments"
" USING social_pubs,social_comments_content" " USING social_pubs,social_comments"
" WHERE social_pubs.NotCod='%ld'" " WHERE social_pubs.NotCod='%ld'"
" AND social_pubs.PubType='%u'" " AND social_pubs.PubType='%u'"
" AND social_pubs.PubCod=social_comments_content.ComCod", " AND social_pubs.PubCod=social_comments.ComCod",
SocNot->NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); SocNot->NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE);
DB_QueryDELETE (Query,"can not remove social comments"); DB_QueryDELETE (Query,"can not remove social comments");
@ -2555,7 +2555,7 @@ static void Soc_RemoveASocialCommentFromDB (struct SocialComment *SocCom)
char Query[128]; char Query[128];
/***** Remove content of this social comment *****/ /***** Remove content of this social comment *****/
sprintf (Query,"DELETE FROM social_comments_content" sprintf (Query,"DELETE FROM social_comments"
" WHERE ComCod='%ld'", " WHERE ComCod='%ld'",
SocCom->ComCod); SocCom->ComCod);
DB_QueryDELETE (Query,"can not remove a social comment"); DB_QueryDELETE (Query,"can not remove a social comment");
@ -2584,12 +2584,12 @@ void Soc_RemoveUsrSocialContent (long UsrCod)
/***** Remove social comments *****/ /***** Remove social comments *****/
/* Remove content of all the comments in all the social notes of the user */ /* Remove content of all the comments in all the social notes of the user */
sprintf (Query,"DELETE FROM social_comments_content" sprintf (Query,"DELETE FROM social_comments"
" USING social_pubs,social_comments_content" " USING social_pubs,social_comments"
" WHERE social_pubs.NotCod IN" " WHERE social_pubs.NotCod IN"
" (SELECT NotCod FROM social_notes WHERE UsrCod='%ld')" " (SELECT NotCod FROM social_notes WHERE UsrCod='%ld')"
" AND social_pubs.PubType='%u'" " AND social_pubs.PubType='%u'"
" AND social_pubs.PubCod=social_comments_content.ComCod", " AND social_pubs.PubCod=social_comments.ComCod",
UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE);
DB_QueryDELETE (Query,"can not remove social comments"); DB_QueryDELETE (Query,"can not remove social comments");
@ -2602,11 +2602,11 @@ void Soc_RemoveUsrSocialContent (long UsrCod)
DB_QueryDELETE (Query,"can not remove social comments"); DB_QueryDELETE (Query,"can not remove social comments");
/* Remove content of all the comments of the user in any social note */ /* Remove content of all the comments of the user in any social note */
sprintf (Query,"DELETE FROM social_comments_content" sprintf (Query,"DELETE FROM social_comments"
" USING social_pubs,social_comments_content" " USING social_pubs,social_comments"
" WHERE social_pubs.PublisherCod='%ld'" " WHERE social_pubs.PublisherCod='%ld'"
" AND social_pubs.PubType='%u'" " AND social_pubs.PubType='%u'"
" AND social_pubs.PubCod=social_comments_content.ComCod", " AND social_pubs.PubCod=social_comments.ComCod",
UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); UsrCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE);
DB_QueryDELETE (Query,"can not remove social comments"); DB_QueryDELETE (Query,"can not remove social comments");
@ -2807,11 +2807,11 @@ static void Soc_GetDataOfSocialCommentByCod (struct SocialComment *SocCom)
sprintf (Query,"SELECT social_pubs.PubCod,social_pubs.PublisherCod," sprintf (Query,"SELECT social_pubs.PubCod,social_pubs.PublisherCod,"
"social_pubs.NotCod," "social_pubs.NotCod,"
"UNIX_TIMESTAMP(social_pubs.TimePublish)," "UNIX_TIMESTAMP(social_pubs.TimePublish),"
"social_comments_content.Content" "social_comments.Content"
" FROM social_pubs,social_comments_content" " FROM social_pubs,social_comments"
" WHERE social_pubs.PubCod='%ld'" " WHERE social_pubs.PubCod='%ld'"
" AND social_pubs.PubType='%u'" " AND social_pubs.PubType='%u'"
" AND social_pubs.PubCod=social_comments_content.ComCod", " AND social_pubs.PubCod=social_comments.ComCod",
SocCom->ComCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE); SocCom->ComCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE);
if (DB_QuerySELECT (Query,&mysql_res,"can not get data of social comment")) if (DB_QuerySELECT (Query,&mysql_res,"can not get data of social comment"))
{ {