Version19.46.9

This commit is contained in:
Antonio Cañas Vargas 2019-10-30 23:55:49 +01:00
parent a3f44db68c
commit 245cdd8fbd
6 changed files with 98 additions and 102 deletions

View File

@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD: En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 19.46.8 (2019-10-29)" #define Log_PLATFORM_VERSION "SWAD 19.46.9 (2019-10-29)"
#define CSS_FILE "swad19.45.css" #define CSS_FILE "swad19.45.css"
#define JS_FILE "swad19.39.js" #define JS_FILE "swad19.39.js"
/* /*
@ -495,6 +495,7 @@ ps2pdf source.ps destination.pdf
// TODO: Impedir la creación y edición de proyectos si no son editables. // TODO: Impedir la creación y edición de proyectos si no son editables.
// TODO: Continuar convirtiendo <img a HTM_IMG () // TODO: Continuar convirtiendo <img a HTM_IMG ()
Version 19.46.9: Oct 29, 2019 Code refactoring in HTML images. (246241 lines)
Version 19.46.8: Oct 29, 2019 Code refactoring in HTML images. (246244 lines) Version 19.46.8: Oct 29, 2019 Code refactoring in HTML images. (246244 lines)
Version 19.46.7: Oct 29, 2019 Code refactoring in HTML images. (246217 lines) Version 19.46.7: Oct 29, 2019 Code refactoring in HTML images. (246217 lines)
Version 19.46.6: Oct 29, 2019 Code refactoring in HTML images. (246226 lines) Version 19.46.6: Oct 29, 2019 Code refactoring in HTML images. (246226 lines)

View File

@ -88,6 +88,7 @@ void Log_DrawLogo (Hie_Level_t Scope,long Cod,const char *AltText,
long DegCod; long DegCod;
char *URL; char *URL;
char *Icon; char *Icon;
bool ClassNotEmpty;
/***** Path to logo *****/ /***** Path to logo *****/
if (HieIcon[Scope]) // Scope is correct if (HieIcon[Scope]) // Scope is correct
@ -170,10 +171,17 @@ void Log_DrawLogo (Hie_Level_t Scope,long Cod,const char *AltText,
if (asprintf (&Icon,"%s",HieIcon[Scope]) < 0) if (asprintf (&Icon,"%s",HieIcon[Scope]) < 0)
Lay_NotEnoughMemoryExit (); Lay_NotEnoughMemoryExit ();
} }
ClassNotEmpty = false;
if (Class)
if (Class[0])
ClassNotEmpty = true;
HTM_IMG (URL,Icon,AltText, HTM_IMG (URL,Icon,AltText,
"class=\"ICO%ux%u%s\"", "class=\"ICO%ux%u%s%s\"",
Size,Size,Class ? Class : Size,Size,
""); ClassNotEmpty ? " " :
"",
ClassNotEmpty ? Class :
"");
free ((void *) Icon); free ((void *) Icon);
free ((void *) URL); free ((void *) URL);
} }

View File

