1 rizwank 1.1 <?php
2
3 if (!isset($HTTP_GET_VARS['which'])) {
4 print "Please choose the category from which you wish to delete links.<br />";
5
6 $results = mysql_list_tables($mysqdb['name']) or die("Invalid request: " . mysql_error());
7
8 while ($row = mysql_fetch_row($results)) {
9 $cats[] = $row[0];
10 }
11
12 for ($i = 0; $i < count($cats); $i++) {
13 print "<a href=\"?func=8&which=" . $cats[$i] . "\"> • " . $cats[$i] . "</a><br />\n";
14 }
15
16 mysql_free_result($results);
17
18 } else {
19
20 print "Listed below are the links you currently have in <em>" . $HTTP_GET_VARS[which] . "</em>. Click on a link's name to delete it.<br />\n<span class=\"error\">Make sure you really want to delete the link, as there is no way to undo this operation.</span><br /><br />";
21 $query = "SELECT * FROM `$HTTP_GET_VARS[which]` ORDER BY `title`";
22 rizwank 1.1
23 $results = mysql_query($query) or die("Invalid query: " . mysql_error());
24
25 while ($row = mysql_fetch_array($results)) {
26 $links[] = array('id' => $row[0], 'url' => $row[1],'title' => $row[2],'extras' => $row[3]);
27 }
28
29 for ($i = 0; $i < count($links); $i++) {
30 $url = $links[$i]['url'];
31 $extras = $links[$i]['extras'];
32 $title = $links[$i]['title'];
33 $id = $links[$i]['id'];
34 print "• <a href=\"lib/func_dellinks.php?link_cat=" . $HTTP_GET_VARS[which] . "&link_id=" . $id . "\">" . $title . "</a> <span class=\"pale\">(" . substr($url,0,20) . "..)</span><br />\n";
35 }
36
37 }
38
39 ?>
|