mirror of https://github.com/acanas/swad-core.git
Version 15.110.4
This commit is contained in:
parent
665d9bbc05
commit
683d00554c
|
@ -917,7 +917,7 @@ CREATE TABLE IF NOT EXISTS sessions (
|
|||
--
|
||||
-- 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,
|
||||
Content LONGTEXT NOT NULL,
|
||||
UNIQUE INDEX(ComCod),
|
||||
|
|
|
@ -122,14 +122,19 @@
|
|||
/****************************** 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 JS_FILE "swad15.107.2.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.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:
|
||||
RENAME TABLE social_timeline TO social_pubs;
|
||||
|
||||
|
|
|
@ -1940,9 +1940,9 @@ mysql> DESCRIBE sessions;
|
|||
"UNIQUE INDEX(SessionId),"
|
||||
"INDEX(UsrCod))");
|
||||
|
||||
/***** Table social_comments_content *****/
|
||||
/***** Table social_comments *****/
|
||||
/*
|
||||
mysql> DESCRIBE social_comments_content;
|
||||
mysql> DESCRIBE social_comments;
|
||||
+---------+------------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+---------+------------+------+-----+---------+-------+
|
||||
|
@ -1951,7 +1951,7 @@ mysql> DESCRIBE social_comments_content;
|
|||
+---------+------------+------+-----+---------+-------+
|
||||
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,"
|
||||
"Content LONGTEXT NOT NULL,"
|
||||
"UNIQUE INDEX(ComCod),"
|
||||
|
|
|
@ -1620,11 +1620,11 @@ static void Soc_WriteCommentsInSocialNote (long NotCod,
|
|||
sprintf (Query,"SELECT social_pubs.PubCod,social_pubs.PublisherCod,"
|
||||
"social_pubs.NotCod,"
|
||||
"UNIX_TIMESTAMP(social_pubs.TimePublish),"
|
||||
"social_comments_content.Content"
|
||||
" FROM social_pubs,social_comments_content"
|
||||
"social_comments.Content"
|
||||
" FROM social_pubs,social_comments"
|
||||
" WHERE social_pubs.NotCod='%ld'"
|
||||
" 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",
|
||||
NotCod,(unsigned) Soc_PUB_COMMENT_TO_NOTE);
|
||||
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
|
||||
|
||||
/* 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')",
|
||||
SocPub.PubCod,
|
||||
Content);
|
||||
|
@ -2374,11 +2374,11 @@ static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot)
|
|||
char Query[256];
|
||||
|
||||
/***** Remove content of the comments of this social note *****/
|
||||
sprintf (Query,"DELETE FROM social_comments_content"
|
||||
" USING social_pubs,social_comments_content"
|
||||
sprintf (Query,"DELETE FROM social_comments"
|
||||
" USING social_pubs,social_comments"
|
||||
" WHERE social_pubs.NotCod='%ld'"
|
||||
" 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);
|
||||
DB_QueryDELETE (Query,"can not remove social comments");
|
||||
|
||||
|
@ -2555,7 +2555,7 @@ static void Soc_RemoveASocialCommentFromDB (struct SocialComment *SocCom)
|
|||
char Query[128];
|
||||
|
||||
/***** Remove content of this social comment *****/
|
||||
sprintf (Query,"DELETE FROM social_comments_content"
|
||||
sprintf (Query,"DELETE FROM social_comments"
|
||||
" WHERE ComCod='%ld'",
|
||||
SocCom->ComCod);
|
||||
DB_QueryDELETE (Query,"can not remove a social comment");
|
||||
|
@ -2584,12 +2584,12 @@ void Soc_RemoveUsrSocialContent (long UsrCod)
|
|||
|
||||
/***** Remove social comments *****/
|
||||
/* Remove content of all the comments in all the social notes of the user */
|
||||
sprintf (Query,"DELETE FROM social_comments_content"
|
||||
" USING social_pubs,social_comments_content"
|
||||
sprintf (Query,"DELETE FROM social_comments"
|
||||
" USING social_pubs,social_comments"
|
||||
" WHERE social_pubs.NotCod IN"
|
||||
" (SELECT NotCod FROM social_notes WHERE UsrCod='%ld')"
|
||||
" 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);
|
||||
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");
|
||||
|
||||
/* Remove content of all the comments of the user in any social note */
|
||||
sprintf (Query,"DELETE FROM social_comments_content"
|
||||
" USING social_pubs,social_comments_content"
|
||||
sprintf (Query,"DELETE FROM social_comments"
|
||||
" USING social_pubs,social_comments"
|
||||
" WHERE social_pubs.PublisherCod='%ld'"
|
||||
" 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);
|
||||
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,"
|
||||
"social_pubs.NotCod,"
|
||||
"UNIX_TIMESTAMP(social_pubs.TimePublish),"
|
||||
"social_comments_content.Content"
|
||||
" FROM social_pubs,social_comments_content"
|
||||
"social_comments.Content"
|
||||
" FROM social_pubs,social_comments"
|
||||
" WHERE social_pubs.PubCod='%ld'"
|
||||
" 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);
|
||||
if (DB_QuerySELECT (Query,&mysql_res,"can not get data of social comment"))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue