diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index e7968df421..f6cbe2abb7 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -8,20 +8,20 @@ $title = 'Manage Links'; $this_file = 'link-manager.php'; function category_dropdown($fieldname, $selected = 0) { - global $wpdb, $tablelinkcategories; - - $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id"); - echo ' \n"; + global $wpdb, $tablelinkcategories; + + $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id"); + echo "\n\n"; } function add_magic_quotes($array) { @@ -44,6 +44,7 @@ $wpvarstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'); + for ($i=0; $iquery("update $tablelinks SET link_owner='$newowner' WHERE link_id IN ($all_links)"); - header('Location: '.$this_file); + header('Location: ' . $this_file); break; } case 'Visibility': @@ -108,7 +110,7 @@ switch ($action) { //for each link id (in $linkcheck[]): toggle the visibility if (count($linkcheck) == 0) { - header('Location: '.$this_file); + header('Location: ' . $this_file); exit; } $all_links = join(',', $linkcheck); @@ -132,7 +134,7 @@ switch ($action) { $q = $wpdb->query("update $tablelinks SET link_visible='Y' WHERE link_id IN ($all_linkson)"); } - header('Location: '.$this_file); + header('Location: ' . $this_file); break; } case 'Move': @@ -145,14 +147,14 @@ switch ($action) { //for each link id (in $linkcheck[]) change category to selected value if (count($linkcheck) == 0) { - header('Location: '.$this_file); + header('Location: ' . $this_file); exit; } $all_links = join(',', $linkcheck); // should now have an array of links we can change $q = $wpdb->query("update $tablelinks SET link_category='$category' WHERE link_id IN ($all_links)"); - header('Location: '.$this_file); + header('Location: ' . $this_file); break; } @@ -161,16 +163,16 @@ switch ($action) { $standalone = 1; include_once('admin-header.php'); - $link_url = $HTTP_POST_VARS["linkurl"]; - $link_name = $HTTP_POST_VARS["name"]; - $link_image = $HTTP_POST_VARS["image"]; - $link_target = $HTTP_POST_VARS["target"]; - $link_category = $HTTP_POST_VARS["category"]; - $link_description = $HTTP_POST_VARS["description"]; - $link_visible = $HTTP_POST_VARS["visible"]; - $link_rating = $HTTP_POST_VARS["rating"]; - $link_rel = $HTTP_POST_VARS["rel"]; - $link_notes = $HTTP_POST_VARS["notes"]; + $link_url = $HTTP_POST_VARS['linkurl']; + $link_name = $HTTP_POST_VARS['name']; + $link_image = $HTTP_POST_VARS['image']; + $link_target = $HTTP_POST_VARS['target']; + $link_category = $HTTP_POST_VARS['category']; + $link_description = $HTTP_POST_VARS['description']; + $link_visible = $HTTP_POST_VARS['visible']; + $link_rating = $HTTP_POST_VARS['rating']; + $link_rel = $HTTP_POST_VARS['rel']; + $link_notes = $HTTP_POST_VARS['notes']; $auto_toggle = get_autotoggle($link_category); if ($user_level < get_settings('links_minadminlevel')) @@ -193,7 +195,7 @@ switch ($action) { case 'editlink': { - if (isset($submit) && ($submit == "Save")) { + if (isset($submit)) { if (isset($links_show_cat_id) && ($links_show_cat_id != '')) $cat_id = $links_show_cat_id; @@ -207,17 +209,17 @@ switch ($action) { $standalone = 1; include_once('admin-header.php'); - $link_id = $HTTP_POST_VARS["link_id"]; - $link_url = $HTTP_POST_VARS["linkurl"]; - $link_name = $HTTP_POST_VARS["name"]; - $link_image = $HTTP_POST_VARS["image"]; - $link_target = $HTTP_POST_VARS["target"]; - $link_category = $HTTP_POST_VARS["category"]; - $link_description = $HTTP_POST_VARS["description"]; - $link_visible = $HTTP_POST_VARS["visible"]; - $link_rating = $HTTP_POST_VARS["rating"]; - $link_rel = $HTTP_POST_VARS["rel"]; - $link_notes = $HTTP_POST_VARS["notes"]; + $link_id = $HTTP_POST_VARS['link_id']; + $link_url = $HTTP_POST_VARS['linkurl']; + $link_name = $HTTP_POST_VARS['name']; + $link_image = $HTTP_POST_VARS['image']; + $link_target = $HTTP_POST_VARS['target']; + $link_category = $HTTP_POST_VARS['category']; + $link_description = $HTTP_POST_VARS['description']; + $link_visible = $HTTP_POST_VARS['visible']; + $link_rating = $HTTP_POST_VARS['rating']; + $link_rel = $HTTP_POST_VARS['rel']; + $link_notes = $HTTP_POST_VARS['notes']; $auto_toggle = get_autotoggle($link_category); if ($user_level < get_settings('links_minadminlevel')) @@ -238,8 +240,8 @@ switch ($action) { " link_notes='" . addslashes($link_notes) . "'\n" . " WHERE link_id=$link_id"); } // end if save - setcookie('links_show_cat_id_'.$cookiehash, $links_show_cat_id, time()+600); - header('Location: '.$this_file); + setcookie('links_show_cat_id_' . $cookiehash, $links_show_cat_id, time()+600); + header('Location: ' . $this_file); break; } // end Save @@ -248,12 +250,12 @@ switch ($action) { $standalone = 1; include_once('admin-header.php'); - $link_id = $HTTP_POST_VARS["link_id"]; + $link_id = $HTTP_GET_VARS["link_id"]; if ($user_level < get_settings('links_minadminlevel')) die ("Cheatin' uh ?"); - $wpdb->query("DELETE FROM $tablelinks WHERE link_id = '$link_id'"); + $wpdb->query("DELETE FROM $tablelinks WHERE link_id = $link_id"); if (isset($links_show_cat_id) && ($links_show_cat_id != '')) $cat_id = $links_show_cat_id; @@ -273,12 +275,12 @@ switch ($action) { $standalone=0; include_once ('admin-header.php'); if ($user_level < get_settings('links_minadminlevel')) { - die("You have no right to edit the links for this blog.
Ask for a promotion to your blog admin. :)"); + die("You have no right to edit the links for this blog.
Ask for a promotion to your blog admin. :)"); } - $row = $wpdb->get_row("SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel, link_notes " . - " FROM $tablelinks " . - " WHERE link_id = $link_id"); + $row = $wpdb->get_row("SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel, link_notes + FROM $tablelinks + WHERE link_id = $link_id"); if ($row) { $link_url = stripslashes($row->link_url); @@ -294,52 +296,47 @@ switch ($action) { } ?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
Edit a link:
URL:
Display Name/Alt text:
Image:
Description:
Rel:
Notes:
Rating: - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - -
URI:
Link Name:
Image:
Description:
rel:
Notes:
Rating: (Leave at 0 for no rating.) -
Target: -   -   -
Visible: -   -
: - -
-   - -
+ (Leave at 0 for no rating.)
Target: +  +
Visible: +  +
Category:
+   + + + + +
+