1 rizwank 1.1 <?php
2
3 if (!isset($HTTP_GET_VARS['stage'])) {
4 print "Choose a category name to view the links in that category, which you can then edit.<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=5&stage=1&which=" . $cats[$i] . "\"> • " . $cats[$i] . "</a><br />\n";
14 }
15
16 mysql_free_result($results);
17
18 } elseif ($HTTP_GET_VARS['stage'] == "1") {
19
20 print "Listed below are the links you currently have in <em><strong>" . $HTTP_GET_VARS[which] . "</strong></em>. Click on a link's name to edit it.<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], 'status' => $row[4]);
27 }
28
29 for ($i = 0; $i < count($links); $i++) {
30 $id = $links[$i]['id'];
31 $url = $links[$i]['url'];
32 $extras = $links[$i]['extras'];
33 $title = $links[$i]['title'];
34 $status = $links[$i]['status'];
35 print "• <a href=\"?func=5&stage=2&link_cat=" . $HTTP_GET_VARS[which] . "&link_url=" . $url . "&link_name=" . $title . "&link_extras=" . $extras . "&link_status=" . $status . "&link_id=" . $id ."\">" . $title . "</a> <span class=\"pale\">(" . substr($url,0,20) . "..)</span><br />\n";
36 }
37
38 } elseif ($HTTP_GET_VARS['stage'] == "2") {
39 print "You are now editing your link <em><strong>" . $HTTP_GET_VARS['link_name'] . "</strong></em> in the category <em><strong>" . $HTTP_GET_VARS['link_cat'] . "</strong></em>.";
40 $inc = $mysqvars['path'] . "/lib/admin_editlinks_form.php";
41 include($inc);
42 }
43 rizwank 1.1
44 ?>
|