Version 15.101

This commit is contained in:
Antonio Cañas Vargas 2016-01-07 14:57:35 +01:00
parent 54849d19a1
commit ced90826db
5 changed files with 99 additions and 12 deletions

View File

@ -11213,6 +11213,10 @@ UPDATE social_notes SET HieCod=CrsCod WHERE NoteType IN ('7','8','9','12');
ALTER TABLE social_notes DROP COLUMN CtyCod,DROP COLUMN InsCod,DROP COLUMN CtrCod,DROP COLUMN CrsCod;
CREATE TABLE IF NOT EXISTS social_timeline_new (PubCod BIGINT NOT NULL AUTO_INCREMENT, NotCod BIGINT NOT NULL, PublisherCod INT NOT NULL, AuthorCod INT NOT NULL, TimePublish DATETIME NOT NULL, UNIQUE INDEX(PubCod), UNIQUE INDEX(NotCod,PublisherCod), INDEX(PublisherCod), INDEX(AuthorCod), INDEX(TimePublish)) SELECT PubCod,NotCod,PublisherCod,AuthorCod,TimePublish FROM social_timeline ORDER BY PubCod;
----- SWAD 15.100.5 (2016/01/07) -----
CREATE TABLE IF NOT EXISTS social_comments (ComCod BIGINT NOT NULL AUTO_INCREMENT,UsrCod INT NOT NULL,NotCod INT NOT NULL,TimeComment DATETIME NOT NULL,UNIQUE INDEX(ComCod),INDEX(UsrCod),INDEX(NotCod,TimeComment),INDEX(TimeComment));
CREATE TABLE IF NOT EXISTS social_comments_content (ComCod BIGINT NOT NULL,Content LONGTEXT NOT NULL,UNIQUE INDEX(ComCod),FULLTEXT(Content)) ENGINE = MYISAM;

View File

@ -913,7 +913,27 @@ CREATE TABLE IF NOT EXISTS sessions (
UNIQUE INDEX(SessionId),
INDEX(UsrCod));
--
-- Table social: stores social notes
-- Table social_comments: stores the comments to social notes
--
CREATE TABLE IF NOT EXISTS social_comments (
ComCod BIGINT NOT NULL AUTO_INCREMENT,
UsrCod INT NOT NULL,
NotCod INT NOT NULL,
TimeComment DATETIME NOT NULL,
UNIQUE INDEX(ComCod),
INDEX(UsrCod),
INDEX(NotCod,TimeComment),
INDEX(TimeComment));
--
-- Table social_notes: stores the content of comments to social notes
--
CREATE TABLE IF NOT EXISTS social_comments_content (
ComCod BIGINT NOT NULL,
Content LONGTEXT NOT NULL,
UNIQUE INDEX(ComCod),
FULLTEXT(Content)) ENGINE = MYISAM;
--
-- Table social_notes: stores social notes
--
CREATE TABLE IF NOT EXISTS social_notes (
NotCod BIGINT NOT NULL AUTO_INCREMENT,

View File

@ -124,13 +124,32 @@ En definitiva, se estar
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.100.4 (2016-01-07)"
#define Log_PLATFORM_VERSION "SWAD 15.101 (2016-01-07)"
#define CSS_FILE "swad15.100.2.css"
#define JS_FILE "swad15.100.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.101: Jan 07, 2016 Store social comment in database. (191091 lines)
16 changes necessary in database:
CREATE TABLE IF NOT EXISTS social_comments (ComCod BIGINT NOT NULL AUTO_INCREMENT,UsrCod INT NOT NULL,NotCod INT NOT NULL,TimeComment DATETIME NOT NULL,UNIQUE INDEX(ComCod),INDEX(UsrCod),INDEX(NotCod,TimeComment),INDEX(TimeComment));
CREATE TABLE IF NOT EXISTS social_comments_content (ComCod BIGINT NOT NULL,Content LONGTEXT NOT NULL,UNIQUE INDEX(ComCod),FULLTEXT(Content)) ENGINE = MYISAM;
UPDATE actions SET Txt='Redactar public. social (global)' WHERE ActCod='1491' AND Language='es';
UPDATE actions SET Txt='Crear public. social (global)' WHERE ActCod='1492' AND Language='es';
UPDATE actions SET Txt='Eliminar public. social (global)' WHERE ActCod='1493' AND Language='es';
UPDATE actions SET Txt='Solicitar elim. public. social (global)' WHERE ActCod='1494' AND Language='es';
UPDATE actions SET Txt='Compartir public. social (global)' WHERE ActCod='1495' AND Language='es';
UPDATE actions SET Txt='Dejar de compartir public. social (global)' WHERE ActCod='1496' AND Language='es';
UPDATE actions SET Txt='Redactar public. social (usuario)' WHERE ActCod='1497' AND Language='es';
UPDATE actions SET Txt='Crear public. social (usuario)' WHERE ActCod='1498' AND Language='es';
UPDATE actions SET Txt='Compartir public. social (usuario)' WHERE ActCod='1499' AND Language='es';
UPDATE actions SET Txt='Dejar de compartir public. social (usuario)' WHERE ActCod='1500' AND Language='es';
UPDATE actions SET Txt='Solicitar elim. public. social (usuario)' WHERE ActCod='1501' AND Language='es';
UPDATE actions SET Txt='Eliminar public. social (usuario)' WHERE ActCod='1502' AND Language='es';
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1503','es','N','Crear comentario social (global)');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1504','es','N','Crear comentario social (usuario)');
Version 15.100.4: Jan 07, 2016 Fixed bug when sharing a social note.
Receive social comment. (191012 lines)
Version 15.100.3: Jan 07, 2016 Fixed bug when sharing and unsharing a social note. (190999 lines)

