style='<?php echo $style; ?> '><?php echo $extraWatchGoalHTML->renderEnabled($row->id, $row->disabled); ?> </td> <td class='ewCentered' style='<?php echo $style; ?> '><?php echo @$extraWatchGoalHTML->renderActionButtons($row->id); ?> </td> </tr> <?php } } ?> </tbody> </table> <br/><br/> <?php if (!$rows) { echo ExtraWatchHelper::renderNoData(); } ?> <br/><br/><br/><br/>
function renderGraphsForGroup($group = 0) { require_once JPATH_BASE2 . DS . "components" . DS . "com_extrawatch" . DS . "view" . DS . "trendtooltip.php"; return; $output = "<table border='0' width='80%'><tr><td>"; if (!$group) { $group = 10; //referers as first value in graphs } $date = $this->extraWatch->date->jwDateToday(); $rows = $this->findLatestGraphDataRecursively($group, $date, FALSE); $output .= $this->renderGraphSelectionForm($group); if (!$rows) { $output .= "<br/><br/><br/><br/><div style='text-align: center'>" . ExtraWatchHelper::renderNoData() . "</div><br/><br/><br/><br/>"; } foreach ($rows as $row) { $output .= "<br/><br/>"; $output .= $this->renderDayTrends($group, $row->name, $date); $output .= "<br/><br/>"; $output .= $this->renderWeekTrends($group, $row->name, $date); $output .= "<hr/><br/>"; } $output .= $this->renderGraphSelectionForm($group); $output .= "</td></tr></table>"; return $output; }
function renderVisitors() { $this->lastDate = ""; $activeVisitorsOutput = $this->getVisitorsCached(FALSE); $inactiveVisitorsOutput = $this->getVisitorsCached(TRUE); $output = $activeVisitorsOutput . $inactiveVisitorsOutput; if (!$output) { $output = ExtraWatchHelper::renderNoData(); } return $output; }
function renderSEOReport($day, $fromEmail = FALSE, $renderAlsoNotChanged = FALSE) { $allTimeReport = $this->extraWatch->config->getCheckboxValue("EXTRAWATCH_SEO_SHOW_ALL_TIME_REPORT"); $showEncryptedKeywords = $this->extraWatch->config->getCheckboxValue('EXTRAWATCH_SEO_LIST_ENCRYPTED_KEYWORDS'); if ($allTimeReport) { $day = FALSE; // if all-time report is checked, day value won't be passed to query } $loadsPerDay = $this->extraWatch->stat->getKeyValueInGroupByDate(EW_DB_KEY_LOADS, EW_DB_KEY_LOADS, $day); if (!$loadsPerDay && !$allTimeReport) { return ExtraWatchHelper::renderNoData(); } $searchEngineHits = $this->extraWatch->seo->getTotalVisitsByKeyphrasesByDay($day); if ($loadsPerDay) { $percent = sprintf("%.2f", $searchEngineHits / $loadsPerDay * 100); } if ($day) { $day = $day - 1; } $output = ""; if (!_EW_CLOUD_MODE) { $output .= $this->renderMostDynamicKeyphrases($renderAlsoNotChanged, $day); } $output .= "<table border='0' class='table'>"; $output .= "<tr><td></td><td align='right'><b>" . _EW_SEO_TOTAL_VISITS_FROM_SEARCH_ENGINES . ": " . $searchEngineHits . " (" . @$percent . "%)</b></td></tr>"; $rows = $this->extraWatch->seo->getUri2KeyphrasePosUris($day); if ($rows) { foreach ($rows as $row) { $isChange = FALSE; $total = $row->valueTotal; $percent = 0; if ($loadsPerDay) { $percent = sprintf("%.2f", $total / $loadsPerDay * 100); } $outputBlock = "<tr><td><h3><a href='" . $row->uri . "'>" . $row->title . "</a></h3><td align='right'><b>" . _EW_STATS_TOTAL . ": " . $total . " ({$percent}%)</b></td></tr><tr><td colspan='2'>"; $rows2 = $this->extraWatch->seo->getUri2KeyphrasePosById($day, $row->uri2titleId); if ($rows2) { $outputBlock .= "<table width='100%' class='tablesorter table table-striped'><thead><tr><th>" . _EW_URI . "</th><th>" . _EW_POSITION . "</th><th>" . _EW_COUNT . "</th><th>" . _EW_EMAIL_REPORTS_PERCENT . "</th><th>" . _EW_EMAIL_REPORTS_1DAY_CHANGE . "</th><th>" . _EW_EMAIL_REPORTS_7DAY_CHANGE . "</th><th>" . _EW_EMAIL_REPORTS_28DAY_CHANGE . "</th><th></th></tr></thead><tbody>"; $i = 0; foreach ($rows2 as $row2) { if (@(!$showEncryptedKeywords) && $row2->keyphrase == ExtraWatchHelper::_EW_ENCRYPTED) { continue; } if ($loadsPerDay) { $percent = sprintf("%.2f", $row2->value / $loadsPerDay * 100); } $isChangeForRow = $this->extraWatchStatHTML->isChange(EW_DB_KEY_SEARCH_RESULT_NUM, $row2->uri2keyphrasePosId, $day); if ($renderAlsoNotChanged || $isChangeForRow) { $outputBlock .= "<tr class='tableRow" . $i++ % 2 . "'><td width='100%'>" . $this->renderKeyphraseLink($row2->keyphrase) . "</td>" . "<td width='5%' align='right'>" . $row2->position . "<td width='5%' align='right'>" . $row2->value . "</td>" . "<td width='5%' align='right' style='color: #555'>(" . $percent . "%)</td>"; if ($day == FALSE) { $dayChanged = ExtraWatchDate::jwDateToday() - 1; } else { $dayChanged = $day; } $outputBlock .= $this->extraWatchStatHTML->renderDiffTableCellsAndIcon(EW_DB_KEY_SEARCH_RESULT_NUM, $row2->uri2keyphrasePosId, $dayChanged, $fromEmail); $outputBlock .= "</tr>\r\n"; $isChange = TRUE; } } $outputBlock .= "</tbody></table><br/>"; } if ($renderAlsoNotChanged || $isChange) { $output .= $outputBlock; } $output .= "</td></tr>\r\n"; } } $output .= "</table>"; return $output; }
function renderNightlyEmail() { $keysArray = unserialize(EXTRAWATCH_STATS_ITEMS); $day = $this->extraWatch->date->jwDateToday(); $totalRowCount = 0; foreach ($keysArray as $key) { $group = @constant('EW_DB_KEY_' . strtoupper($key)); $totalRowCount += $this->extraWatch->stat->getCountByKeyAndDate($group, $day - 1); } if (!$totalRowCount) { return ExtraWatchHelper::renderNoData(); } $output = "<table>"; $output .= "<tr><td><h3></h3></td><td class='ewCentered'> <u>" . _EW_EMAIL_REPORTS_VALUE . "</u></td><td class='ewCentered'> <u>" . _EW_EMAIL_REPORTS_PERCENT . "</u></td><td class='ewCentered'> <u>" . _EW_EMAIL_REPORTS_1DAY_CHANGE . "</u></td><td class='ewCentered'> <u>" . _EW_EMAIL_REPORTS_7DAY_CHANGE . "</u></td><td class='ewCentered'> <u>" . _EW_EMAIL_REPORTS_28DAY_CHANGE . "</u></td></tr>\r\n"; $output .= "<tr><td>" . _EW_STATS_UNIQUE . "</td><td align='right'>" . $this->extraWatch->stat->getCountByKeyAndDate(EW_DB_KEY_UNIQUE, $day - 1) . "</td><td></td>" . $this->renderDiffTableCellsAndIcon(EW_DB_KEY_UNIQUE, EW_DB_KEY_UNIQUE, $day - 1, TRUE) . "</td></tr>\r\n"; $output .= "<tr><td>" . _EW_STATS_LOADS . "</td><td align='right'>" . $this->extraWatch->stat->getCountByKeyAndDate(EW_DB_KEY_LOADS, $day - 1) . "</td><td></td>" . $this->renderDiffTableCellsAndIcon(EW_DB_KEY_LOADS, EW_DB_KEY_LOADS, $day - 1, TRUE) . "</td></tr>\r\n"; $output .= "<tr><td>" . _EW_STATS_HITS . "</td><td align='right'>" . $this->extraWatch->stat->getCountByKeyAndDate(EW_DB_KEY_HITS, $day - 1) . "</td><td></td>" . $this->renderDiffTableCellsAndIcon(EW_DB_KEY_HITS, EW_DB_KEY_HITS, $day - 1, TRUE) . "</td></tr>\r\n"; foreach ($keysArray as $key) { if ($key == 'ip' && !$this->extraWatch->config->getCheckboxValue('EXTRAWATCH_IP_STATS')) { continue; } $output .= nl2br($this->renderIntValuesByNameForEmail($key, TRUE, FALSE, $day, 10, FALSE, TRUE)); $output .= "<tr><td colspan='4'> </td></tr>\r\n"; } $output .= "</table>"; return $output; }
function renderBlockedIPs($date = 0, $expanded = FALSE, $displayedInStats = TRUE) { $output = ""; if (!$expanded) { $output .= "<a href='javascript:extrawatch_blockIpManually();'>" . _EW_STATS_IP_BLOCKING_ENTER . "</a><br/>"; } $total = FALSE; if (!@$date) { $total = TRUE; } $count = $this->extraWatch->block->countBlockedIPs($date); if (!$count && !$displayedInStats) { $output = ExtraWatchHelper::renderNoData(); $output .= $this->renderAntispamHowTo(); return $output; } $limit = $this->extraWatch->config->getConfigValue('EXTRAWATCH_STATS_MAX_ROWS'); $output .= "<tr><th></th><th></th><th>IP</th><th>" . strtolower(_EW_STATS_HITS) . "</th>"; if (!$displayedInStats) { $output .= "<th>" . _EW_BLOCKING_BAD_WORD . "</th>"; $output .= "<th>" . _EW_BLOCKING_REASON . "</th>"; } $output .= "</tr>"; if ($count > $limit && !$expanded) { $output = "<tr><td colspan='4'>" . $this->extraWatchStatHTML->renderExpand('ip_blocking_title', $total) . "</td></tr>"; } if (@$expanded) { $rows = $this->extraWatch->block->getBlockedIPs($date, 100); // this cannot be unlimited, because otherwise the page would not open } else { $rows = $this->extraWatch->block->getBlockedIPs($date, $limit); } $lastDate = 0; $i = 0; if (@$rows) { foreach ($rows as $row) { $icon = ""; if (!strstr($row->ip, "*")) { if (@(!$row->country)) { $country = $this->extraWatch->helper->countryByIp($row->ip); $this->extraWatch->block->updateCountryForBlockedIp($row->ip, $country); } else { $country = $row->country; } $countryName = $this->extraWatch->helper->countryCodeToCountryName($country); if (!$country) { $country = "none"; } $icon = "<img src='" . $this->extraWatch->config->getLiveSiteWithSuffix() . "components/com_extrawatch/img/flags/" . @strtolower($country) . ".png' title='{$countryName}' alt='{$countryName}'/>"; } $mapsIcon = "<img src='" . $this->extraWatch->config->getLiveSiteWithSuffix() . "components/com_extrawatch/img/icons/map_icon.gif' border='0' " . $this->extraWatch->helper->getTooltipOnEvent() . "=\"ajax_showTooltip('" . $this->extraWatch->config->getLiveSite() . $this->extraWatch->env->getEnvironmentSuffix() . $this->extraWatch->env->renderBackendAjaxLink($this->extraWatch->config, 'ajax', 'tooltip') . "&ip=" . @$row->ip . "&env=" . $this->extraWatch->config->getEnvironment() . "&projectId=" . _EW_PROJECT_ID . "',this);return FALSE\"/>"; if (!$displayedInStats && $lastDate != $row->date) { $output .= "<tr><td colspan='4'><u>" . ExtraWatchDate::getDateByDay($row->date) . "</u></td></tr>"; $lastDate = $row->date; } $output .= "<tr class='tableRow" . $i++ % 2 . "'><td class='ewCentered'>" . $mapsIcon . "</td><td class='ewCentered' title='{$row->reason}'>" . $icon . "</td><td align='left' title='{$row->reason}'>" . $row->ip . "</td><td class='ewCentered' title='{$row->reason}'>" . $row->hits . "</td>"; if (!$displayedInStats) { if (!$row->badWord) { $spamWordAffected = $this->extraWatch->block->checkForSpamWord($row->reason); if (@$spamWordAffected) { $this->extraWatch->block->updateSpamWordForBlockedIp($row->ip, $spamWordAffected); $row->badWord = $spamWordAffected; } } $output .= "<td class='ewCentered' title='" . $row->badWord . "'>" . ExtraWatchHelper::truncate($row->badWord, 10) . "</td>"; $output .= "<td title=\"" . ExtraWatchHelper::htmlspecialchars($row->reason) . "\">" . $this->highlightSpamWord($row->badWord, $row->reason) . "</td>"; } $output .= "<td>"; if (!$expanded) { $output .= "<a id='{$row->ip}' href='javascript:extrawatch_blockIpToggle(\"{$row->ip}\");history.go(0);' title='{$row->reason}'>" . _EW_BLOCKING_UNBLOCK . "</a>"; } else { $output .= "<a id='{$row->ip}' href='" . $this->extraWatch->config->renderLink("antiSpam", "&action=toggleBlocking&ip=" . $row->ip) . "' title='{$row->reason}'>" . _EW_BLOCKING_UNBLOCK . "</a>"; } $output .= "</td>"; $output .= "</tr>"; } } return $output; }
function renderPagesWithHighlightedHTMLElementsTable($day = 0, $limit = 20) { if (!$day) { $day = ExtraWatchDate::jwDateToday(); } $rows = $this->extraWatchHeatmap->getTopHeatmapUris($day, 20); $output = sprintf("<table class='tablesorter table table-striped'>\n <thead>\n <tr><th>%s</th> \t \t \t \t\t \t \t \t \t \t\t \t \t\t \t \t\t\t \t \t\t \t \t \t\t \t \t \t \t \t \t\t \t\t \t\t\t\t \t\t\t \t\t \t\t \t \t\t \t\t \n <th>%s</th>\n <th>%s</th>", _EW_HEATMAP_CLICKS, _EW_HEATMAP_TITLE, _EW_URI); $output .= sprintf("<th align='center'>%s</th><th>%s</th><th>%s</th><th></th></tr>", _EW_EMAIL_REPORTS_1DAY_CHANGE, _EW_EMAIL_REPORTS_7DAY_CHANGE, _EW_EMAIL_REPORTS_28DAY_CHANGE); $output .= "</thead><tbody>"; if (!$rows) { $output .= "</table>"; $output .= ExtraWatchHelper::renderNoData(); return $output; } $maxClicksForDay = $this->extraWatchHeatmap->getMaxClicksForDay($day); $i = 0; if ($rows) { foreach ($rows as $row) { if (@$row->uri2titleId) { $output .= $this->renderHeatmapTableRow($row, $day, $maxClicksForDay, $i, TRUE); $i++; } } } $output .= "</tbody></table>"; return $output; }
function renderFlowTable($selectedUriId, $outgoingLinks, $nestingLevel) { $nodeArray = array(); $edgeArray = array(); $this->flow->retrieveFlow($selectedUriId, $nodeArray, $edgeArray, $outgoingLinks, $nestingLevel); $output = "<table border='0' width='100%' class='tablesorter table table-striped'>\n\t\t<thead>\n\t\t<tr>\n\t\t\t<th>Color</th>\n\t\t\t<th>Percentage</th> \t \t \t \t\t \t \t \t \t \t\t \t \t\t \t \t\t\t \t \t\t \t \t \t\t \t \t \t \t \t \t\t \t\t \t\t\t\t \t\t\t \t\t \t\t \t \t\t \t\t \n\t\t\t<th>From</th>\n\t\t\t<th>To</th>\n\t\t\t<th>Count</th>\n\t\t\t<th>Sum</th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n "; $i = 1; foreach ($edgeArray as $key => $value) { $output .= $this->renderEdgeTableRow($value); $i++; } if (!$edgeArray) { $output .= "<tr><td>" . ExtraWatchHelper::renderNoData() . "</td></tr>"; } $output .= "</tbody></table>"; return $output; }