Another spider: MJ12bot/v1.2.3; http://www.majestic12.co.uk/bot.php?+
[infodrom.org/www.zeitungsliste.de] / lib / core.inc
index 00645a6..773642d 100644 (file)
@@ -144,6 +144,14 @@ function is_spider()
       strpos($_SERVER['HTTP_USER_AGENT'], 'msnbot') !== false ||
       strpos($_SERVER['HTTP_USER_AGENT'], 'Twiceler-0.9') !== false ||
       strpos($_SERVER['HTTP_USER_AGENT'], 'ScoutJet') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'penthesilea/0.3') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'VisBot/2.0') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'Netluchs/Nutch-1.0') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'Yanga WorldSearch Bot') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'Semager') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'DotBot') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'Baiduspider') !== false ||
+      strpos($_SERVER['HTTP_USER_AGENT'], 'MJ12bot/') !== false ||
       strpos($_SERVER['HTTP_USER_AGENT'], 'Cityreview Robot') !== false) {
     if (isset($_SESSION['uid']))
       $_SESSION['robot'] = true;
@@ -155,6 +163,17 @@ function is_spider()
   return false;
 }
 
+function is_admin()
+{
+  global $_SESSION;
+
+  if (!array_key_exists('nickname', $_SESSION))
+    return false;
+
+  error_log( $_SESSION['nickname'] === 'Joey');
+  return $_SESSION['nickname'] === 'Joey';
+}
+
 function format_info_bookmarks()
 {
   global $_SESSION;
@@ -171,11 +190,11 @@ function format_info_bookmarks()
 
   $sth = db_query($query);
 
-  if ($sth === false || pg_NumRows ($sth) == 0)
+  if ($sth === false || pg_num_rows ($sth) == 0)
     return false;
 
   $ret = '<p><ul>';
-  for ($n=0; $n < pg_NumRows ($sth); $n++) {
+  for ($n=0; $n < pg_num_rows ($sth); $n++) {
     $row = pg_fetch_array ($sth, $n);
     $ret .= sprintf('<li><a href="%szeitung/%d.html">%s</a></li>',
                    $cfg['basepath'], $row['zeitung'], $row['name']);