Hallo das Widget Top Keywords zeigt bei mir nur 10 Buchstaben an.
Ich habe dies auch auf einer anderen Webseite gesehen:
oder
Sieht bei mir genau so aus.
Die Variable var_dump($keywords); gibt aber alle 10 Keywords aus.
Ich gehe mal da von aus das die Formatierung die die API zurück liefert geändert wurde?
Wie muß der Code denn nun geändert werden damit die Ausgabe wieder stimmt?
<?php // This function will call the API to get best keyword for current URL. // Then it writes the list of best keywords in a HTML list function DisplayTopKeywords($url = "") { // Do not spend more than 1 second fetching the data @ini_set("default_socket_timeout", $timeout = 1); // Get the Keywords data $url = empty($url) ? "http://". $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : $url; $api = "http://www.analytics.ip-profis.de/?module=API&method=Referers.getKeywordsForPageUrl&format=php&filter_limit=10&token_auth=Deine Auth ID&date=previous1&period=week&idSite=390&url=" . urlencode($url); $keywords = @unserialize(file_get_contents($api)); if($keywords === false || isset($keywords["result"])) { // DEBUG ONLY: uncomment for troubleshooting an empty output (the URL output reveals the token_auth) // echo "Error while fetching the Top Keywords from Piwik"; return; } // Display the list in HTML $url = htmlspecialchars($url, ENT_QUOTES); $output = "Top Keywords for $url
- ";
foreach($keywords as $keyword) {
$output .= "
- ". $keyword[0]. " "; } if(empty($keywords)) { $output .= "Nothing yet..."; } $output .= "