From 8898dd33235d68994e05cf464cf02588869600b4 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 12 Apr 2003 23:33:56 +0000 Subject: [PATCH] Added configurable favicon and site icon support. --- docs/upgrades/upgrade_5.2.4-5.3.0.sql | 8 ++++++++ lib/WebGUI/Operation/Settings.pm | 10 ++++++++++ lib/WebGUI/Style.pm | 8 ++++++-- www/extras/favicon.ico | Bin 0 -> 318 bytes 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 www/extras/favicon.ico diff --git a/docs/upgrades/upgrade_5.2.4-5.3.0.sql b/docs/upgrades/upgrade_5.2.4-5.3.0.sql index 05442e117..d04400483 100644 --- a/docs/upgrades/upgrade_5.2.4-5.3.0.sql +++ b/docs/upgrades/upgrade_5.2.4-5.3.0.sql @@ -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','Default Home Page
\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

\r\n\r\nNot Found Page
\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

\r\n\r\nDocument Type Declaration
\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

\r\n\r\nFavicon
\r\nAn icon that appears on Internet Explorer short cuts such as your "Favorites". To learn more about Favicon click here.\r\n

\r\n\r\nSite Icon
\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

\r\n\r\n\r\nAdd edit stamp to posts?
\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

\r\n\r\nFilter Contributed HTML
\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

\r\n\r\nMaximum Attachment Size
\r\nThe size (in kilobytes) of the maximum allowable attachment to be uploaded to your system.\r\n

\r\n\r\nMax Image Size
\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

\r\n\r\nThumbnail Size
\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

\r\n\r\nSnippet Preview Length
\r\nHow many characters of a snippet should be displayed in the collateral management system main listing.\r\n

\r\n\r\nText Area Rows
\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

\r\n\r\nText Area Columns
\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

\r\n\r\nText Box Size
\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

\r\n\r\nPage Cache Timeout
\r\nThe amount of time pages should remain cached for registered users.\r\n

\r\n\r\nPage Cache Timeout (Visitors)
\r\nThe amount of time pages should remain cached for visitors.\r\n

\r\n\r\nNOTE: 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); diff --git a/lib/WebGUI/Operation/Settings.pm b/lib/WebGUI/Operation/Settings.pm index 732cc3fe8..54893a183 100644 --- a/lib/WebGUI/Operation/Settings.pm +++ b/lib/WebGUI/Operation/Settings.pm @@ -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}); diff --git a/lib/WebGUI/Style.pm b/lib/WebGUI/Style.pm index 4f048411e..8b0376653 100644 --- a/lib/WebGUI/Style.pm +++ b/lib/WebGUI/Style.pm @@ -62,8 +62,12 @@ sub get { @body = split(/\^\-\;/,$style{body}); $header = $session{setting}{docTypeDec}."\n".' '; $header .= $session{page}{title}.' - '.$session{setting}{companyName}; - $header .= '' - .$style{styleSheet}.$session{page}{metaTags}; + my $type = lc($session{setting}{siteicon}); + $type =~ s/.*\.(.*?)$/$1/; + $header .= ' + + + '.$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 .= ''; diff --git a/www/extras/favicon.ico b/www/extras/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2bd04aeb42cb17681da773ac24ab11929dbe332f GIT binary patch literal 318 zcmbu4yAi`M3_~HE2cVkNJXRi4qqxXr4%MC^L%2^NKRPMWqzZH(NRawTg=J>MMQf36 zl2&NYVfw!@uh#KGdsnB*NUAZ0#&hV{AIkoH+wgOO+1xg#T5Bo<1dv&c2y6>i^@56p kdJX?pT(5ffD{rNaaD$h+e^lZ`H)=A^A&{3P`0al<0o@8Bp#T5? literal 0 HcmV?d00001