Register  Login  
  May 18, 2012  
Search_Blog Minimize
Print  

Blog_Archive Minimize
Print  

Blog    
View_Blog Minimize
Jun 10

Written by: host
Wednesday, June 10, 2009 10:23 AM 

In the last few years, the number of way that someone can view your site has increased considerably.  The growth in different browsers and the growth in cell phones, the change is amazing.
 
As you may have noted from other blog posts and several Dotnetnuke forum posts, I have been attempting to get people to move off IE6 to any of the current new browsers.  So I was somewhat surprised by the following stored procedure in Dotnetnuke:

CREATE PROCEDURE dbo.Getsitelog2
                @PortalId    INT,
                @PortalAlias NVARCHAR(50),
                @StartDate   DATETIME,
                @EndDate     DATETIME
AS
  SELECT   sitelog.datetime,
           'Name' = CASE
                      WHEN sitelog.userid IS NULL
                      THEN NULL
                      ELSE users.firstname + ' ' + users.lastname
                    END,
           'Referrer' = CASE
                          WHEN sitelog.referrer LIKE '%' + @PortalAlias + '%'
                          THEN NULL
                          ELSE sitelog.referrer
                        END,
           'UserAgent' = CASE
                           WHEN sitelog.useragent LIKE '%MSIE 1%'
                           THEN 'Internet Explorer 1'
                           WHEN sitelog.useragent LIKE '%MSIE 2%'
                           THEN 'Internet Explorer 2'
                           WHEN sitelog.useragent LIKE '%MSIE 3%'
                           THEN 'Internet Explorer 3'
                           WHEN sitelog.useragent LIKE '%MSIE 4%'
                           THEN 'Internet Explorer 4'
                           WHEN sitelog.useragent LIKE '%MSIE 5%'
                           THEN 'Internet Explorer 5'
                           WHEN sitelog.useragent LIKE '%MSIE 6%'
                           THEN 'Internet Explorer 6'
                           WHEN sitelog.useragent LIKE '%MSIE%'
                           THEN 'Internet Explorer'
                           WHEN sitelog.useragent LIKE '%Mozilla/1%'
                           THEN 'Netscape Navigator 1'
                           WHEN sitelog.useragent LIKE '%Mozilla/2%'
                           THEN 'Netscape Navigator 2'
                           WHEN sitelog.useragent LIKE '%Mozilla/3%'
                           THEN 'Netscape Navigator 3'
                           WHEN sitelog.useragent LIKE '%Mozilla/4%'
                           THEN 'Netscape Navigator 4'
                           WHEN sitelog.useragent LIKE '%Mozilla/5%'
                           THEN 'Netscape Navigator 6+'
                           ELSE sitelog.useragent
                         END,
           sitelog.userhostaddress,
           tabs.tabname
  FROM     sitelog
           LEFT OUTER JOIN users
             ON sitelog.userid = users.userid
           LEFT OUTER JOIN tabs
             ON sitelog.tabid = tabs.tabid
  WHERE    sitelog.portalid = @PortalId
           AND sitelog.datetime BETWEEN @StartDate AND @EndDate
  ORDER BY sitelog.datetime DESC

This one of the several SiteLog Stored Procedures.  As you can see it is a bit dated when it comes to defining the UserAgent.

You may want to update this procedure ... I have posted a request in Gemini so a future version of DNN will recognize the current browsers.  DNNP-10180

Here is what I have used to replace the procedure:

ALTER  procedure dbo.GetSiteLog2

   @PortalId int,
   @PortalAlias nvarchar(50),
   @StartDate datetime,
   @EndDate datetime
as

set nocount on

select SiteLog.DateTime,
    'Name' = 
    case
        when SiteLog.UserId is null then null
        else Users.FirstName + ' ' + Users.LastName
    end,
    'Referrer' =
    case
        when SiteLog.Referrer like '%' + @PortalAlias + '%' then null
        else SiteLog.Referrer
    end,
    'UserAgent' =
    case
        when charindex('MSIE 1', UserAgent) > 0  then 'IE1'
        when charindex('MSIE 2', UserAgent) > 0  then 'IE2'
        when charindex('MSIE 3', UserAgent) > 0  then 'IE3'
        when charindex('MSIE 4', UserAgent) > 0  then 'IE4'
        when charindex('MSIE 5', UserAgent) > 0  then 'IE5'
        when charindex('MSIE 6', UserAgent) > 0  then 'IE6'
        when charindex('MSIE 7', UserAgent) > 0  then 'IE7'
        when charindex('MSIE 8', UserAgent) > 0  then 'IE8'
        when charindex('Firefox', UserAgent) > 0 then 'FF'
        when charindex('Opera', UserAgent) > 0   then 'Opera'
        when charindex('Chrome', UserAgent) > 0  then 'Chrome'
        when charindex('Gecko', UserAgent) > 0   then 'Safari'
        when charindex('bot', UserAgent) > 0     then 'bot'
        when charindex('slurp', UserAgent) > 0   then 'bot'
        when charindex('crawler', UserAgent) > 0 then 'bot'
        when charindex('spider', UserAgent) > 0  then 'bot'
        when charindex('jeeves', UserAgent) > 0  then 'bot'
        when charindex('google', UserAgent) > 0  then 'bot'
        when charindex('ScoutJet', UserAgent) > 0  then 'bot'
        when charindex('Charlotte', UserAgent) > 0  then 'bot'
        when charindex('Yandex', Useragent) > 0   then 'bot'
        when charindex('YahooSeeker', Useragent) > 0   then 'bot'
        when charindex('Java/1.6', Useragent) > 0   then 'bot'
        when charindex('Wells', Useragent) > 0   then 'bot'
        when charindex('ia_archiver', Useragent) > 0   then 'bot'
        when charindex('Mail.Ru', Useragent) > 0   then 'bot'
        when charindex('Shelob', Useragent) > 0   then 'bot'
        when charindex('Netscape', UserAgent) > 0  then 'Netscape'
        when charindex('Mozilla', UserAgent) > 0  then 'Mozilla'
        else 'Other'
    end,
    SiteLog.UserHostAddress,
    Tabs.TabName
from
    SiteLog
    left outer join Users on SiteLog.UserId = Users.UserId
    left outer join Tabs on SiteLog.TabId = Tabs.TabId
where
    SiteLog.PortalId = @PortalId
    and SiteLog.DateTime between @StartDate and @EndDate
order by
     SiteLog.DateTime desc

You may also want to update GetSiteLog5 with a similiar change to the UserAgents

 Hope this helps
Paul

 

Tags:

1 comment(s) so far...

Coach Factory Outlet

Some bags sold at Coach Factory Outlet will have small defects. These defects are made during the process of Coach Outlet Online. But these defects are very small. No body will notice Coach Outlet. In case you buy some bags which you will not like in the future, it is better for you to check the quality before you make the payment.Of course, if you think fake Coach Factory are much cheaper and you can accept them. You can buy some of them on Internet. There are plenty of these Coach Factory Outlet there
Ladies are creatures of Coach Factory Store. They are born to love designer bags. Sometimes they can not Coach Outlet. They can not stop buying their Coach Factory there are very little money in their wallets. They know they should not do that. But a Coach Outlet Store Online will definately show her personality and Coach Outlet Online. Just like people will love Coach Outlet Store, women can not say no to Coach Outlet Online.

By michaelkors on   Tuesday, May 15, 2012 4:28 AM

Blog_List Maximize
Print  

  Home | Blog | Forum | Subscriptions | Free Modules | Videos   Page generated in 0.0939828 seconds.
  Copyright 2010 by TressleWorks   Terms Of Use | Privacy Statement