Uh-Oh! MySQLinks error: You gave MySQLinc a wrong security code or no security code.\n"; exit; } // no category? better set one. if (!$mysqlinks_category) { $mysqlinks_category = $mysqvars['default_category']; } // no before? better set one. if (!$mysqlinks_before) { $mysqlinks_before = ""; } // no after? better set one. if (!$mysqlinks_after) { $mysqlinks_after = "
\n"; } // build comparison array for recently updated blog checking $classxml = $mysqvars['path'] . "lib/class.xml.php"; require_once($classxml); $file = $mysqvars['xml']; $android = file($file) or die("MySQLinc says: couldn't open recently updated list."); $data = implode("",$android); $obj = new xml($data,"xml"); for($i = 0; $i < count($xml["weblogUpdates_weblog"]); $i++) { $updated[$i] = $xml["weblogUpdates_weblog"][$i]->attributes[0]["url"]; } $updated = implode(' ',$updated); // grab links from the specified category that are marked public $query = "select * from `$mysqlinks_category` where `status` = '1' order by `title`"; $results = mysql_query($query) or die("Invalid query: " . mysql_error()); while ($row = mysql_fetch_array($results)) { $links[] = array('url' => $row[1],'title' => $row[2],'extras' => $row[3], 'status' => $row[4]); } // check and display for ($l = 0; $l < count($links); $l++) { if (isset($links[$l])) { // assign nicer variable names to link components $url = $links[$l]['url']; $extras = $links[$l]['extras']; $title = $links[$l]['title']; $status = $links[$l]['status']; // strip url to it's birthday suit to account for variations i.e. http://gazpachosoup.net vs http://www.gazpachosoup.net $naked = str_replace('http://www.','',$url); $naked = str_replace('http://','',$naked); // check if naked url exists in recently updated list $check = strpos($updated,$naked); // depending on whether or not it's recently updated, print it plain or peanut if ($check === false) { // plain - not recently updated print "$mysqlinks_before$title$mysqlinks_after"; } else { // peanut - recently updated print "$mysqlinks_before$title$mysqlinks_after"; } } } print "
"; if ($mysqlinks_link == "none") { print "\n"; } elseif ($mysqlinks_link == "text") { print "powered by MySQLinks"; } else { print "\"powered"; } unset($links,$updated); ?>