1 rizwank 1.1 <?php
2 //get set
3 include('lib/config.php');
4
5 // get authorised
6 include('lib/validate.php');
7
8 // get connected
9 include('lib/database.php');
10 ?>
11
12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
13 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
14 <head>
15 <title>MySQLinks | Logged In: <?php echo $_SESSION['valid']['name']; ?></title>
16 <link rel="stylesheet" type="text/css" href="mysqlinks.css" media="all" name="default" />
17 <meta http-equiv="imagetoolbar" content="no" />
18 <meta http-equiv="cache-control" content="no-cache" />
19 <meta http-equiv="pragmas" content="no-cache" />
20 <meta http-equiv="robots" content="noindex,nofollow,noarchive,nocache" />
21 <meta http-equiv="Content-type" content='text/html; charset="utf-8"' />
22 rizwank 1.1 <meta http-equiv="Content-Language" content="en-au" />
23 <script LANGUAGE="JAVASCRIPT">
24 <!--//
25 function changeCat() {
26 gourl=document.mysqform.mysqdrop.selectedIndex
27 if (document.mysqform.mysqdrop.options[gourl].value != "none") {
28 location = document.mysqform.mysqdrop.options[gourl].value
29 }
30 }
31
32 //-->
33 </script>
34 <script type="text/javascript">
35 /*
36 Made by Martial Boissonneault © 2001-2004 http://getElementById.com/
37 May be used and changed freely as long as this msg is intact
38 Visit http://getElementById.com/ for more free scripts and tutorials.
39 */
40 function BlurLinks(){
41 if(document.getElementById){
42 lnks=document.getElementsByTagName('a');
43 rizwank 1.1 for(i=0;i<lnks.length;i++){
44 lnks[i].onfocus=new Function("if(this.blur)this.blur()");
45 }
46 }
47 }
48 </script>
49 <style>
50 a {
51 text-decoration: none;
52 background: transparent;
53 color: #365c80;
54 }
55
56 a:hover {
57 text-decoration: underline;
58 background: transparent;
59 color: #800000;
60 }
61
62 a.grey {
63 color: #c0c0c0;
64 rizwank 1.1 background: transparent;
65 }
66 </style>
67 </head>
68 <body style="background: #fff url('mysqlinks_sidebar.png') top left no-repeat; padding-top: 50px;">
69 <center>
70 <form style="display: inline;" name="mysqform">
71 <select name="mysqdrop" onchange="changeCat()" style="font: bold 11px Verdana, Tahoma, Sans-Serif; width: 130px; color: #404040;">
72 <?php
73 if (!isset($HTTP_GET_VARS['cat'])) {
74 // set a default category
75 $cat = $mysqvars['default_category'];
76 } else {
77 $cat = $HTTP_GET_VARS['cat'];
78 }
79
80 $results = mysql_list_tables($mysqdb['name']) or die("Invalid request: " . mysql_error());
81
82 while ($row = mysql_fetch_row($results)) {
83 $funkychars = rawurlencode($row[0]);
84 if ($cat == $row[0]) {
85 rizwank 1.1 print " <option selected value=\"$mysqvars[url]sidebar.php?cat=$funkychars\">$row[0]</option>\n";
86 } else {
87 print " <option value=\"$mysqvars[url]sidebar.php?cat=$row[0]\">$row[0]</option>\n";
88 }
89 }
90
91 mysql_free_result($results);
92
93 // getting the links from the db
94
95 $query = "SELECT * FROM `$cat` ORDER BY `title`";
96
97 $results = mysql_query($query) or die("Invalid query: " . mysql_error());
98
99 while ($row = mysql_fetch_array($results)) {
100 $links[] = array('url' => $row[1],'title' => $row[2],'extras' => $row[3], 'status' => $row[4]);
101 }
102
103 ?>
104 </select>
105 </form>
106 rizwank 1.1 </center>
107
108 <p style="font: 11px/1.1 Verdana, Tahoma, Sans-Serif;">
109 <?php
110
111 // build comparison array for recently updated blog checking
112 require('lib/class.xml.php');
113 $file = $mysqvars['xml'];
114 $data = implode("",file($file)) or die("could not open XML input file");
115 $obj = new xml($data,"xml");
116 for($i = 0; $i < count($xml["weblogUpdates_weblog"]); $i++) {
117 $updated[] = $xml["weblogUpdates_weblog"][$i]->attributes[0]["url"];
118 }
119 $updated = implode(' ',$updated);
120
121 // displaying the links in the specified number of columns
122
123 for ($l = 0; $l < count($links); $l++) {
124 if (isset($links[$l])) {
125 // assign nicer variable names to link components
126 $url = $links[$l]['url'];
127 rizwank 1.1 $extras = $links[$l]['extras'];
128 $title = $links[$l]['title'];
129 $status = $links[$l]['status'];
130 // strip url to it's birthday suit to account for variations i.e. http://gazpachosoup.net vs http://www.gazpachosoup.net
131 $naked = str_replace('http://www.','',$url);
132 $naked = str_replace('http://','',$naked);
133 // check if naked url exists in recently updated list
134 $check = strpos($updated,$naked);
135
136 // depending on whether or not it's recently updated, print it plain or peanut
137 if ($check === false) {
138 // plain - not recently updated
139 //also, check if it's a public or private link and display private in italic
140 if ($status == "0") {
141 print "• <a href=\"$url\" class=\"\" target=\"_main\" title=\"$extras\" onclick=\"javascript:this.className = 'grey'\"><em>$title</em></a><br />\n";
142 } else {
143 print "• <a href=\"$url\" class=\"\" target=\"_main\" title=\"$extras\" onclick=\"javascript:this.className = 'grey'\">$title</a><br />\n";
144 }
145 } else {
146 // peanut - recently updated
147 //also, check if it's a public or private link and display private in italic
148 rizwank 1.1 if ($status == "0") {
149 print "<strong>• <a href=\"$url\" class=\"\" target=\"_main\" title=\"$extras\" onclick=\"javascript:this.className = 'grey'\"><em>$title</em></a></strong><br />\n";
150 } else {
151 print "<strong>• <a href=\"$url\" class=\"\" target=\"_main\" title=\"$extras\" onclick=\"javascript:this.className = 'grey'\">$title</a></strong><br />\n";
152 }
153 }
154 }
155 }
156
157 ?>
158 </p>
159
160
161
162 </body>
163 </html>
|