@ -2754,6 +2754,8 @@ static void Mch_DrawScoreRow (double Score,double MinScore,double MaxScore,
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
unsigned Color; unsigned Color;
unsigned BarWidth; unsigned BarWidth;
char *Icon;
char *Title;
/***** Compute color *****/ /***** Compute color *****/
/* /*
@ -2804,14 +2806,18 @@ static void Mch_DrawScoreRow (double Score,double MinScore,double MaxScore,
/* Draw bar and write number of users for this score */ /* Draw bar and write number of users for this score */
HTM_TD_Begin ("class=\"MCH_SCO_NUM%s\"",Mch_GetClassBorder (NumRow)); HTM_TD_Begin ("class=\"MCH_SCO_NUM%s\"",Mch_GetClassBorder (NumRow));
fprintf (Gbl.F.Out,"<img src=\"%s/score%u_1x1.png\"" // Background if (asprintf (&Icon,"score%u_1x1.png",Color) < 0) // Background
" alt=\"\" title=\"%u %s\" class=\"MCH_SCO_BAR\"" Lay_NotEnoughMemoryExit ();
" style=\"width:%u%%;\" />", if (asprintf (&Title,"%u %s",
Cfg_URL_ICON_PUBLIC,Color, NumUsrs,
NumUsrs,NumUsrs == 1 ? Txt_ROLES_SINGUL_abc[Rol_STD][Usr_SEX_UNKNOWN] : NumUsrs == 1 ? Txt_ROLES_SINGUL_abc[Rol_STD][Usr_SEX_UNKNOWN] :
Txt_ROLES_PLURAL_abc[Rol_STD][Usr_SEX_UNKNOWN], Txt_ROLES_PLURAL_abc[Rol_STD][Usr_SEX_UNKNOWN]) < 0)
BarWidth); Lay_NotEnoughMemoryExit ();
HTM_IMG (Cfg_URL_ICON_PUBLIC,Icon,Title,
"class=\"MCH_SCO_BAR\" style=\"width:%u%%;\"",BarWidth);
fprintf (Gbl.F.Out,"&nbsp;%u",NumUsrs); fprintf (Gbl.F.Out,"&nbsp;%u",NumUsrs);
free ((void *) Title);
free ((void *) Icon);
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -1530,7 +1530,7 @@ static void Med_ShowJPG (struct Media *Media,
extern const char *Txt_File_not_found; extern const char *Txt_File_not_found;
char FileNameMedia[NAME_MAX + 1]; char FileNameMedia[NAME_MAX + 1];
char FullPathMediaPriv[PATH_MAX + 1]; char FullPathMediaPriv[PATH_MAX + 1];
char URL_JPG[PATH_MAX + 1]; char *URL;
/***** Build private path to JPG *****/ /***** Build private path to JPG *****/
snprintf (FileNameMedia,sizeof (FileNameMedia), snprintf (FileNameMedia,sizeof (FileNameMedia),
@ -1547,20 +1547,15 @@ static void Med_ShowJPG (struct Media *Media,
in order to gain access to it for showing/downloading *****/ in order to gain access to it for showing/downloading *****/
Brw_CreateTmpPublicLinkToPrivateFile (FullPathMediaPriv,FileNameMedia); Brw_CreateTmpPublicLinkToPrivateFile (FullPathMediaPriv,FileNameMedia);
/***** Build URL pointing to symbolic link *****/
snprintf (URL_JPG,sizeof (URL_JPG),
"%s/%s/%s/%s",
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
Gbl.FileBrowser.TmpPubDir.L,
Gbl.FileBrowser.TmpPubDir.R,
FileNameMedia);
/***** Show media *****/ /***** Show media *****/
fprintf (Gbl.F.Out,"<img src=\"%s\" class=\"%s\" alt=\"\"",URL_JPG,ClassMedia); if (asprintf (&URL,"%s/%s/%s",
if (Media->Title) Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
if (Media->Title[0]) Gbl.FileBrowser.TmpPubDir.L,
fprintf (Gbl.F.Out," title=\"%s\"",Media->Title); Gbl.FileBrowser.TmpPubDir.R) < 0)
fprintf (Gbl.F.Out," lazyload=\"on\" />"); // Lazy load of the media Lay_NotEnoughMemoryExit ();
HTM_IMG (URL,FileNameMedia,Media->Title,
"class=\"%s\" lazyload=\"on\"",ClassMedia); // Lazy load of the media
free ((void *) URL);
} }
else else
fprintf (Gbl.F.Out,"%s",Txt_File_not_found); fprintf (Gbl.F.Out,"%s",Txt_File_not_found);
@ -1577,31 +1572,33 @@ static void Med_ShowGIF (struct Media *Media,
extern const char *Txt_File_not_found; extern const char *Txt_File_not_found;
char FileNameMedia[NAME_MAX + 1]; char FileNameMedia[NAME_MAX + 1];
char FullPathMediaPriv[PATH_MAX + 1]; char FullPathMediaPriv[PATH_MAX + 1];
char URL_GIF[PATH_MAX + 1]; char *URL;
char URL_PNG[PATH_MAX + 1]; char *URL_GIF;
char *URL_PNG;
/***** Build private path to animated GIF image *****/ /***** Build private path to animated GIF image *****/
snprintf (FileNameMedia,sizeof (FileNameMedia), snprintf (FileNameMedia,sizeof (FileNameMedia),
"%s.%s", "%s.%s",
Media->Name,Med_Extensions[Med_GIF]); Media->Name,Med_Extensions[Med_GIF]);
snprintf (FullPathMediaPriv,sizeof (FullPathMediaPriv), snprintf (FullPathMediaPriv,sizeof (FullPathMediaPriv), // The animated GIF image
"%s/%s", "%s/%s",
PathMedPriv,FileNameMedia); PathMedPriv,FileNameMedia);
/***** Check if private media file exists *****/ /***** Check if private media file exists *****/
if (Fil_CheckIfPathExists (FullPathMediaPriv)) // The animated GIF image if (Fil_CheckIfPathExists (FullPathMediaPriv)) // The animated GIF image
{ {
/***** Create symbolic link from temporary public directory to private file /***** Create symbolic link from temporary public directory to private file
in order to gain access to it for showing/downloading *****/ in order to gain access to it for showing/downloading *****/
Brw_CreateTmpPublicLinkToPrivateFile (FullPathMediaPriv,FileNameMedia); Brw_CreateTmpPublicLinkToPrivateFile (FullPathMediaPriv,FileNameMedia);
/***** Create URL pointing to symbolic link *****/ /***** Create URL pointing to symbolic link *****/
snprintf (URL_GIF,sizeof (URL_GIF), if (asprintf (&URL,"%s/%s/%s",
"%s/%s/%s/%s", Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
Cfg_URL_FILE_BROWSER_TMP_PUBLIC, Gbl.FileBrowser.TmpPubDir.L,
Gbl.FileBrowser.TmpPubDir.L, Gbl.FileBrowser.TmpPubDir.R) < 0)
Gbl.FileBrowser.TmpPubDir.R, Lay_NotEnoughMemoryExit ();
FileNameMedia); if (asprintf (&URL_GIF,"%s/%s",URL,FileNameMedia) < 0)
Lay_NotEnoughMemoryExit ();
/***** Build private path to static PNG image *****/ /***** Build private path to static PNG image *****/
snprintf (FileNameMedia,sizeof (FileNameMedia), snprintf (FileNameMedia,sizeof (FileNameMedia),
@ -1610,22 +1607,16 @@ static void Med_ShowGIF (struct Media *Media,
snprintf (FullPathMediaPriv,sizeof (FullPathMediaPriv), snprintf (FullPathMediaPriv,sizeof (FullPathMediaPriv),
"%s/%s", "%s/%s",
PathMedPriv,FileNameMedia); PathMedPriv,FileNameMedia);
if (asprintf (&URL_PNG,"%s/%s",URL,FileNameMedia) < 0) // The static PNG image
Lay_NotEnoughMemoryExit ();
/***** Check if private media file exists *****/ /***** Check if private media file exists *****/
if (Fil_CheckIfPathExists (FullPathMediaPriv)) // The static PNG image if (Fil_CheckIfPathExists (FullPathMediaPriv)) // The static PNG image
{ {
/***** Create symbolic link from temporary public directory to private file /***** Create symbolic link from temporary public directory to private file
in order to gain access to it for showing/downloading *****/ in order to gain access to it for showing/downloading *****/
Brw_CreateTmpPublicLinkToPrivateFile (FullPathMediaPriv,FileNameMedia); Brw_CreateTmpPublicLinkToPrivateFile (FullPathMediaPriv,FileNameMedia);
/***** Create URL pointing to symbolic link *****/
snprintf (URL_PNG,sizeof (URL_PNG),
"%s/%s/%s/%s",
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
Gbl.FileBrowser.TmpPubDir.L,
Gbl.FileBrowser.TmpPubDir.R,
FileNameMedia);
/***** Show static PNG and animated GIF *****/ /***** Show static PNG and animated GIF *****/
HTM_DIV_Begin ("class=\"MED_PLAY\"" HTM_DIV_Begin ("class=\"MED_PLAY\""
" onmouseover=\"toggleOnGIF(this,'%s');\"" " onmouseover=\"toggleOnGIF(this,'%s');\""
@ -1634,13 +1625,8 @@ static void Med_ShowGIF (struct Media *Media,
URL_PNG); URL_PNG);
/* Image */ /* Image */
fprintf (Gbl.F.Out,"<img src=\"%s\" class=\"%s\" alt=\"\"", HTM_IMG (URL,FileNameMedia,Media->Title,
URL_PNG, "class=\"%s\" lazyload=\"on\"",ClassMedia); // Lazy load of the media
ClassMedia);
if (Media->Title)
if (Media->Title[0])
fprintf (Gbl.F.Out," title=\"%s\"",Media->Title);
fprintf (Gbl.F.Out," lazyload=\"on\" />"); // Lazy load of the media
/* Overlay with GIF label */ /* Overlay with GIF label */
fprintf (Gbl.F.Out,"<span class=\"MED_PLAY_ICO\">" fprintf (Gbl.F.Out,"<span class=\"MED_PLAY_ICO\">"
@ -1651,6 +1637,11 @@ static void Med_ShowGIF (struct Media *Media,
} }
else else
fprintf (Gbl.F.Out,"%s",Txt_File_not_found); fprintf (Gbl.F.Out,"%s",Txt_File_not_found);
/***** Free URLs *****/
free ((void *) URL_PNG);
free ((void *) URL_GIF);
free ((void *) URL);
} }
else else
fprintf (Gbl.F.Out,"%s",Txt_File_not_found); fprintf (Gbl.F.Out,"%s",Txt_File_not_found);

View File

@ -28,9 +28,10 @@ TODO: Check if web service is called from an authorized IP.
/********************************* Headers ***********************************/ /********************************* Headers ***********************************/
/*****************************************************************************/ /*****************************************************************************/
#define _GNU_SOURCE // For asprintf
#include <linux/stddef.h> // For NULL #include <linux/stddef.h> // For NULL
#include <stdbool.h> // For boolean type #include <stdbool.h> // For boolean type
#include <stdio.h> // For fprintf #include <stdio.h> // For fprintf, asprintf
#include <stdlib.h> // For calloc, free #include <stdlib.h> // For calloc, free
#include <string.h> #include <string.h>
@ -97,6 +98,7 @@ void Plg_ListPlugins (void)
unsigned NumPlg; unsigned NumPlg;
struct Plugin *Plg; struct Plugin *Plg;
char URL[Cns_MAX_BYTES_WWW + Cns_BYTES_SESSION_ID + 1]; char URL[Cns_MAX_BYTES_WWW + Cns_BYTES_SESSION_ID + 1];
char *Icon;
if (Gbl.Usrs.Me.Role.Logged != Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged != Rol_SYS_ADM)
{ {
@ -139,10 +141,12 @@ void Plg_ListPlugins (void)
HTM_TD_Begin ("class=\"DAT LM\" style=\"width:45px;\""); HTM_TD_Begin ("class=\"DAT LM\" style=\"width:45px;\"");
HTM_A_Begin ("href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\"", HTM_A_Begin ("href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\"",
URL,Plg->Name); URL,Plg->Name);
fprintf (Gbl.F.Out,"<img src=\"%s/%s24x24.gif\" alt=\"%s\" title=\"%s\"" if (asprintf (&Icon,"%s24x24.gif",
" class=\"ICO40x40\" />", Gbl.Plugins.Lst[NumPlg].Logo) < 0)
Cfg_URL_ICON_PLUGINS_PUBLIC,Gbl.Plugins.Lst[NumPlg].Logo, Lay_NotEnoughMemoryExit ();
Plg->Name,Plg->Name); HTM_IMG (Cfg_URL_ICON_PLUGINS_PUBLIC,Icon,Plg->Name,
"class=\"ICO40x40\"");
free ((void *) Icon);
HTM_A_End (); HTM_A_End ();
HTM_TD_End (); HTM_TD_End ();
@ -379,6 +383,7 @@ static void Plg_ListPluginsForEdition (void)
{ {
unsigned NumPlg; unsigned NumPlg;
struct Plugin *Plg; struct Plugin *Plg;
char *Icon;
/***** Write heading *****/ /***** Write heading *****/
HTM_TABLE_BeginWidePadding (2); HTM_TABLE_BeginWidePadding (2);
@ -409,13 +414,12 @@ static void Plg_ListPluginsForEdition (void)
/* Plugin logo */ /* Plugin logo */
// TODO: Change plugin icons to 32x32 // TODO: Change plugin icons to 32x32
HTM_TD_Begin ("class=\"CM\" style=\"width:45px;\""); HTM_TD_Begin ("class=\"CM\" style=\"width:45px;\"");
fprintf (Gbl.F.Out,"<img src=\"%s/%s24x24.gif\"" if (asprintf (&Icon,"%s24x24.gif",
" alt=\"%s\" title=\"%s\"" Gbl.Plugins.Lst[NumPlg].Logo) < 0)
" class=\"ICO40x40\" />", Lay_NotEnoughMemoryExit ();
Cfg_URL_ICON_PLUGINS_PUBLIC, HTM_IMG (Cfg_URL_ICON_PLUGINS_PUBLIC,Icon,Gbl.Plugins.Lst[NumPlg].Name,
Gbl.Plugins.Lst[NumPlg].Logo, "class=\"ICO40x40\"");
Gbl.Plugins.Lst[NumPlg].Name, free ((void *) Icon);
Gbl.Plugins.Lst[NumPlg].Name);
HTM_TD_End (); HTM_TD_End ();
/* Plugin name */ /* Plugin name */

View File

@ -25,7 +25,9 @@
/********************************* Headers ***********************************/ /********************************* Headers ***********************************/
/*****************************************************************************/ /*****************************************************************************/
#define _GNU_SOURCE // For asprintf
#include <math.h> // For log10, floor, ceil, modf, sqrt... #include <math.h> // For log10, floor, ceil, modf, sqrt...
#include <stdio.h> // For asprintf
#include <stdlib.h> // For getenv, malloc #include <stdlib.h> // For getenv, malloc
#include <string.h> // For string functions #include <string.h> // For string functions
@ -2851,10 +2853,8 @@ static void Sta_WriteAccessHour (unsigned Hour,struct Sta_Hits *Hits,unsigned Co
BarHeight = (unsigned) (((Hits->Num * 500.0) / Hits->Max) + 0.5); BarHeight = (unsigned) (((Hits->Num * 500.0) / Hits->Max) + 0.5);
if (BarHeight == 0) if (BarHeight == 0)
BarHeight = 1; BarHeight = 1;
fprintf (Gbl.F.Out,"<img src=\"%s/o1x1.png\"" // Orange background HTM_IMG (Cfg_URL_ICON_PUBLIC,"o1x1.png",NULL, // Orange background
" alt=\"\" title=\"\"" "style=\"width:10px;height:%upx;\"",BarHeight);
" style=\"width:10px; height:%upx;\" />",
Cfg_URL_ICON_PUBLIC,BarHeight);
} }
else else
fprintf (Gbl.F.Out,"0%%<br />0"); fprintf (Gbl.F.Out,"0%%<br />0");
@ -2955,10 +2955,8 @@ static void Sta_ShowAverageAccessesPerMinute (unsigned long NumRows,MYSQL_RES *m
/* First division (left) */ /* First division (left) */
HTM_TD_Begin ("class=\"LM\" style=\"width:%upx;\"", HTM_TD_Begin ("class=\"LM\" style=\"width:%upx;\"",
Sta_WIDTH_SEMIDIVISION_GRAPHIC); Sta_WIDTH_SEMIDIVISION_GRAPHIC);
fprintf (Gbl.F.Out,"<img src=\"%s/ejexizq24x1.gif\"" HTM_IMG (Cfg_URL_ICON_PUBLIC,"ejexizq24x1.gif",NULL,
" alt=\"\" title=\"\"" "style=\"display:block;width:%upx;height:1px;\"",
" style=\"display:block; width:%upx; height:1px;\" />",
Cfg_URL_ICON_PUBLIC,
Sta_WIDTH_SEMIDIVISION_GRAPHIC); Sta_WIDTH_SEMIDIVISION_GRAPHIC);
HTM_TD_End (); HTM_TD_End ();
@ -2969,11 +2967,8 @@ static void Sta_ShowAverageAccessesPerMinute (unsigned long NumRows,MYSQL_RES *m
{ {
HTM_TD_Begin ("class=\"LM\" style=\"width:%upx;\"", HTM_TD_Begin ("class=\"LM\" style=\"width:%upx;\"",
Sta_WIDTH_SEMIDIVISION_GRAPHIC); Sta_WIDTH_SEMIDIVISION_GRAPHIC);
fprintf (Gbl.F.Out,"<img src=\"%s/ejex24x1.gif\"" HTM_IMG (Cfg_URL_ICON_PUBLIC,"ejex24x1.gif",NULL,
" alt=\"\" title=\"\"" "style=\"display:block;width:%upx;height:1px;\"",
" style=\"display:block;"
" width:%upx; height:1px;\" />",
Cfg_URL_ICON_PUBLIC,
Sta_WIDTH_SEMIDIVISION_GRAPHIC); Sta_WIDTH_SEMIDIVISION_GRAPHIC);
HTM_TD_End (); HTM_TD_End ();
} }
@ -2981,10 +2976,8 @@ static void Sta_ShowAverageAccessesPerMinute (unsigned long NumRows,MYSQL_RES *m
/* Last division (right) */ /* Last division (right) */
HTM_TD_Begin ("class=\"LM\" style=\"width:%upx;\"", HTM_TD_Begin ("class=\"LM\" style=\"width:%upx;\"",
Sta_WIDTH_SEMIDIVISION_GRAPHIC); Sta_WIDTH_SEMIDIVISION_GRAPHIC);
fprintf (Gbl.F.Out,"<img src=\"%s/tr24x1.gif\"" HTM_IMG (Cfg_URL_ICON_PUBLIC,"tr24x1.gif",NULL,
" alt=\"\" title=\"\"" "style=\"display:block;width:%upx;height:1px;\"",
" style=\"display:block; width:%upx; height:1px;\" />",
Cfg_URL_ICON_PUBLIC,
Sta_WIDTH_SEMIDIVISION_GRAPHIC); Sta_WIDTH_SEMIDIVISION_GRAPHIC);
HTM_TD_End (); HTM_TD_End ();
@ -3083,14 +3076,12 @@ static void Sta_WriteAccessMinute (unsigned Minute,float HitsNum,float MaxX)
/***** Draw bar with a width proportional to the number of hits *****/ /***** Draw bar with a width proportional to the number of hits *****/
if (HitsNum != 0.0) if (HitsNum != 0.0)
if ((BarWidth = (unsigned) (((HitsNum * (float) Sta_WIDTH_GRAPHIC / MaxX)) + 0.5)) != 0) if ((BarWidth = (unsigned) (((HitsNum * (float) Sta_WIDTH_GRAPHIC / MaxX)) + 0.5)) != 0)
fprintf (Gbl.F.Out,"<img src=\"%s/%c1x1.png\"" HTM_IMG (Cfg_URL_ICON_PUBLIC,
" alt=\"\" title=\"\"" (Minute % 60) == 0 ? "r1x1.png" : // red background
" style=\"display:block;" "o1x1.png", // orange background
" width:%upx; height:1px;\" />", NULL,
Cfg_URL_ICON_PUBLIC, "style=\"display:block;width:%upx;height:1px;\"",
(Minute % 60) == 0 ? 'r' : // red background BarWidth);
'o', // orange background
BarWidth);
/***** End cell of graphic and end row *****/ /***** End cell of graphic and end row *****/
HTM_TD_End (); HTM_TD_End ();
@ -3315,14 +3306,8 @@ static void Sta_ShowNumHitsPerBanner (unsigned long NumRows,
HTM_A_Begin ("href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\"", HTM_A_Begin ("href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\"",
Ban.WWW, Ban.WWW,
Ban.FullName); Ban.FullName);
fprintf (Gbl.F.Out,"<img src=\"%s/%s\"" HTM_IMG (Cfg_URL_BANNER_PUBLIC,Ban.Img,Ban.FullName,
" alt=\"%s\" title=\"%s\"" "style=\"margin:0 10px 5px 0;\"");
" class=\"BANNER_SMALL\""
" style=\"margin:0 10px 5px 0;\" />",
Cfg_URL_BANNER_PUBLIC,
Ban.Img,
Ban.ShrtName,
Ban.FullName);
HTM_A_End (); HTM_A_End ();
/* Draw bar proportional to number of clicks */ /* Draw bar proportional to number of clicks */
@ -3841,6 +3826,7 @@ static void Sta_DrawBarNumHits (char Color,
unsigned MaxBarWidth) unsigned MaxBarWidth)
{ {
unsigned BarWidth; unsigned BarWidth;
char *Icon;
HTM_TD_Begin ("class=\"LOG LM\""); HTM_TD_Begin ("class=\"LOG LM\"");
@ -3850,14 +3836,14 @@ static void Sta_DrawBarNumHits (char Color,
BarWidth = (unsigned) (((HitsNum * (float) MaxBarWidth) / HitsMax) + 0.5); BarWidth = (unsigned) (((HitsNum * (float) MaxBarWidth) / HitsMax) + 0.5);
if (BarWidth == 0) if (BarWidth == 0)
BarWidth = 1; BarWidth = 1;
fprintf (Gbl.F.Out,"<img src=\"%s/%c1x1.png\"" // Background if (asprintf (&Icon,"%c1x1.png",Color) < 0) // Background
" alt=\"\" title=\"\"" Lay_NotEnoughMemoryExit ();
" class=\"LM\"" HTM_IMG (Cfg_URL_ICON_PUBLIC,Icon,NULL,
" style=\"width:%upx; height:10px;\" />", "style=\"width:%upx;height:10px;\"",BarWidth);
Cfg_URL_ICON_PUBLIC,Color,BarWidth); free ((void *) Icon);
fprintf (Gbl.F.Out,"&nbsp;");
/***** Write the number of hits *****/ /***** Write the number of hits *****/
fprintf (Gbl.F.Out,"&nbsp;");
Str_WriteFloatNumToFile (Gbl.F.Out,HitsNum); Str_WriteFloatNumToFile (Gbl.F.Out,HitsNum);
fprintf (Gbl.F.Out,"&nbsp;(%u", fprintf (Gbl.F.Out,"&nbsp;(%u",
(unsigned) (((HitsNum * 100.0) / (unsigned) (((HitsNum * 100.0) /