예제 #1
0
    $metinfo = "\n{$kname}.statcookie = function (name, value, options) { if (typeof value != 'undefined') { options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); } var path = options.path ? '; path=' + options.path : ''; var domain = options.domain ? '; domain=' + options.domain : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = {$kname}.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } };\n{$kname}.myPlugin={Client:function(){var a={ie:0,webkit:0,gecko:0,opera:0,khtml:0};var b={se360:0,se:0,maxthon:0,qq:0,tt:0,theworld:0,cometbrowser:0,greenbrowser:0,ie:0,chrome:0,netscape:0,firefox:0,opera:0,safari:0,konq:0};var c=navigator.userAgent.toLowerCase();for(var d in a){if(typeof d==='string'){var e='gecko'===d?/rv:([\\w.]+)/:RegExp(d+'[ \\/]([\\w.]+)');if(e.test(c)){a.version=window.opera?window.opera.version():RegExp.\$1;a[d]=parseFloat(a.version);a.type=d;break}}};for(var d in b){if(typeof d==='string'){var e=null;switch(d){case'se360':e=/360se(?:[ \\/]([\\w.]+))?/;break;case'se':e=/se ([\\w.]+)/;break;case'qq':e=/qqbrowser\\/([\\w.]+)/;break;case'tt':e=/tencenttraveler ([\\w.]+)/;break;case'safari':e=/version\\/([\\w.]+)/;break;case'konq':e=/konqueror\\/([\\w.]+)/;break;case'netscape':e=/navigator\\/([\\w.]+)/;break;default:e=RegExp(d+'(?:[ \\/]([\\w.]+))?')};if(e.test(c)){b.metversion=window.opera?window.opera.version():RegExp.\$1?RegExp.\$1:'';b[d]=parseFloat(b.metversion);b.type=d;break}}};return{engine:a,metshell:b}}};\nfunction broversion(){\n\tvar bro={$kname}.myPlugin.Client();\n\t\tt=bro.metshell.type;\n\t\tv=bro.metshell.metversion;\n\t\t//bro=t=='ie'?t+v:t;\n\t\tif(t=='ie'&&v==''){\n\t\t\te=/ie(?:[ \\/]([\\w.]+))?/;\t\n\t\t\tv=e.exec(navigator.userAgent.toLowerCase())[1];\n\t\t}\n\t\tbro=t=='ie'?t+v:t;\n\t\tif(typeof window.external !='undefined' && typeof window.external.twGetRunPath!='unknown'&& typeof window.external.twGetRunPath!='undefined'){\n\t\t\tvar r=external.twGetRunPath();\n\t\t\tif(r&&r.toLowerCase().indexOf('360se') > -1) bro='se360';\n\t\t}\n\t\tif(t=='ie'&&typeof external.addChannel=='undefined'){\n\t\t\tbro='se360';\n\t\t}\n\treturn bro;\n}\nfunction forcook(cd,u){\n\tcd = cd.split(',');\n\tcdm=cd.length;\n\tfor(var i=0;i < cdm;i++){\n\t\tif(u!='' && cd[i]==u)return false;\n\t}\n\treturn true;\n}\nfunction metstat(){\n\tvar url=encodeURIComponent(window.location.href),lurl=encodeURIComponent(document.referrer),cookm={$kname}.statcookie('recordurl'),myDate = new Date();\n\tvar dt = Date.UTC(myDate.getFullYear(),myDate.getMonth(),myDate.getDay(),myDate.getHours(),myDate.getMinutes(),myDate.getSeconds())/1000;\n\tvar xt = Date.UTC(myDate.getFullYear(),myDate.getMonth(),myDate.getDay(),23,59,59)/1000;\n\tvar ctime = xt - dt;\n\t//if(!cookm || forcook(cookm,url)){\n\t\tvar cks = cookm?cookm:'';\n\t\tvar c*k = cookm?1:0;\n\t\t{$kname}.statcookie('recordurl',cks+','+url, {expires: ctime, path: '/'});\n\t\tvar murl ='{$u}include/stat/stat.php?type=submit';\n\t\t\tmurl+='&ip={$ip}';\n\t\t\tmurl+='&url='+url;\n\t\t\tmurl+='&lurl='+lurl;\n\t\t\tmurl+='&cook='+c*k;\n\t\t\tmurl+='&d={$d}';\n\t\t\tmurl+='&browser='+broversion();\n\t\t\tmurl+='&jsoncallback=?';\n\t\t//\$.ajax({ type: 'POST', url: murl });\n\t\t{$kname}.getJSON(murl);\n\t//}\n}\nmetstat();\n\t\t\t";
    echo $metinfo;
}
if ($type == 'submit' && $met_stat) {
    $lurl = str_replace("\\", '', $lurl);
    $url = str_replace("\\", '', $url);
    $ip = delete($ip);
    $url = delete($url);
    $lurl = delete($lurl);
    $browser = delete($browser);
    $d = delete($d);
    if (stristr($lurl, 'www.google') || stristr($lurl, 'soso.') || stristr($lurl, 'yahoo.')) {
        $google_type = "ok";
    }
    if (checkadd(1, $ip) && checkadd(2, $url) && $browser != '') {
        if (!$lurl || checkadd(2, $lurl) || $google_type == "ok") {
            $stime = strtotime(date("Y-m-d H:i:s"));
            /*访问的页面*/
            $d = explode('-', $d);
            $columnid = $d[0];
            $listid = $d[1];
            $lang = $d[2];
            $dizhi = '';
            $dayquery = "INSERT INTO {$met_visit_day} SET\n\t\t\t\t\t\t\tip           = '{$ip}',\n\t\t\t\t\t\t\tacctime      = '{$stime}',\n\t\t\t\t\t\t\tvisitpage    = '{$url}',\n\t\t\t\t\t\t\tantepage     = '{$lurl}',\n\t\t\t\t\t\t\tcolumnid     = '{$columnid}',\n\t\t\t\t\t\t\tlistid       = '{$listid}',\n\t\t\t\t\t\t\tbrowser      = '{$browser}',\n\t\t\t\t\t\t\tdizhi        = '{$dizhi}',\n\t\t\t\t\t\t\tnetwork      = '{$network}',\n\t\t\t\t\t\t\tlang         = '{$lang}'";
            $dtime = strtotime(date("Y-m-d"));
            $visit = $db->get_one("SELECT * FROM {$met_visit_summary} WHERE stattime='{$dtime}'");
            $ztian0 = strtotime(date("Y/m/d 00:00:00"));
            $ztian1 = strtotime(date("Y/m/d 23:59:59"));
            $ipset = $ip;
            $met_stat_maxok = 1;
            if ($visit) {
예제 #2
0
function seperatetokens($tags)
{
    $i = 0;
    $j = 0;
    $k = 0;
    $pp = 0;
    $wflag = 0;
    $aflag = 0;
    $nflag = 0;
    $oflag = 0;
    $l = count($tags);
    foreach ($tags as $t) {
        //echo $t['token']."/".$t['tag']." <br>";
        $new = $t['tag'];
        $new = preg_replace('/\\s+/', '', $new);
        //echo "<br />";
        if ($new == 'WEE') {
            $week[$i] = $t['token'];
            //echo $t['token'] . "/" . $t['tag'] .  " ";
            //echo "\n";
            $wflag = 1;
            $i = $i + 1;
        }
        if ($new == 'ADD') {
            $addr[$j] = $t['token'];
            //echo $t['token'] . "/" . $t['tag'] .  " ";
            //echo "\n";
            $aflag = 1;
            $j = $j + 1;
        }
        if ($new == 'NN') {
            $noun[$k] = $t['token'];
            //echo $t['token'] . "/" . $t['tag'] .  " ";
            //echo "\n";
            $nflag = 1;
            $k = $k + 1;
        }
        if ($new == 'AGE') {
            $age[$k] = $t['token'];
            //echo $t['token'] . "/" . $t['tag'] .  " ";
            //echo "\n";
            $oflag = 1;
            $pp = $pp + 1;
        }
        //$i=$i+1;
        echo "\n";
    }
    /*for($m=0;$m<$i;$m++)
    		{echo "Noun ".$j.": ".$noun[$j]."<br>"; }*/
    if ($nflag == 0) {
        $noun[0] = 'llllllllll';
    }
    if ($wflag == 1) {
        checkweek($week);
    } elseif ($oflag == 1) {
        checkage($noun);
    } elseif ($aflag == 1) {
        checkadd($noun);
    } else {
        if ($nflag == 1 && $aflag == 0 && $oflag == 0) {
            checknoun($noun);
        }
    }
    //echo $i;
}