Line 328... |
Line 328... |
328 |
//eP.appendChild(ePText) |
328 |
//eP.appendChild(ePText) |
329 |
//objDiv[0].appendChild(eP) |
329 |
//objDiv[0].appendChild(eP) |
330 |
} |
330 |
} |
331 |
} |
331 |
} |
332 |
|
332 |
|
333 |
|
- |
|
334 |
//============================================= |
- |
|
335 |
// Skript pro sbírání statistiky návštěvnosti stránek |
- |
|
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; |
- |
|
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); |
- |
|
462 |
|
- |
|
463 |
// Do již načteného dokumentu se nesmí zapisovat (vznikla by nová stránka) |
- |
|
464 |
//pmv_do.writeln('<img src="'+pmv_src+'" alt="phpMyVisites" style="border:0" />'); |
- |
|
465 |
// Místo toho přednačteme obrázek |
- |
|
466 |
|
- |
|
467 |
var dummy_picture=new Image(); |
- |
|
468 |
dummy_picture.src=pmv_src; |
- |
|
469 |
} |
- |
|
470 |
|
- |
|
471 |
|
- |
|
472 |
function doLoad() |
- |
|
473 |
// Tato funkce se spustí při načtení celé stránky. |
- |
|
474 |
{ |
- |
|
475 |
// Najdi všechna místa pro seznam |
- |
|
476 |
var objToc = document.getElementsByTagName("body")[0] // Odtud začínáme |
- |
|
477 |
tocPutToc(objToc) |
- |
|
478 |
// Najdi horní konec stránky a umísti tam značku |
- |
|
479 |
putUp() |
- |
|
480 |
// Volání zpracování návštěvnosti |
- |
|
481 |
var a_vars = Array(); |
- |
|
482 |
var pagename=''; |
- |
|
483 |
var phpmyvisitesSite = 1; |
- |
|
484 |
var phpmyvisitesURL = "http://www.mlab.cz/phpmyvisites/phpmyvisites.php"; |
- |
|
485 |
|
- |
|
486 |
//if (location.hostname != "") // jen při přístupu na server |
- |
|
487 |
//{ |
- |
|
488 |
pmv_log(phpmyvisitesURL, phpmyvisitesSite, pagename, a_vars); // PHPmyvisites |
- |
|
489 |
//} |
- |
|
490 |
} |
- |
|
491 |
|
- |
|
492 |
|
- |
|
493 |
// Zaregistruj výkonný skript po načtení celé stránky |
333 |
// Zaregistruj výkonný skript po načtení celé stránky |
494 |
window.onload = doLoad |
334 |
window.onload = doLoad |