+ function handler_robotstxt(&$page)
+ {
+ global $globals;
+
+ $disallowed_uris = array();
+ if ($globals->core->restricted_platal) {
+ $disallowed_uris[] = '/';
+ } else if (!empty($globals->core->robotstxt_disallowed_uris)) {
+ $disallowed_uris = preg_split('/[\s,]+/',
+ $globals->core->robotstxt_disallowed_uris,
+ -1, PREG_SPLIT_NO_EMPTY);
+ }
+
+ if (count($disallowed_uris) > 0) {
+ header('Content-Type: text/plain');
+ echo "User-agent: *\n";
+ foreach ($disallowed_uris as $uri) {
+ echo "Disallow: $uri\n";
+ }
+ exit;
+ }
+ return PL_NOT_FOUND;
+ }
+