function renderTable($bots = FALSE, $inactive, $ipFilter = FALSE, $renderAsEmail = FALSE, $renderedFromHistory = FALSE)
 {
     $output = "";
     $rows = $this->getJoinedURIRows($bots, $inactive, $ipFilter);
     $agentNotPublishedMessage = $this->extraWatch->env->getAgentNotPublishedMsg($this->extraWatch->database);
     $downloadLog = $this->extraWatch->downloads->getDownloadLogIpTimestampPath();
     $countryCodeToCountryNameArray = $this->extraWatch->helper->countryCodeToCountryNameList();
     if ($bots == FALSE && $agentNotPublishedMessage != FALSE && sizeof($rows) == 0 && $inactive == 0) {
         $output .= "<tr><td colspan='10'><span style='color:red; font-weight: bold;'>" . $agentNotPublishedMessage . "</span></td></tr> ";
         return $output;
     } else {
     }
     if (!$rows) {
         $noDataHTML = "";
         if (!$bots && _EW_CLOUD_MODE && $inactive == FALSE && !$renderedFromHistory) {
             $noDataHTML = "<table><tr><td>";
             $noDataHTML .= "<h2 style='color: #e74c3c; font-weight: bold;'>1. Select the HTML code below and copy it to a clipboard </h2>";
             $noDataHTML .= "<i>(Click on text area below, Ctrl+A, Ctrl+C)</i><br/><br/>";
             $noDataHTML .= "<textarea cols='90' rows='8'>";
             $noDataHTML .= htmlentities($this->extraWatch->helper->renderHTMLCodeSnippet(_EW_PROJECT_ID));
             $noDataHTML .= "</textarea><br/><br/>";
             $noDataHTML .= "<h2 style='color: #e74c3c; font-weight: bold;'>2. Open editor of your website's front-end</h2><br/>";
             $noDataHTML .= "This step may be different for every CMS. <br/>You need to find where's your website frontend saved as HTML and the modify that file. <br/><b>Or ask your webmaster do to it for you!</b>";
             $noDataHTML .= "<h2 style='color: #e74c3c; font-weight: bold;'>3. Find the &lt;/body&gt; tag</h2>";
             $noDataHTML .= "This is a footer of my website &copy;MyWebsite.com<br/><b>&lt;/body&gt;</b><br/>&lt;/html&gt;";
             $noDataHTML .= "<h2 style='color: #e74c3c; font-weight: bold;'>4. Paste this code before the &lt;/body&gt; tag</h2>";
             $noDataHTML .= "This is a footer of my website &copy;MyWebsite.com<br/><i>{code from clipboard}</i><br/><b>&lt;/body&gt;</b><br/>&lt;/html&gt;";
             $noDataHTML .= "</td><td valign='top'>";
             $noDataHTML .= "<h2 style='color: #e74c3c; font-weight: bold;'>.. Or Watch the video with instructions:</h2><br/><br/>";
             $noDataHTML .= "<iframe width=\"640\" height=\"360\" src=\"//www.youtube.com/embed/tvHNg-X4d8o\" frameborder=\"0\" allowfullscreen></iframe>";
             $noDataHTML .= "</td></tr></table>";
         } else {
             if ($inactive == FALSE) {
                 $noDataHTML .= _EW_NO_DATA;
             }
         }
         $output .= "<tr><td colspan='5'>" . $noDataHTML . "</td></tr>";
         return $output;
     }
     /** if visits are empty */
     //$output = "";
     $i = 0xff;
     $decrement = -1;
     $lastIp = "";
     //to be able to hide flags / address for same IP in next rows
     $lastReferer = "";
     $lastColor = "";
     $rowNumber = 0;
     $dateToday = $this->extraWatch->date->jwDateToday();
     $uri2HeatmapClicksAssoc = $this->heatmap->heatmapForDayAsAsoc($dateToday);
     $maxClicksOfDay = $this->heatmap->getMaxClicksForDay($dateToday);
     if (!$renderAsEmail) {
         $liveSiteWithSuffix = $this->extraWatch->config->getLiveSiteWithSuffix();
     } else {
         $liveSiteWithSuffix = $this->extraWatch->config->getDomainFromLiveSite(_EW_PROJECT_ID) . $this->extraWatch->config->getLiveSiteWithSuffix();
     }
     if (@$rows) {
         foreach ($rows as $row) {
             $rowNumber++;
             /* reset the values from previous iteration */
             $country = "none";
             $countryName = "";
             $countryUpper = "";
             $color = "";
             $inactiveClass = "";
             $inactiveImageClass = "";
             if ($row->inactive) {
                 $inactiveClass = "class='extraWatchInactiveVisit'";
                 $inactiveImageClass = "class='extraWatchInactiveImage'";
             }
             $flag = "<img src='" . $liveSiteWithSuffix . "components/com_extrawatch/img/flags/{$country}.png' title='{$countryName}' alt='{$countryName}' {$inactiveImageClass}/>";
             if ($this->extraWatch->block->getBlockedIp($row->ip)) {
                 //TODO optimize whole block
                 $ipString = "<s>" . ExtraWatchHelper::htmlspecialchars($row->ip) . "</s>";
             } else {
                 $ipString = ExtraWatchHelper::htmlspecialchars($row->ip);
             }
             //TODO optimize whole block
             if ($i < 0xcc || $i <= 0x0) {
                 $decrement = $decrement * -1;
             }
             $i = $i + $decrement;
             $color = sprintf("%x", $i) . sprintf("%x", $i) . sprintf("%x", $i);
             if ($bots == TRUE) {
                 $color = "ffffff";
             }
             $country = $row->country;
             if (!$country) {
                 $country = $this->extraWatch->helper->countryByIp($row->ip);
                 $this->extraWatch->visit->updateCountryForIP($country, $row->ip);
             }
             if (@$country) {
                 $countryName = @$countryCodeToCountryNameArray[$country];
                 $this->extraWatch->helper->countryCodeToCountryName($country);
                 //TODO optimize
                 $flag = "<img src='" . $liveSiteWithSuffix . "components/com_extrawatch/img/flags/{$country}.png' title='{$countryName}' alt='{$countryName}' {$inactiveImageClass}/>";
                 $countryUpper = strtoupper($country);
             }
             $userAgent = ExtraWatchHelper::htmlspecialchars($row->browser);
             $browser = "";
             $os = "";
             $browserIcon = "";
             $osIcon = "";
             if (@$userAgent) {
                 $browser = $this->extraWatch->referer->identifyBrowser(@$userAgent);
                 if (@$browser) {
                     $browserIcon = $liveSiteWithSuffix . "components/com_extrawatch/img/icons/" . strtolower($browser) . ".gif";
                 }
                 if (@$browserIcon) {
                     $browser = "<img src='{$browserIcon}' alt='{$userAgent}' title='{$userAgent}' {$inactiveImageClass}/>";
                 }
                 $os = json_decode(@$this->extraWatch->referer->identifyOSAsJSON(@$userAgent));
                 if (@$os->name) {
                     $osIcon = $liveSiteWithSuffix . "components/com_extrawatch/img/icons/" . strtolower($os->icon);
                 }
                 if (@$osIcon) {
                     $os = sprintf("<img src='%s' alt='%s' title='%s' {$inactiveImageClass}/>", $osIcon, $userAgent, $userAgent);
                 }
             }
             //$output .= $rowNumber;
             if ($bots == TRUE && $osIcon) {
                 continue;
             }
             // bot icon fix
             if ($bots == TRUE) {
                 $osIcon = $liveSiteWithSuffix . "components/com_extrawatch/img/icons/blank.gif";
                 $browserIcon = $liveSiteWithSuffix . "components/com_extrawatch/img/icons/blank.gif";
                 $browser = sprintf("<img src='%s' alt='%s' title='%s' {$inactiveImageClass}/>", ExtraWatchHelper::htmlspecialchars($browserIcon), ExtraWatchHelper::htmlspecialchars($userAgent), ExtraWatchHelper::htmlspecialchars($userAgent));
                 $os = sprintf("<img src='%s' alt='%s' title='%s' {$inactiveImageClass}/>", ExtraWatchHelper::htmlspecialchars($osIcon), ExtraWatchHelper::htmlspecialchars($userAgent), ExtraWatchHelper::htmlspecialchars($userAgent));
             }
             $username = "";
             if (@$row->username) {
                 if (@get_class($this->extraWatch->env) == "ExtraWatchJoomlaEnv") {
                     $username = "******" . $this->extraWatch->config->getAdministratorIndex() . "?option=com_users&task=view&filter_search={$row->username}' style='color: black; text-decoration:none;'><i>" . @ExtraWatchHelper::htmlspecialchars($row->username) . "</i></a>";
                 } else {
                     $username = "******" . @ExtraWatchHelper::htmlspecialchars($row->username) . "</i></span>";
                 }
             }
             $ipString = sprintf("<a id='%s' href='javascript:extrawatch_blockIpToggle(\"%s\");extrawatch_sendVisitsReq();' style='color:black;' {$inactiveClass}>%s</a>", ExtraWatchHelper::htmlspecialchars($row->ip), ExtraWatchHelper::htmlspecialchars($row->ip), $ipString);
             $mapsIcon = "<img src='" . $liveSiteWithSuffix . "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\"/>";
             $timeOfVisit = $this->extraWatch->helper->secondsToHumanFormat(@$row->timeDiff);
             $timeOfVisit = str_replace(" ", "&nbsp;", $timeOfVisit);
             $displayCountryFlag = FALSE;
             if ($lastIp != $row->ip) {
                 $lastTimestamp = $row->timestamp;
                 $displayCountryFlag = TRUE;
                 $lastIp = $row->ip;
                 $rowNumber = 1;
             } else {
                 $flag = "";
                 // do not display flag, ip if the IP is same sa previous
                 $ipString = "";
             }
             if (!$displayCountryFlag) {
                 $username = "";
                 $browser = "";
                 $os = "";
                 $mapsIcon = "";
                 $timeOfVisit = "";
             }
             if ($lastReferer != $row->referer) {
                 $output .= $this->renderRefererRow($lastReferer, $color);
                 $lastReferer = $row->referer;
                 $lastColor = $color;
             }
             $dateOfVisit = ExtraWatchDate::date("d.m.Y", $row->timestamp);
             if (@$this->lastDate != $dateOfVisit) {
                 $output .= "<tr><td ></td><td ></td><td ></td><td ><td ></td></td><td ></td><td ></td><td ></td><td colspan='8'  colspan='3'><h3>{$dateOfVisit}</h3></td></tr>";
                 $this->lastDate = $dateOfVisit;
             }
             $output .= "<tr><td valign='top' align='left' ></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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign='top' align='left' >" . @$mapsIcon . "</td><td valign='top' align='left' >";
             if (!$countryUpper) {
                 $output .= "<a href='" . $this->extraWatch->config->renderLink("goals", "insert&country=" . @$countryUpper) . "' style='color: #999999;' title='" . _EW_VISITS_ADD_GOAL_COUNTRY . "'>" . @$countryUpper . "</a>";
             }
             $onlineString = "";
             if ($row->inactive == 0 && $ipString) {
                 $onlineString = "<img src='" . $liveSiteWithSuffix . "components/com_extrawatch/img/icons/online.png' valign='top' border='0'/>";
             }
             $output .= "</td><td valign='top' align='left' >" . @$flag . "</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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign='top' align='left' ><span {$inactiveClass}>{$ipString}</span>";
             $output .= "{$username}</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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign='top' align='left' >{$onlineString}</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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign='top' align='left' >" . @$browser . "</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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign='top' align='left' >" . @$os . "</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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td valign='top' align='left'  width='80%'>";
             $day = $this->extraWatch->date->jwDateFromTimestamp($row->timestamp);
             $downloadsForIp = $this->extraWatch->downloads->getDownloadLogForIPBetweenTimestampsFromRef($downloadLog, $rowNumber, $row->ip, $lastTimestamp, $row->timestamp);
             //TODO optimize
             $timestampHumanReadable = ExtraWatchDate::date("H:i:s", $row->timestamp);
             $downloadIcon = "<img src='" . $liveSiteWithSuffix . "components/com_extrawatch/img/icons/downloads.png' {$inactiveImageClass} />";
             if (@$downloadsForIp) {
                 foreach ($downloadsForIp as $download) {
                     $downloadTimestampHumanReadable = ExtraWatchDate::date("H:i:s", $download['timestamp']);
                     $output .= "<div {$inactiveClass}>" . $downloadTimestampHumanReadable . " {$downloadIcon} " . $download['dname'] . "</div><br/>";
                 }
             }
             $goalsForIp = $this->extraWatch->goal->getGoalsForVisitIdBetweenTimestamps($row->visitId, $lastTimestamp, $row->timestamp);
             //TODO optimize
             if (@$goalsForIp) {
                 foreach ($goalsForIp as $goalForIp) {
                     $goalTimestampHumanReadable = ExtraWatchDate::date("H:i:s", $goalForIp->timestamp);
                     $goalLink = "<a href='" . $this->extraWatch->config->renderLink("goals", "edit&goalId=" . (int) $goalForIp->goalId . "") . "' target='_blank'>" . $goalForIp->name . "</a>";
                     $output .= "<div style='background-color: #FFF9E1;' {$inactiveClass}>" . $goalTimestampHumanReadable . sprintf(_EW_VISITS_GOAL_REACHED, $goalLink) . "</div><br/>";
                 }
             }
             $lastTimestamp = $row->timestamp;
             $trucateCharLimit = $this->extraWatch->config->getConfigValue('EXTRAWATCH_TRUNCATE_VISITS');
             $uriTruncated = $this->extraWatch->helper->truncate(urldecode($row->uri), $trucateCharLimit);
             $titleOriginal = $row->title;
             $row->title = $this->extraWatch->helper->truncate($row->title, $trucateCharLimit);
             $row->title = $this->extraWatch->helper->removeRepetitiveTitle($row->title);
             $uri2titleId = $this->extraWatch->visit->getUri2TitleId($row->uri, $titleOriginal);
             //TODO optimize
             $output .= "<div id='id{$row->id}' style='text-decoration: none;' {$inactiveClass} onmouseout=\"toggleElementVisibility('goal_" . $row->id . "',0);\"  onmouseover=\"toggleDiv('" . $row->id . "','" . $row->ip . "',1, " . (int) $uri2titleId . ", {$day});\" >";
             if (@_EW_CLOUD_MODE) {
                 $projectSite = $this->extraWatch->config->getDomainFromLiveSite(_EW_PROJECT_ID);
                 if (!ExtraWatchHelper::startsWith($projectSite, "http://")) {
                     //add http prefix
                     $projectSite = "http://" . $projectSite;
                 }
             }
             if (!$row->title) {
                 $row->title = $uriTruncated;
             }
             $output .= "{$timestampHumanReadable} <a href='" . @$projectSite . $row->uri . "' target='_blank' {$inactiveClass} title='{$uriTruncated}'>{$row->title}</a>";
             /*
                     $userHeatmapClicks = $this->heatmap->getHeatmapClickNums($row->ip, $row->uri, ExtraWatchDate::jwDateFromTimestamp($timestampHumanReadable));//TODO optimize  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                     if (@$userHeatmapClicks > 0) {  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                       if (@$maxClicksOfDay) {  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                             $ratio = $userHeatmapClicks / $maxClicksOfDay;  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                       } else {
                           $ratio = 1;  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                       }
                       $userClicksColor = ExtraWatchHelper::rgbFromRatio($ratio);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                       $output .= $this->heatmapHTML->renderHeatmapLink($row->uri, (int) $uri2titleId, $day, "&nbsp;<img src='" . $liveSiteWithSuffix . "components/com_extrawatch/img/icons/click.png' title='" . _EW_HEATMAP_CLICK_OPEN . "'/> <span style='color: " . $userClicksColor . "' title='" . _EW_HEATMAP_CLICK_OPEN . "' $inactiveClass>$userHeatmapClicks</span>", $row->ip);  	 	    	    		  	 	  	 	  		 	 		    	 			 	   		  	 	 		 	 	   	      	  	 		 		 				 			 		  		    	 		 		  
                     }
             */
             $clicks = @$uri2HeatmapClicksAssoc[$row->uri];
             if (@$clicks) {
                 if (@$maxClicksOfDay) {
                     $ratio = $clicks / $maxClicksOfDay;
                     $color = ExtraWatchHelper::rgbFromRatio($ratio);
                 }
                 $heatmapLinkOutput = $this->heatmapHTML->renderHeatmapLink($row->uri, (int) $uri2titleId, $day, "<span style='color: " . $color . "' title='" . _EW_HEATMAP_CLICK_OPEN . "'>{$clicks}</span>");
             }
             $paramData = $this->extraWatch->visit->areParamDataForUri($row->id);
             //TODO optimize
             if ($paramData) {
                 $output .= "<img src='" . $liveSiteWithSuffix . "components/com_extrawatch/img/icons/submit.png' />";
             }
             if (!$renderAsEmail) {
                 /* ad as goal link */
                 $output .= "<div id='goal_" . $row->id . "' style='display: none; margin: 0px; padding: 2px; left: 40%;' class='uriDetailDiv'>" . _EW_STATS_LOADING;
                 $output .= "</div>";
             }
             if ($timeOfVisit) {
             }
             $output .= "<td>{$heatmapLinkOutput}</td>";
             $output .= "<td>";
             if (@$timeOfVisit) {
                 $output .= "<td valign='top'><img src='" . $liveSiteWithSuffix . "components/com_extrawatch/img/icons/clock.png' title='" . _EW_LIVE_STATS_SESSION_TIME . "'/></td><td valign='top'  style='color: grey'>";
                 $output .= $timeOfVisit;
             }
             $output .= "</td>";
             $output .= "</div>";
             //TODO handle post data
             if ($paramData) {
                 $postImage = "<div id='idp{$row->id}' onmouseout=\"toggleDiv('post_" . $row->id . "',0, " . (int) $uri2titleId . ", {$day});\" onmouseover=\"toggleDiv('post_" . $row->id . "',1, " . (int) $uri2titleId . ", {$day});\">";
             } else {
                 $postImage = "";
             }
             $output .= $postImage;
             /* show only last URI, not all by user */
             if ($this->extraWatch->config->getCheckboxValue('EXTRAWATCH_ONLY_LAST_URI')) {
                 break;
             }
             $output .= "</td>";
             $output .= "</tr>";
         }
     }
     $output .= @$this->renderRefererRow($lastReferer, $lastColor);
     unset($uri2HeatmapClicksAssoc);
     unset($downloadLog);
     unset($countryCodeToCountryNameArray);
     return $output;
 }
 function renderMostClickedHTMLElementsTable($day = 0)
 {
     $rows = $this->extraWatchHeatmap->getMostClickedHTMLElements($day);
     $liveSite = $this->extraWatch->config->getLiveSiteWithSuffix();
     $output = "<table class='tablesorter table table-striped'>";
     $output .= sprintf("<thead><tr><th align='center'>%s</th><th align='center'>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th></th></tr></thead><tbody>", _EW_HEATMAP_CLICKS, _EW_GOALS, "element ID", _EW_HEATMAP_TITLE, _EW_EMAIL_REPORTS_1DAY_CHANGE, _EW_EMAIL_REPORTS_7DAY_CHANGE, _EW_EMAIL_REPORTS_28DAY_CHANGE);
     $i = 0;
     if (!$rows) {
         $output .= "</table>";
         $output .= ExtraWatchHelper::renderNoData();
         return $output;
     }
     if (@$rows) {
         $maxClicksForDay = $this->extraWatchHeatmap->getMaxClicksForDay($day);
         foreach ($rows as $row) {
             $trendsCells = $this->extraWatchStatHTML->renderDiffTableCellsAndIcon(EW_DB_KEY_HTML_ELEMENT, addslashes($row->xpath), $day);
             $ratio = $row->clickCount / $maxClicksForDay;
             $color = ExtraWatchHelper::rgbFromRatio($ratio);
             $highlightElementLink = $this->renderHighlightElementLink($liveSite . $row->uri, $row->xpath);
             if ($day) {
                 $link = "<td title='" . ExtraWatchHelper::htmlspecialchars($row->xpath) . "'>" . $highlightElementLink . "</td>";
             } else {
                 $link = "<td>" . $this->renderHighlightElementLink($liveSite . $row->uri, "all", ExtraWatchHelper::htmlspecialchars(ExtraWatchHelper::truncate($row->xpath))) . "</td>";
             }
             $output .= "<tr  class='tableRow" . $i % 2 . "'>" . "<td class='ewCentered' style='color: " . $color . "' width='5%%'>" . $row->clickCount . "</td><td class='ewCentered'>";
             if (@$row->clicked_element_xpath_condition) {
                 //render goal name instead of link
                 $output .= "<a href='" . $this->extraWatch->config->renderLink("goals", "edit&goalId=" . (int) $row->id . "") . "'>" . $row->name . "</a>";
             } else {
                 $output .= "<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>";
             }
             $output .= "</td>" . $link . "<td><a href='" . $liveSite . $row->uri . "' title='" . ExtraWatchHelper::htmlspecialchars($row->title) . "' target='_blank'>" . ExtraWatchHelper::truncate($row->title) . "</a></td>" . $trendsCells . "</tr>";
             $i++;
         }
     }
     $output .= "</tbody></table>";
     return $output;
 }