Dobra wreszcie się zmobilizowałem (jak zobaczyłem ile GBot zeżarł mi transferu w tym miesiącu

) i postanowiłem zrobić lofi do phpbb.
Nie takie pełne, ale odchudzony kod, brak grafiki i jest on cały czas dla bota (bo jestem zbulwersowany tym ile transferu mi zeżarł

)
w includes/functions.php
po
<?
dajemy:
function is_bot()
{
global $_SERVER;
$ua = $_SERVER['HTTP_USER_AGENT'];
if (strstr($ua, 'google') || strstr($ua, 'msn') || strstr($ua, 'onet'))
return true;
else
return false;
}
if (is_bot()) $is_bot = 1; else $is_bot = 0;
Tu można sobie dodawać nowe boty do listy.
i żeby botowi wczytał się inny np. header
w includes/page_header.php
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
zamieniamy na
if ($is_bot)
{
$template->set_filenames(array(
'overall_header' => 'bot/overall_header.tpl'
));
}
else
{
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
}
w katalogu templates/TWOJ_STYL/ tworzymy katalog
bot i tam wrzucamy TPL o nazwie overall_header.tpl - ten który ma się wyświetlać botowi
Dla reszty plików analogicznie.