/** * SEO Report * @param $day * @return string|void */ function renderSEOReport($day, $renderAsEmail = FALSE) { $rows = $this->extraWatch->seo->retrieveTopUrisReferedByKeyphrase($day); if (!@$rows) { return; } $output = "<table width='700px' border=\"0\">"; $output .= "<tr><td colspan=\"5\"></td></tr>"; $output .= "<tr><th align=\"left\">" . _EW_STATS_KEYPHRASE . "</th><th>" . _EW_EMAIL_REPORTS_VALUE . "</th><th>perc.</th><th>" . _EW_EMAIL_REPORTS_1DAY_CHANGE . "</th><th>" . _EW_EMAIL_REPORTS_7DAY_CHANGE . "</th><th>" . _EW_EMAIL_REPORTS_28DAY_CHANGE . "</th></tr>"; foreach ($rows as $row) { $totalIntValuesForDay = $this->extraWatch->stat->getCountByKeyAndDate(EW_DB_KEY_UNIQUE, $day); if (!$totalIntValuesForDay) { continue; } /* removing trailing / from uri to include it into link */ $liveSite = $this->extraWatch->config->getDomainFromLiveSiteByUsername(_EW_PROJECT_ID); $uri = $row->uri; if (strpos($uri, "/") == 0) { //starts with / $uri = substr($uri, 1); } $percentOfHitsPerDay = sprintf("%.2f%%", $row->total / $totalIntValuesForDay * 100); $output .= "<tr><td colspan=\"2\"><h4><a href='" . $liveSite . $uri . "' target=\"_blank\">" . $row->title . "</a></h4></td><td align=\"left\"><b>Hits: " . $row->total . "</b></td><td align=\"left\" colspan=\"3\">" . $percentOfHitsPerDay . " of traffic</td></tr>"; $keyphrases = $this->extraWatch->seo->retrieveKeyphrasesForUri($day, $row->uriId); $group = EW_DB_KEY_URI2KEYPHRASE; foreach ($keyphrases as $keyphrase) { if (is_numeric($keyphrase->value)) { $percent = sprintf("(%.2f%%)", $keyphrase->value / $row->total * 100); } else { $percent = $keyphrase->value; } $oneDayDiff = $this->extraWatch->stat->getRelDiffOfTwoDays($day - 1, $day, EW_DB_KEY_URI2KEYPHRASE, $keyphrase->uri2keyphraseId); $sevenDayDiff = $this->extraWatch->stat->getRelDiffOfTwoDays($day - 7, $day, EW_DB_KEY_URI2KEYPHRASE, $keyphrase->uri2keyphraseId); $twentyEightDayDiff = $this->extraWatch->stat->getRelDiffOfTwoDays($day - 28, $day, EW_DB_KEY_URI2KEYPHRASE, $keyphrase->uri2keyphraseId); $oneDayDiffRendered = $this->renderPercentage($oneDayDiff); $sevenDayDiffRendered = $this->renderPercentage($sevenDayDiff); $twentyEightDayDiffRendered = $this->renderPercentage($twentyEightDayDiff); $origName = $keyphrase->uri2keyphraseId; $trendsIcon = "<img src='" . $this->extraWatch->config->getLiveSiteWithSuffix() . "components/com_extrawatch/img/icons/trend_icon.gif' border='0' " . $this->extraWatch->helper->getTooltipOnEvent() . "=\"ajax_showTooltip('" . $this->extraWatch->config->getLiveSiteWithSuffix() . $this->extraWatch->env->renderBackendAjaxLink($this->extraWatch->config, 'ajax', 'trendtooltip') . "&group={$group}&name=" . urlencode($origName) . "&date={$day}&env=" . $this->extraWatch->config->getEnvironment() . "&projectId=" . _EW_PROJECT_ID . "',this);return false;\"/>"; $output .= "<tr><td title='" . ExtraWatchHelper::htmlspecialchars($keyphrase->name) . "'><a href='http://www.google.com/search?q=" . ExtraWatchHelper::htmlspecialchars(urlencode($keyphrase->name)) . "'>" . ExtraWatchHelper::htmlspecialchars(ExtraWatchHelper::truncate($keyphrase->name, 100)) . "</a></td> \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 <td style='width: 30px;' align='right'>" . ExtraWatchHelper::htmlspecialchars($keyphrase->value) . "</td><td style='width: 20px' align='right'>{$percent}</td><td align='center'>{$oneDayDiffRendered}</td><td class='ewCentered'>{$sevenDayDiffRendered}</td><td class='ewCentered'>{$twentyEightDayDiffRendered}</td>"; if (!$renderAsEmail) { $output .= "<td>" . $trendsIcon . "</td>"; } $output .= "</tr>"; } } $output .= "<tr><td> </td></tr><tr><td colspan=\"5\">"; $output .= "</td></tr></table>"; return $output; }
function highlightSpamWord($spamWord, $reason) { if ($spamWord) { $pos = strpos($reason, $spamWord); if ($pos) { $offset = $pos - 10; if (@$offset > 0) { $reason = "..." . substr($reason, $offset, strlen($reason) - $offset); } } $reason = str_ireplace("{$spamWord}", "<b>{$spamWord}</b>", $reason); } return ExtraWatchHelper::truncate($reason, 40); }
function renderHeatmapLatestElementClicksTableRow($row) { $countryCode = $this->extraWatch->helper->countryByIpCached($row->ip); $countryIcon = $this->extraWatchStatHTML->renderCountryFlagIcon($countryCode, $countryCode); if (@$row->clicked_element_xpath_condition) { //render goal name instead of link $goalLink = "<a href='" . $this->extraWatch->config->renderLink("goals", "edit&goalId=" . (int) $row->id . "") . "'>" . $row->name . "</a>"; } else { $goalLink = "<a href='" . $this->extraWatch->config->renderLink("goals", "insert&clicked_element_xpath_condition=" . urlencode($row->xpath) . "") . "' title='" . _EW_STATS_ADD_TO_GOALS . "'><img src='" . $this->extraWatch->config->getLiveSiteWithSuffix() . "components/com_extrawatch/img/icons/goal-add.gif' border='0'/></a>"; } return sprintf("<tr id='heatmapTableRowId_" . $row->clickId . "'> \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 <td class='ewCentered' width='5%%'>%s</td>\n <td class='ewCentered'>%s</td>\n <td>%s</td>\n <td>%s</td>\n <td>%s</td>\n <td>%s</td>\n <td>%s</td>\n <td>%s</td>\n <td>%s</td>\n </tr>", $row->clickCount, $goalLink, $this->renderHighlightElementLink($row->uri, $row->xpath, "<span title='" . $row->xpath . "'>" . ExtraWatchHelper::truncate($row->xpath) . "</span>"), $row->uri, $countryIcon, $row->ip, $row->x, $row->y, $row->w . "x" . $row->h); }
/** presentation logic */ function renderGraph($uriId, $outgoingLinks, $nestingLevel) { $outgoingLinks = $outgoingLinks - 1; $nodeArray = array(); $edgeArray = array(); $this->flow->retrieveFlow($uriId, $nodeArray, $edgeArray, $outgoingLinks, $nestingLevel); $edgesOutput = ""; $nodesOutput = ""; // print_r($nodeArray); foreach ($nodeArray as $key => $value) { $nodesOutput .= sprintf("var node_%d = graph.newNode({label: '%s', sublabel: '%s'});\n", $value, addslashes(htmlspecialchars_decode(ExtraWatchHelper::truncate($this->visit->getTitleByUriId($value), self::TRUNCATE_LEN))), addslashes(htmlspecialchars_decode(ExtraWatchHelper::truncate($this->visit->getUriNameByUri2TitleId($value), self::TRUNCATE_LEN)))); } foreach ($edgeArray as $key => $value) { $edgesOutput .= $this->renderEdgeJs($value); } return $nodesOutput . $edgesOutput; }
</b></td> <td align="left" colspan="3"><?php echo $percentOfHitsPerDay; ?> of traffic</td> </tr> <?php $keyphrases = $extraWatch->seo->retrieveKeyphrasesForDayAndUriId($day, $row->uriId); foreach ($keyphrases as $keyphrase) { if (is_numeric($keyphrase->value)) { $percent = sprintf("(%.2f%%)", $keyphrase->value / $row->total * 100); } else { $percent = $keyphrase->value; } echo "<tr><td title='" . $keyphrase->name . "'><a href='http://www.google.com/search?q=" . urlencode($keyphrase->name) . "'>" . ExtraWatchHelper::truncate($keyphrase->name, 60) . "</a></td>" . "<td style='width: 30px;' align='right'>" . $keyphrase->value . "</td><td style='width: 20px' align='right'>{$percent}</td>" . $extraWatchStatHTML->renderDiffTableCellsAndIcon(EW_DB_KEY_URI2KEYPHRASE, $keyphrase->uri2keyphraseId, $day) . "</tr>"; } ?> <?php } ?> <tr> <td> </td> </tr> <tr> <td colspan="5"> <?php echo $this->renderDateControlGet('seo', $day); ?>
if (@$filepathar) { foreach ($filepathar as $filepath) { ?> <tr> <td height="23" width="60%" align="left" title="<?php echo $filepath->dname; ?> "><?php echo ExtraWatchHelper::truncate($filepath->dname); ?> </td> <td height="23" width="40%" align="left" title="<?php echo $filepath->allowedReferrer; ?> "><?php echo ExtraWatchHelper::truncate($filepath->allowedReferrer); ?> </td> <td width="9%" class="table" height="23"><div align="center"><a href="<?php echo $extraWatch->config->renderLink("downloads", "editFile&did=" . $filepath->did); ?> "><img src="<?php echo $extraWatch->config->getLiveSiteWithSuffix(); ?> components/com_extrawatch/img/icons/edit.png"/></a></div></td> <td width="11%" class="table" height="23"><div align="center"><a href="javascript:confirmChoicefilepath('<?php echo $filepath->did; ?> ')"><img src="<?php echo $extraWatch->config->getLiveSiteWithSuffix(); ?>