";
$results = mysql_list_tables($mysqdb['name']) or die("Invalid request: " . mysql_error());
while ($row = mysql_fetch_row($results)) {
$cats[] = $row[0];
}
for ($i = 0; $i < count($cats); $i++) {
print " • " . $cats[$i] . "
\n";
}
mysql_free_result($results);
} elseif ($HTTP_GET_VARS['stage'] == "1") {
print "Listed below are the links you currently have in " . $HTTP_GET_VARS[which] . ". Click on a link's name to edit it.
";
$query = "SELECT * FROM `$HTTP_GET_VARS[which]` ORDER BY `title`";
$results = mysql_query($query) or die("Invalid query: " . mysql_error());
while ($row = mysql_fetch_array($results)) {
$links[] = array('id' => $row[0], 'url' => $row[1],'title' => $row[2],'extras' => $row[3], 'status' => $row[4]);
}
for ($i = 0; $i < count($links); $i++) {
$id = $links[$i]['id'];
$url = $links[$i]['url'];
$extras = $links[$i]['extras'];
$title = $links[$i]['title'];
$status = $links[$i]['status'];
print "• " . $title . " (" . substr($url,0,20) . "..)
\n";
}
} elseif ($HTTP_GET_VARS['stage'] == "2") {
print "You are now editing your link " . $HTTP_GET_VARS['link_name'] . " in the category " . $HTTP_GET_VARS['link_cat'] . ".";
$inc = $mysqvars['path'] . "/lib/admin_editlinks_form.php";
include($inc);
}
?>