$v) { if (is_array($v)) { $array[$k] = add_magic_quotes($v); } else { $array[$k] = addslashes($v); } } return $array; } if (!get_magic_quotes_gpc()) { $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); } $b2varstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes'); for ($i=0; $iquery("UPDATE $tablelinks set link_visible = 'N' WHERE link_category = $link_category"); } $wpdb->query("INSERT INTO $tablelinks (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes) " . " VALUES('" . addslashes($link_url) . "','" . addslashes($link_name) . "', '" . addslashes($link_image) . "', '$link_target', $link_category, '" . addslashes($link_description) . "', '$link_visible', $user_ID, $link_rating, '" . addslashes($link_rel) . "', '" . addslashes($link_notes) . "')"); header('Location: linkmanager.php'); break; } // end Add case 'editlink': { if (isset($submit) && ($submit == "Save")) { if (isset($links_show_cat_id) && ($links_show_cat_id != '')) $cat_id = $links_show_cat_id; if (!isset($cat_id) || ($cat_id == '')) { if (!isset($links_show_cat_id) || ($links_show_cat_id == '')) $cat_id = 'All'; } $links_show_cat_id = $cat_id; $standalone = 1; include_once('b2header.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"]; $auto_toggle = get_autotoggle($link_category); if ($user_level < $minadminlevel) die ("Cheatin' uh ?"); // if we are in an auto toggle category and this one is visible then we // need to make the others invisible before we update this one. if (($auto_toggle == 'Y') && ($link_visible == 'Y')) { $wpdb->query("UPDATE $tablelinks set link_visible = 'N' WHERE link_category = $link_category"); } $wpdb->query("UPDATE $tablelinks SET link_url='" . addslashes($link_url) . "',\n " . " link_name='" . addslashes($link_name) . "',\n link_image='" . addslashes($link_image) . "',\n " . " link_target='$link_target',\n link_category=$link_category,\n " . " link_visible='$link_visible',\n link_description='" . addslashes($link_description) . "',\n " . " link_rating=$link_rating,\n" . " link_rel='" . addslashes($link_rel) . "',\n" . " link_notes='" . addslashes($link_notes) . "'\n" . " WHERE link_id=$link_id"); //error_log($sql); } // end if save setcookie('links_show_cat_id', $links_show_cat_id, time()+600); header("Location: linkmanager.php"); break; } // end Save case 'Delete': { $standalone = 1; include_once('b2header.php'); $link_id = $HTTP_POST_VARS["link_id"]; if ($user_level < $minadminlevel) die ("Cheatin' uh ?"); $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; if (!isset($cat_id) || ($cat_id == '')) { if (!isset($links_show_cat_id) || ($links_show_cat_id == '')) $cat_id = 'All'; } $links_show_cat_id = $cat_id; setcookie("links_show_cat_id", $links_show_cat_id, time()+600); header("Location: linkmanager.php"); break; } // end Delete case 'linkedit': { $standalone=0; include_once ('b2header.php'); if ($user_level < $minadminlevel) { 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"); if ($row) { $link_url = stripslashes($row->link_url); $link_name = stripslashes($row->link_name); $link_image = $row->link_image; $link_target = $row->link_target; $link_category = $row->cat_id; $link_description = stripslashes($row->link_description); $link_visible = $row->link_visible; $link_rating = $row->link_rating; $link_rel = stripslashes($row->link_rel); $link_notes = stripslashes($row->link_notes); } ?>
Edit a link:
URL:
Display Name/Alt text:
Image:
Description:
Rel:
Notes:
Rating:  (Leave at 0 for no rating.)
Target:    
Visible:  
: get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id"); echo " \n"; ?>
 
Ask for a promotion to your blog admin :)"); } switch ($order_by) { 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_name': default: $sqlorderby = 'name'; break; } if ($action != "popup") { ?>
Link Categories: Manage Link Categories Import Blogroll
Show links in category:
Order by:
get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id"); echo " \n"; ?>
Add a link:
URL:
Display Name/Alt text:
Image:
Description:
Rel:
Notes:
Rating:  (Leave at 0 for no rating.)
Target:    
Visible:  
: get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id"); echo " \n"; ?>

You can drag link this to your toolbar and when you click it a window will pop up that will allow you to add whatever site you're on to your links! Right now this only works on Mozilla or Netscape, but we're working on it.