Honor echo var in get_links(). http://mosquito.wordpress.org/view.php?id=1023 Props: MC_incubus

git-svn-id: http://svn.automattic.com/wordpress/trunk@2461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-03-22 00:08:57 +00:00
parent ecbeff5616
commit e20d004cab
1 changed files with 30 additions and 12 deletions

View File

@ -168,19 +168,27 @@ function get_links($category = -1, $before = '', $after = '<br />',
if (!$results) {
return;
}
$output = "";
foreach ($results as $row) {
if (!isset($row->recently_updated)) $row->recently_updated = false;
echo($before);
$output .= ($before);
if ($show_updated && $row->recently_updated) {
echo get_settings('links_recently_updated_prepend');
$output .= get_settings('links_recently_updated_prepend');
}
$the_link = '#';
if ( !empty($row->link_url) )
$the_link = wp_specialchars($row->link_url);
$rel = $row->link_rel;
if ($rel != '') {
$rel = " rel='$rel'";
}
$desc = wp_specialchars($row->link_description, ENT_QUOTES);
$name = wp_specialchars($row->link_name, ENT_QUOTES);
@ -202,27 +210,37 @@ function get_links($category = -1, $before = '', $after = '<br />',
if ('' != $target) {
$target = " target='$target'";
}
echo("<a href='$the_link'");
echo($rel . $title . $target);
echo('>');
$output.= "<a href='$the_link'";
$output.= $rel . $title . $target;
$output.= '>';
if (($row->link_image != null) && $show_images) {
if (strstr($row->link_image, 'http'))
echo "<img src='$row->link_image' $alt $title />";
$output.= "<img src='$row->link_image' $alt $title />";
else // If it's a relative path
echo "<img src='" . get_settings('siteurl') . "$row->link_image' $alt $title />";
$output.= "<img src='" . get_settings('siteurl') . "$row->link_image' $alt $title />";
} else {
echo($name);
$output.= $name;
}
echo('</a>');
$output.= '</a>';
if ($show_updated && $row->recently_updated) {
echo get_settings('links_recently_updated_append');
$output.= get_settings('links_recently_updated_append');
}
if ($show_description && ($desc != '')) {
echo($between.$desc);
$output.= $between.$desc;
}
echo("$after\n");
$output.= "$after\n";
} // end while
if($echo) {
echo $output;
} else {
return $output;
}
}