diff --git a/wp-admin/linkmanager.php b/wp-admin/linkmanager.php index 62cf722ced..1a8c7ce8c2 100644 --- a/wp-admin/linkmanager.php +++ b/wp-admin/linkmanager.php @@ -339,7 +339,7 @@ switch ($action) { } $links_show_cat_id = $cat_id; if (!isset($order_by) || ($order_by == '')) - $order_by = 'order_id'; + $order_by = 'order_name'; setcookie('links_show_cat_id', $links_show_cat_id, time()+600); $standalone=0; include_once ("./b2header.php"); @@ -349,13 +349,13 @@ switch ($action) { switch ($order_by) { - case 'order_name': $sqlorderby = 'name'; break; + case 'order_id': $sqlorderby = 'id'; break; case 'order_url': $sqlorderby = 'url'; break; case 'order_desc': $sqlorderby = 'description'; break; case 'order_owner': $sqlorderby = 'owner'; break; case 'order_rating': $sqlorderby = 'rating'; break; - case 'order_id': //fall through - default: $sqlorderby = 'id'; break; + case 'order_name': + default: $sqlorderby = 'name'; break; } if ($action != "popup") { @@ -416,25 +416,24 @@ switch ($action) {
- - + - - - - - - - - - +
URLNameImg?Vis?Category  
+ + + + + + + + + + link_url); - if (strlen($short_url) > 35) { - $short_url = substr($short_url, 0, 32).'...'; - } - echo("\n"); - echo(" \n"); - echo(" \n"); - if ($row->link_image != null) { - echo(" \n"); - } else { - echo(" \n"); - } - if ($row->link_visible == 'Y') { - echo(" \n"); - } else { - echo(" \n"); - } - echo(" \n"); - echo(" \n"); - echo(" \n"); - echo("\n"); - - echo("\n"); - echo(" \n"); - echo(" \n"); - $my_rel = stripslashes($row->link_rel); - if ($my_rel == '') { - $my_rel = ' '; - } - echo(" \n"); - echo(" \n"); - echo(" \n"); - echo(" \n"); - echo("\n"); - } + // echo "$sql"; + $links = $wpdb->get_results($sql); + foreach ($links as $link) { + $short_url = str_replace('http://', '', $link->link_url); + $short_url = str_replace('www.', '', $short_url); + if ('/' == substr($short_url, -1)) $short_url = substr($short_url, 0, -1); + if (strlen($short_url) > 35) $short_url = substr($short_url, 0, 32).'...'; + + $link->link_name = stripslashes($link->link_name); + $link->category = stripslashes($link->category); + $link->link_rel = stripslashes($link->link_rel); + $image = ($link->link_image != null) ? 'Yes' : 'No'; + $visible = ($link->link_visible == 'Y') ? 'Yes' : 'No'; + ++$i; + $style = ($i % 2) ? ' class="alternate"' : ''; +echo << + + + + + + + + + +LINKS; + } ?> - -
NameURLCategoryRelevanceImageVisible  
link_url."\">".$short_url."".stripslashes($row->link_name)."YNYN".stripslashes($row->category)."link_id'; document.forms['links'].action.value='linkedit'; \" value=\"Edit\" class=\"search\" />link_id'; document.forms['links'].action.value='Delete'; return confirm('You are about to delete this link.\\n \'Cancel\' to stop, \'OK\' to delete.'); \" value=\"Delete\" class=\"search\" />
Desc: ".stripslashes($row->link_description)."Rel:$my_relRating: ".$row->link_rating."Owner:".$row->user_login."
$link->link_name
+ Description: $link->link_description
$short_url$link->category$link->link_rel$image$visible
+ + @@ -592,4 +582,4 @@ switch ($action) { - + \ No newline at end of file