mirror of https://github.com/acanas/swad-core.git
Version 15.102.3
This commit is contained in:
parent
36a89ae8ba
commit
a7b612cb35
|
@ -118,13 +118,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.102.2 (2016-01-08)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.102.3 (2016-01-08)"
|
||||
#define CSS_FILE "swad15.102.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.102.3: Jan 08, 2016 The social notes of the user are shown in her/his global timeline even if he/she does not follow any user. (191603 lines)
|
||||
Version 15.102.2: Jan 08, 2016 When a user is eliminated, all her/his social publshing are removed. (191606 lines)
|
||||
Version 15.102.1: Jan 08, 2016 Changes in layout of social timeline. (191557 lines)
|
||||
Version 15.102: Jan 08, 2016 Remove a comment in social timeline. (191534 lines)
|
||||
|
|
|
@ -248,46 +248,43 @@ void Soc_ShowTimelineGbl (void)
|
|||
if (Gbl.CurrentAct != ActReqSocPstGbl) // Not writing a new post
|
||||
Soc_PutLinkToWriteANewPost (ActReqSocPstGbl,NULL);
|
||||
|
||||
/***** 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");
|
||||
|
||||
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,NotCod,PublisherCod,AuthorCod,UNIX_TIMESTAMP(TimePublish)"
|
||||
" FROM social_timeline WHERE PubCod IN "
|
||||
"(SELECT PubCod FROM pub_cods)"
|
||||
" ORDER BY PubCod DESC");
|
||||
|
||||
/***** Show timeline *****/
|
||||
Soc_ShowTimeline (Query,ActSeeSocTmlGbl,Txt_Public_activity);
|
||||
|
||||
/***** 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 *****/
|
||||
/***** Show warning if I do not follow anyone *****/
|
||||
if (!Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod))
|
||||
Lay_ShowAlert (Lay_INFO,Txt_You_dont_follow_any_user);
|
||||
|
||||
/***** 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");
|
||||
|
||||
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,NotCod,PublisherCod,AuthorCod,UNIX_TIMESTAMP(TimePublish)"
|
||||
" FROM social_timeline WHERE PubCod IN "
|
||||
"(SELECT PubCod FROM pub_cods)"
|
||||
" ORDER BY PubCod DESC");
|
||||
|
||||
/***** Show timeline *****/
|
||||
Soc_ShowTimeline (Query,ActSeeSocTmlGbl,Txt_Public_activity);
|
||||
|
||||
/***** 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");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue