dbFields = array(
'robotstxt'=>'User-agent: *'.PHP_EOL.'Allow: /'
);
}
public function form()
{
$html = '
';
$html .= $this->description();
$html .= '
';
$html .= '';
$html .= '';
$html .= '';
$html .= '
';
return $html;
}
public function siteHead()
{
global $WHERE_AM_I;
$html = PHP_EOL.''.PHP_EOL;
if ($WHERE_AM_I=='page') {
global $page;
$robots = array();
if ($page->noindex()) {
$robots['noindex'] = 'noindex';
}
if ($page->nofollow()) {
$robots['nofollow'] = 'nofollow';
}
if ($page->noarchive()) {
$robots['noarchive'] = 'noarchive';
}
if (!empty($robots)) {
$robots = implode(',', $robots);
$html .= ''.PHP_EOL;
}
}
return $html;
}
public function beforeAll()
{
$webhook = 'robots.txt';
if ($this->webhook($webhook)) {
header('Content-type: text/plain');
echo $this->getValue('robotstxt');
exit(0);
}
}
}