Location: PHPKode > projects > Stuffed Tracker - Web Traffic Monitoring & Analysis > stuffed-tracker-web-traffic-monitoring-analysis/actions/debug.info.php
<?

ExtendUser();

if (($nsProduct->LICENSE==3&&!$nsUser->SUPER_ADMIN) || ($nsProduct->LICENSE!=3 && !$nsUser->SUPER_USER)) exit;

$Mode=V($_REQUEST['Mode']);
if ($Mode=='phpinfo') {phpinfo(); exit;}

$Logs->USE_LOG=false;

function CollectPhpInfo($HTML)
{
    global $PhpInfo;
    $HTML=strip_tags($HTML);
    if (strpos($HTML,'phpinfo')) $HTML=substr($HTML,strpos($HTML,'phpinfo')+9);
    $PhpInfo=$HTML;
}

$LicensesArr=array('1'=>'Trial', '2'=>'Merchant', '3'=>'Agency');

$PhpVersion=phpversion();
$TrackerVersion=$nsProduct->VERSION;
$TrackerLicense=$LicensesArr[$nsProduct->LICENSE];
$MyVersion = $Db->ReturnValue("SELECT VERSION()");
$PhpInfo=false;
if (function_exists('ob_start')) {
    ob_start("CollectPhpInfo");
    phpinfo();
    ob_end_clean();
}

$MyVars=array();
$Sql = new Query("SHOW VARIABLES");
while ($Row=$Sql->Row()) {
    $MyVars[]=$Row; 
}

$Tables=array();
$Sql = new Query("SHOW TABLE STATUS");
while ($Row=$Sql->Row()) {
    if (strpos($Row->Name,PFX)!=0) continue;
    $Tables[]=$Row; 
}

$Clients=array();
$Query = "
    SELECT
    C.*, COUNT(S.ID) AS CNT
    FROM ?_client C
        LEFT JOIN ?_site S
            ON S.COMPANY_ID=C.ID
    GROUP BY C.ID
";
$Sql = new Query($Query);
while ($Row=$Sql->Row()) {
    $Clients[$Row->ID]=$Row;
}

$Sites=array();
$Query = "SELECT * FROM ?_site";
$Sql = new Query($Query);
while ($Row=$Sql->Row()) $Sites[$Row->COMPANY_ID][$Row->ID]=$Row;

$SiteHosts=array();
$Query = "SELECT * FROM ?_site_host";
$Sql = new Query($Query);
while ($Row=$Sql->Row()) $SiteHosts[$Row->SITE_ID][]=$Row;

foreach ($Sites as $Cp=>$Arr) foreach ($Arr as $SiteId=>$Row) {
    $Query = "SELECT COUNT(*) FROM ?_{$Row->COMPANY_ID}_stat_log WHERE SITE_ID=?";
    $Sites[$Cp][$SiteId]->STAT_CNT=$Db->ReturnValue($Query,$Row->ID);
}

$Config=array();
$Query = "SELECT * FROM ?_config";
$Sql = new Query($Query);
while ($Row=$Sql->Row()) $Config[$Row->COMPANY_ID][$Row->SITE_ID]=$Row;


$PriorArr=explode("|", $Config[0][0]->TRACKING_MODE);
$TrafficPrior=V($PriorArr[0], "NONE");
if (V($PriorArr[1])) {
    $EntryArr=explode(";", $PriorArr[1]);
    for($i=0;$i<count($EntryArr);$i++) {
        $TmpArr=explode(":", $EntryArr[$i]);
        if ($TmpArr[0]=="NONE") $NoneEntryPrior=$TmpArr[1];
        if ($TmpArr[0]=="PAID") $PaidEntryPrior=$TmpArr[1];
        if ($TmpArr[0]=="NATURAL") $NaturalEntryPrior=$TmpArr[1];
    }
}
$NoneEntryPrior=V($NoneEntryPrior, "LAST");
$PaidEntryPrior=V($PaidEntryPrior, "LAST");
$NaturalEntryPrior=V($NaturalEntryPrior, "LAST");

$PriorStr='';
if ($TrafficPrior=='NONE') $PriorStr='Equal priority, '.(($NoneEntryPoint=='FIRST')?'fisrt entry point':'last entry point');
else {
    $PriorStr=($TrafficPrior=='PAID')?'Paid traffic priority':'Natural traffic priority';
    $PriorStr.=', '.(($PaidEntryPrior=='FIRST')?'first paid entry point':'last paid entry point');
    $PriorStr.=', '.(($NaturalEntryPrior=='FIRST')?'first natural entry point':'last natural entry point');
}

