Version18.80

This commit is contained in:
Antonio Cañas Vargas 2019-03-17 20:12:59 +01:00
parent 9cb7fc6930
commit 0ffaf968f6
7 changed files with 126 additions and 5228 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -457,11 +457,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.79.1 (2019-03-17)"
#define CSS_FILE "swad18.77.css"
#define JS_FILE "swad18.77.js"
#define Log_PLATFORM_VERSION "SWAD 18.80 (2019-03-17)"
#define CSS_FILE "swad18.80.css"
#define JS_FILE "swad18.80.js"
/*
TODO: Crear la función para ver Fig_COOKIES
Version 18.80: Mar 17, 2019 Figure about cookies. (240647 lines)
Version 18.79.1: Mar 17, 2019 YouTube videos are not shown if user doesn't accept third party cookies. (240541 lines)
Version 18.79: Mar 17, 2019 New module swad_cookies for user's preference about cookies. (240494 lines)
2 changes necessary in database:

View File

@ -169,6 +169,7 @@ static void Fig_GetAndShowMsgsStats (void);
static void Fig_GetAndShowSurveysStats (void);
static void Fig_GetAndShowNumUsrsPerPrivacy (void);
static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,const char *FieldName);
static void Fig_GetAndShowNumUsrsPerCookies (void);
static void Fig_GetAndShowNumUsrsPerLanguage (void);
static void Fig_GetAndShowNumUsrsPerFirstDayOfWeek (void);
static void Fig_GetAndShowNumUsrsPerDateFormat (void);
@ -333,7 +334,7 @@ void Fig_ShowFigures (void)
Fig_GetAndShowNumUsrsPerTheme, // Fig_THEMES
Fig_GetAndShowNumUsrsPerSideColumns, // Fig_SIDE_COLUMNS
Fig_GetAndShowNumUsrsPerPrivacy, // Fig_PRIVACY
Fig_GetAndShowNumUsrsPerPrivacy, // Fig_COOKIES
Fig_GetAndShowNumUsrsPerCookies, // Fig_COOKIES
};
/***** Get the type of figure ******/
@ -4891,6 +4892,100 @@ static void Fig_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,co
0);
}
/*****************************************************************************/
/** Get and show number of users who have chosen a preference about cookies **/
/*****************************************************************************/
static void Fig_GetAndShowNumUsrsPerCookies (void)
{
extern const char *Hlp_ANALYTICS_Figures_cookies;
extern const char *Txt_FIGURE_TYPES[Fig_NUM_FIGURES];
extern const char *Txt_Cookies;
extern const char *Txt_No_of_users;
extern const char *Txt_PERCENT_of_users;
unsigned i;
char AcceptedInDB[2] =
{
'N', // false
'Y' // true
};
char *AcceptedClass[2] =
{
"DAT_RED", // false
"DAT_GREEN" // true
};
char *AcceptedSymbol[2] =
{
"✗", // false
"✓" // true
};
char *SubQuery;
unsigned NumUsrs[Mnu_NUM_MENUS];
unsigned NumUsrsTotal = 0;
/***** Start box and table *****/
Box_StartBoxTable (NULL,Txt_FIGURE_TYPES[Fig_COOKIES],NULL,
Hlp_ANALYTICS_Figures_cookies,Box_NOT_CLOSABLE,2);
/***** Heading row *****/
fprintf (Gbl.F.Out,"<tr>"
"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"RIGHT_MIDDLE\">"
"%s"
"</th>"
"</tr>",
Txt_Cookies,
Txt_No_of_users,
Txt_PERCENT_of_users);
/***** For each option... *****/
for (i = 0;
i < 2;
i++)
{
/* Get number of users who have chosen this menu from database */
if (asprintf (&SubQuery,"usr_data.ThirdPartyCookies='%c'",
AcceptedInDB[i]) < 0)
Lay_NotEnoughMemoryExit ();
NumUsrs[i] = Fig_GetNumUsrsWhoChoseAnOption (SubQuery);
free ((void *) SubQuery);
/* Update total number of users */
NumUsrsTotal += NumUsrs[i];
}
/***** Write number of users who have chosen each option *****/
for (i = 0;
i < 2;
i++)
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s CENTER_MIDDLE\">"
"%s"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"%u"
"</td>"
"<td class=\"DAT RIGHT_MIDDLE\">"
"%5.2f%%"
"</td>"
"</tr>",
AcceptedClass[i],
AcceptedSymbol[i],
NumUsrs[i],
NumUsrsTotal ? (float) NumUsrs[i] * 100.0 /
(float) NumUsrsTotal :
0);
/***** End table and box *****/
Box_EndBoxTable ();
}
/*****************************************************************************/
/********* Get and show number of users who have chosen a language ***********/
/*****************************************************************************/

View File

@ -3015,6 +3015,27 @@ const char *Hlp_ANALYTICS_Figures_privacy =
"ANALYTICS.Figures.en#privacy";
#endif
const char *Hlp_ANALYTICS_Figures_cookies =
#if L==1
"ANALYTICS.Figures.es#cookies";
#elif L==2
"ANALYTICS.Figures.en#cookies";
#elif L==3
"ANALYTICS.Figures.en#cookies";
#elif L==4
"ANALYTICS.Figures.es#cookies";
#elif L==5
"ANALYTICS.Figures.en#cookies";
#elif L==6
"ANALYTICS.Figures.es#cookies";
#elif L==7
"ANALYTICS.Figures.en#cookies";
#elif L==8
"ANALYTICS.Figures.en#cookies";
#elif L==9
"ANALYTICS.Figures.en#cookies";
#endif
const char *Hlp_ANALYTICS_Degrees =
#if L==1
"ANALYTICS.Degrees.es";

View File

@ -49876,7 +49876,7 @@ const char *Txt_To_watch_YouTube_videos_you_have_to_accept_third_party_cookies_i
" von Drittanbietern akzeptieren.";
#elif L==3 // en
"To watch YouTube videos"
" you have to accept third party cookies"
" you have to accept third-party cookies"
" in your personal settings.";
#elif L==4 // es
"Para ver v&iacute;deos de YouTube"

View File

@ -1864,8 +1864,8 @@ static void TL_GetAndWritePost (long PstCod)
}
/***** Show image *****/
Med_ShowMedia (&Media,"TL_POST_IMG_CONTAINER TL_RIGHT_WIDTH",
"TL_POST_IMG TL_RIGHT_WIDTH");
Med_ShowMedia (&Media,"TL_POST_MED_CONTAINER TL_RIGHT_WIDTH",
"TL_POST_MED TL_RIGHT_WIDTH");
/***** Free image *****/
Med_MediaDestructor (&Media);
@ -2826,8 +2826,8 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
fprintf (Gbl.F.Out,"</div>");
/* Show image */
Med_ShowMedia (&SocCom->Media,"TL_COMMENT_IMG_CONTAINER TL_COMMENT_WIDTH",
"TL_COMMENT_IMG TL_COMMENT_WIDTH");
Med_ShowMedia (&SocCom->Media,"TL_COMMENT_MED_CONTAINER TL_COMMENT_WIDTH",
"TL_COMMENT_MED TL_COMMENT_WIDTH");
/* Put icon to mark this comment as favourite */
if (IAmTheAuthor) // I am the author