Version 15.133.8

This commit is contained in:
Antonio Cañas Vargas 2016-01-29 00:41:52 +01:00
parent 4b5898a219
commit cb1332d315
6 changed files with 96 additions and 51 deletions

View File

@ -2100,6 +2100,26 @@ a:hover img.CENTRE_PHOTO_SHOW
font-size:30pt;
font-weight:bold;
}
.FOLLOW_USR_PHOTO
{
box-sizing:border-box;
width:72px;
height:90px;
text-align:left;
vertical-align:bottom;
}
.FOLLOW_USR_NAME
{
box-sizing:border-box;
min-width:106px;
height:90px;
text-align:left;
vertical-align:bottom;
}
.FOLLOW_USR_ICON
{
padding:4px;
}
.CON {color:#B8D070; font-size:11pt; line-height:110%; white-space:nowrap;}
.CON_CRS {color:#398000; font-size:11pt; line-height:110%; white-space:nowrap;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

After

Width:  |  Height:  |  Size: 371 B

View File

@ -121,13 +121,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.133.7 (2016-01-28)"
#define Log_PLATFORM_VERSION "SWAD 15.133.8 (2016-01-29)"
#define CSS_FILE "swad15.131.2.css"
#define JS_FILE "swad15.131.3.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.133.8: Jan 29, 2016 Link to request a user's profile. (195328 lines)
Version 15.133.7: Jan 28, 2016 Changes in layout of followed/followers. (195288 lines)
Version 15.133.6: Jan 28, 2016 Changes in layout of "Who to follow". (195287 lines)
Version 15.133.5: Jan 28, 2016 Unlogged users can not view "Who to follow". (195276 lines)

View File

@ -105,6 +105,9 @@ void Fol_SuggestWhoToFollow (void)
unsigned NumUsr;
struct UsrData UsrDat;
/***** Put link to request user's profile *****/
Prf_PutLinkRequestUserProfile ();
/***** First try: build query to get users to follow *****/
sprintf (Query,"SELECT DISTINCT UsrCod FROM"
" ("
@ -206,7 +209,7 @@ void Fol_SuggestWhoToFollow (void)
if (NumUsrs)
{
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_Who_to_follow);
Lay_StartRoundFrame ("560px",Txt_Who_to_follow);
/***** Put form to update connected users *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
@ -221,7 +224,7 @@ void Fol_SuggestWhoToFollow (void)
/***** Start listing *****/
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\""
" style=\"margin:12px auto;\">");
" style=\"margin:0 auto;\">");
for (NumUsr = 0;
NumUsr < NumUsrs;
@ -494,7 +497,7 @@ void Fol_ListFollowing (void)
Usr_UsrDataConstructor (&UsrDat);
/***** Start listing *****/
Lay_StartRoundFrameTable (NULL,2,Txt_Following);
Lay_StartRoundFrameTable ("560px",2,Txt_Following);
for (NumUsr = 0;
NumUsr < NumUsrs;
@ -570,7 +573,7 @@ void Fol_ListFollowers (void)
Usr_UsrDataConstructor (&UsrDat);
/***** Start listing *****/
Lay_StartRoundFrameTable (NULL,2,Txt_Followers);
Lay_StartRoundFrameTable ("560px",2,Txt_Followers);
for (NumUsr = 0;
NumUsr < NumUsrs;
@ -629,49 +632,8 @@ static void Fol_ShowFollowedOrFollower (const struct UsrData *UsrDat)
char PhotoURL[PATH_MAX+1];
bool Visible = Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod);
/***** Put form to follow / unfollow *****/
fprintf (Gbl.F.Out,"<td class=\"RIGHT_MIDDLE\""
" style=\"width:25px; height:62px;\">");
if (Visible &&
Gbl.Usrs.Me.Logged &&
Gbl.Usrs.Me.UsrDat.UsrCod != UsrDat->UsrCod)
{
if (Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDat->UsrCod)) // I follow user
{
Act_FormStart (ActUnfUsr);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_Following_unfollow,NULL);
fprintf (Gbl.F.Out,"<div class=\"ICON_HIGHLIGHT\">"
"<img src=\"%s/following64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Unfollow,Txt_Following_unfollow);
Act_FormEnd ();
}
else // I do not follow this user
{
Act_FormStart (ActFolUsr);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_Follow,NULL);
fprintf (Gbl.F.Out,"<div class=\"ICON_HIGHLIGHT\">"
"<img src=\"%s/follow64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Follow,Txt_Follow);
Act_FormEnd ();
}
}
fprintf (Gbl.F.Out,"</td>");
/***** Check if I can see the public profile *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\""
" style=\"width:64px; height:84px;\">");
fprintf (Gbl.F.Out,"<td class=\"FOLLOW_USR_PHOTO\">");
if (Visible)
{
/***** User's photo *****/
@ -680,21 +642,67 @@ static void Fol_ShowFollowedOrFollower (const struct UsrData *UsrDat)
NULL,
"PHOTO60x80",Pho_ZOOM,false);
}
fprintf (Gbl.F.Out,"</td>");
fprintf (Gbl.F.Out,"</td>"
"<td class=\"FOLLOW_USR_NAME\">");
/***** Put form to go to public profile *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\""
" style=\"min-width:87px; height:84px;\">");
if (Visible &&
UsrDat->Nickname[0])
{
Act_FormStart (ActSeePubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"DAT");
Usr_RestrictLengthAndWriteName (UsrDat,8);
Usr_RestrictLengthAndWriteName (UsrDat,10);
fprintf (Gbl.F.Out,"</a>");
Act_FormEnd ();
}
/***** Put form to follow / unfollow *****/
if (Visible && Gbl.Usrs.Me.Logged)
{
if (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod)
fprintf (Gbl.F.Out,"<div class=\"FOLLOW_USR_ICON ICON_HIDDEN\">"
"<img src=\"%s/usr64x64.gif\""
" alt=\"\""
" class=\"ICON25x25\" />"
"</div>"
"</a>",
Gbl.Prefs.IconsURL);
else
{
if (Fol_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDat->UsrCod)) // I follow user
{
Act_FormStart (ActUnfUsr);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_Following_unfollow,NULL);
fprintf (Gbl.F.Out,"<div class=\"FOLLOW_USR_ICON ICON_HIGHLIGHT\">"
"<img src=\"%s/following64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON25x25\" />"
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Unfollow,Txt_Following_unfollow);
Act_FormEnd ();
}
else // I do not follow this user
{
Act_FormStart (ActFolUsr);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_Follow,NULL);
fprintf (Gbl.F.Out,"<div class=\"FOLLOW_USR_ICON ICON_HIGHLIGHT\">"
"<img src=\"%s/follow64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON25x25\" />"
"</div>"
"</a>",
Gbl.Prefs.IconsURL,
Txt_Follow,Txt_Follow);
Act_FormEnd ();
}
}
}
fprintf (Gbl.F.Out,"</td>");
}

View File

@ -121,6 +121,21 @@ char *Prf_GetURLPublicProfile (char *URL,const char *NicknameWithoutArroba)
return URL;
}
/*****************************************************************************/
/******************* Put link to request a user's profile ********************/
/*****************************************************************************/
void Prf_PutLinkRequestUserProfile (void)
{
extern const char *Txt_View_public_profile;
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
Lay_PutContextualLink (ActReqPubPrf,NULL,
"usr64x64.gif",
Txt_View_public_profile,Txt_View_public_profile);
fprintf (Gbl.F.Out,"</div>");
}
/*****************************************************************************/
/************************** Request a user's profile *************************/
/*****************************************************************************/

View File

@ -40,6 +40,7 @@
/*****************************************************************************/
char *Prf_GetURLPublicProfile (char *URL,const char *NicknameWithoutArroba);
void Prf_PutLinkRequestUserProfile (void);
void Prf_RequestUserProfile (void);
void Prf_GetUsrDatAndShowUserProfile (void);