From a4ba40f8f1f4546f6dfed1e3a2b5bf84c4d4896f Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sun, 1 Jun 2003 10:16:04 +0000 Subject: [PATCH] Redid HTML, cleaned up interface, ezSQL, order by name by default. git-svn-id: http://svn.automattic.com/wordpress/trunk@130 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/linkmanager.php | 110 ++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 60 deletions(-) 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