当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
kernel.sql.php 27.95 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146
<?php
/*!
* ATTENTION: THIS FREE LICENSE IS ONLY FOR PERSONAL NON-COMMERCIAL USER. FOR COMMERCIAL PURPOSES, PLEASE PURCHASE A COMMERCIAL LICENSE! *
* module: Centcount Analyticsb Free Kernel SQL PHP Code *
* version: 1.00 Free *
* author: WM Jonssen *
* date: 03/12/2018 *
* copyright 2015-2018 WM Jonssen <wm.jonssen@gmail.com> - All rights reserved.*
* license: Dual licensed under the Free License and Commercial License. *
* https://www.centcount.com *
*/
define('TB_CA_CREATE_TEXT', "(
RecordNo BIGINT NOT NULL DEFAULT 0 PRIMARY KEY,
VID BIGINT NOT NULL DEFAULT 0,
Step INT NOT NULL DEFAULT 0,
StatusCode INT NOT NULL DEFAULT 0,
DelaySecond INT NOT NULL DEFAULT 0,
ReadySecond INT NOT NULL DEFAULT 0,
LoadSecond INT NOT NULL DEFAULT 0,
OnlineSecond INT NOT NULL DEFAULT 0,
MaxReadX TINYINT NOT NULL DEFAULT 0,
MaxReadY TINYINT NOT NULL DEFAULT 0,
PageAction TINYINT NOT NULL DEFAULT 0,
ClientTime BIGINT NOT NULL DEFAULT 0,
PageViews INT NOT NULL DEFAULT 0,
TotalPageViews INT NOT NULL DEFAULT 0,
Visits INT NOT NULL DEFAULT 0,
TotalVisits INT NOT NULL DEFAULT 0,
LastVisitTime BIGINT NOT NULL DEFAULT 0,
Title VARCHAR(512) NOT NULL DEFAULT '',
TitleMD5 VARCHAR(32) NOT NULL DEFAULT '',
Page VARCHAR(1024) NOT NULL DEFAULT '',
PageMD5 VARCHAR(32) NOT NULL DEFAULT '',
PageDomain VARCHAR(128) NOT NULL DEFAULT '',
PDMD5 VARCHAR(32) NOT NULL DEFAULT '',
Referrer VARCHAR(3072) NOT NULL DEFAULT '',
RFMD5 VARCHAR(32) NOT NULL DEFAULT '',
RefDomain VARCHAR(128) NOT NULL DEFAULT '',
RDMD5 VARCHAR(32) NOT NULL DEFAULT '',
SE VARCHAR(64) NOT NULL DEFAULT '',
SEName VARCHAR(32) NOT NULL DEFAULT '',
Keyword VARCHAR(128) NOT NULL DEFAULT '',
KWMD5 VARCHAR(32) NOT NULL DEFAULT '',
FromType TINYINT NOT NULL DEFAULT 0,
FromKey VARCHAR(128) NOT NULL DEFAULT '',
FromKeyMD5 VARCHAR(32) NOT NULL DEFAULT '',
FromVal VARCHAR(1024) NOT NULL DEFAULT '',
FromValMD5 VARCHAR(32) NOT NULL DEFAULT '',
UTMSource VARCHAR(32) NOT NULL DEFAULT '',
UTMMedium VARCHAR(32) NOT NULL DEFAULT '',
UTMTerm VARCHAR(128) NOT NULL DEFAULT '',
UTMContent VARCHAR(64) NOT NULL DEFAULT '',
UTMCampaign VARCHAR(64) NOT NULL DEFAULT '',
UserAgent VARCHAR(512) NOT NULL DEFAULT '',
Platform VARCHAR(32) NOT NULL DEFAULT '',
AppName VARCHAR(32) NOT NULL DEFAULT '',
OS VARCHAR(32) NOT NULL DEFAULT '',
OSCodename VARCHAR(32) NOT NULL DEFAULT '',
OSVersion VARCHAR(32) NOT NULL DEFAULT '',
OSVersionN FLOAT NOT NULL DEFAULT 0,
CPU VARCHAR(16) NOT NULL DEFAULT '',
Device VARCHAR(32) NOT NULL DEFAULT '',
DeviceType TINYINT NOT NULL DEFAULT 0,
Brand VARCHAR(32) NOT NULL DEFAULT '',
Model VARCHAR(32) NOT NULL DEFAULT '',
Spider VARCHAR(32) NOT NULL DEFAULT '',
ScreenWidth INT NOT NULL DEFAULT 0,
ScreenHeight INT NOT NULL DEFAULT 0,
ColorDepth TINYINT NOT NULL DEFAULT 0,
TouchScreen TINYINT NOT NULL DEFAULT 0,
Plugin VARCHAR(2048) NOT NULL DEFAULT '',
Language VARCHAR(16) NOT NULL DEFAULT '',
BrowserName VARCHAR(32) NOT NULL DEFAULT '',
BrowserVersion VARCHAR(32) NOT NULL DEFAULT '',
BrowserVersionN FLOAT NOT NULL DEFAULT 0,
BrowserCore VARCHAR(16) NOT NULL DEFAULT '',
BrowserCoreVersion VARCHAR(32) NOT NULL DEFAULT '',
BrowserCoreVersionN FLOAT NOT NULL DEFAULT 0,
CookieEnabled TINYINT NOT NULL DEFAULT 0,
IP VARCHAR(15) NOT NULL DEFAULT '',
NIP BIGINT NOT NULL DEFAULT 0,
Country VARCHAR(64) NOT NULL DEFAULT '',
CountryMD5 VARCHAR(32) NOT NULL DEFAULT '',
Region VARCHAR(64) NOT NULL DEFAULT '',
RegionMD5 VARCHAR(32) NOT NULL DEFAULT '',
City VARCHAR(64) NOT NULL DEFAULT '',
CityMD5 VARCHAR(32) NOT NULL DEFAULT '',
ISP VARCHAR(128) NOT NULL DEFAULT '',
ISPMD5 VARCHAR(32) NOT NULL DEFAULT '',
Latitude FLOAT NOT NULL DEFAULT 0,
Longitude FLOAT NOT NULL DEFAULT 0,
CountryISO VARCHAR(2) NOT NULL DEFAULT '',
ContinentISO VARCHAR(2) NOT NULL DEFAULT '',
ScrollWidth INT NOT NULL DEFAULT 0,
ScrollHeight INT NOT NULL DEFAULT 0,
ScrollLeft INT NOT NULL DEFAULT 0,
ScrollTop INT NOT NULL DEFAULT 0,
MinReadX TINYINT NOT NULL DEFAULT 0,
MinReadY TINYINT NOT NULL DEFAULT 0,
ClientWidth INT NOT NULL DEFAULT 0,
ClientHeight INT NOT NULL DEFAULT 0,
ClientLeft INT NOT NULL DEFAULT 0,
ClientTop INT NOT NULL DEFAULT 0,
IsUTM TINYINT NOT NULL DEFAULT 0,
IsPV TINYINT NOT NULL DEFAULT 1,
IsUPV TINYINT NOT NULL DEFAULT 0,
IsNVS TINYINT NOT NULL DEFAULT 0,
IsRVS TINYINT NOT NULL DEFAULT 0,
IsRBT TINYINT NOT NULL DEFAULT 0,
IsUV TINYINT NOT NULL DEFAULT 0,
IsNV TINYINT NOT NULL DEFAULT 0,
IsRV TINYINT NOT NULL DEFAULT 0,
IsBounce TINYINT NOT NULL DEFAULT 1,
IsExit TINYINT NOT NULL DEFAULT 1,
IsFakeData TINYINT NOT NULL DEFAULT 0,
EntryCode TINYINT NOT NULL DEFAULT 0,
ExitCode TINYINT NOT NULL DEFAULT 0,
LastRN BIGINT NOT NULL DEFAULT 0,
LastStatus INT NOT NULL DEFAULT 0,
Clicks INT NOT NULL DEFAULT 0,
ValidClicks INT NOT NULL DEFAULT 0,
RecordTime INT NOT NULL DEFAULT 0,
UpdateTime BIGINT NOT NULL DEFAULT 0,
INDEX indexVID (VID),
INDEX indexNIP (NIP),
INDEX indexUT (UpdateTime))");
define('TB_VA_CREATE_TEXT', "(
pKey INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
VID BIGINT NOT NULL DEFAULT 0,
RecordNo BIGINT NOT NULL DEFAULT 0,
DeviceType TINYINT NOT NULL DEFAULT 0,
FromType TINYINT NOT NULL DEFAULT 0,
UAR INT NOT NULL DEFAULT 0,
VA1 VARCHAR(5120) NOT NULL DEFAULT '',
VA2 VARCHAR(5120) NOT NULL DEFAULT '',
VA3 VARCHAR(5120) NOT NULL DEFAULT '',
VA4 VARCHAR(5120) NOT NULL DEFAULT '',
RecordTime INT NOT NULL DEFAULT 0,
UNIQUE uniqueUpdate (RecordNo, UAR),
INDEX indexVID (VID))");
define('TB_VC_CREATE_TEXT', "(
pKey INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
VID BIGINT NOT NULL DEFAULT 0,
RecordNo BIGINT NOT NULL DEFAULT 0,
DeviceType TINYINT NOT NULL DEFAULT 0,
FromType TINYINT NOT NULL DEFAULT 0,
FromKey VARCHAR(128) NOT NULL DEFAULT '',
FromKeyMD5 VARCHAR(32) NOT NULL DEFAULT '',
FromVal VARCHAR(1024) NOT NULL DEFAULT '',
FromValMD5 VARCHAR(32) NOT NULL DEFAULT '',
UTMSource VARCHAR(32) NOT NULL DEFAULT '',
UTMMedium VARCHAR(32) NOT NULL DEFAULT '',
UTMTerm VARCHAR(128) NOT NULL DEFAULT '',
UTMContent VARCHAR(64) NOT NULL DEFAULT '',
UTMCampaign VARCHAR(64) NOT NULL DEFAULT '',
TotalPageViews INT NOT NULL DEFAULT 0,
UCR INT NOT NULL DEFAULT 0,
MX INT NOT NULL DEFAULT 0,
MY INT NOT NULL DEFAULT 0,
X INT NOT NULL DEFAULT 0,
Y INT NOT NULL DEFAULT 0,
ClientWidth INT NOT NULL DEFAULT 0,
ClientHeight INT NOT NULL DEFAULT 0,
ClientLeft INT NOT NULL DEFAULT 0,
ClientTop INT NOT NULL DEFAULT 0,
Page VARCHAR(1024) NOT NULL DEFAULT '',
PageMD5 VARCHAR(32) NOT NULL DEFAULT '',
NodeActionType TINYINT NOT NULL DEFAULT 0,
NodeIDMD5 VARCHAR(32) NOT NULL DEFAULT '',
NodeHtmlMD5 VARCHAR(32) NOT NULL DEFAULT '',
NodeTagMD5 VARCHAR(32) NOT NULL DEFAULT '',
NodeNodeMD5 VARCHAR(32) NOT NULL DEFAULT '',
NodeHref VARCHAR(1024) NOT NULL DEFAULT '',
NodeHrefMD5 VARCHAR(32) NOT NULL DEFAULT '',
NodeText VARCHAR(256) NOT NULL DEFAULT '',
NodeRepeatClick TINYINT NOT NULL DEFAULT 0,
RecordTime INT NOT NULL DEFAULT 0,
UNIQUE uniqueUpdate (RecordNo, UCR),
INDEX indexPg (PageMD5),
INDEX indexVID (VID),
INDEX indexIDMD5 (NodeIDMD5),
INDEX indexHtmlMD5 (NodeHtmlMD5),
INDEX indexNodeMD5 (NodeNodeMD5),
INDEX indexHrefMD5 (NodeHrefMD5))");
define('TB_VID_CREATE_TEXT', '(
VID BIGINT NOT NULL DEFAULT 0 PRIMARY KEY,
RecordNo BIGINT NOT NULL DEFAULT 0,
UNIQUE uniqueRN (RecordNo))');
define('TB_IND_CREATE_TEXT', "(
MD5 VARCHAR(33) NOT NULL DEFAULT '' PRIMARY KEY,
Type TINYINT NOT NULL DEFAULT 0,
PV INT NOT NULL DEFAULT 0,
UPV INT NOT NULL DEFAULT 0,
RVS INT NOT NULL DEFAULT 0,
UV INT NOT NULL DEFAULT 0,
NV INT NOT NULL DEFAULT 0,
RV INT NOT NULL DEFAULT 0,
Visits INT NOT NULL DEFAULT 0,
Bounces INT NOT NULL DEFAULT 0,
BounceRate INT NOT NULL DEFAULT 0,
Exits INT NOT NULL DEFAULT 0,
ExitRate INT NOT NULL DEFAULT 0,
TotalReady BIGINT NOT NULL DEFAULT 0,
ReadyTimes INT NOT NULL DEFAULT 0,
AvgReady INT NOT NULL DEFAULT 0,
TotalLoad BIGINT NOT NULL DEFAULT 0,
LoadTimes INT NOT NULL DEFAULT 0,
AvgLoad INT NOT NULL DEFAULT 0,
TotalOnline BIGINT NOT NULL DEFAULT 0,
OnlineTimes INT NOT NULL DEFAULT 0,
AvgOnline INT NOT NULL DEFAULT 0,
TotalDelay BIGINT NOT NULL DEFAULT 0,
DelayTimes INT NOT NULL DEFAULT 0,
AvgDelay INT NOT NULL DEFAULT 0,
MaxReadX BIGINT NOT NULL DEFAULT 0,
MaxReadY BIGINT NOT NULL DEFAULT 0,
MRTimes INT NOT NULL DEFAULT 0,
AvgMRX INT NOT NULL DEFAULT 0,
AvgMRY INT NOT NULL DEFAULT 0,
DREntry INT NOT NULL DEFAULT 0,
SEEntry INT NOT NULL DEFAULT 0,
RFEntry INT NOT NULL DEFAULT 0,
Detail VARCHAR(2048) NOT NULL DEFAULT '',
Clicks INT NOT NULL DEFAULT 0,
ValidClicks INT NOT NULL DEFAULT 0,
Extra VARCHAR(255) NOT NULL DEFAULT '',
ExtraMD5 VARCHAR(33) NOT NULL DEFAULT '',
INDEX indexSort (Type,PV),
INDEX indexExtra (ExtraMD5))");
function INIT_CA() {
static $CA_ARRAY = array(
'Step' => 0,
'StatusCode' => 0,
'VID' => '',
'RecordNo' => 0,
'DelaySecond' => 0,
'ReadySecond' => 0,
'LoadSecond' => 0,
'OnlineSecond' => 0,
'MinReadX' => 0,
'MinReadY' => 0,
'MaxReadX' => 0,
'MaxReadY' => 0,
'PageAction' => 0,
'ClientTime' => 0,
'PageViews' => 0,
'TotalPageViews' => 0,
'Visits' => 1,
'TotalVisits' => 1,
'Charset' => '',
'Title' => '',
'Page' => '',
'Referrer' => '',
'SE' => '',
'SEName' => '',
'Keyword' => '',
'UserAgent' => '',
'Platform' => '',
'AppName' => '',
'OS' => '',
'OSCodename' => '',
'OSVersion' => '',
'OSVersionN' => '',
'CPU' => '',
'Device' => '',
'DeviceType' => 0,
'Brand' => '',
'Model' => '',
'SmartPhone' => '',
'Spider' => '',
'ScreenWidth' => 0,
'ScreenHeight' => 0,
'ColorDepth' => 0,
'Plugin' => '',
'Language' => '',
'BrowserName' => '',
'BrowserVersion' => '',
'BrowserVersionN' => 0,
'BrowserCore' => '',
'BrowserCoreVersion' => '',
'BrowserCoreVersionN' => 0,
'CookieEnabled' => -1,
'IP' => '',
'NIP' => 0,
'Country' => 'Unknown',
'CountryMD5' => 'Unknown',
'Region' => 'Unknown',
'RegionMD5' => 'Unknown',
'City' => 'Unknown',
'CityMD5' => 'Unknown',
'ISP' => 'Unknown',
'ISPMD5' => 'Unknown',
'Latitude' => 0,
'Longitude' => 0,
'CountryISO' => '',
'ContinentISO' => '',
'ScrollWidth' => 0,
'ScrollHeight' => 0,
'ScrollLeft' => 0,
'ScrollTop' => 0,
'ClientWidth' => 0,
'ClientHeight' => 0,
'ClientLeft' => 0,
'ClientTop' => 0,
'IsUTM' => 0,
'IsPV' => 1,
'IsUPV' => 1,
'IsNVS' => 0,
'IsRVS' => 0,
'IsRBT' => 0,
'IsUV' => 0,
'IsNV' => 0,
'IsRV' => 0,
'IsBounce' => 1,
'IsExit' => 1,
'IsFakeData' => 0,
'EntryCode' => 0,
'ExitCode' => 0,
'EntryTpye' => 0,
'ExitType' => 0,
'LastRN' => 0,
'TitleMD5' => '',
'PageMD5' => '',
'RFMD5' => '',
'KWMD5' => '',
'PageDomain' => '',
'PDMD5' => '',
'RefDomain' => '',
'RDMD5' => '',
'FromType' => 0,
'FromKey' => '',
'FromKeyMD5' => '',
'FromVal' => '',
'FromValMD5' => '',
'UTMSource' => '',
'UTMMedium' => '',
'UTMTerm' => '',
'UTMContent' => '',
'UTMCampaign' => '',
'RecordTime' => 0,
'UpdateTime' => 0,
'LastStatus' => 0,
'Clicks' => 0,
'ValidClicks' => 0,
'UAR' => 0,
'UAS' => 0,
'VA' => '',
'UCR' => 0,
'MX' => 0,
'MY' => 0,
'X' => 0,
'Y' => 0,
'NodeActionType' => 0,
'NodeIDMD5' => '',
'NodeHtmlMD5' => '',
'NodeTagMD5' => '',
'NodeNodeMD5' => '',
'NodeHref' => '',
'NodeHrefMD5' => '',
'NodeText' => '',
'NodeRepeatClick' => 0
);
return $CA_ARRAY;
}
function get_redis_array($a, &$CA) {
switch ($a) {
case "ca_insert":
return array(
'UpdateTime' => $CA['UpdateTime'],
'RecordNo' => $CA['RecordNo'],
'VID' => $CA['VID'],
'Step' => $CA['Step'],
'StatusCode' => $CA['StatusCode'],
'ClientTime' => $CA['ClientTime'],
'DelaySecond' => $CA['DelaySecond'],
'ReadySecond' => $CA['ReadySecond'],
'LoadSecond' => $CA['LoadSecond'],
'OnlineSecond' => $CA['OnlineSecond'],
'MaxReadX' => $CA['MaxReadX'],
'MaxReadY' => $CA['MaxReadY'],
'PageAction' => $CA['PageAction'],
'PageViews' => $CA['PageViews'],
'TotalPageViews' => $CA['TotalPageViews'],
'Visits' => $CA['Visits'],
'TotalVisits' => $CA['TotalVisits'],
'LastVisitTime' => $CA['LastVisitTime'],
'Title' => $CA['Title'],
'TitleMD5' => $CA['TitleMD5'],
'Page' => $CA['Page'],
'PageMD5' => $CA['PageMD5'],
'PageDomain' => $CA['PageDomain'],
'PDMD5' => $CA['PDMD5'],
'Referrer' => $CA['Referrer'],
'RFMD5' => $CA['RFMD5'],
'RefDomain' => $CA['RefDomain'],
'RDMD5' => $CA['RDMD5'],
'SE' => $CA['SE'],
'SEName' => $CA['SEName'],
'Keyword' => $CA['Keyword'],
'KWMD5' => $CA['KWMD5'],
'FromType' => $CA['FromType'],
'FromKey' => $CA['FromKey'],
'FromKeyMD5' => $CA['FromKeyMD5'],
'FromVal' => $CA['FromVal'],
'FromValMD5' => $CA['FromValMD5'],
'UTMSource' => $CA['UTMSource'],
'UTMMedium' => $CA['UTMMedium'],
'UTMTerm' => $CA['UTMTerm'],
'UTMContent' => $CA['UTMContent'],
'UTMCampaign' => $CA['UTMCampaign'],
'UserAgent' => $CA['UserAgent'],
'Platform' => $CA['Platform'],
'AppName' => $CA['AppName'],
'OS' => $CA['OS'],
'OSCodename' => $CA['OSCodename'],
'OSVersion' => $CA['OSVersion'],
'OSVersionN' => $CA['OSVersionN'],
'CPU' => $CA['CPU'],
'Device' => $CA['Device'],
'DeviceType' => $CA['DeviceType'],
'Brand' => $CA['Brand'],
'Model' => $CA['Model'],
'Spider' => $CA['Spider'],
'ScreenWidth' => $CA['ScreenWidth'],
'ScreenHeight' => $CA['ScreenHeight'],
'ColorDepth' => $CA['ColorDepth'],
'TouchScreen' => $CA['TouchScreen'],
'Plugin' => $CA['Plugin'],
'Language' => $CA['Language'],
'BrowserName' => $CA['BrowserName'],
'BrowserVersion' => $CA['BrowserVersion'],
'BrowserVersionN' => $CA['BrowserVersionN'],
'BrowserCore' => $CA['BrowserCore'],
'BrowserCoreVersion' => $CA['BrowserCoreVersion'],
'BrowserCoreVersionN' => $CA['BrowserCoreVersionN'],
'CookieEnabled' => $CA['CookieEnabled'],
'IP' => $CA['IP'],
'NIP' => $CA['NIP'],
'Country' => $CA['Country'],
'CountryMD5' => $CA['CountryMD5'],
'Region' => $CA['Region'],
'RegionMD5' => $CA['RegionMD5'],
'City' => $CA['City'],
'CityMD5' => $CA['CityMD5'],
'ISP' => $CA['ISP'],
'ISPMD5' => $CA['ISPMD5'],
'Latitude' => $CA['Latitude'],
'Longitude' => $CA['Longitude'],
'CountryISO' => $CA['CountryISO'],
'ContinentISO' => $CA['ContinentISO'],
'ScrollWidth' => $CA['ScrollWidth'],
'ScrollHeight' => $CA['ScrollHeight'],
'ScrollLeft' => $CA['ScrollLeft'],
'ScrollTop' => $CA['ScrollTop'],
'MinReadX' => $CA['MinReadX'],
'MinReadY' => $CA['MinReadY'],
'ClientWidth' => $CA['ClientWidth'],
'ClientHeight' => $CA['ClientHeight'],
'ClientLeft' => $CA['ClientLeft'],
'ClientTop' => $CA['ClientTop'],
'IsUTM' => $CA['IsUTM'],
'IsPV' => $CA['IsPV'],
'IsUPV' => $CA['IsUPV'],
'IsNVS' => $CA['IsNVS'],
'IsRVS' => $CA['IsRVS'],
'IsRBT' => $CA['IsRBT'],
'IsUV' => $CA['IsUV'],
'IsNV' => $CA['IsNV'],
'IsRV' => $CA['IsRV'],
'IsBounce' => $CA['IsBounce'],
'IsExit' => $CA['IsExit'],
'IsFakeData' => $CA['IsFakeData'],
'EntryCode' => $CA['EntryCode'],
'ExitCode' => $CA['ExitCode'],
'LastRN' => $CA['LastRN'],
'LastStatus' => $CA['StatusCode'],
'Clicks' => 0,
'ValidClicks' => 0,
'RecordTime' => $CA['RecordTime'],
'LUT' => 1);
case "ca_update":
return array(
'RecordNo' => $CA['RecordNo'],
'VID' => $CA['VID'],
'StatusCode' => $CA['StatusCode'],
'ClientTime' => $CA['ClientTime'],
'PageAction' => $CA['PageAction'],
'PageViews' => $CA['PageViews'],
'TotalPageViews' => $CA['TotalPageViews'],
'Visits' => $CA['Visits'],
'TotalVisits' => $CA['TotalVisits'],
'LastVisitTime' => $CA['LastVisitTime'],
'Page' => $CA['Page'],
'PageMD5' => $CA['PageMD5'],
'PageDomain' => $CA['PageDomain'],
'PDMD5' => $CA['PDMD5'],
'Referrer' => $CA['Referrer'],
'RFMD5' => $CA['RFMD5'],
'RefDomain' => $CA['RefDomain'],
'RDMD5' => $CA['RDMD5'],
'SE' => $CA['SE'],
'SEName' => $CA['SEName'],
'Keyword' => $CA['Keyword'],
'KWMD5' => $CA['KWMD5'],
'FromType' => $CA['FromType'],
'FromKey' => $CA['FromKey'],
'FromKeyMD5' => $CA['FromKeyMD5'],
'FromVal' => $CA['FromVal'],
'FromValMD5' => $CA['FromValMD5'],
'UTMSource' => $CA['UTMSource'],
'UTMMedium' => $CA['UTMMedium'],
'UTMTerm' => $CA['UTMTerm'],
'UTMContent' => $CA['UTMContent'],
'UTMCampaign' => $CA['UTMCampaign'],
'UserAgent' => $CA['UserAgent'],
'Platform' => $CA['Platform'],
'AppName' => $CA['AppName'],
'OS' => $CA['OS'],
'OSCodename' => $CA['OSCodename'],
'OSVersion' => $CA['OSVersion'],
'OSVersionN' => $CA['OSVersionN'],
'CPU' => $CA['CPU'],
'Device' => $CA['Device'],
'DeviceType' => $CA['DeviceType'],
'Brand' => $CA['Brand'],
'Model' => $CA['Model'],
'Spider' => $CA['Spider'],
'ScreenWidth' => $CA['ScreenWidth'],
'ScreenHeight' => $CA['ScreenHeight'],
'ColorDepth' => $CA['ColorDepth'],
'TouchScreen' => $CA['TouchScreen'],
'Plugin' => $CA['Plugin'],
'Language' => $CA['Language'],
'BrowserName' => $CA['BrowserName'],
'BrowserVersion' => $CA['BrowserVersion'],
'BrowserVersionN' => $CA['BrowserVersionN'],
'BrowserCore' => $CA['BrowserCore'],
'BrowserCoreVersion' => $CA['BrowserCoreVersion'],
'BrowserCoreVersionN' => $CA['BrowserCoreVersionN'],
'CookieEnabled' => $CA['CookieEnabled'],
'IP' => $CA['IP'],
'NIP' => $CA['NIP'],
'Country' => $CA['Country'],
'CountryMD5' => $CA['CountryMD5'],
'Region' => $CA['Region'],
'RegionMD5' => $CA['RegionMD5'],
'City' => $CA['City'],
'CityMD5' => $CA['CityMD5'],
'ISP' => $CA['ISP'],
'ISPMD5' => $CA['ISPMD5'],
'Latitude' => $CA['Latitude'],
'Longitude' => $CA['Longitude'],
'CountryISO' => $CA['CountryISO'],
'ContinentISO' => $CA['ContinentISO'],
'IsUTM' => $CA['IsUTM'],
'IsPV' => $CA['IsPV'],
'IsUPV' => $CA['IsUPV'],
'IsNVS' => $CA['IsNVS'],
'IsRVS' => $CA['IsRVS'],
'IsRBT' => $CA['IsRBT'],
'IsUV' => $CA['IsUV'],
'IsNV' => $CA['IsNV'],
'IsRV' => $CA['IsRV'],
'IsBounce' => $CA['IsBounce'],
'IsExit' => $CA['IsExit'],
'IsFakeData' => $CA['IsFakeData'],
'EntryCode' => $CA['EntryCode'],
'ExitCode' => $CA['ExitCode'],
'LastRN' => $CA['LastRN'],
'Clicks' => 0,
'ValidClicks' => 0,
'RecordTime' => $CA['RecordTime'],
'LUT' => 1);
case "ca_ready":
return array(
'UpdateTime' => $CA['UpdateTime'],
'Step' => $CA['Step'],
'DelaySecond' => $CA['DelaySecond'],
'ReadySecond' => $CA['ReadySecond'],
'LoadSecond' => $CA['LoadSecond'],
'OnlineSecond' => $CA['OnlineSecond'],
'MaxReadX' => $CA['MaxReadX'],
'MaxReadY' => $CA['MaxReadY'],
'PageAction' => $CA['PageAction'],
'Title' => $CA['Title'],
'TitleMD5' => $CA['TitleMD5'],
'ScrollWidth' => $CA['ScrollWidth'],
'ScrollHeight' => $CA['ScrollHeight'],
'ScrollLeft' => $CA['ScrollLeft'],
'ScrollTop' => $CA['ScrollTop'],
'MinReadX' => $CA['MinReadX'],
'MinReadY' => $CA['MinReadY'],
'ClientWidth' => $CA['ClientWidth'],
'ClientHeight' => $CA['ClientHeight'],
'ClientLeft' => $CA['ClientLeft'],
'ClientTop' => $CA['ClientTop'],
'LastStatus' => $CA['StatusCode']
);
case "ca_beat":
return array(
'UpdateTime' => $CA['UpdateTime'],
'Step' => $CA['Step'],
'DelaySecond' => $CA['DelaySecond'],
'ReadySecond' => $CA['ReadySecond'],
'LoadSecond' => $CA['LoadSecond'],
'OnlineSecond' => $CA['OnlineSecond'],
'MinReadX' => $CA['MinReadX'],
'MinReadY' => $CA['MinReadY'],
'MaxReadX' => $CA['MaxReadX'],
'MaxReadY' => $CA['MaxReadY'],
'PageAction' => $CA['PageAction'],
'LastStatus' => $CA['StatusCode']
);
case "ca_beat_exit":
return array(
'UpdateTime' => $CA['UpdateTime'],
'Step' => $CA['Step'],
'DelaySecond' => $CA['DelaySecond'],
'ReadySecond' => $CA['ReadySecond'],
'LoadSecond' => $CA['LoadSecond'],
'OnlineSecond' => $CA['OnlineSecond'],
'MinReadX' => $CA['MinReadX'],
'MinReadY' => $CA['MinReadY'],
'MaxReadX' => $CA['MaxReadX'],
'MaxReadY' => $CA['MaxReadY'],
'PageAction' => $CA['PageAction'],
'ExitCode' => $CA['ExitCode'],
'LastStatus' => $CA['StatusCode']
);
case "va_insert":
return array(
'VID' => $CA['VID'],
'RecordNo' => $CA['RecordNo'],
'DeviceType' => $CA['DeviceType'],
'FromType' => $CA['FromType'],
'UAR' => $CA['UAR'],
'RecordTime' => $CA['RecordTime'],
'LUT' => 1
);
case "vc_insert":
return array(
'VID' => $CA['VID'],
'RecordNo' => $CA['RecordNo'],
'DeviceType' => $CA['DeviceType'],
'FromType' => $CA['FromType'],
'FromKey' => $CA['FromKey'],
'FromKeyMD5' => $CA['FromKeyMD5'],
'FromVal' => $CA['FromVal'],
'FromValMD5' => $CA['FromValMD5'],
'UTMSource' => $CA['UTMSource'],
'UTMMedium' => $CA['UTMMedium'],
'UTMTerm' => $CA['UTMTerm'],
'UTMContent' => $CA['UTMContent'],
'UTMCampaign' => $CA['UTMCampaign'],
'TotalPageViews' => $CA['TotalPageViews'],
'UCR' => $CA['UCR'],
'MX' => $CA['MX'],
'MY' => $CA['MY'],
'X' => $CA['X'],
'Y' => $CA['Y'],
'ClientWidth' => $CA['ClientWidth'],
'ClientHeight' => $CA['ClientHeight'],
'ClientLeft' => $CA['ClientLeft'],
'ClientTop' => $CA['ClientTop'],
'Page' => $CA['Page'],
'PageMD5' => $CA['PageMD5'],
'NodeActionType' => $CA['NodeActionType'],
'NodeIDMD5' => $CA['NodeIDMD5'],
'NodeHtmlMD5' => $CA['NodeHtmlMD5'],
'NodeTagMD5' => $CA['NodeTagMD5'],
'NodeNodeMD5' => $CA['NodeNodeMD5'],
'NodeHref' => $CA['NodeHref'],
'NodeHrefMD5' => $CA['NodeHrefMD5'],
'NodeText' => $CA['NodeText'],
'NodeRepeatClick' => $CA['NodeRepeatClick'],
'RecordTime' => $CA['RecordTime']
);
}
return '';
}
function init_ind_insert($name, $type=0) {
return array(
'MD5' => $name,
'Type' => $type,
'PV' => 0,
'UV' => 0,
'UPV' => 0,
'RVS' => 0,
'NV' => 0,
'RV' => 0,
'Visits' => 0,
'Bounces' => 0,
'Exits' => 0,
'DREntry' => 0,
'SEEntry' => 0,
'RFEntry' => 0,
'Detail' => '',
'Extra' => '',
'ExtraMD5' => '',
'TotalReady' => 0,
'ReadyTimes' => 0,
'TotalLoad' => 0,
'LoadTimes' => 0,
'TotalOnline' => 0,
'OnlineTimes' => 0,
'TotalDelay' => 0,
'DelayTimes' => 0,
'MaxReadX' => 0,
'MaxReadY' => 0,
'MRTimes' => 0,
'Clicks' => 0,
'ValidClicks' => 0,
'LUT' => 1
);
}
define('CA_INSERT','(
UpdateTime,
RecordNo,
VID,
Step,
StatusCode,
ClientTime,
DelaySecond,
ReadySecond,
LoadSecond,
OnlineSecond,
MaxReadX,
MaxReadY,
PageAction,
PageViews,
TotalPageViews,
Visits,
TotalVisits,
LastVisitTime,
Title,
TitleMD5,
Page,
PageMD5,
PageDomain,
PDMD5,
Referrer,
RFMD5,
RefDomain,
RDMD5,
SE,
SEName,
Keyword,
KWMD5,
FromType,
FromKey,
FromKeyMD5,
FromVal,
FromValMD5,
UTMSource,
UTMMedium,
UTMTerm,
UTMContent,
UTMCampaign,
UserAgent,
Platform,
AppName,
OS,
OSCodename,
OSVersion,
OSVersionN,
CPU,
Device,
DeviceType,
Brand,
Model,
Spider,
ScreenWidth,
ScreenHeight,
ColorDepth,
TouchScreen,
Plugin,
Language,
BrowserName,
BrowserVersion,
BrowserVersionN,
BrowserCore,
BrowserCoreVersion,
BrowserCoreVersionN,
CookieEnabled,
IP,
NIP,
Country,
CountryMD5,
Region,
RegionMD5,
City,
CityMD5,
ISP,
ISPMD5,
Latitude,
Longitude,
CountryISO,
ContinentISO,
ScrollWidth,
ScrollHeight,
ScrollLeft,
ScrollTop,
MinReadX,
MinReadY,
ClientWidth,
ClientHeight,
ClientLeft,
ClientTop,
IsUTM,
IsPV,
IsUPV,
IsNVS,
IsRVS,
IsRBT,
IsUV,
IsNV,
IsRV,
IsBounce,
IsExit,
IsFakeData,
EntryCode,
ExitCode,
LastRN,
LastStatus,
Clicks,
ValidClicks,
RecordTime
)');
define('IND_INSERT','(
MD5,
Type,
PV,
UPV,
RVS,
UV,
NV,
RV,
Visits,
Bounces,
BounceRate,
Exits,
ExitRate,
TotalReady,
ReadyTimes,
AvgReady,
TotalLoad,
LoadTimes,
AvgLoad,
TotalOnline,
OnlineTimes,
AvgOnline,
TotalDelay,
DelayTimes,
AvgDelay,
MaxReadX,
MaxReadY,
MRTimes,
AvgMRX,
AvgMRY,
DREntry,
SEEntry,
RFEntry,
Detail,
Clicks,
ValidClicks,
Extra,
ExtraMD5
)');
define('VC_INSERT','(
VID,
RecordNo,
DeviceType,
FromType,
FromKey,
FromKeyMD5,
FromVal,
FromValMD5,
UTMSource,
UTMMedium,
UTMTerm,
UTMContent,
UTMCampaign,
TotalPageViews,
UCR,
MX,
MY,
X,
Y,
ClientWidth,
ClientHeight,
ClientLeft,
ClientTop,
Page,
PageMD5,
NodeActionType,
NodeIDMD5,
NodeHtmlMD5,
NodeTagMD5,
NodeNodeMD5,
NodeHref,
NodeHrefMD5,
NodeText,
NodeRepeatClick,
RecordTime
)');
function get_ca_insert_value(&$CA){
return "(
{$CA['UpdateTime']},
{$CA['RecordNo']},
{$CA['VID']},
{$CA['Step']},
{$CA['StatusCode']},
{$CA['ClientTime']},
{$CA['DelaySecond']},
{$CA['ReadySecond']},
{$CA['LoadSecond']},
{$CA['OnlineSecond']},
{$CA['MaxReadX']},
{$CA['MaxReadY']},
{$CA['PageAction']},
{$CA['PageViews']},
{$CA['TotalPageViews']},
{$CA['Visits']},
{$CA['TotalVisits']},
{$CA['LastVisitTime']},
'{$CA['Title']}',
'{$CA['TitleMD5']}',
'{$CA['Page']}',
'{$CA['PageMD5']}',
'{$CA['PageDomain']}',
'{$CA['PDMD5']}',
'{$CA['Referrer']}',
'{$CA['RFMD5']}',
'{$CA['RefDomain']}',
'{$CA['RDMD5']}',
'{$CA['SE']}',
'{$CA['SEName']}',
'{$CA['Keyword']}',
'{$CA['KWMD5']}',
{$CA['FromType']},
'{$CA['FromKey']}',
'{$CA['FromKeyMD5']}',
'{$CA['FromVal']}',
'{$CA['FromValMD5']}',
'{$CA['UTMSource']}',
'{$CA['UTMMedium']}',
'{$CA['UTMTerm']}',
'{$CA['UTMContent']}',
'{$CA['UTMCampaign']}',
'{$CA['UserAgent']}',
'{$CA['Platform']}',
'{$CA['AppName']}',
'{$CA['OS']}',
'{$CA['OSCodename']}',
'{$CA['OSVersion']}',
'{$CA['OSVersionN']}',
'{$CA['CPU']}',
'{$CA['Device']}',
'{$CA['DeviceType']}',
'{$CA['Brand']}',
'{$CA['Model']}',
'{$CA['Spider']}',
{$CA['ScreenWidth']},
{$CA['ScreenHeight']},
{$CA['ColorDepth']},
{$CA['TouchScreen']},
'{$CA['Plugin']}',
'{$CA['Language']}',
'{$CA['BrowserName']}',
'{$CA['BrowserVersion']}',
{$CA['BrowserVersionN']},
'{$CA['BrowserCore']}',
'{$CA['BrowserCoreVersion']}',
{$CA['BrowserCoreVersionN']},
{$CA['CookieEnabled']},
'{$CA['IP']}',
{$CA['NIP']},
'{$CA['Country']}',
'{$CA['CountryMD5']}',
'{$CA['Region']}',
'{$CA['RegionMD5']}',
'{$CA['City']}',
'{$CA['CityMD5']}',
'{$CA['ISP']}',
'{$CA['ISPMD5']}',
{$CA['Latitude']},
{$CA['Longitude']},
'{$CA['CountryISO']}',
'{$CA['ContinentISO']}',
{$CA['ScrollWidth']},
{$CA['ScrollHeight']},
{$CA['ScrollLeft']},
{$CA['ScrollTop']},
{$CA['MinReadX']},
{$CA['MinReadY']},
{$CA['ClientWidth']},
{$CA['ClientHeight']},
{$CA['ClientLeft']},
{$CA['ClientTop']},
{$CA['IsUTM']},
{$CA['IsPV']},
{$CA['IsUPV']},
{$CA['IsNVS']},
{$CA['IsRVS']},
{$CA['IsRBT']},
{$CA['IsUV']},
{$CA['IsNV']},
{$CA['IsRV']},
{$CA['IsBounce']},
{$CA['IsExit']},
{$CA['IsFakeData']},
{$CA['EntryCode']},
{$CA['ExitCode']},
{$CA['LastRN']},
{$CA['LastStatus']},
{$CA['Clicks']},
{$CA['ValidClicks']},
{$CA['RecordTime']})";
}
function get_ind_insert_value(&$CA) {
if (!isset($CA['Extra'])) $CA['Extra'] = '';
$CA['ExtraMD5'] = $CA['Extra'] ? tmd5($CA['Extra']) : '';
$CA['BounceRate'] = $CA['Visits'] ? (int)($CA['Bounces'] / $CA['Visits'] * 10000) : 0;
$CA['ExitRate'] = $CA['PV'] ? (int)($CA['Exits'] / $CA['PV'] * 10000) : 0;
$CA['AvgReady'] = $CA['ReadyTimes'] ? $CA['TotalReady'] / $CA['ReadyTimes'] : 0;
$CA['AvgLoad'] = $CA['LoadTimes'] ? $CA['TotalLoad'] / $CA['LoadTimes'] : 0;
$CA['AvgOnline'] = $CA['OnlineTimes'] ? $CA['TotalOnline'] / $CA['OnlineTimes'] : 0;
$CA['AvgDelay'] = $CA['DelayTimes'] ? $CA['TotalDelay'] / $CA['DelayTimes'] : 0;
$CA['AvgMRX'] = $CA['MRTimes'] ? $CA['MaxReadX'] / $CA['MRTimes'] : 0;
$CA['AvgMRY'] = $CA['MRTimes'] ? $CA['MaxReadY'] / $CA['MRTimes'] : 0;
return "(
'{$CA['MD5']}',
{$CA['Type']},
{$CA['PV']},
{$CA['UPV']},
{$CA['RVS']},
{$CA['UV']},
{$CA['NV']},
{$CA['RV']},
{$CA['Visits']},
{$CA['Bounces']},
{$CA['BounceRate']},
{$CA['Exits']},
{$CA['ExitRate']},
{$CA['TotalReady']},
{$CA['ReadyTimes']},
{$CA['AvgReady']},
{$CA['TotalLoad']},
{$CA['LoadTimes']},
{$CA['AvgLoad']},
{$CA['TotalOnline']},
{$CA['OnlineTimes']},
{$CA['AvgOnline']},
{$CA['TotalDelay']},
{$CA['DelayTimes']},
{$CA['AvgDelay']},
{$CA['MaxReadX']},
{$CA['MaxReadY']},
{$CA['MRTimes']},
{$CA['AvgMRX']},
{$CA['AvgMRY']},
{$CA['DREntry']},
{$CA['SEEntry']},
{$CA['RFEntry']},
'{$CA['Detail']}',
{$CA['Clicks']},
{$CA['ValidClicks']},
'{$CA['Extra']}',
'{$CA['ExtraMD5']}'
)";
}
function get_vc_insert_value(&$CA) {
return "(
{$CA['VID']},
{$CA['RecordNo']},
{$CA['DeviceType']},
{$CA['FromType']},
'{$CA['FromKey']}',
'{$CA['FromKeyMD5']}',
'{$CA['FromVal']}',
'{$CA['FromValMD5']}',
'{$CA['UTMSource']}',
'{$CA['UTMMedium']}',
'{$CA['UTMTerm']}',
'{$CA['UTMContent']}',
'{$CA['UTMCampaign']}',
{$CA['TotalPageViews']},
{$CA['UCR']},
{$CA['MX']},
{$CA['MY']},
{$CA['X']},
{$CA['Y']},
{$CA['ClientWidth']},
{$CA['ClientHeight']},
{$CA['ClientLeft']},
{$CA['ClientTop']},
'{$CA['Page']}',
'{$CA['PageMD5']}',
{$CA['NodeActionType']},
'{$CA['NodeIDMD5']}',
'{$CA['NodeHtmlMD5']}',
'{$CA['NodeTagMD5']}',
'{$CA['NodeNodeMD5']}',
'{$CA['NodeHref']}',
'{$CA['NodeHrefMD5']}',
'{$CA['NodeText']}',
'{$CA['NodeRepeatClick']}',
{$CA['RecordTime']}
)";
}
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化