View File

@ -1935,6 +1935,46 @@ mysql> DESCRIBE sessions;
"UNIQUE INDEX(SessionId),"
"INDEX(UsrCod))");
/***** Table social_comments *****/
/*
mysql> DESCRIBE social_comments;
+-------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------+------+-----+---------+----------------+
| ComCod | bigint(20) | NO | PRI | NULL | auto_increment |
| UsrCod | int(11) | NO | MUL | NULL | |
| NotCod | int(11) | NO | MUL | NULL | |
| TimeComment | datetime | NO | MUL | NULL | |
+-------------+------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS social_comments ("
"ComCod BIGINT NOT NULL AUTO_INCREMENT,"
"UsrCod INT NOT NULL,"
"NotCod INT NOT NULL,"
"TimeComment DATETIME NOT NULL,"
"UNIQUE INDEX(ComCod),"
"INDEX(UsrCod),"
"INDEX(NotCod,TimeComment),"
"INDEX(TimeComment));");
/***** Table social_comments_content *****/
/*
mysql> DESCRIBE social_comments_content;
+---------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+------------+------+-----+---------+-------+
| ComCod | bigint(20) | NO | PRI | NULL | |
| Content | longtext | NO | MUL | NULL | |
+---------+------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS social_comments_content ("
"ComCod BIGINT NOT NULL,"
"Content LONGTEXT NOT NULL,"
"UNIQUE INDEX(ComCod),"
"FULLTEXT(Content)) ENGINE = MYISAM;");
/***** Table social_notes *****/
/*
mysql> DESCRIBE social_notes;

View File

@ -1408,10 +1408,10 @@ void Soc_ReceiveCommentUsr (void)
static void Soc_ReceiveComment (void)
{
char Content[Cns_MAX_BYTES_LONG_TEXT+1];
// char Query[128+Cns_MAX_BYTES_LONG_TEXT];
char Query[128+Cns_MAX_BYTES_LONG_TEXT];
struct SocialNote SocNot;
char ParamName[32];
// long ComCod;
long ComCod;
/***** Get and store new comment *****/
/* Get the code of the social note */
@ -1422,13 +1422,17 @@ static void Soc_ReceiveComment (void)
Par_GetParAndChangeFormat (ParamName,Content,Cns_MAX_BYTES_LONG_TEXT,
Str_TO_RIGOROUS_HTML,true);
/* Insert post content in the database */
/*
sprintf (Query,"INSERT INTO social_comments (SocNot,UsrCod,Content,TimeComment)"
" VALUES ('%ld','%s',NOW())",
SocNot.NotCod,Content);
/* Insert comment in the database */
sprintf (Query,"INSERT INTO social_comments (NotCod,UsrCod,TimeComment)"
" VALUES ('%ld','%ld',NOW())",
SocNot.NotCod,Gbl.Usrs.Me.UsrDat.UsrCod);
ComCod = DB_QueryINSERTandReturnCode (Query,"can not create comment");
*/
/* Insert comment content in the database */
sprintf (Query,"INSERT INTO social_comments_content (ComCod,Content)"
" VALUES ('%ld','%s')",
ComCod,Content);
DB_QueryINSERT (Query,"can not store comment content");
Lay_ShowAlert (Lay_INFO,Content);
}