$P3PStr=GetParam("P3P", "STRVAL");
$P3PRef=GetParam("P3P_REF", "STRVAL");

$StorageParams=array('2'=>'Inherit','1'=>'Store','0'=>'Don\'t store');
$DuplicateParams=array('2'=>'Inherit','0'=>'Disable','1'=>'Ignore');

function EchoDupl($Cp,$Site,$Param,$Param2)
{
    $Str='';
    global $DuplicateParams,$Config;
    $Str=$DuplicateParams[$Config[$Cp][$Site]->$Param];
    if ($Config[$Cp][$Site]->$Param==1) $Str.=' ('.$Config[$Cp][$Site]->$Param2.'s)';
    return $Str;
}

$NumberOfUsers=$Db->ReturnValue("SELECT COUNT(*) FROM ?_user");
$NumberOfAdmins=$Db->ReturnValue("SELECT COUNT(*) FROM ?_admin");

$BrowserGroups=$Db->ReturnValue("SELECT COUNT(*) FROM ?_host_grp");
$AgentGroups=$Db->ReturnValue("SELECT COUNT(*) FROM ?_visitor_agent_browser");
$Countries=$Db->ReturnValue("SELECT COUNT(*) FROM ?_country");

$IpIgnore=array();
$Query = "SELECT * FROM ?_ip_ignore";
$Sql = new Query($Query);
while ($Row=$Sql->Row()) $IpIgnore[]=$Row;
$Query = "SELECT * FROM ?_ip WHERE IGNORED='1' ";
$Sql = new Query($Query);
while ($Row=$Sql->Row()) {
    $Row->TEMPLATE=$Row->IP;
    if ($Row->DESCRIPTION) $Row->TEMPLATE.=" ({$Row->DESCRIPTION})";
    $IpIgnore[]=$Row;
}

$StoreIsWritable=CheckStore();
$InstallDeleted=!is_dir(SELF."/install");
$ConfIsWritable=is__writable(SELF."/conf.vars.php");
function CheckStore() {
    if (!is_dir(SELF."/store")) return false;
    $Filename="test.txt";
    $f=@fopen(SELF."/store/$Filename", "a+");
    if (!$f) return false;
    if (!@is__writable(SELF."/store/$Filename")) return false;
    @unlink(SELF."/store/$Filename");
    return true;
}

$CronLastLaunched=$Db->ReturnValue("SELECT STAMP FROM ?_cron_log ORDER BY ID DESC LIMIT 1");
$DefLangCharset=DefLangCharset($nsProduct->DEFAULT_LANG);

function DefLangCharset($DefLang)
{
    include SELF."/lang/$DefLang/_system/{$DefLang}.config.php";
    return $LangConfig['charset'];
}

$TrafficModes=array('0'=>'All visitors','1'=>'Visitors from paid links','2'=>'Visitors from natural referrers','3'=>'Direct visitors');
$CacheUpdateActions=array('0'=>'Ask user','1'=>'Add report to queue','2'=>'Run by ajax');
UserColumns();
$UserColumns=array('HITS','SALES','ACTIONS','CLICKS','ROI','CONVERSIONS','GRAPHS','NEWRET','VISITS');

$IgnoredRefHosts=array();
$IgnoredRefGroups=array();
$Query = "SELECT * FROM ?_host_grp WHERE BAN='1'";
$Sql  = new Query($Query);
while ($Row=$Sql->Row()) $IgnoredRefGroups[]=$Row;
$Query = "SELECT * FROM ?_host WHERE BAN='1'";
$Sql  = new Query($Query);
while ($Row=$Sql->Row()) $IgnoredRefHosts[]=$Row;

$IgnoredAgents=array();
$IgnoredAgentGroups=array();
$Query = "SELECT * FROM ?_visitor_agent_browser WHERE BAN='1'";
$Sql  = new Query($Query);
while ($Row=$Sql->Row()) $IgnoredAgentGroups[]=$Row;
$Query = "SELECT * FROM ?_visitor_agent WHERE BAN='1'";
$Sql  = new Query($Query);
while ($Row=$Sql->Row()) $IgnoredAgents[]=$Row;

include $nsTemplate->Inc();

?>
Return current item: Stuffed Tracker - Web Traffic Monitoring & Analysis