function renderExtraWatchAgent()
 {
     $output = "";
     $extraWatch = new ExtraWatchMain();
     require_once JPATH_BASE . DS . "components" . DS . "com_extrawatch" . DS . "lang" . DS . $extraWatch->config->getLanguage() . ".php";
     if (EXTRAWATCH_DEBUG) {
         $output .= "<span style='color: #ff3333'>" . _EW_DESC_DEBUG . "</span><br/>";
     }
     $extraWatch->block->checkPostRequestForSpam(ExtraWatchHelper::requestGet());
     ///
     $extraWatch->block->checkPostRequestForSpam(ExtraWatchHelper::requestPost());
     ///
     try {
         $extraWatch->visit->insertVisit();
     } catch (ExtraWatchIPBlockedException $e) {
         die($this->config->getConfigValue('EXTRAWATCH_BLOCKING_MESSAGE'));
     }
     /*
      * The following piece of code identifies the userAgent and inserts the backlink to extrawatch.com  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
      * I would really appreciate, that you would keep the this unchanged.  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
      * It took me some time to create and maintain this component and to share it with everyone.  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
      * This is the least you could kindly do. Thank you.  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
      *
      * CodeGravity.com  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
      */
     $output = "";
     // reset output;
     $title = "";
     if (!_EW_CLOUD_MODE) {
         $title = "Heatmap, Real-time analytics, Conversion tracking and anti-spam for Joomla, Wordpress, Drupal, Magento and Prestashop";
     }
     $output .= $extraWatch->helper->renderHTMLCodeSnippet(_EW_PROJECT_ID);
     return $output;
 }
 function renderInfoPanel($renderUpdatesTraffic = FALSE)
 {
     $countToday = $this->extraWatch->block->getBlockedCountByDate($this->extraWatch->date->jwDateToday());
     $output = "";
     if (TRUE) {
         $output = sprintf("<br/><div style='border: 1px solid #ffff00; background-color: #ffffdd; width: 90%%;'>" . _EW_ANTISPAM_BLOCKED, (int) $countToday, (int) $this->extraWatch->block->getBlockedCountTotal());
         if ($renderUpdatesTraffic) {
             $output .= ". ";
             $output .= _EW_TRAFFIC_AJAX . sprintf(": %.3f", ExtraWatchHelper::requestGet('traffic') / 1024 / 1024) . " MB";
         }
         $clickCountToday = $this->extraWatch->heatmap->getHeatmapClickCountByDate($this->extraWatch->date->jwDateToday());
         $output .= sprintf(" &nbsp;" . _EW_VISITS_HEATMAP_CLICK_COUNT, (int) $clickCountToday);
         $output .= "</div>";
     }
     return $output;
 }
 /**
  * visitor
  */
 function getJoinedURIRows($bots, $inactive, $ipFilter = FALSE)
 {
     if ($bots) {
         $browserCondition = "is NULL";
         $limit = $this->config->getConfigValue("EXTRAWATCH_LIMIT_BOTS");
     } else {
         $browserCondition = "is not NULL";
         $limit = $this->config->getConfigValue("EXTRAWATCH_LIMIT_VISITORS");
     }
     $count = $this->config->getConfigValue('EXTRAWATCH_HISTORY_MAX_VALUES');
     $actualPage = (int) ExtraWatchHelper::requestGet('pageNum');
     ///
     $actualRecord = $actualPage * $count;
     $limit = $actualRecord . "," . $count;
     $query = sprintf("SELECT *, #__extrawatch_history.id as visitId FROM #__extrawatch_history LEFT JOIN #__extrawatch_uri_history ON #__extrawatch_history.id = #__extrawatch_uri_history.fk WHERE #__extrawatch_history.browser %s order by #__extrawatch_history.id desc, #__extrawatch_uri_history.timestamp desc limit %s", $this->database->getEscaped($browserCondition), $this->database->getEscaped($limit));
     $rows = $this->database->objectListQuery($query);
     return $rows;
 }
 function renderHistoryNavigation()
 {
     $pageNumFromRequest = (int) @ExtraWatchHelper::requestGet('pageNum');
     $increment = $this->extraWatch->config->getConfigValue('EXTRAWATCH_HISTORY_MAX_VALUES');
     $count = $this->visitHistory->getHistoryCount();
     $maxPageCount = 0;
     if ((int) $increment) {
         $maxPageCount = floor($count / $increment);
     }
     $maxPages = 20;
     if (!$pageNumFromRequest) {
         $pageNumFromRequest = 0;
     }
     $output = "";
     $output .= "<table width='100%'><tr><td>";
     if (isset($pageNumFromRequest) && $pageNumFromRequest > 0) {
         $pageNumPrev = $pageNumFromRequest - 1;
     }
     $output .= $this->renderPageLink(@$pageNumPrev, "&lt;&lt;" . _EW_HISTORY_PREVIOUS, @$pageNumFromRequest);
     $output .= $this->renderPageLink(0, 0, $pageNumFromRequest) . " ... ";
     $j = 0;
     for ($i = $pageNumFromRequest - floor($maxPages / 2); $i < $maxPageCount; $i++) {
         if ($i > 0 && $i < $maxPageCount) {
             $pageNum = $i;
             $output .= $this->renderPageLink($pageNum, $pageNum, $pageNumFromRequest);
             if ($j > $maxPages) {
                 break;
             }
             $j++;
         }
     }
     $output .= "... " . $this->renderPageLink($maxPageCount, $maxPageCount, $pageNumFromRequest);
     if (isset($pageNumFromRequest) && $pageNumFromRequest < $maxPageCount) {
         $pageNumNext = $pageNumFromRequest + 1;
     }
     $output .= $this->renderPageLink(@$pageNumNext, _EW_HISTORY_NEXT . "&gt;&gt;", $pageNumFromRequest);
     $output .= "</td></tr></table>";
     echo $output;
 }
