",
- WhichUsrs == Gbl.Social.WhichUsrs ? "PREF_ON" :
+ WhichUsrs == Gbl.Timeline.WhichUsrs ? "PREF_ON" :
"PREF_OFF");
Frm_StartForm (ActSeeSocTmlGbl);
Par_PutHiddenParamUnsigned ("WhichUsrs",WhichUsrs);
@@ -1151,51 +1158,51 @@ static void Soc_PutFormWhichUsrs (void)
Pre_EndPrefsHead ();
/***** Show warning if I do not follow anyone *****/
- if (Gbl.Social.WhichUsrs == Soc_USRS_FOLLOWED)
- Soc_ShowWarningYouDontFollowAnyUser ();
+ if (Gbl.Timeline.WhichUsrs == TL_USRS_FOLLOWED)
+ TL_ShowWarningYouDontFollowAnyUser ();
}
/*****************************************************************************/
/***** Put hidden parameter with which users to view in global timeline ******/
/*****************************************************************************/
-static void Soc_PutParamWhichUsrs (void)
+static void TL_PutParamWhichUsrs (void)
{
- Par_PutHiddenParamUnsigned ("WhichUsrs",Gbl.Social.WhichUsrs);
+ Par_PutHiddenParamUnsigned ("WhichUsrs",Gbl.Timeline.WhichUsrs);
}
/*****************************************************************************/
/********* Get parameter with which users to view in global timeline *********/
/*****************************************************************************/
-static void Soc_GetParamsWhichUsrs (void)
+static void TL_GetParamsWhichUsrs (void)
{
/***** Get which users I want to see *****/
- Gbl.Social.WhichUsrs = (Soc_WhichUsrs_t)
+ Gbl.Timeline.WhichUsrs = (TL_WhichUsrs_t)
Par_GetParToUnsignedLong ("WhichUsrs",
1,
- Soc_NUM_WHICH_USRS - 1,
- (unsigned long) Soc_USRS_UNKNOWN);
+ TL_NUM_WHICH_USRS - 1,
+ (unsigned long) TL_USRS_UNKNOWN);
/***** If parameter WhichUsrs is not present, get it from database *****/
- if (Gbl.Social.WhichUsrs == Soc_USRS_UNKNOWN)
- Gbl.Social.WhichUsrs = Soc_GetWhichUsrsFromDB ();
+ if (Gbl.Timeline.WhichUsrs == TL_USRS_UNKNOWN)
+ Gbl.Timeline.WhichUsrs = TL_GetWhichUsrsFromDB ();
/***** If parameter WhichUsrs is unknown, set it to default *****/
- if (Gbl.Social.WhichUsrs == Soc_USRS_UNKNOWN)
- Gbl.Social.WhichUsrs = Soc_DEFAULT_WHICH_USRS;
+ if (Gbl.Timeline.WhichUsrs == TL_USRS_UNKNOWN)
+ Gbl.Timeline.WhichUsrs = TL_DEFAULT_WHICH_USRS;
}
/*****************************************************************************/
/********** Get user's last data from database giving a user's code **********/
/*****************************************************************************/
-static Soc_WhichUsrs_t Soc_GetWhichUsrsFromDB (void)
+static TL_WhichUsrs_t TL_GetWhichUsrsFromDB (void)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned UnsignedNum;
- Soc_WhichUsrs_t WhichUsrs = Soc_USRS_UNKNOWN;
+ TL_WhichUsrs_t WhichUsrs = TL_USRS_UNKNOWN;
/***** Get which users from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get timeline users from user's last data",
@@ -1207,8 +1214,8 @@ static Soc_WhichUsrs_t Soc_GetWhichUsrsFromDB (void)
/* Get which users */
if (sscanf (row[0],"%u",&UnsignedNum) == 1)
- if (UnsignedNum < Soc_NUM_WHICH_USRS)
- WhichUsrs = (Soc_WhichUsrs_t) UnsignedNum;
+ if (UnsignedNum < TL_NUM_WHICH_USRS)
+ WhichUsrs = (TL_WhichUsrs_t) UnsignedNum;
}
/***** Free structure that stores the query result *****/
@@ -1221,18 +1228,18 @@ static Soc_WhichUsrs_t Soc_GetWhichUsrsFromDB (void)
/********************** Save which users into database ***********************/
/*****************************************************************************/
-static void Soc_SaveWhichUsersInDB (void)
+static void TL_SaveWhichUsersInDB (void)
{
if (Gbl.Usrs.Me.Logged)
{
- if (Gbl.Social.WhichUsrs == Soc_USRS_UNKNOWN)
- Gbl.Social.WhichUsrs = Soc_DEFAULT_WHICH_USRS;
+ if (Gbl.Timeline.WhichUsrs == TL_USRS_UNKNOWN)
+ Gbl.Timeline.WhichUsrs = TL_DEFAULT_WHICH_USRS;
/***** Update which users in database *****/
// WhichUsrs is stored in usr_last for next time I log in
DB_QueryUPDATE ("can not update timeline users in user's last data",
"UPDATE usr_last SET TimelineUsrs=%u WHERE UsrCod=%ld",
- (unsigned) Gbl.Social.WhichUsrs,
+ (unsigned) Gbl.Timeline.WhichUsrs,
Gbl.Usrs.Me.UsrDat.UsrCod);
}
}
@@ -1241,7 +1248,7 @@ static void Soc_SaveWhichUsersInDB (void)
/********* Get parameter with which users to view in global timeline *********/
/*****************************************************************************/
-static void Soc_ShowWarningYouDontFollowAnyUser (void)
+static void TL_ShowWarningYouDontFollowAnyUser (void)
{
extern const char *Txt_You_dont_follow_any_user;
unsigned NumFollowing;
@@ -1262,18 +1269,18 @@ static void Soc_ShowWarningYouDontFollowAnyUser (void)
}
/*****************************************************************************/
-/********** Show new social activity (new publications in timeline) **********/
+/******************* Show new publications in timeline ***********************/
/*****************************************************************************/
// The publications are inserted as list elements of a hidden list
-static void Soc_InsertNewPubsInTimeline (char *Query)
+static void TL_InsertNewPubsInTimeline (char *Query)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumPubsGot;
unsigned long NumPub;
- struct SocialPublication SocPub;
- struct SocialNote SocNot;
+ struct TL_Publication SocPub;
+ struct TL_Note SocNot;
/***** Get new publications timeline from database *****/
NumPubsGot = DB_QuerySELECT (&mysql_res,"can not get timeline",
@@ -1285,16 +1292,16 @@ static void Soc_InsertNewPubsInTimeline (char *Query)
NumPub < NumPubsGot;
NumPub++)
{
- /* Get data of social publication */
+ /* Get data of publication */
row = mysql_fetch_row (mysql_res);
- Soc_GetDataOfSocialPublicationFromRow (row,&SocPub);
+ TL_GetDataOfPublicationFromRow (row,&SocPub);
- /* Get data of social note */
+ /* Get data of note */
SocNot.NotCod = SocPub.NotCod;
- Soc_GetDataOfSocialNotByCod (&SocNot);
+ TL_GetDataOfNoteByCod (&SocNot);
- /* Write social note */
- Soc_WriteSocialNote (&SocNot,
+ /* Write note */
+ TL_WriteNote (&SocNot,
SocPub.TopMessage,SocPub.PublisherCod,
false,false);
}
@@ -1304,18 +1311,18 @@ static void Soc_InsertNewPubsInTimeline (char *Query)
}
/*****************************************************************************/
-/********** Show old social activity (old publications in timeline) **********/
+/********************* Show old publications in timeline *********************/
/*****************************************************************************/
// The publications are inserted as list elements of a hidden list
-static void Soc_ShowOldPubsInTimeline (char *Query)
+static void TL_ShowOldPubsInTimeline (char *Query)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumPubsGot;
unsigned long NumPub;
- struct SocialPublication SocPub;
- struct SocialNote SocNot;
+ struct TL_Publication SocPub;
+ struct TL_Note SocNot;
/***** Get old publications timeline from database *****/
NumPubsGot = DB_QuerySELECT (&mysql_res,"can not get timeline",
@@ -1327,16 +1334,16 @@ static void Soc_ShowOldPubsInTimeline (char *Query)
NumPub < NumPubsGot;
NumPub++)
{
- /* Get data of social publication */
+ /* Get data of publication */
row = mysql_fetch_row (mysql_res);
- Soc_GetDataOfSocialPublicationFromRow (row,&SocPub);
+ TL_GetDataOfPublicationFromRow (row,&SocPub);
- /* Get data of social note */
+ /* Get data of note */
SocNot.NotCod = SocPub.NotCod;
- Soc_GetDataOfSocialNotByCod (&SocNot);
+ TL_GetDataOfNoteByCod (&SocNot);
- /* Write social note */
- Soc_WriteSocialNote (&SocNot,
+ /* Write note */
+ TL_WriteNote (&SocNot,
SocPub.TopMessage,SocPub.PublisherCod,
false,false);
}
@@ -1345,14 +1352,14 @@ static void Soc_ShowOldPubsInTimeline (char *Query)
DB_FreeMySQLResult (&mysql_res);
/***** Store first publication code into session *****/
- Soc_UpdateFirstPubCodIntoSession (SocPub.PubCod);
+ TL_UpdateFirstPubCodIntoSession (SocPub.PubCod);
}
/*****************************************************************************/
/***************** Put link to view new publications in timeline *************/
/*****************************************************************************/
-static void Soc_PutLinkToViewNewPublications (void)
+static void TL_PutLinkToViewNewPublications (void)
{
extern const char *The_ClassFormInBoxBold[The_NUM_THEMES];
extern const char *Txt_See_new_activity;
@@ -1375,7 +1382,7 @@ static void Soc_PutLinkToViewNewPublications (void)
/***************** Put link to view old publications in timeline *************/
/*****************************************************************************/
-static void Soc_PutLinkToViewOldPublications (void)
+static void TL_PutLinkToViewOldPublications (void)
{
extern const char *The_ClassFormInBoxBold[The_NUM_THEMES];
extern const char *Txt_See_more;
@@ -1404,14 +1411,14 @@ static void Soc_PutLinkToViewOldPublications (void)
}
/*****************************************************************************/
-/***************************** Write social note *****************************/
+/******************************** Write note *********************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
-static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
- Soc_TopMessage_t TopMessage,long UsrCod,
- bool Highlight, // Highlight social note
- bool ShowNoteAlone) // Social note is shown alone, not in a list
+static void TL_WriteNote (const struct TL_Note *SocNot,
+ TL_TopMessage_t TopMessage,long UsrCod,
+ bool Highlight, // Highlight note
+ bool ShowNoteAlone) // Note is shown alone, not in a list
{
extern const char *Txt_Forum;
extern const char *Txt_Course;
@@ -1454,9 +1461,9 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
fprintf (Gbl.F.Out,"\">");
if (SocNot->NotCod <= 0 ||
- SocNot->NoteType == Soc_NOTE_UNKNOWN ||
+ SocNot->NoteType == TL_NOTE_UNKNOWN ||
SocNot->UsrCod <= 0)
- Ale_ShowAlert (Ale_ERROR,"Error in social note.");
+ Ale_ShowAlert (Ale_ERROR,"Error in note.");
else
{
/***** Initialize location in hierarchy *****/
@@ -1466,7 +1473,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
Crs.CrsCod = -1L;
/***** Write sharer/commenter if distinct to author *****/
- Soc_WriteTopMessage (TopMessage,UsrCod);
+ TL_WriteTopMessage (TopMessage,UsrCod);
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
@@ -1480,9 +1487,9 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
IAmTheAuthor = ItsMe;
if (!IAmTheAuthor)
{
- IAmASharerOfThisSocNot = Soc_CheckIfNoteIsSharedByUsr (SocNot->NotCod,
+ IAmASharerOfThisSocNot = TL_CheckIfNoteIsSharedByUsr (SocNot->NotCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
- IAmAFaverOfThisSocNot = Soc_CheckIfNoteIsFavedByUsr (SocNot->NotCod,
+ IAmAFaverOfThisSocNot = TL_CheckIfNoteIsFavedByUsr (SocNot->NotCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
}
}
@@ -1499,48 +1506,48 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
fprintf (Gbl.F.Out,"
");
/* Write author's full name and nickname */
- Soc_WriteAuthorNote (&UsrDat);
+ TL_WriteAuthorNote (&UsrDat);
/* Write date and time */
- Soc_WriteDateTime (SocNot->DateTimeUTC);
+ TL_WriteDateTime (SocNot->DateTimeUTC);
/* Write content of the note */
- if (SocNot->NoteType == Soc_NOTE_SOCIAL_POST)
+ if (SocNot->NoteType == TL_NOTE_POST)
/* Write post content */
- Soc_GetAndWriteSocialPost (SocNot->Cod);
+ TL_GetAndWritePost (SocNot->Cod);
else
{
/* Get location in hierarchy */
if (!SocNot->Unavailable)
switch (SocNot->NoteType)
{
- case Soc_NOTE_INS_DOC_PUB_FILE:
- case Soc_NOTE_INS_SHA_PUB_FILE:
+ case TL_NOTE_INS_DOC_PUB_FILE:
+ case TL_NOTE_INS_SHA_PUB_FILE:
/* Get institution data */
Ins.InsCod = SocNot->HieCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA);
break;
- case Soc_NOTE_CTR_DOC_PUB_FILE:
- case Soc_NOTE_CTR_SHA_PUB_FILE:
+ case TL_NOTE_CTR_DOC_PUB_FILE:
+ case TL_NOTE_CTR_SHA_PUB_FILE:
/* Get centre data */
Ctr.CtrCod = SocNot->HieCod;
Ctr_GetDataOfCentreByCod (&Ctr);
break;
- case Soc_NOTE_DEG_DOC_PUB_FILE:
- case Soc_NOTE_DEG_SHA_PUB_FILE:
+ case TL_NOTE_DEG_DOC_PUB_FILE:
+ case TL_NOTE_DEG_SHA_PUB_FILE:
/* Get degree data */
Deg.DegCod = SocNot->HieCod;
Deg_GetDataOfDegreeByCod (&Deg);
break;
- case Soc_NOTE_CRS_DOC_PUB_FILE:
- case Soc_NOTE_CRS_SHA_PUB_FILE:
- case Soc_NOTE_EXAM_ANNOUNCEMENT:
- case Soc_NOTE_NOTICE:
+ case TL_NOTE_CRS_DOC_PUB_FILE:
+ case TL_NOTE_CRS_SHA_PUB_FILE:
+ case TL_NOTE_EXAM_ANNOUNCEMENT:
+ case TL_NOTE_NOTICE:
/* Get course data */
Crs.CrsCod = SocNot->HieCod;
Crs_GetDataOfCourseByCod (&Crs);
break;
- case Soc_NOTE_FORUM_POST:
+ case TL_NOTE_FORUM_POST:
/* Get forum type of the post */
For_GetForumTypeAndLocationOfAPost (SocNot->Cod,&Gbl.Forum.ForumSelected);
For_SetForumName (&Gbl.Forum.ForumSelected,
@@ -1551,39 +1558,39 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
}
/* Write note type */
- Soc_PutFormGoToAction (SocNot);
+ TL_PutFormGoToAction (SocNot);
/* Write location in hierarchy */
if (!SocNot->Unavailable)
switch (SocNot->NoteType)
{
- case Soc_NOTE_INS_DOC_PUB_FILE:
- case Soc_NOTE_INS_SHA_PUB_FILE:
+ case TL_NOTE_INS_DOC_PUB_FILE:
+ case TL_NOTE_INS_SHA_PUB_FILE:
/* Write location (institution) in hierarchy */
fprintf (Gbl.F.Out,"
%s: %s
",
Txt_Institution,Ins.ShrtName);
break;
- case Soc_NOTE_CTR_DOC_PUB_FILE:
- case Soc_NOTE_CTR_SHA_PUB_FILE:
+ case TL_NOTE_CTR_DOC_PUB_FILE:
+ case TL_NOTE_CTR_SHA_PUB_FILE:
/* Write location (centre) in hierarchy */
fprintf (Gbl.F.Out,"
%s: %s
",
Txt_Centre,Ctr.ShrtName);
break;
- case Soc_NOTE_DEG_DOC_PUB_FILE:
- case Soc_NOTE_DEG_SHA_PUB_FILE:
+ case TL_NOTE_DEG_DOC_PUB_FILE:
+ case TL_NOTE_DEG_SHA_PUB_FILE:
/* Write location (degree) in hierarchy */
fprintf (Gbl.F.Out,"
%s: %s
",
Txt_Degree,Deg.ShrtName);
break;
- case Soc_NOTE_CRS_DOC_PUB_FILE:
- case Soc_NOTE_CRS_SHA_PUB_FILE:
- case Soc_NOTE_EXAM_ANNOUNCEMENT:
- case Soc_NOTE_NOTICE:
+ case TL_NOTE_CRS_DOC_PUB_FILE:
+ case TL_NOTE_CRS_SHA_PUB_FILE:
+ case TL_NOTE_EXAM_ANNOUNCEMENT:
+ case TL_NOTE_NOTICE:
/* Write location (course) in hierarchy */
fprintf (Gbl.F.Out,"
%s: %s
",
Txt_Course,Crs.ShrtName);
break;
- case Soc_NOTE_FORUM_POST:
+ case TL_NOTE_FORUM_POST:
/* Write forum name */
fprintf (Gbl.F.Out,"
%s: %s
",
Txt_Forum,ForumName);
@@ -1593,7 +1600,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
}
/* Write note summary */
- Soc_GetNoteSummary (SocNot,SummaryStr);
+ TL_GetNoteSummary (SocNot,SummaryStr);
fprintf (Gbl.F.Out,"
%s
",SummaryStr);
}
@@ -1605,83 +1612,82 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
/* Create unique id for new comment */
Frm_SetUniqueId (IdNewComment);
- /* Get number of comments in this social note */
- NumComments = Soc_GetNumCommentsInSocialNote (SocNot->NotCod);
+ /* Get number of comments in this note */
+ NumComments = TL_GetNumCommentsInNote (SocNot->NotCod);
/* Put icon to add a comment */
- // if (NumComments || SocNot->Unavailable) // Unavailable social notes can not be commented
- if (SocNot->Unavailable) // Unavailable social notes can not be commented
- Soc_PutIconCommentDisabled ();
+ if (SocNot->Unavailable) // Unavailable notes can not be commented
+ TL_PutIconCommentDisabled ();
else
- Soc_PutIconToToggleCommentSocialNote (IdNewComment);
+ TL_PutIconToToggleCommentNote (IdNewComment);
fprintf (Gbl.F.Out,"
");
fprintf (Gbl.F.Out,"
"
"
");
- /* Put icon to mark this social note as favourite */
- if (SocNot->Unavailable || // Unavailable social notes can not be favourited
+ /* Put icon to mark this note as favourite */
+ if (SocNot->Unavailable || // Unavailable notes can not be favourited
IAmTheAuthor) // I am the author
{
/* Put disabled icon and list of users
- who have marked this social note as favourite */
- Soc_PutDisabledIconFav (SocNot->NumFavs);
- Soc_ShowUsrsWhoHaveMarkedSocialNoteAsFav (SocNot);
+ who have marked this note as favourite */
+ TL_PutDisabledIconFav (SocNot->NumFavs);
+ TL_ShowUsrsWhoHaveMarkedNoteAsFav (SocNot);
}
else // Available and I am not the author
{
fprintf (Gbl.F.Out,"
",
Gbl.UniqueNameEncrypted,NumDiv);
- if (IAmAFaverOfThisSocNot) // I have favourited this social note
+ if (IAmAFaverOfThisSocNot) // I have favourited this note
/* Put icon to unfav this publication and list of users */
- Soc_PutFormToUnfavSocialNote (SocNot);
- else // I am not a faver of this social note
+ TL_PutFormToUnfavNote (SocNot);
+ else // I am not a faver of this note
/* Put icon to fav this publication and list of users */
- Soc_PutFormToFavSocialNote (SocNot);
+ TL_PutFormToFavNote (SocNot);
fprintf (Gbl.F.Out,"
");
}
/* Put icon to share/unshare */
- if (SocNot->Unavailable || // Unavailable social notes can not be shared
+ if (SocNot->Unavailable || // Unavailable notes can not be shared
IAmTheAuthor) // I am the author
{
/* Put disabled icon and list of users
- who have shared this social note */
- Soc_PutDisabledIconShare (SocNot->NumShared);
- Soc_ShowUsrsWhoHaveSharedSocialNote (SocNot);
+ who have shared this note */
+ TL_PutDisabledIconShare (SocNot->NumShared);
+ TL_ShowUsrsWhoHaveSharedNote (SocNot);
}
else // Available and I am not the author
{
fprintf (Gbl.F.Out,"
",
Gbl.UniqueNameEncrypted,NumDiv);
- if (IAmASharerOfThisSocNot) // I am a sharer of this social note
+ if (IAmASharerOfThisSocNot) // I am a sharer of this note
/* Put icon to unshare this publication and list of users */
- Soc_PutFormToUnshareSocialNote (SocNot);
- else // I am not a sharer of this social note
+ TL_PutFormToUnshareNote (SocNot);
+ else // I am not a sharer of this note
/* Put icon to share this publication and list of users */
- Soc_PutFormToShareSocialNote (SocNot);
+ TL_PutFormToShareNote (SocNot);
fprintf (Gbl.F.Out,"
");
}
- /* Put icon to remove this social note */
+ /* Put icon to remove this note */
if (IAmTheAuthor)
- Soc_PutFormToRemoveSocialPublication (SocNot->NotCod);
+ TL_PutFormToRemovePublication (SocNot->NotCod);
/* End of icon bar */
fprintf (Gbl.F.Out,"
");
/* Show comments */
if (NumComments)
- Soc_WriteCommentsInSocialNote (SocNot);
+ TL_WriteCommentsInNote (SocNot);
/* End of bottom right */
fprintf (Gbl.F.Out,"
");
/* Put hidden form to write a new comment */
- Soc_PutHiddenFormToWriteNewCommentToSocialNote (SocNot->NotCod,IdNewComment);
+ TL_PutHiddenFormToWriteNewCommentToNote (SocNot->NotCod,IdNewComment);
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
@@ -1703,15 +1709,15 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
-static void Soc_WriteTopMessage (Soc_TopMessage_t TopMessage,long UsrCod)
+static void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long UsrCod)
{
extern const char *Txt_My_public_profile;
extern const char *Txt_Another_user_s_profile;
- extern const char *Txt_SOCIAL_NOTE_TOP_MESSAGES[Soc_NUM_TOP_MESSAGES];
+ extern const char *Txt_TIMELINE_NOTE_TOP_MESSAGES[TL_NUM_TOP_MESSAGES];
struct UsrData UsrDat;
bool ItsMe = Usr_ItsMe (UsrCod);
- if (TopMessage != Soc_TOP_MESSAGE_NONE)
+ if (TopMessage != TL_TOP_MESSAGE_NONE)
{
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
@@ -1734,7 +1740,7 @@ static void Soc_WriteTopMessage (Soc_TopMessage_t TopMessage,long UsrCod)
/***** Show action made *****/
fprintf (Gbl.F.Out," %s:
",
- Txt_SOCIAL_NOTE_TOP_MESSAGES[TopMessage]);
+ Txt_TIMELINE_NOTE_TOP_MESSAGES[TopMessage]);
}
/***** Free memory used for user's data *****/
@@ -1743,11 +1749,11 @@ static void Soc_WriteTopMessage (Soc_TopMessage_t TopMessage,long UsrCod)
}
/*****************************************************************************/
-/************ Write name and nickname of author of a social note *************/
+/*************** Write name and nickname of author of a note *****************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
-static void Soc_WriteAuthorNote (const struct UsrData *UsrDat)
+static void TL_WriteAuthorNote (const struct UsrData *UsrDat)
{
extern const char *Txt_My_public_profile;
extern const char *Txt_Another_user_s_profile;
@@ -1777,11 +1783,11 @@ static void Soc_WriteAuthorNote (const struct UsrData *UsrDat)
}
/*****************************************************************************/
-/**************** Write the date of creation of a social note ****************/
+/******************* Write the date of creation of a note ********************/
/*****************************************************************************/
// TimeUTC holds UTC date and time in UNIX format (seconds since 1970)
-static void Soc_WriteDateTime (time_t TimeUTC)
+static void TL_WriteDateTime (time_t TimeUTC)
{
extern const char *Txt_Today;
char IdDateTime[Frm_MAX_BYTES_ID + 1];
@@ -1809,7 +1815,7 @@ static void Soc_WriteDateTime (time_t TimeUTC)
/***************** Get from database and write public post *******************/
/*****************************************************************************/
-static void Soc_GetAndWriteSocialPost (long PstCod)
+static void TL_GetAndWritePost (long PstCod)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@@ -1820,15 +1826,16 @@ static void Soc_GetAndWriteSocialPost (long PstCod)
/***** Initialize image *****/
Med_MediaConstructor (&Media);
- /***** Get social post from database *****/
+ /***** Get post from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get the content"
- " of a social post",
+ " of a post",
"SELECT Content," // row[0]
"MediaName," // row[1]
"MediaType," // row[2]
"MediaTitle," // row[3]
"MediaURL" // row[4]
- " FROM social_posts WHERE PstCod=%ld",
+ " FROM social_posts"
+ " WHERE PstCod=%ld",
PstCod);
/***** Result should have a unique row *****/
@@ -1866,85 +1873,85 @@ static void Soc_GetAndWriteSocialPost (long PstCod)
}
/*****************************************************************************/
-/********* Put form to go to an action depending on the social note **********/
+/************* Put form to go to an action depending on the note *************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
-static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
+static void TL_PutFormGoToAction (const struct TL_Note *SocNot)
{
extern const Act_Action_t For_ActionsSeeFor[For_NUM_TYPES_FORUM];
extern const char *The_ClassFormOutBoxBold[The_NUM_THEMES];
- extern const char *Txt_SOCIAL_NOTE[Soc_NUM_NOTE_TYPES];
+ extern const char *Txt_TIMELINE_NOTE[TL_NUM_NOTE_TYPES];
extern const char *Txt_not_available;
char Class[64];
- const Act_Action_t Soc_DefaultActions[Soc_NUM_NOTE_TYPES] =
+ const Act_Action_t TL_DefaultActions[TL_NUM_NOTE_TYPES] =
{
- ActUnk, // Soc_NOTE_UNKNOWN
+ ActUnk, // TL_NOTE_UNKNOWN
/* Institution tab */
- ActReqDatSeeDocIns, // Soc_NOTE_INS_DOC_PUB_FILE
- ActReqDatShaIns, // Soc_NOTE_INS_SHA_PUB_FILE
+ ActReqDatSeeDocIns, // TL_NOTE_INS_DOC_PUB_FILE
+ ActReqDatShaIns, // TL_NOTE_INS_SHA_PUB_FILE
/* Centre tab */
- ActReqDatSeeDocCtr, // Soc_NOTE_CTR_DOC_PUB_FILE
- ActReqDatShaCtr, // Soc_NOTE_CTR_SHA_PUB_FILE
+ ActReqDatSeeDocCtr, // TL_NOTE_CTR_DOC_PUB_FILE
+ ActReqDatShaCtr, // TL_NOTE_CTR_SHA_PUB_FILE
/* Degree tab */
- ActReqDatSeeDocDeg, // Soc_NOTE_DEG_DOC_PUB_FILE
- ActReqDatShaDeg, // Soc_NOTE_DEG_SHA_PUB_FILE
+ ActReqDatSeeDocDeg, // TL_NOTE_DEG_DOC_PUB_FILE
+ ActReqDatShaDeg, // TL_NOTE_DEG_SHA_PUB_FILE
/* Course tab */
- ActReqDatSeeDocCrs, // Soc_NOTE_CRS_DOC_PUB_FILE
- ActReqDatShaCrs, // Soc_NOTE_CRS_SHA_PUB_FILE
+ ActReqDatSeeDocCrs, // TL_NOTE_CRS_DOC_PUB_FILE
+ ActReqDatShaCrs, // TL_NOTE_CRS_SHA_PUB_FILE
/* Assessment tab */
- ActSeeOneExaAnn, // Soc_NOTE_EXAM_ANNOUNCEMENT
+ ActSeeOneExaAnn, // TL_NOTE_EXAM_ANNOUNCEMENT
/* Users tab */
- /* Social tab */
- ActUnk, // Soc_NOTE_SOCIAL_POST (action not used) // TODO: Move to start tab
- ActSeeFor, // Soc_NOTE_FORUM_POST // TODO: Move to messages tab
+ /* Start tab */
+ ActUnk, // TL_NOTE_SOCIAL_POST (action not used) // TODO: Move to start tab
+ ActSeeFor, // TL_NOTE_FORUM_POST // TODO: Move to messages tab
/* Messages tab */
- ActSeeOneNot, // Soc_NOTE_NOTICE
+ ActSeeOneNot, // TL_NOTE_NOTICE
/* Statistics tab */
/* Profile tab */
};
- const char *Soc_Icons[Soc_NUM_NOTE_TYPES] =
+ const char *TL_Icons[TL_NUM_NOTE_TYPES] =
{
- NULL, // Soc_NOTE_UNKNOWN
+ NULL, // TL_NOTE_UNKNOWN
/* Institution tab */
- "file.svg", // Soc_NOTE_INS_DOC_PUB_FILE
- "file.svg", // Soc_NOTE_INS_SHA_PUB_FILE
+ "file.svg", // TL_NOTE_INS_DOC_PUB_FILE
+ "file.svg", // TL_NOTE_INS_SHA_PUB_FILE
/* Centre tab */
- "file.svg", // Soc_NOTE_CTR_DOC_PUB_FILE
- "file.svg", // Soc_NOTE_CTR_SHA_PUB_FILE
+ "file.svg", // TL_NOTE_CTR_DOC_PUB_FILE
+ "file.svg", // TL_NOTE_CTR_SHA_PUB_FILE
/* Degree tab */
- "file.svg", // Soc_NOTE_DEG_DOC_PUB_FILE
- "file.svg", // Soc_NOTE_DEG_SHA_PUB_FILE
+ "file.svg", // TL_NOTE_DEG_DOC_PUB_FILE
+ "file.svg", // TL_NOTE_DEG_SHA_PUB_FILE
/* Course tab */
- "file.svg", // Soc_NOTE_CRS_DOC_PUB_FILE
- "file.svg", // Soc_NOTE_CRS_SHA_PUB_FILE
+ "file.svg", // TL_NOTE_CRS_DOC_PUB_FILE
+ "file.svg", // TL_NOTE_CRS_SHA_PUB_FILE
/* Assessment tab */
- "bullhorn.svg", // Soc_NOTE_EXAM_ANNOUNCEMENT
+ "bullhorn.svg", // TL_NOTE_EXAM_ANNOUNCEMENT
/* Users tab */
- /* Social tab */
- NULL, // Soc_NOTE_SOCIAL_POST (icon not used)
- "comments.svg", // Soc_NOTE_FORUM_POST
+ /* Start tab */
+ NULL, // TL_NOTE_SOCIAL_POST (icon not used)
/* Messages tab */
- "sticky-note.svg", // Soc_NOTE_NOTICE
+ "comments.svg", // TL_NOTE_FORUM_POST // TODO: Move down
+ "sticky-note.svg", // TL_NOTE_NOTICE
/* Statistics tab */
@@ -1952,12 +1959,12 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
};
- if (SocNot->Unavailable || // File/notice... pointed by this social note is unavailable
+ if (SocNot->Unavailable || // File/notice... pointed by this note is unavailable
Gbl.Form.Inside) // Inside another form
{
/***** Do not put form *****/
fprintf (Gbl.F.Out,"%s",
- Txt_SOCIAL_NOTE[SocNot->NoteType]);
+ Txt_TIMELINE_NOTE[SocNot->NoteType]);
if (SocNot->Unavailable)
fprintf (Gbl.F.Out," (%s)",Txt_not_available);
fprintf (Gbl.F.Out,"
");
@@ -1969,43 +1976,43 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
/***** Parameters depending on the type of note *****/
switch (SocNot->NoteType)
{
- case Soc_NOTE_INS_DOC_PUB_FILE:
- case Soc_NOTE_INS_SHA_PUB_FILE:
- Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]);
+ case TL_NOTE_INS_DOC_PUB_FILE:
+ case TL_NOTE_INS_SHA_PUB_FILE:
+ Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentIns.Ins.InsCod) // Not the current institution
Ins_PutParamInsCod (SocNot->HieCod); // Go to another institution
break;
- case Soc_NOTE_CTR_DOC_PUB_FILE:
- case Soc_NOTE_CTR_SHA_PUB_FILE:
- Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]);
+ case TL_NOTE_CTR_DOC_PUB_FILE:
+ case TL_NOTE_CTR_SHA_PUB_FILE:
+ Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCtr.Ctr.CtrCod) // Not the current centre
Ctr_PutParamCtrCod (SocNot->HieCod); // Go to another centre
break;
- case Soc_NOTE_DEG_DOC_PUB_FILE:
- case Soc_NOTE_DEG_SHA_PUB_FILE:
- Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]);
+ case TL_NOTE_DEG_DOC_PUB_FILE:
+ case TL_NOTE_DEG_SHA_PUB_FILE:
+ Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentDeg.Deg.DegCod) // Not the current degree
Deg_PutParamDegCod (SocNot->HieCod); // Go to another degree
break;
- case Soc_NOTE_CRS_DOC_PUB_FILE:
- case Soc_NOTE_CRS_SHA_PUB_FILE:
- Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]);
+ case TL_NOTE_CRS_DOC_PUB_FILE:
+ case TL_NOTE_CRS_SHA_PUB_FILE:
+ Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
break;
- case Soc_NOTE_EXAM_ANNOUNCEMENT:
- Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]);
+ case TL_NOTE_EXAM_ANNOUNCEMENT:
+ Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]);
Exa_PutHiddenParamExaCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
break;
- case Soc_NOTE_SOCIAL_POST: // Not applicable
+ case TL_NOTE_POST: // Not applicable
return;
- case Soc_NOTE_FORUM_POST:
+ case TL_NOTE_FORUM_POST:
Frm_StartFormUnique (For_ActionsSeeFor[Gbl.Forum.ForumSelected.Type]);
For_PutAllHiddenParamsForum (1, // Page of threads = first
1, // Page of posts = first
@@ -2017,8 +2024,8 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
break;
- case Soc_NOTE_NOTICE:
- Frm_StartFormUnique (Soc_DefaultActions[SocNot->NoteType]);
+ case TL_NOTE_NOTICE:
+ Frm_StartFormUnique (TL_DefaultActions[SocNot->NoteType]);
Not_PutHiddenParamNotCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
@@ -2031,16 +2038,16 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
snprintf (Class,sizeof (Class),
"%s ICO_HIGHLIGHT",
The_ClassFormOutBoxBold[Gbl.Prefs.Theme]);
- Frm_LinkFormSubmitUnique (Txt_SOCIAL_NOTE[SocNot->NoteType],Class);
+ Frm_LinkFormSubmitUnique (Txt_TIMELINE_NOTE[SocNot->NoteType],Class);
fprintf (Gbl.F.Out,"");
/* Start form to write the post */
- Soc_FormStart (ActRcvSocPstGbl,ActRcvSocPstUsr);
+ TL_FormStart (ActRcvSocPstGbl,ActRcvSocPstUsr);
/* Textarea and button */
- Soc_PutTextarea (Txt_New_SOCIAL_post,
+ TL_PutTextarea (Txt_New_TIMELINE_post,
"TL_POST_TEXTAREA TL_RIGHT_WIDTH",
"TL_POST_IMG_TIT_URL TL_POST_IMG_WIDTH");
@@ -2367,7 +2374,7 @@ static void Soc_PutFormToWriteNewPost (void)
/*** Put textarea and button inside a form to submit a new post or comment ***/
/*****************************************************************************/
-static void Soc_PutTextarea (const char *Placeholder,
+static void TL_PutTextarea (const char *Placeholder,
const char *ClassTextArea,const char *ClassImgTit)
{
extern const char *Txt_Post;
@@ -2382,7 +2389,7 @@ static void Soc_PutTextarea (const char *Placeholder,
" class=\"%s\""
" onfocus=\"expandTextarea(this,'%s','5');\">"
"",
- Soc_MAX_CHARS_IN_POST,
+ TL_MAX_CHARS_IN_POST,
Placeholder,ClassTextArea,
IdDivImgButton);
@@ -2411,18 +2418,18 @@ static void Soc_PutTextarea (const char *Placeholder,
/******************* Receive and store a new public post *********************/
/*****************************************************************************/
-void Soc_ReceiveSocialPostGbl (void)
+void TL_ReceivePostGbl (void)
{
long NotCod;
- /***** Receive and store social post *****/
- NotCod = Soc_ReceiveSocialPost ();
+ /***** Receive and store post *****/
+ NotCod = TL_ReceivePost ();
/***** Write updated timeline after publication (global) *****/
- Soc_ShowTimelineGblHighlightingNot (NotCod);
+ TL_ShowTimelineGblHighlightingNot (NotCod);
}
-void Soc_ReceiveSocialPostUsr (void)
+void TL_ReceivePostUsr (void)
{
long NotCod;
@@ -2433,25 +2440,25 @@ void Soc_ReceiveSocialPostUsr (void)
Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat);
/***** Start section *****/
- Lay_StartSection (Soc_TIMELINE_SECTION_ID);
+ Lay_StartSection (TL_TIMELINE_SECTION_ID);
- /***** Receive and store social post *****/
- NotCod = Soc_ReceiveSocialPost ();
+ /***** Receive and store post *****/
+ NotCod = TL_ReceivePost ();
/***** Write updated timeline after publication (user) *****/
- Soc_ShowTimelineUsrHighlightingNot (NotCod);
+ TL_ShowTimelineUsrHighlightingNot (NotCod);
/***** End section *****/
Lay_EndSection ();
}
-// Returns the code of the social note just created
-static long Soc_ReceiveSocialPost (void)
+// Returns the code of the note just created
+static long TL_ReceivePost (void)
{
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
struct Media Media;
long PstCod;
- struct SocialPublication SocPub;
+ struct TL_Publication SocPub;
/***** Get the content of the new post *****/
Par_GetParAndChangeFormat ("Content",Content,Cns_MAX_BYTES_LONG_TEXT,
@@ -2461,9 +2468,9 @@ static long Soc_ReceiveSocialPost (void)
Med_MediaConstructor (&Media);
/***** Get attached image (action, file and title) *****/
- Media.Width = Soc_IMAGE_SAVED_MAX_WIDTH;
- Media.Height = Soc_IMAGE_SAVED_MAX_HEIGHT;
- Media.Quality = Soc_IMAGE_SAVED_QUALITY;
+ Media.Width = TL_IMAGE_SAVED_MAX_WIDTH;
+ Media.Height = TL_IMAGE_SAVED_MAX_HEIGHT;
+ Media.Quality = TL_IMAGE_SAVED_QUALITY;
Med_GetMediaFromForm (-1,&Media,NULL);
if (Content[0] || // Text not empty
@@ -2493,8 +2500,8 @@ static long Soc_ReceiveSocialPost (void)
(Media.Name[0] && // Save image URL only if image attached
Media.URL ) ? Media.URL : "");
- /* Insert post in social notes */
- Soc_StoreAndPublishSocialNote (Soc_NOTE_SOCIAL_POST,PstCod,&SocPub);
+ /* Insert post in notes */
+ TL_StoreAndPublishNote (TL_NOTE_POST,PstCod,&SocPub);
/***** Analyze content and store notifications about mentions *****/
Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (SocPub.PubCod,Content);
@@ -2509,14 +2516,14 @@ static long Soc_ReceiveSocialPost (void)
}
/*****************************************************************************/
-/****** Put an icon to toggle on/off the form to comment a social note *******/
+/********* Put an icon to toggle on/off the form to comment a note ***********/
/*****************************************************************************/
-static void Soc_PutIconToToggleCommentSocialNote (const char UniqueId[Frm_MAX_BYTES_ID + 1])
+static void TL_PutIconToToggleCommentNote (const char UniqueId[Frm_MAX_BYTES_ID + 1])
{
extern const char *Txt_Comment;
- /***** Link to toggle on/off the form to comment a social note *****/
+ /***** Link to toggle on/off the form to comment a note *****/
fprintf (Gbl.F.Out,"");
}
@@ -2690,7 +2697,7 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot)
for (NumCom = NumCommentsInitiallyHidden;
NumCom < NumComments;
NumCom++)
- Soc_WriteOneSocialCommentInList (mysql_res);
+ TL_WriteOneCommentInList (mysql_res);
fprintf (Gbl.F.Out,"");
}
@@ -2698,21 +2705,21 @@ static void Soc_WriteCommentsInSocialNote (const struct SocialNote *SocNot)
DB_FreeMySQLResult (&mysql_res);
}
-static void Soc_WriteOneSocialCommentInList (MYSQL_RES *mysql_res)
+static void TL_WriteOneCommentInList (MYSQL_RES *mysql_res)
{
MYSQL_ROW row;
- struct SocialComment SocCom;
+ struct TL_Comment SocCom;
/***** Initialize image *****/
Med_MediaConstructor (&SocCom.Media);
- /***** Get data of social comment *****/
+ /***** Get data of comment *****/
row = mysql_fetch_row (mysql_res);
- Soc_GetDataOfSocialCommentFromRow (row,&SocCom);
+ TL_GetDataOfCommentFromRow (row,&SocCom);
- /***** Write social comment *****/
- Soc_WriteSocialComment (&SocCom,
- Soc_TOP_MESSAGE_NONE,-1L,
+ /***** Write comment *****/
+ TL_WriteComment (&SocCom,
+ TL_TOP_MESSAGE_NONE,-1L,
false);
/***** Free image *****/
@@ -2720,10 +2727,10 @@ static void Soc_WriteOneSocialCommentInList (MYSQL_RES *mysql_res)
}
/*****************************************************************************/
-/******* Put an icon to toggle on/off comments in a social publication *******/
+/********** Put an icon to toggle on/off comments in a publication ***********/
/*****************************************************************************/
-static void Soc_PutIconToToggleComments (const char *UniqueId,
+static void TL_PutIconToToggleComments (const char *UniqueId,
const char *Icon,const char *Text)
{
extern const char *The_ClassFormInBox[The_NUM_THEMES];
@@ -2739,13 +2746,13 @@ static void Soc_PutIconToToggleComments (const char *UniqueId,
}
/*****************************************************************************/
-/**************************** Write social comment ***************************/
+/******************************** Write comment ******************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
-static void Soc_WriteSocialComment (struct SocialComment *SocCom,
- Soc_TopMessage_t TopMessage,long UsrCod,
- bool ShowCommentAlone) // Social comment is shown alone, not in a list
+static void TL_WriteComment (struct TL_Comment *SocCom,
+ TL_TopMessage_t TopMessage,long UsrCod,
+ bool ShowCommentAlone) // Comment is shown alone, not in a list
{
extern const char *Txt_Forum;
extern const char *Txt_Course;
@@ -2768,7 +2775,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom,
NULL,Box_NOT_CLOSABLE);
/***** Write sharer/commenter if distinct to author *****/
- Soc_WriteTopMessage (TopMessage,UsrCod);
+ TL_WriteTopMessage (TopMessage,UsrCod);
fprintf (Gbl.F.Out,"
"
"
"
@@ -2785,7 +2792,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom,
if (SocCom->PubCod <= 0 ||
SocCom->NotCod <= 0 ||
SocCom->UsrCod <= 0)
- Ale_ShowAlert (Ale_ERROR,"Error in social comment.");
+ Ale_ShowAlert (Ale_ERROR,"Error in comment.");
else
{
/***** Get author's data *****/
@@ -2795,7 +2802,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom,
ItsMe = Usr_ItsMe (UsrDat.UsrCod);
IAmTheAuthor = ItsMe;
if (!IAmTheAuthor)
- IAmAFaverOfThisSocCom = Soc_CheckIfCommIsFavedByUsr (SocCom->PubCod,
+ IAmAFaverOfThisSocCom = TL_CheckIfCommIsFavedByUsr (SocCom->PubCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Left: write author's photo *****/
@@ -2810,12 +2817,12 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom,
fprintf (Gbl.F.Out,"