forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: durangod on May 01, 2013, 06:20:51 pm

Title: 1.5.20 statistic details
Post by: durangod on May 01, 2013, 06:20:51 pm
Hi i was looking at my stats and i noticed that win7 (32/64), and win8 are not listed in the OS portion as well as IE9 or IE10, chrome, and opera not listed  in the browser portion.   Is this something that will be released on the next update or is this something we add ourselves thru admin panel.   

Thanks...
Title: Re: 1.5.20 statistic details
Post by: Αndré on May 02, 2013, 03:50:35 pm
As far as I know nobody added support for those operating systems and browsers (yet). I assume you have to edit the code if you want to support them.
Title: Re: 1.5.20 statistic details
Post by: durangod on May 02, 2013, 11:36:35 pm
Well it does appear so far that they intended to have the values, they are in the arrays in the include/stats.inc.php   
Title: Re: 1.5.20 statistic details
Post by: durangod on May 02, 2013, 11:39:45 pm
correction, win 7 is listed but i guess ie9 and ie10 are just covered under the generic ie array element
Title: Re: 1.5.20 statistic details
Post by: durangod on May 02, 2013, 11:58:04 pm
and this appears to be fine

in include/functions.inc.php

in the function

Code: [Select]
function cpg_determine_client()
{

for windows 7 it shows

Code: [Select]
} elseif (preg_match('#Windows NT 6\.1#i', $server_agent)) {
        $os = 'Windows 7';

windows 7 is  Windows NT 6.1  so that should match..
Title: Re: 1.5.20 statistic details
Post by: Αndré on May 03, 2013, 09:18:30 am
i noticed that win7 (32/64), and win8 are not listed in the OS portion as well as IE9 or IE10, chrome, and opera not listed  in the browser portion
As I don't use detailed statistics in my galleries, I don't have data to test. What exactly is displayed for those versions of Windows and browsers? A screenshot might also help.
Title: Re: 1.5.20 statistic details
Post by: Phill Luckhurst on May 03, 2013, 11:30:33 am
We simply need to adjust the code below. I think we should drop recognition of the older IE versions (3, 4, 5 and 5.5) and add IE9 and 10.

Code: [Select]
  $browser = 'Unknown';
    if (preg_match('#MSIE#i', $server_agent)) {
        if (preg_match('#MSIE 8\.0#i', $server_agent)) {
            $browser = 'IE8';
        } elseif (preg_match('#MSIE 7\.0#i', $server_agent)) {
            $browser = 'IE7';
        } elseif (preg_match('#MSIE 6\.0#i', $server_agent)) {
            $browser = 'IE6';
        } elseif (preg_match('#MSIE 5\.5#i', $server_agent)) {
            $browser = 'IE5.5';
        } elseif (preg_match('#MSIE 5\.0#i', $server_agent)) {
            $browser = 'IE5.0';
        } elseif (preg_match('#MSIE 4\.0#i', $server_agent)) {
            $browser = 'IE4';
        } elseif (preg_match('#MSIE 3\.0#i', $server_agent)) {
            $browser = 'IE3';
        } else {
            $browser = 'IE';
        }

So instead if we have

Code: [Select]
$browser = 'Unknown';
    if (preg_match('#MSIE#i', $server_agent)) {
        if (preg_match('#MSIE 10\.0#i', $server_agent)) {
            $browser = 'IE10';
        } elseif (preg_match('#MSIE 9\.0#i', $server_agent)) {
            $browser = 'IE9';
        } elseif (preg_match('#MSIE 8\.0#i', $server_agent)) {
            $browser = 'IE8';
        } elseif (preg_match('#MSIE 7\.0#i', $server_agent)) {
            $browser = 'IE7';
        } elseif (preg_match('#MSIE 6\.0#i', $server_agent)) {
            $browser = 'IE6';
        } else {
            $browser = 'IE';
        }

Seems to work for me.
Title: Re: 1.5.20 statistic details
Post by: Phill Luckhurst on May 03, 2013, 12:21:10 pm
I think we also need to add for windows 8

Code: [Select]
  } elseif (preg_match('#Windows NT 6\.2#i', $server_agent)) {
        $os = 'Windows 8';

Fortunately we don't detect FF versions or we would be changing the code hourly...
Title: Re: Re: 1.5.20 statistic details
Post by: durangod on May 03, 2013, 12:26:02 pm
Fortunately we don't detect FF versions or we would be changing the code hourly...

LMAO OMG soooo true... very funny  :)

Thanks for the help all... great job
Title: Re: 1.5.20 statistic details
Post by: Αndré on May 03, 2013, 12:43:13 pm
i noticed that win7 (32/64) [is] not listed in the OS portion
As you already said it's listed in the function. I just faked my user agent and the Coppermine stats also logged me as Windows 7 user. So we just need to add Windows 8 and the newer versions of IE.

Edit: we also need corresponding icons (either download them somewhere or create them ourselves)
Title: Re: 1.5.20 statistic details
Post by: durangod on May 03, 2013, 02:53:48 pm
Wont the windows icons just default to a standard windows icon if one is not assigned?
Title: Re: 1.5.20 statistic details
Post by: Αndré on May 03, 2013, 03:04:45 pm
Wont the windows icons just default to a standard windows icon if one is not assigned?
No. Instead, the string "Windows 8" will be displayed.

However, I just added Windows 8 support to statistic details page in SVN revision 8565. Will add support for the newer Internet Explorer versions later. Or do we want to drop the browser version for IE? As far as I can see we don't store it for any other browser.
Title: Re: 1.5.20 statistic details
Post by: Phill Luckhurst on May 03, 2013, 03:27:56 pm
People seem to like the IE versions. I know a lot of web devs use it to decide whether to continue supporting a particular version or not.
Title: Re: 1.5.20 statistic details
Post by: Αndré on May 03, 2013, 03:52:20 pm
Fine by me. As I never use IE, I'll have to find out how each version's icon looks like before I can search icons we can use :D
Title: Re: 1.5.20 statistic details
Post by: Αndré on May 06, 2013, 05:24:26 pm
Added support for Internet Explorer 9 & 10 in SVN revision 8566. I haven't added new icons, but used the IE8 icon.
Title: Re: 1.5.20 statistic details
Post by: Phill Luckhurst on May 06, 2013, 06:56:50 pm
Excellent job Andre. I did find the official icons but they are on a limited licence so am happy to stick with the current one you have used.