diff --git a/linkmanager.php b/linkmanager.php index c41827814d..a837e4f9cf 100644 --- a/linkmanager.php +++ b/linkmanager.php @@ -51,7 +51,7 @@ if (!get_magic_quotes_gpc()) { $b2varstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', - 'submit', 'order_by', 'links_show_cat_id', 'rating'); + 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel'); for ($i=0; $iAsk for a promotion to your blog admin :)"); } - $sql = "SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating " . + $sql = "SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel " . " FROM $tablelinks " . " WHERE link_id = $link_id"; @@ -208,6 +211,7 @@ switch ($action) { $link_description = stripslashes($row->link_description); $link_visible = $row->link_visible; $link_rating = $row->link_rating; + $link_rel = stripslashes($row->link_rel); } ?> @@ -236,6 +240,10 @@ switch ($action) { Description: + + Rel: + + Rating: @@ -408,7 +416,7 @@ switch ($action) {   \n"); echo("\n"); - echo(" Desc: ".stripslashes($row->link_description)."\n"); + echo(" Desc: ".stripslashes($row->link_description)."\n"); + echo(" Rel:\n"); + $my_rel = stripslashes($row->link_rel); + if ($my_rel == '') { + $my_rel = ' '; + } + echo(" $my_rel\n"); echo(" Rating: ".$row->link_rating."\n"); - echo(" Owner:\n"); + echo(" Owner:\n"); echo(" ".$row->user_login."\n"); echo("\n"); } @@ -491,6 +505,10 @@ switch ($action) { Description: + + Rel: + + Rating: diff --git a/links.install.php b/links.install.php index cd3ba6500f..9c6c224859 100644 --- a/links.install.php +++ b/links.install.php @@ -92,6 +92,7 @@ if (!$got_links) { " link_owner int NOT NULL DEFAULT '1', " . " link_rating int NOT NULL DEFAULT '0', " . " link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " . + " link_rel varchar(255) NOT NULL default '', " . " PRIMARY KEY (link_id) " . ") "; $result = mysql_query($sql) or print ("Can't create the table '$tablelinks' in the database.
" . $sql . "
" . mysql_error()); diff --git a/links.php b/links.php index 17cedf1528..b231e7315e 100644 --- a/links.php +++ b/links.php @@ -110,7 +110,7 @@ function get_links($category = -1, $before = '', $after = '
', } dbconnect(); $sql = "SELECT link_url, link_name, link_image, link_target, " . - " link_description, link_rating $get_updated " . + " link_description, link_rating, link_rel $get_updated " . " FROM $tablelinks " . " WHERE link_visible = 'Y' " . $category_query; @@ -139,7 +139,11 @@ function get_links($category = -1, $before = '', $after = '
', if (($row->link_url != null) || ($row->link_url != '')) { $the_link = $row->link_url; } - echo("link_rel); + if ($rel != '') { + $rel = 'rel="'.$rel.'"'; + } + echo("link_description) . "\" target=\"$row->link_target\">"); if (($row->link_image != null) && $show_images) { diff --git a/links.sql b/links.sql index 8fb559f83e..a6d0e396d8 100644 --- a/links.sql +++ b/links.sql @@ -40,6 +40,7 @@ CREATE TABLE b2links ( link_owner int NOT NULL DEFAULT '1', link_rating int NOT NULL DEFAULT '0', link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + link_rel varchar(255) NOT NULL default '', PRIMARY KEY (link_id) ) TYPE=MyISAM; diff --git a/links.update-1.3.sql b/links.update-1.3.sql index bc9c175554..f87bdf2790 100644 --- a/links.update-1.3.sql +++ b/links.update-1.3.sql @@ -28,6 +28,6 @@ -- // ***************************************************************** ALTER TABLE b2links ADD COLUMN link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'; - +ALTER TABLE b2links ADD COLUMN link_rel varchar(255) NOT NULL DEFAULT ''; diff --git a/links.weblogs.com.php b/links.weblogs.com.php index 3d90fff4d3..eddc465de8 100644 --- a/links.weblogs.com.php +++ b/links.weblogs.com.php @@ -4,7 +4,6 @@ require_once('./b2config.php'); require_once($b2inc.'/b2functions.php'); // globals to hold state -$inside_weblog = false; $updated_timestamp = 0; $all_links = array(); @@ -83,7 +82,7 @@ function get_weblogs_updatedfile() { ** Callback function. Called at the start of a new xml tag. **/ function startElement($parser, $tagName, $attrs) { - global $inside_weblog, $updated_timestamp, $all_links; + global $updated_timestamp, $all_links; if ($tagName == 'WEBLOGUPDATES') { //convert 'updated' into php date variable $updated_timestamp = strtotime($attrs['UPDATED']);