Beispiel #5
0
$extraWatch = new ExtraWatchMain();
$extraWatch->helper->setNoindexHttpHeaders();
//setting explicitly for ajax requests
$extraWatchHTML = new ExtraWatchHTML();
$referer = ExtraWatchInput::validate(_EW_INPUT_REFERRER, ExtraWatchHelper::requestGet("ref"));
///
$title = ExtraWatchHelper::requestGet("title");
///
$uri = ExtraWatchInput::validate(_EW_INPUT_URI, ExtraWatchHelper::requestGet("uri"));
///
$queryString = ExtraWatchHelper::requestGet("referringQuery");
///
if ($queryString) {
    $uri .= "?" . $queryString;
}
$params = ExtraWatchHelper::requestGet("getParams");
///
$uri = ExtraWatchInput::validate(_EW_INPUT_URI, ExtraWatchHelper::unescapeSlash($uri));
///
$title = ExtraWatchHelper::unescapeSlash($title);
///
$referer = ExtraWatchInput::validate(_EW_INPUT_REFERRER, ExtraWatchHelper::unescapeSlash($referer));
///
$params = ExtraWatchHelper::unescapeSlash($params);
///
$uri = $uri . $params;
//adding params to uri
$env = ExtraWatchEnvFactory::getEnvironment();
$modulePath = realpath(dirname(__FILE__) . DS . ".." . DS . ".." . DS . ".." . DS);
ExtraWatchLog::debug("img.php - referer: {$referer} title: {$title} uri: {$uri} prams: " . print_r($params, true));
if (@_EW_CLOUD_MODE) {
include_once JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "includes.php";
$extraWatch = new ExtraWatchMain();
$extraWatch->helper->setNoindexHttpHeaders();
//setting explicitly for ajax requests
$extraWatchHTML = new ExtraWatchHTML();
$extraWatchTrendHTML = new ExtraWatchTrendHTML($extraWatch);
$extraWatch->block->checkBackendTokenFromUrl();
$extraWatch->config->initializeTranslations();
//echo $extraWatchHTML->renderAdminStyles();
echo $extraWatchHTML->renderPrint();
echo $extraWatchHTML->renderCloseWindow();
$group = (int) @ExtraWatchHelper::requestGet('group');
///
$name = ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, urldecode(@ExtraWatchHelper::requestGet('name')));
///
$date = (int) @ExtraWatchHelper::requestGet('date');
///
?>
<center>
<h2><?php 
echo htmlentities($name);
?>
</h2>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
</center>
<br/><br/>
<table>
<tr>
<td>
<div id='trendChartDaily' style='width:100%; margin-top:50px; height: 35%;'></div>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
</td>
</tr>
 static function request($key = null)
 {
     $value = ExtraWatchHelper::requestGet($key);
     if (!$value) {
         $value = ExtraWatchHelper::requestPost($key);
     }
     return $value;
 }
