Rev 1477 Rev 1478
Line 332... Line 332...
332   332  
333   333  
334 //============================================= 334 //=============================================
335 // Skript pro sbírání statistiky návštěvnosti stránek 335 // Skript pro sbírání statistiky návštěvnosti stránek
336 // 336 //
-   337 // http://www.phpmyvisites.net/
-   338  
-   339 // License GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
-   340  
-   341  
-   342 function pmv_plugMoz(pmv_pl) {
-   343 if (pmv_tm.indexOf(pmv_pl) != -1 && (navigator.mimeTypes[pmv_pl].enabledPlugin != null))
-   344 return '1';
-   345 return '0';
-   346 }
-   347  
-   348  
-   349 function pmv_plugIE(pmv_plug){
-   350 pmv_find = false;
337 // http://www.phpmyvisites.net/ // License GNU/GPL (http://www.gnu.org/copyleft/gpl.html)function pmv_plugMoz(pmv_pl) { if (pmv_tm.indexOf(pmv_pl) != -1 && (navigator.mimeTypes[pmv_pl].enabledPlugin != null)) return '1'; return '0';}function pmv_plugIE(pmv_plug){ pmv_find = false; document.write('<SCR' + 'IPT LANGUAGE=VBScript>\n on error resume next \n pmv_find = IsObject(CreateObject("' + pmv_plug + '")) </SCR' + 'IPT>\n'); if (pmv_find) return '1'; return '0';}var pmv_jav='0'; if(navigator.javaEnabled()) pmv_jav='1';var pmv_agent = navigator.userAgent.toLowerCase();var pmv_moz = (navigator.appName.indexOf("Netscape") != -1);var pmv_ie= (pmv_agent.indexOf("msie") != -1);var pmv_win = ((pmv_agent.indexOf("win") != -1) || (pmv_agent.indexOf("32bit") != -1));// Determine if cookie enabledvar pmv_cookie=(navigator.cookieEnabled)? '1' : '0';//if not IE4+ nor NS6+if ((typeof (navigator.cookieEnabled) =="undefined") && (pmv_cookie == '0')) { document.cookie="pmv_testcookie" pmv_cookie=(document.cookie.indexOf("pmv_testcookie")!=-1)? '1' : '0';}var pmv_dir = '0'; var pmv_fla = '0'; var pmv_pdf = '0'; var pmv_qt = '0'; var pmv_rea = '0'; var pmv_wma = '0'; if (!pmv_win || pmv_moz){ var pmv_tm = ''; for (var i=0; i < navigator.mimeTypes.length; i++) pmv_tm += navigator.mimeTypes[i].type.toLowerCase(); pmv_dir = pmv_plugMoz("application/x-director"); pmv_fla = pmv_plugMoz("application/x-shockwave-flash"); pmv_pdf = pmv_plugMoz("application/pdf"); pmv_qt = pmv_plugMoz("video/quicktime"); pmv_rea = pmv_plugMoz("audio/x-pn-realaudio-plugin"); pmv_wma = pmv_plugMoz("application/x-mplayer2");} else if (pmv_win && pmv_ie){ pmv_dir = pmv_plugIE("SWCtl.SWCtl.1"); pmv_fla = pmv_plugIE("ShockwaveFlash.ShockwaveFlash.1"); if (pmv_plugIE("PDF.PdfCtrl.1") == '1' || pmv_plugIE('PDF.PdfCtrl.5') == '1' || pmv_plugIE('PDF.PdfCtrl.6') == '1') pmv_pdf = '1'; pmv_qt = pmv_plugIE("Quicktime.Quicktime"); // Old : "QuickTimeCheckObject.QuickTimeCheck.1" pmv_rea = pmv_plugIE("rmocx.RealPlayer G2 Control.1"); pmv_wma = pmv_plugIE("wmplayer.ocx"); // Old : "MediaPlayer.MediaPlayer.1"} var pmv_do = document;var pmv_rtu = '';try {pmv_rtu = top.pmv_do.referrer;} catch(e) { if (parent) { if (parent.pmv_getReferer) { try {pmv_rtu = parent.pmv_getReferer;} catch(E3) {pmv_rtu = '';} } else { try {pmv_rtu = parent.document.referrer;} catch(E) { try {pmv_rtu = document.referrer;} catch(E2) {pmv_rtu = '';} } } parent.pmv_getReferer = document.location.href; } else { try {pmv_rtu = document.referrer;} catch(E3) {pmv_rtu = '';} }}// Get the url to call phpmyvisitesfunction pmv_getUrlStat(pmv_urlPmv, pmv_site, pmv_urlDoc, pmv_pname, pmv_typeClick, pmv_vars){ var pmv_getvars=''; if (pmv_vars) { for (var i in pmv_vars){ if (!Array.prototype[i]){ pmv_getvars = pmv_getvars + '&a_vars['+ escape(i) + ']' + "=" + escape(pmv_vars[i]); } } } var pmv_da = new Date(); var pmv_src = pmv_urlPmv; pmv_src += '?url='+escape(pmv_urlDoc)+'&pagename='+escape(pmv_pname)+pmv_getvars; pmv_src += '&id='+pmv_site+'&res='+screen.width+'x'+screen.height+'&col='+screen.colorDepth; pmv_src += '&h='+pmv_da.getHours()+'&m='+pmv_da.getMinutes()+'&s='+pmv_da.getSeconds(); pmv_src += '&flash='+pmv_fla+'&director='+pmv_dir+'&quicktime='+pmv_qt+'&realplayer='+pmv_rea; pmv_src += '&pdf='+pmv_pdf+'&windowsmedia='+pmv_wma+'&java='+pmv_jav+'&cookie='+pmv_cookie; if ((pmv_typeClick) && (pmv_typeClick != "")) pmv_src += '&type='+escape(pmv_typeClick); pmv_src += '&ref='+escape(pmv_rtu); return pmv_src;}// log action : pmv_typeClick = empty like a page, FILE ans in the futur RSS, PODCASTfunction pmv_click (pmv_urlPmv, pmv_site, pmv_urlDoc, pmv_pname, pmv_typeClick, pmv_vars){ var pmv_src = pmv_getUrlStat(pmv_urlPmv, pmv_site, pmv_urlDoc, pmv_pname, pmv_typeClick, pmv_vars); var pmv_img = new Image(); pmv_img.src = pmv_src;}// Log current pagefunction pmv_log(pmv_urlPmv, pmv_site, pmv_pname, pmv_vars){ var pmv_urlCur = pmv_do.location.href; var pmv_pos = pmv_urlCur.indexOf("//"); if (pmv_pos > 0) { pmv_urlCur = pmv_urlCur.substr(pmv_pos); } var pmv_src = pmv_getUrlStat(pmv_urlPmv, pmv_site, pmv_urlCur, pmv_pname, "", pmv_vars); 351 document.write('<SCR' + 'IPT LANGUAGE=VBScript>\n on error resume next \n pmv_find = IsObject(CreateObject("' + pmv_plug + '")) </SCR' + 'IPT>\n');
-   352 if (pmv_find) return '1';
-   353 return '0';
-   354 }
-   355  
-   356 var pmv_jav='0'; if(navigator.javaEnabled()) pmv_jav='1';
-   357 var pmv_agent = navigator.userAgent.toLowerCase();
-   358 var pmv_moz = (navigator.appName.indexOf("Netscape") != -1);
-   359 var pmv_ie= (pmv_agent.indexOf("msie") != -1);
-   360 var pmv_win = ((pmv_agent.indexOf("win") != -1) || (pmv_agent.indexOf("32bit") != -1));
-   361  
-   362 // Determine if cookie enabled
-   363 var pmv_cookie=(navigator.cookieEnabled)? '1' : '0';
-   364  
-   365 //if not IE4+ nor NS6+
-   366 if ((typeof (navigator.cookieEnabled) =="undefined") && (pmv_cookie == '0')) {
-   367 document.cookie="pmv_testcookie"
-   368 pmv_cookie=(document.cookie.indexOf("pmv_testcookie")!=-1)? '1' : '0';
-   369 }
-   370  
-   371 var pmv_dir = '0';
-   372 var pmv_fla = '0';
-   373 var pmv_pdf = '0';
-   374 var pmv_qt = '0';
-   375 var pmv_rea = '0';
-   376 var pmv_wma = '0';
-   377  
-   378 if (!pmv_win || pmv_moz){
-   379 var pmv_tm = '';
-   380 for (var i=0; i < navigator.mimeTypes.length; i++)
-   381 pmv_tm += navigator.mimeTypes[i].type.toLowerCase();
-   382 pmv_dir = pmv_plugMoz("application/x-director");
-   383 pmv_fla = pmv_plugMoz("application/x-shockwave-flash");
-   384 pmv_pdf = pmv_plugMoz("application/pdf");
-   385 pmv_qt = pmv_plugMoz("video/quicktime");
-   386 pmv_rea = pmv_plugMoz("audio/x-pn-realaudio-plugin");
-   387 pmv_wma = pmv_plugMoz("application/x-mplayer2");
-   388 } else if (pmv_win && pmv_ie){
-   389 pmv_dir = pmv_plugIE("SWCtl.SWCtl.1");
-   390 pmv_fla = pmv_plugIE("ShockwaveFlash.ShockwaveFlash.1");
-   391 if (pmv_plugIE("PDF.PdfCtrl.1") == '1' || pmv_plugIE('PDF.PdfCtrl.5') == '1' || pmv_plugIE('PDF.PdfCtrl.6') == '1')
-   392 pmv_pdf = '1';
-   393 pmv_qt = pmv_plugIE("Quicktime.Quicktime"); // Old : "QuickTimeCheckObject.QuickTimeCheck.1"
-   394 pmv_rea = pmv_plugIE("rmocx.RealPlayer G2 Control.1");
-   395 pmv_wma = pmv_plugIE("wmplayer.ocx"); // Old : "MediaPlayer.MediaPlayer.1"
-   396 }
-   397  
-   398 var pmv_do = document;
-   399 var pmv_rtu = '';
-   400 try {pmv_rtu = top.pmv_do.referrer;} catch(e) {
-   401 if (parent) {
-   402 if (parent.pmv_getReferer) {
-   403 try {pmv_rtu = parent.pmv_getReferer;} catch(E3) {pmv_rtu = '';}
-   404 }
-   405 else {
-   406 try {pmv_rtu = parent.document.referrer;} catch(E) {
-   407 try {pmv_rtu = document.referrer;} catch(E2) {pmv_rtu = '';}
-   408 }
-   409 }
-   410 parent.pmv_getReferer = document.location.href;
-   411 }
-   412 else {
-   413 try {pmv_rtu = document.referrer;} catch(E3) {pmv_rtu = '';}
-   414 }
-   415 }
-   416  
-   417  
-   418 // Get the url to call phpmyvisites
-   419 function pmv_getUrlStat(pmv_urlPmv, pmv_site, pmv_urlDoc, pmv_pname, pmv_typeClick, pmv_vars)
-   420 {
-   421 var pmv_getvars='';
-   422 if (pmv_vars) {
-   423 for (var i in pmv_vars){
-   424 if (!Array.prototype[i]){
-   425 pmv_getvars = pmv_getvars + '&a_vars['+ escape(i) + ']' + "=" + escape(pmv_vars[i]);
-   426 }
-   427 }
-   428 }
-   429
-   430 var pmv_da = new Date();
-   431 var pmv_src = pmv_urlPmv;
-   432 pmv_src += '?url='+escape(pmv_urlDoc)+'&pagename='+escape(pmv_pname)+pmv_getvars;
-   433 pmv_src += '&id='+pmv_site+'&res='+screen.width+'x'+screen.height+'&col='+screen.colorDepth;
-   434 pmv_src += '&h='+pmv_da.getHours()+'&m='+pmv_da.getMinutes()+'&s='+pmv_da.getSeconds();
-   435 pmv_src += '&flash='+pmv_fla+'&director='+pmv_dir+'&quicktime='+pmv_qt+'&realplayer='+pmv_rea;
-   436 pmv_src += '&pdf='+pmv_pdf+'&windowsmedia='+pmv_wma+'&java='+pmv_jav+'&cookie='+pmv_cookie;
-   437 if ((pmv_typeClick) && (pmv_typeClick != "")) pmv_src += '&type='+escape(pmv_typeClick);
-   438 pmv_src += '&ref='+escape(pmv_rtu);
-   439
-   440 return pmv_src;
-   441 }
-   442  
-   443  
-   444 // log action : pmv_typeClick = empty like a page, FILE ans in the futur RSS, PODCAST
-   445 function pmv_click (pmv_urlPmv, pmv_site, pmv_urlDoc, pmv_pname, pmv_typeClick, pmv_vars)
-   446 {
-   447 var pmv_src = pmv_getUrlStat(pmv_urlPmv, pmv_site, pmv_urlDoc, pmv_pname, pmv_typeClick, pmv_vars);
-   448 var pmv_img = new Image();
-   449 pmv_img.src = pmv_src;
-   450 }
-   451  
-   452  
-   453 // Log current page
-   454 function pmv_log(pmv_urlPmv, pmv_site, pmv_pname, pmv_vars)
-   455 {
-   456 var pmv_urlCur = pmv_do.location.href;
-   457 var pmv_pos = pmv_urlCur.indexOf("//");
-   458 if (pmv_pos > 0) {
-   459 pmv_urlCur = pmv_urlCur.substr(pmv_pos);
-   460 }
-   461 var pmv_src = pmv_getUrlStat(pmv_urlPmv, pmv_site, pmv_urlCur, pmv_pname, "", pmv_vars);
338   462  
339 // Do již načteného dokumentu se nesmí zapisovat (vznikla by nová stránka) 463 // Do již načteného dokumentu se nesmí zapisovat (vznikla by nová stránka)
340 //pmv_do.writeln('<img src="'+pmv_src+'" alt="phpMyVisites" style="border:0" />'); 464 //pmv_do.writeln('<img src="'+pmv_src+'" alt="phpMyVisites" style="border:0" />');
341 // Místo toho přednačteme obrázek 465 // Místo toho přednačteme obrázek
342   466  
343 // var dummy_picture=new Image(); 467 var dummy_picture=new Image();
344 // dummy_picture.src=pmv_src; 468 dummy_picture.src=pmv_src;
345 //} 469 }
346   470  
347   471  
348 function doLoad() 472 function doLoad()
349 // Tato funkce se spustí při načtení celé stránky. 473 // Tato funkce se spustí při načtení celé stránky.
350 { 474 {