1
0

Use return instead of echo in the remaining core

Debug-messages still may use echo, and some functions in functions_image and trackback still use it to generate progress messages, which should get cleaned up as well but is not that urgent
This commit is contained in:
onli
2013-07-05 19:16:11 +02:00
parent 0614fcdf51
commit d80a8334c8
16 changed files with 51 additions and 73 deletions

View File

@ -856,7 +856,7 @@ function serendipity_track_url($list, $url, $entry_id = 0) {
* @return string List of Top referrers
*/
function serendipity_displayTopReferrers($limit = 10, $use_links = true, $interval = 7) {
serendipity_displayTopUrlList('referrers', $limit, $use_links, $interval);
return serendipity_displayTopUrlList('referrers', $limit, $use_links, $interval);
}
/**
@ -870,7 +870,7 @@ function serendipity_displayTopReferrers($limit = 10, $use_links = true, $interv
* @return string List of Top exits
*/
function serendipity_displayTopExits($limit = 10, $use_links = true, $interval = 7) {
serendipity_displayTopUrlList('exits', $limit, $use_links, $interval);
return serendipity_displayTopUrlList('exits', $limit, $use_links, $interval);
}
/**
@ -913,18 +913,18 @@ function serendipity_displayTopUrlList($list, $limit, $use_links = true, $interv
}
$rows = serendipity_db_query($query);
echo "<span class='serendipityReferer'>";
$output = "<span class='serendipityReferer'>";
if (is_array($rows)) {
foreach ($rows as $row) {
if ($use_links) {
printf(
$output .= sprintf(
'<span class="block_level"><a href="%1$s://%2$s" title="%2$s" >%2$s</a> (%3$s)</span>',
htmlspecialchars($row['scheme']),
htmlspecialchars($row['host']),
htmlspecialchars($row['total'])
);
} else {
printf(
$output .= sprintf(
'<span class="block_level">%1$s (%2$s)</span>',
htmlspecialchars($row['host']),
htmlspecialchars($row['total'])
@ -932,7 +932,8 @@ function serendipity_displayTopUrlList($list, $limit, $use_links = true, $interv
}
}
}
echo "</span>";
$output .= "</span>";
return $output;
}
/**