function extrawatch_mainController($task = "")
{
    $current_error_reporting = error_reporting();
    error_reporting(E_ALL & ~(E_STRICT | E_NOTICE));
    $extraWatch = new ExtraWatchMain();
    $extraWatchHTML = new ExtraWatchHTML();
    $extraWatchGoalHTML = new ExtraWatchGoalHTML($extraWatch);
    $extraWatchTrendHTML = new ExtraWatchTrendHTML($extraWatch);
    $env = ExtraWatchEnvFactory::getEnvironment();
    $queryParams = ExtraWatchHelper::getUrlQueryParams();
    $action = ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, @$queryParams['action']);
    ///
    if (!$task) {
        $task = ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, @$queryParams['task']);
        ///
    }
    ExtraWatchHelper::checkIfRequestPathAllowed($extraWatch, $env, $task);
    $taskFromNavigation = ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, @ExtraWatchHelper::request('task'));
    ///
    if ($taskFromNavigation) {
        $task = $taskFromNavigation;
    }
    $option = ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, @ExtraWatchHelper::requestGet('option'));
    ///
    $result = ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, @ExtraWatchHelper::requestGet('result'));
    ///
    $params = @$queryParams['params'];
    ///
    $output = "";
    if (!$extraWatch->config->getLiveSite()) {
        $extraWatch->config->setLiveSite($env->getRootSite());
        if ($env->getRootSite() != $extraWatch->config->getLiveSite()) {
            die("<span style='color: red; font-weight: bold;'>Error: It was not possible to write data to the database! Check your database permissions</span>");
        }
    }
    $extraWatch->setup->runAdditionalSQLScripts();
    $extraWatch->config->saveRandValue();
    switch ($task) {
        case "ajax":
            $includePath = JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "ajax";
            ExtraWatchHelper::checkIfFileExistsInDir($includePath, $action . ".php");
            if ($action == "download") {
                if (ExtraWatchInput::validate(_EW_INPUT_FILE_PATH, $includePath . DS . $action . ".php")) {
                    include_once $includePath . DS . $action . ".php";
                }
                die;
            } else {
                $extraWatch->config->validateRequestToken($queryParams);
                $output = ExtraWatchHelper::get_include_contents("ajax" . DS . $action . ".php", array("params" => $params));
                die($output);
            }
            break;
        case "js":
            $extraWatch->config->validateRequestToken($queryParams);
            $includePath = "js";
            ExtraWatchHelper::checkIfFileExistsInDir(JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . $includePath, $action . ".php");
            $output = ExtraWatchHelper::get_include_contents($includePath . DS . $action . ".php", array());
            die($output);
            break;
        case "useFreeVersion":
            $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
            $extraWatch->config->useFreeVersion();
            $extraWatch->config->saveVersionIntoDatabase();
            $extraWatch->config->setLiveSite($env->getRootSite());
            break;
        case "activate":
            $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
            if ($action == "codecanyon") {
                $extraWatch->config->saveConfigValue("EXTRAWATCH_MARKETPLACE", $action);
            }
            $extraWatch->config->activate(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestGet('key')));
            ///
            $extraWatch->config->saveVersionIntoDatabase();
            $extraWatch->config->setLiveSite($env->getRootSite());
            break;
        case "licenseAccepted":
            $extraWatch->config->setLiveSite($env->getRootSite());
            $extraWatch->config->setLicenseAccepted();
            $extraWatch->config->setHtAccessPermissions();
            $extraWatch->config->saveVersionIntoDatabase();
            break;
        case "resetLiveSite":
            $extraWatch->block->checkPermissions();
            $extraWatch->config->setLiveSite($env->getRootSite());
            break;
    }
    if (!_EW_CLOUD_MODE && !$extraWatch->config->checkLicenseAccepted()) {
        //remove check license accepted if cloud mode
        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
        $output .= $extraWatchHTML->renderHeader($extraWatch);
        $output .= $extraWatchHTML->renderAcceptLicense();
        return $output;
    } else {
        if (!_EW_CLOUD_MODE && (!$extraWatch->config->isFree() && !$extraWatch->config->isAdFree() && !$extraWatch->config->isUnregistered())) {
            $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
            $output .= $extraWatchHTML->renderHeader($extraWatch);
            $output .= $extraWatchHTML->renderAdFreeLicense();
            return $output;
        }
        switch ($task) {
            case "storeIpInfoDbKey":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $keyValue = ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestPost('storeIpInfoDbKey'));
                ///
                if ($keyValue) {
                    $extraWatch->config->saveConfigValue("EXTRAWATCH_IPINFODB_KEY", $keyValue);
                } else {
                    $output = "<br/><div style='border: 1px solid red; width: 50%; padding: 10px;'>" . _EW_STATS_MAP_INVALID_KEY . "</div>";
                }
                $output .= $extraWatchHTML->renderLocation();
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "users":
                switch ($action) {
                    case "save":
                        $result = $extraWatch->helper->saveUserSettings(ExtraWatchHelper::requestPost());
                        ///
                    default:
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchHTML->renderUsers($extraWatch);
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                }
                break;
            case "update":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderUpdate();
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "sizes":
                if (!$extraWatch->config->isFree()) {
                    $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                    $output .= $extraWatchHTML->renderHeader($extraWatch);
                    $output .= $extraWatchHTML->renderSizes();
                    $output .= $extraWatchHTML->renderFooter();
                }
                break;
            case "seo":
                switch ($action) {
                    case "save":
                        $result = $extraWatch->helper->saveSEOSettings(ExtraWatchHelper::requestPost());
                        ///
                    default:
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchHTML->renderSEO();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                }
                break;
            case "graphs":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $extraWatchTrendHTML = new ExtraWatchTrendHTML($extraWatch);
                $output .= $extraWatchHTML->renderGraphs($extraWatchTrendHTML);
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "trends":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $extraWatchTrendHTML->renderTrends();
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "credits":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderCredits();
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "goals":
                switch ($action) {
                    case "insert":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchGoalHTML->renderBackToGoals();
                        $output .= $extraWatchGoalHTML->renderGoalsInsert((int) @ExtraWatchHelper::requestGet('id'), (int) @ExtraWatchHelper::requestGet('postid'));
                        ///
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "save":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $extraWatch->goal->saveGoal(ExtraWatchHelper::requestPost());
                        ///
                        $output .= $extraWatchGoalHTML->renderGoals(@$result);
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "edit":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchGoalHTML->renderBackToGoals();
                        $output .= $extraWatchGoalHTML->renderGoalEdit(@ExtraWatchHelper::requestGet('goalId'));
                        ///
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "delete":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $result = $extraWatch->goal->deleteGoal(@ExtraWatchHelper::requestGet('goalId'));
                        ///
                        $output .= $extraWatchGoalHTML->renderGoals(@$result);
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "enable":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $result = $extraWatch->goal->enableGoal(@ExtraWatchHelper::requestGet('goalId'));
                        ///
                        $output .= $extraWatchGoalHTML->renderGoals(@$result);
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "disable":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $result = $extraWatch->goal->disableGoal(@ExtraWatchHelper::requestGet('goalId'));
                        ///
                        $output .= $extraWatchGoalHTML->renderGoals(@$result);
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "export":
                        //$output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        //$output .= $extraWatchHTML->renderHeader($extraWatch);
                        $extraWatch->goal->exportGoals(ExtraWatchHelper::requestPost());
                        ///
                        $extraWatchGoalHTML->renderExportGoals(@$result);
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "import":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchGoalHTML->renderImportGoals();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "saveImportGoal":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $extraWatch->goal->saveImportGoal(ExtraWatchHelper::requestPost());
                        ///
                        $output .= $extraWatchGoalHTML->renderGoals(@$result);
                        $output .= $extraWatchHTML->renderFooter();
                    default:
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchGoalHTML->renderGoals(@$result);
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                }
                break;
            case "settings":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderSettings(@$result);
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "settingsSave":
                $result = $extraWatch->helper->saveSettings(ExtraWatchHelper::requestPost());
                ///
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderSettings(@$result);
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "resetData":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $result = $extraWatch->helper->resetData(ExtraWatchHelper::requestPost());
                ///
                $output .= $extraWatchHTML->renderResetData($result);
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "antiSpam":
                switch ($action) {
                    case "toggleBlocking":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $ip = @ExtraWatchHelper::requestGet('ip');
                        ///
                        $extraWatch->block->extrawatch_blockIpToggle($ip);
                        $output .= $extraWatchHTML->renderAntiSpam();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "save":
                        $numRecordsImported = $extraWatch->block->saveBadWordsList(ExtraWatchHelper::requestPost());
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchHTML->renderAntiSpam();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "antiSpamSave":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= nl2br($extraWatch->block->saveImportAntiSpamIp(ExtraWatchHelper::requestPost()));
                        $output .= $extraWatchHTML->renderAntiSpam();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    default:
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchHTML->renderAntiSpam();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                }
                break;
            case "status":
                if (!$extraWatch->config->isFree()) {
                    $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                    $output .= $extraWatchHTML->renderHeader($extraWatch);
                    $output .= $extraWatchHTML->renderStatus();
                    $output .= $extraWatchHTML->renderFooter();
                }
                break;
                /*			case "upgrade" :  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                     {
                         $output .= $extraWatchHTML->renderAdminStyles($extraWatch);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                         $output .= $extraWatchHTML->renderHeader($extraWatch);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                         $output .= $extraWatchHTML->renderUpgrade();  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                         break;  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                     }*/
            /*			case "upgrade" :  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                 {
                     $output .= $extraWatchHTML->renderAdminStyles($extraWatch);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                     $output .= $extraWatchHTML->renderHeader($extraWatch);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                     $output .= $extraWatchHTML->renderUpgrade();  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                     break;  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                 }*/
            case "license":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderAdFreeLicense();
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "history":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderVisitsHistory();
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "flow":
                if (!$extraWatch->config->isFree()) {
                    $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                    $output .= $extraWatchHTML->renderHeader($extraWatch);
                    $output .= $extraWatchHTML->renderFlow();
                    $output .= $extraWatchHTML->renderFooter();
                }
                break;
            case "emails":
                switch ($action) {
                    case "save":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $result = $extraWatch->helper->saveEmailSettings(ExtraWatchHelper::requestPost());
                        ///
                        $output .= $extraWatchHTML->renderEmails();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "send":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $extraWatch->visit->sendNightlyEmails();
                        $output .= $extraWatchHTML->renderEmails();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    default:
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchHTML->renderEmails();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                }
                break;
            case "heatmap":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderHeatMap();
                $output .= $extraWatchHTML->renderFooter();
                return $output;
                break;
            case "clicks":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderClicks();
                $output .= $extraWatchHTML->renderFooter();
                return $output;
                break;
            case "downloads":
                $extraWatchDownloads = new ExtraWatchDownloads($extraWatch->database);
                $extraWatchDownloadsHTML = new ExtraWatchDownloadsHTML($extraWatch->database);
                switch ($action) {
                    case "addExtension":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloadsHTML->renderAddExtension();
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "saveAddExtension":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloads->addExtension(ExtraWatchHelper::requestPost('extname'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        return $output;
                        break;
                    case "editExtension":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloadsHTML->renderEditExtension(ExtraWatchHelper::requestGet('eid'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "saveEditExtension":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloads->updateExtension(ExtraWatchHelper::requestPost('eid'), ExtraWatchHelper::requestPost('extname'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        return $output;
                        break;
                    case "deleteExtension":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloads->deleteExtension(ExtraWatchHelper::requestGet('co'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "addFile":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloadsHTML->renderAddFile();
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "editFile":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloadsHTML->renderEditFile(ExtraWatchHelper::requestGet('did'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    case "saveEditFile":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloads->updateFilePath(ExtraWatchHelper::requestPost('did'), ExtraWatchHelper::requestPost('filepathname'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        return $output;
                        break;
                    case "saveAddFile":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloads->addFilePath(ExtraWatchHelper::requestPost('filepathname'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        return $output;
                        break;
                    case "deleteFile":
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchDownloads->deleteFilePath(ExtraWatchHelper::requestGet('co'));
                        ///
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        break;
                    default:
                        $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                        $output .= $extraWatchHTML->renderHeader($extraWatch);
                        $output .= $extraWatchHTML->renderDownloads();
                        $output .= $extraWatchHTML->renderFooter();
                        return $output;
                        break;
                }
                break;
            case "location":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderLocation();
                $output .= $extraWatchHTML->renderFooter();
                break;
            case "stats":
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderStats();
                $output .= $extraWatchHTML->renderFooter();
                break;
            default:
                $output .= $extraWatchHTML->renderAdminStyles($extraWatch);
                $output .= $extraWatchHTML->renderHeader($extraWatch);
                $output .= $extraWatchHTML->renderBody($option);
                $output .= $extraWatchHTML->renderFooter();
                return $output;
                break;
        }
    }
    error_reporting($current_error_reporting);
    return $output;
}
?>
 >
    <tr>
        <td rowspan="2" id="heatmapElementClick" valign='top' align='left' width='80%'>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
            <?php 
echo _EW_HEATMAP_LOADING;
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
            <br/><br/>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
        </td>
    </tr>
</table>


<?php 
$day = ExtraWatchHelper::requestGet('day');
if (!$day) {
    $day = $extraWatch->date->jwDateToday();
    // yesterday by default, because it contains
}
?>
<h2><?php 
echo _EW_CLICK_AREAS_FOR;
echo $extraWatch->date->getDateByDay($day);
?>
</h2>
<i>This section allows you navigate between days and see the differences in percents, charts of most popular clicks by hovering on the blue charts icon</i>
<table width='700px' border="0">
    <tr>
        <td colspan="5">  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
            <?php 
Beispiel #10
0
    $week = (int) @ExtraWatchHelper::requestGet('week');
    ///
} else {
    $week = $extraWatch->date->getWeekSince1970($extraWatch->date->getUserTimestamp());
}
$prevWeek = $week - 1;
$nextWeek = $week + 1;
ExtraWatchLog::debug("day: {$day}");
$t1 = time() + microtime();
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
<table border='0' cellpadding='1' cellspacing='0' width='100%'>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  

  <?php 
require_once JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "view" . DS . "stats-header.php";
if (@ExtraWatchHelper::requestGet('tab') == "1") {
    require_once JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "view" . DS . "stats-total.php";
} else {
    require_once JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "view" . DS . "stats-today.php";
}
require_once JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "view" . DS . "stats-footer.php";
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  

</table>
<br/><br/>
<span style='color: #ddd'><?php 
echo _EW_RENDERED_IN;
?>
 <?php 
echo sprintf("%.2f", time() + microtime() - $t1);
 function renderDateControlGet($task, $day = 0)
 {
     if (!$day) {
         if (@ExtraWatchHelper::requestGet('day')) {
             $day = @ExtraWatchHelper::requestGet('day');
         } else {
             $day = $this->extraWatch->date->jwDateToday();
         }
     }
     $today = $this->extraWatch->date->jwDateToday();
     $prev = $day - 1;
     $next = $day + 1;
     include JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "view" . DS . "datecontrolget.php";
 }
<?php

/**
 * @file
 * ExtraWatch - A real-time ajax monitor and live stats  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @package ExtraWatch  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @version 2.3  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @revision 2572  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @license http://www.gnu.org/licenses/gpl-3.0.txt     GNU General Public License v3  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @copyright (C) 2015 by CodeGravity.com - All rights reserved!  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @website http://www.codegravity.com  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 */
defined('_JEXEC') or die('Restricted access');
?>

<iframe width="<?php 
echo $extraWatch->config->getConfigValue('EXTRAWATCH_TOOLTIP_WIDTH');
?>
"
        height="<?php 
echo $extraWatch->config->getConfigValue('EXTRAWATCH_TOOLTIP_HEIGHT');
?>
" frameborder="0"
        marginwidth="0" marginheight="0"
        src="<?php 
echo $extraWatch->helper->getIP2LocationURL(@ExtraWatchHelper::requestGet('ip'));
?>
"/>
 function renderTrends()
 {
     $group = @ExtraWatchHelper::requestGet('group');
     $name = urldecode(@ExtraWatchHelper::requestGet('name'));
     $date = @ExtraWatchHelper::requestGet('date');
     $output = "";
     $output .= "<br/><br/>";
     $output .= "<br/><br/>";
     $output .= "<br/><br/>";
     $output .= "<br/><br/>";
     $output .= $this->renderDayTrends($group, $name, $date);
     $output .= "<br/><br/>";
     //$output .= $this->renderWeekTrends($group, $name, $date);
     return $output;
 }
Beispiel #14
0
<?php

/**
 * @file
 * ExtraWatch - A real-time ajax monitor and live stats  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @package ExtraWatch  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @version 2.3  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @revision 2572  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @license http://www.gnu.org/licenses/gpl-3.0.txt     GNU General Public License v3  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @copyright (C) 2015 by CodeGravity.com - All rights reserved!  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 * @website http://www.codegravity.com  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
 */
defined('_JEXEC') or die('Restricted access');
/*define('DS', DIRECTORY_SEPARATOR);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
$jBasePath = realpath(dirname(__FILE__) . DS . ".." . DS . ".." . DS . "..". DS);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
define('JPATH_BASE2', $jBasePath);*/
include_once JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "includes.php";
$extraWatch = new ExtraWatchMain();
$extraWatch->helper->setNoindexHttpHeaders();
//setting explicitly for ajax requests
$extraWatchHTML = new ExtraWatchHTML();
$extraWatch->block->checkBackendTokenFromUrl();
$extraWatch->config->initializeTranslations();
$extraWatch->block->extrawatch_blockIpToggle(ExtraWatchInput::validate(_EW_INPUT_IP, @ExtraWatchHelper::requestGet('ip')));
///**
 function renderExpand($element, $total = FALSE)
 {
     $elementSuffix = "";
     if (@$total) {
         $elementSuffix = "_total";
     }
     if (@ExtraWatchHelper::requestGet($element . $elementSuffix) == "false" || !@ExtraWatchHelper::requestGet($element . $elementSuffix)) {
         $operation = "expand";
     } else {
         $operation = "collapse";
     }
     $operationTranslated = constant("_EW_STATS_" . strtoupper($operation));
     $elementTranslated = constant("_EW_STATS_" . strtoupper($element));
     $output = "<a name='{$element}'></a><a href=\"javascript:extrawatch_expand('{$element}" . $elementSuffix . "')\" id='{$element}" . $elementSuffix . "'><img src='" . $this->extraWatch->config->getLiveSiteWithSuffix() . "components/com_extrawatch/img/icons/{$operation}.gif' border='0' alt='{$operation}'/>{$operationTranslated}&nbsp;{$elementTranslated}</a>";
     return $output;
 }
 /**
  * goals
  */
 function checkGoals($title, $username, $ip, $came_from, $liveSite = "", $clickedXpath = "")
 {
     $query = sprintf("select * from #__extrawatch_goals");
     $rows = $this->database->objectListQuery($query);
     if (@$rows) {
         foreach ($rows as $row) {
             $achieved = array();
             if ($row->disabled) {
                 continue;
             }
             if (@trim(@$row->clicked_element_xpath_condition)) {
                 @($achieved[clicked_element_xpath_condition] = FALSE);
                 if (@$this->helper->wildcardSearch(trim(@$row->clicked_element_xpath_condition), $clickedXpath)) {
                     @($achieved[clicked_element_xpath_condition] = TRUE);
                 }
             } else {
                 if (@trim($row->uri_inversed) == "on") {
                     if (@trim($row->uri_condition)) {
                         @($achieved[uri_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->uri_condition, trim($this->helper->getURI()))) {
                         } else {
                             @($achieved[uri_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->uri_condition)) {
                         @($achieved[uri_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->uri_condition, trim($this->helper->getURI()))) {
                             @($achieved[uri_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->get_inversed) == "on") {
                     if (@trim($row->get_condition)) {
                         @($achieved[get_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->get_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestGet($row->get_var))))) {
                             ///
                         } else {
                             if ($row->get_var == "*") {
                                 $found = FALSE;
                                 foreach (ExtraWatchHelper::requestGet() as $get) {
                                     ///
                                     if ($this->helper->wildcardSearch($row->get_condition, trim($get))) {
                                         $found = TRUE;
                                     }
                                 }
                                 if ($found) {
                                     @($achieved[uri_condition] = FALSE);
                                 }
                             } else {
                                 @($achieved[uri_condition] = TRUE);
                             }
                         }
                     }
                 } else {
                     if (@trim($row->get_condition)) {
                         @($achieved[get_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->get_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestGet($row->get_var))))) {
                             ///
                             @($achieved[get_condition] = TRUE);
                         } else {
                             if ($row->get_var == "*") {
                                 foreach (ExtraWatchHelper::requestGet() as $get) {
                                     ///
                                     if ($this->helper->wildcardSearch($row->get_condition, trim($get))) {
                                         @($achieved[get_condition] = TRUE);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if (@trim($row->post_inversed) == "on") {
                     if (@trim($row->post_condition)) {
                         @($achieved[post_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->post_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestPost($row->post_var))))) {
                             ///
                         } else {
                             if ($row->post_var == "*") {
                                 $found = FALSE;
                                 foreach (ExtraWatchHelper::requestPost() as $post) {
                                     ///
                                     if ($this->helper->wildcardSearch($row->post_condition, trim($post))) {
                                         ///
                                         $found = TRUE;
                                     }
                                 }
                                 if ($found) {
                                     @($achieved[post_condition] = FALSE);
                                 }
                             } else {
                                 @($achieved[post_condition] = TRUE);
                             }
                         }
                     }
                 } else {
                     if (@trim($row->post_condition)) {
                         @($achieved[post_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->post_condition, trim(ExtraWatchInput::validate(_EW_INPUT_ONE_STRING, ExtraWatchHelper::requestPost($row->post_var))))) {
                             ///
                             @($achieved[post_condition] = TRUE);
                         } else {
                             if ($row->post_var == "*") {
                                 foreach (ExtraWatchHelper::requestPost() as $post) {
                                     if ($this->helper->wildcardSearch($row->post_condition, trim($post))) {
                                         @($achieved[post_condition] = TRUE);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if (@trim($row->title_inversed) == "on") {
                     if (@trim($row->title_condition)) {
                         @($achieved[title_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->title_condition, trim($title))) {
                         } else {
                             @($achieved[title_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->title_condition)) {
                         @($achieved[title_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->title_condition, trim($title))) {
                             @($achieved[title_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->username_inversed) == "on") {
                     if (@trim($row->username_condition)) {
                         @($achieved[username_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->username_condition, trim($username))) {
                         } else {
                             @($achieved[username_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->username_condition)) {
                         @($achieved[username_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->username_condition, trim($username))) {
                             @($achieved[username_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->ip_inversed) == "on") {
                     if (@trim($row->ip_condition)) {
                         @($achieved[ip_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->ip_condition, trim($ip))) {
                         } else {
                             @($achieved[ip_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->ip_condition)) {
                         @($achieved[ip_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->ip_condition, trim($ip))) {
                             @($achieved[ip_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->came_from_inversed) == "on") {
                     if (@trim($row->came_from_condition)) {
                         @($achieved[came_from_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->came_from_condition, trim($came_from)) || $this->helper->wildcardSearch($liveSite . $row->came_from_condition, trim($came_from))) {
                         } else {
                             @($achieved[came_from_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->came_from_condition)) {
                         @($achieved[came_from_condition] = FALSE);
                         if (@$this->helper->wildcardSearch($row->came_from_condition, trim($came_from)) || $this->helper->wildcardSearch($liveSite . $row->came_from_condition, trim($came_from))) {
                             @($achieved[came_from_condition] = TRUE);
                         }
                     }
                 }
                 if (@trim($row->country_inversed) == "on") {
                     if (@trim($row->country_condition)) {
                         @($achieved[came_from_condition] = FALSE);
                         $country = $this->helper->countryByIp($ip);
                         //performance optim. - checking country only if there is some condition
                         if (@$this->helper->wildcardSearch($row->country_condition, trim($country))) {
                         } else {
                             @($achieved[came_from_condition] = TRUE);
                         }
                     }
                 } else {
                     if (@trim($row->country_condition)) {
                         @($achieved[country_condition] = FALSE);
                         $country = $this->helper->countryByIp($ip);
                         //performance optim. - checking country only if there is some condition
                         if (@$this->helper->wildcardSearch($row->country_condition, trim($country))) {
                             @($achieved[country_condition] = TRUE);
                         }
                     }
                 }
             }
             if ($this->evaluateAchievedGoals($achieved)) {
                 $this->stat->increaseKeyValueInGroup(EW_DB_KEY_GOALS, $row->id);
                 $this->addIp2GoalId($ip, $row->id);
                 if ($this->config->getCheckboxBooleanValue($row->send_email)) {
                     $totalAchievedCountToday = $this->stat->getIntValueByNameAndValue(EW_DB_KEY_GOALS, $row->id);
                     $email = $this->config->getConfigValue("EXTRAWATCH_EMAIL_REPORTS_ADDRESS");
                     $env = ExtraWatchInput::validate(_EW_INPUT_ENV, ExtraWatchEnvFactory::getEnvironment());
                     $ip = ExtraWatchInput::validate(_EW_INPUT_IP, ExtraWatchVisit::getRemoteIPAddress());
                     ///
                     $subject = sprintf(_EW_GOAL_EMAIL_SUBJECT, $row->name, $totalAchievedCountToday);
                     require_once realpath(dirname(__FILE__)) . DS . "html" . DS . "class.extrawatch.visit.html.php";
                     $extraWatch = new ExtraWatchMain();
                     $extraWatchVisitHTML = new ExtraWatchVisitHTML($extraWatch);
                     $visitsOutput = $extraWatchVisitHTML->renderTable(FALSE, 0, $ip, TRUE);
                     $visitsOutput .= $extraWatchVisitHTML->renderTable(FALSE, 1, $ip, TRUE);
                     $body = "ip: <b>{$ip}</b><br/>{$visitsOutput}";
                     ExtraWatchHelper::sendEmail($env, $email, $email, $subject, $body);
                 }
                 if (@$row->redirect) {
                     $env = ExtraWatchInput::validate(_EW_INPUT_ENV, ExtraWatchEnvFactory::getEnvironment());
                     ///
                     $env->redirect(@$row->redirect);
                 }
                 if (@$row->block) {
                     $blockReason = sprintf(_EW_BLOCKED_BASED_ON_GOAL, $row->id);
                     $this->block->blockIp($ip, $blockReason);
                     try {
                         $this->block->dieWithBlockingMessage($ip);
                     } catch (ExtraWatchIPBlockedException $exception) {
                         die($exception->getBlockingMessage());
                     }
                 }
             }
         }
     }
 }
 function isHeatmapLoaded()
 {
     foreach (ExtraWatchHelper::requestGet() as $key => $value) {
         if (stristr($key, ExtraWatchHeatmap::HEATMAP_PARAM_NAME)) {
             return TRUE;
         }
     }
     return FALSE;
 }
Beispiel #18
0
                <br/>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                <?php 
if (@$result) {
    echo "<span style='color: green;'>" . _EW_SETTINGS_SAVED . "</span><br/><br/>";
}
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                <input type='submit' name='submitForm' class="btn btn-primary" value='  <?php 
echo _EW_SETTINGS_SAVE;
?>
  '/>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
            </td>
        </tr>
    </table>
    <input name='day' type='hidden' value="<?php 
echo ExtraWatchHelper::requestGet("day");
?>
" />  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
    <input name='form_key' type='hidden' value="<?php 
echo $extraWatch->env->getFormKey();
?>
" />  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
</form>
<br/><br/>

<h2>SEO Keywords and Position Report</h2>
<i>This section displays keywords by which users found your website. If you see the #encrypted# instead of a real keywords, the reason is, that google has started encrypting these keywords.
You can read more about it <a href="http://searchenginewatch.com/article/2300838/Google-Keyword-Not-Provided-How-to-Move-Forward" target="_blank">here</a>.
This report is also useful without knowing the exact keywords. You can see the positions in search results from which the actual users came from.</i>
</i><br/>
<?php 
    </tr>
    <tr>
      <td valign='top'><?php 
    echo $values;
    ?>
</td>
    </tr>
    <tr>
      <td colspan='4'>&nbsp;</td>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
    </tr>

    <?php 
}
?>

</table>

<table>
  <?php 
echo $extraWatchBlockHTML->renderBlockedIPs($day, @ExtraWatchHelper::requestGet('ip_blocking_title'));
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
</table>
<br/>
<hr size='1' width='100%'/>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
<?php 
echo $extraWatchHTML->renderDateControl();
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  

    <td colspan='4'>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  

      <table width='100%'>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
        <tr>
          <td class='ewCentered'
              class='<?php 
echo $extraWatchStatHTML->renderTabClass("0", @ExtraWatchHelper::requestGet('tab'));
?>
'>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
            <?php 
echo $extraWatchStatHTML->renderSwitched("0", _EW_STATS_DAILY, @ExtraWatchHelper::requestGet('tab'));
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
          </td>
          <td class='ewCentered'
              class='<?php 
echo $extraWatchStatHTML->renderTabClass("1", @ExtraWatchHelper::requestGet('tab'));
?>
'>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
            <?php 
echo $extraWatchStatHTML->renderSwitched("1", _EW_STATS_ALL_TIME, @ExtraWatchHelper::requestGet('tab'));
?>
  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
          </td>
          <td class='ewCentered' class='tab_none'>
          </td>
        </tr>
      </table>

</table>
 function renderGoalsInsert($id = null, $postid = null)
 {
     $values = "";
     if (isset($id) && $id != "") {
         $rows = $this->extraWatch->visit->getJoinedURIRowById($id);
         if (!$rows) {
             $rows = $this->visitHistory->getJoinedURIRowById($id);
         }
         $row = @$rows[0];
         if (@$row) {
             $values['uri_condition'] = $row->uri;
             $values['title_condition'] = $row->title;
             $values['username_condition'] = $row->username;
             $values['ip_condition'] = $row->ip;
             /*
                         if(sizeof($rows) > 1) {  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
             
                             $previousUriRow = $rows[1];  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                             $values['came_from_condition'] = $previousUriRow->uri;  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                         }  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
             */
             $values['came_from_condition'] = $row->referer;
             $values['country_condition'] = $this->extraWatch->helper->countryByIp($row->ip);
         }
     } else {
         if (@ExtraWatchHelper::requestGet('clicked_element_xpath_condition')) {
             $xpath = urldecode(@ExtraWatchHelper::requestGet('clicked_element_xpath_condition'));
             $values['clicked_element_xpath_condition'] = $xpath;
         } else {
             if (@ExtraWatchHelper::requestGet('country')) {
                 $country = urldecode(@ExtraWatchHelper::requestGet('country'));
                 $values['name'] = _EW_GOALS_COUNTRY . ": {$country}";
                 $values['country_condition'] = $country;
             } else {
                 if (@ExtraWatchHelper::requestGet('from') && @ExtraWatchHelper::requestGet('uri')) {
                     $from = urldecode(@ExtraWatchHelper::requestGet('from'));
                     $to = urldecode(@ExtraWatchHelper::requestGet('uri'));
                     $fromTitle = $this->extraWatch->visit->getTitleByUri($from);
                     if (@(!$fromTitle)) {
                         $fromTitle = $from;
                     }
                     $toTitle = $this->extraWatch->visit->getTitleByUri($to);
                     if (@(!$toTitle)) {
                         $toTitle = $to;
                     }
                     $values['name'] = _EW_STATS_FROM . ": {$fromTitle} " . " " . _EW_STATS_TO . ": {$toTitle}";
                     $values['came_from_condition'] = $from;
                     $values['uri_condition'] = $to;
                 } else {
                     if (@ExtraWatchHelper::requestGet('uri')) {
                         $to = urldecode(@ExtraWatchHelper::requestGet('uri'));
                         $toTitle = $this->extraWatch->visit->getTitleByUri($to);
                         if (!$toTitle) {
                             $toTitle = $to;
                         }
                         $values['name'] = _EW_STATS_TO . ": {$toTitle}";
                         $values['uri_condition'] = $to;
                     }
                 }
             }
         }
     }
     //START POST CODE MOD
     if (isset($postid)) {
         $query = sprintf("select * from #__extrawatch_uri_post where `id` = '%d' ", $postid);
         $rows = $this->extraWatch->visit->database->objectListQuery($query);
         $row = @$rows[0];
         if ($row && $row->type == 1) {
             $values['name'] = "Submits a form with variable: \"" . $row->key . "\" = \"" . $row->value . "\"";
             $values['post_var'] = $row->key;
             $values['post_condition'] = $row->value;
         } elseif ($row && $row->type == 2) {
             $values['name'] = "Opens page " . $uri . " with parameter: \"" . $row->key . "\" = \"" . $row->value . "\"";
             $values['get_var'] = $row->key;
             $values['get_condition'] = $row->value;
         }
     }
     //END POST CODE MOD
     return $this->renderGoalForm(_EW_GOALS_INSERT, $values);
 }
  <?php 
foreach (unserialize(EXTRAWATCH_STATS_ITEMS) as $key) {
    if ($key == 'ip' && !$extraWatch->config->getConfigValue('EXTRAWATCH_IP_STATS')) {
        continue;
    }
    ?>
    <tr>
      <td colspan='4'>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
        <u><?php 
    echo _EW_STATS_ALL_TIME . "&nbsp;";
    echo @constant('_EW_STATS_' . strtoupper($key));
    ?>
</u>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
      </td>
    </tr>
    <tr>
      <td valign='top'><?php 
    echo $extraWatchStatHTML->renderIntValuesByName($key, @ExtraWatchHelper::requestGet($key . "_total"), TRUE);
    ?>
</td>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
    </tr>
    <tr>
      <td colspan='4'>&nbsp;</td>  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
    </tr>

    <?php 
}
?>
</table>