Added configurable favicon and site icon support.

This commit is contained in:
JT Smith 2003-04-12 23:33:56 +00:00
parent 0edcfad5f5
commit 8898dd3323
4 changed files with 24 additions and 2 deletions

View file

@ -37,6 +37,14 @@ update international set namespace='WebGUI/Profile' where namespace='WebGUI' and
update international set namespace='WebGUI/Profile' where namespace='WebGUI' and internationalId=790;
update international set namespace='WebGUI/Profile' where namespace='WebGUI' and internationalId=466;
update international set namespace='WebGUI/Profile' where namespace='WebGUI' and internationalId=467;
insert into settings values ("siteicon","^Extras;favicon.png");
insert into settings values ("favicon","^Extras;favicon.ico");
delete from international where languageId=1 and namespace='WebGUI' and internationalId=898;
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (898,1,'WebGUI','Site Icon', 1050172395);
delete from international where languageId=1 and namespace='WebGUI' and internationalId=634;
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (634,1,'WebGUI','<b>Default Home Page</b><br>\r\nSome really small sites don\'t have a home page, but instead like to use one of their internal pages like "About Us" or "Company Information" as their home page. For that reason, you can set the default page of your site to any page in the site. That page will be the one people go to if they type in just your URL http://www.mywebguisite.com, or if they click on the Home link generated by the ^H; macro.\r\n<p>\r\n\r\n<b>Not Found Page</b><br>\r\nIf a page that a user requests is not found in the system, the user can be redirected to the home page or to an error page where they can attempt to find what they were looking for. You decide which is better for your users.\r\n<p>\r\n\r\n<b>Document Type Declaration</b><br>\r\nThese days it is very common to have a wide array of browsers accessing your site, including automated browsers like search engine spiders. Many of those browsers want to know what kind of content you are serving. The doctype tag allows you to specify that. By default WebGUI generates HTML 4.0 compliant content.\r\n<p>\r\n\r\n<b>Favicon</b><br>\r\nAn icon that appears on Internet Explorer short cuts such as your "Favorites". To learn more about Favicon <a href="http://msdn.microsoft.com/workshop/author/dhtml/howto/shortcuticon.asp">click here</a>.\r\n<p>\r\n\r\n<b>Site Icon</b><br>\r\nAn icon that appears in the URL bar of most modern browsers. It may also appear in the bookmarks of the browser. The image must be 16x16 pixels.\r\n<p>\r\n\r\n\r\n<b>Add edit stamp to posts?</b><br>\r\nTypically if a user edits a post on a discussion, a stamp is added to that post to identify who made the edit, and at what time. On some sites that information is not necessary, therefore you can turn it off here.\r\n<p>\r\n\r\n<b>Filter Contributed HTML</b><br>\r\nEspecially when running a public site where anybody can post to your message boards or user submission systems, it is often a good idea to filter their content for malicious code that can harm the viewing experience of your visitors; And in some circumstances, it can even cause security problems. Use this setting to select the level of filtering you wish to apply.\r\n<p>\r\n\r\n<b>Maximum Attachment Size</b><br>\r\nThe size (in kilobytes) of the maximum allowable attachment to be uploaded to your system.\r\n<p>\r\n\r\n<b>Max Image Size</b><br>\r\nIf images are uploaded to your system that are bigger than the max image size, then they will be resized to the max image size. The max image size is measured in pixels and will use the size of the longest side of the image to determine if the limit has been reached.\r\n<p>\r\n\r\n<b>Thumbnail Size</b><br>\r\nWhen images are uploaded to your system, they will automatically have thumbnails generated at the size specified here (unless overridden on a case-by-case basis). Thumbnail size is measured in pixels.\r\n<p>\r\n\r\n<b>Snippet Preview Length</b><br/>\r\nHow many characters of a snippet should be displayed in the collateral management system main listing.\r\n<p/>\r\n\r\n<b>Text Area Rows</b><br>\r\nSome sites wish to control the size of the forms that WebGUI generates. With this setting you can specify how many rows of characters will be displayed in textareas on the site.\r\n<p>\r\n\r\n<b>Text Area Columns</b><br>\r\nSome sites wish to control the size of the forms that WebGUI generates. With this setting you can specify how many columns of characters will be displayed in textareas on the site.\r\n<p>\r\n\r\n<b>Text Box Size</b><br>\r\nSome sites wish to control the size of the forms that WebGUI generates. With this setting you can specify how characters can be displayed at once in text boxes on the site.\r\n<p>\r\n\r\n<b>Page Cache Timeout</b><br>\r\nThe amount of time pages should remain cached for registered users.\r\n<p>\r\n\r\n<b>Page Cache Timeout (Visitors)</b><br>\r\nThe amount of time pages should remain cached for visitors.\r\n<p>\r\n\r\n<b>NOTE:</b> Page caching is only available if your administrator has installed the Cache::FileCache Perl module. Using page caching can improve site performance by as much as 1000%.', 1050172368);
delete from international where languageId=1 and namespace='WebGUI' and internationalId=897;
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (897,1,'WebGUI','Favicon', 1050170767);

View file

@ -92,6 +92,16 @@ sub www_editContentSettings {
$f->select("defaultPage",$pages,WebGUI::International::get(527),[$session{setting}{defaultPage}]);
$f->select("notFoundPage",$pages,WebGUI::International::get(141),[$session{setting}{notFoundPage}]);
$f->text("docTypeDec",WebGUI::International::get(398),$session{setting}{docTypeDec});
$f->text(
-name=>"favicon",
-label=>WebGUI::International::get(897),
-value=>$session{setting}{favicon}
);
$f->text(
-name=>"siteicon",
-label=>WebGUI::International::get(898),
-value=>$session{setting}{siteicon}
);
$f->integer("maxAttachmentSize",WebGUI::International::get(130),$session{setting}{maxAttachmentSize});
$f->integer("maxImageSize",WebGUI::International::get(583),$session{setting}{maxImageSize});
$f->integer("thumbnailSize",WebGUI::International::get(406),$session{setting}{thumbnailSize});

View file

@ -62,8 +62,12 @@ sub get {
@body = split(/\^\-\;/,$style{body});
$header = $session{setting}{docTypeDec}."\n".'<!-- WebGUI '.$WebGUI::VERSION.' --> <html> <head> <title>';
$header .= $session{page}{title}.' - '.$session{setting}{companyName};
$header .= '</title><link REL="icon" HREF="'.$session{config}{extrasURL}.'/favicon.png" TYPE="image/png">'
.$style{styleSheet}.$session{page}{metaTags};
my $type = lc($session{setting}{siteicon});
$type =~ s/.*\.(.*?)$/$1/;
$header .= '</title>
<link REL="icon" HREF="'.$session{setting}{siteicon}.'" TYPE="image/'.$type.'">
<LINK REL="SHORTCUT ICON" HREF="'.$session{setting}{favicon}.'">
'.$style{styleSheet}.$session{page}{metaTags};
if ($session{var}{adminOn}) {
# This "triple incantation" panders to the delicate tastes of various browsers for reliable cache suppression.
$header .= '<META HTTP-EQUIV="Pragma" CONTENT="no-cache">';

BIN
www/extras/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B