* @link http://suczawa.ath.cx/
**/
$xhtml=true;
#wyświetl błąd
function blad($msg)
{
die('
Blad Galerii Zdjec Suczawa 2009!
'.$msg.'');
}
function NaglowekXHTML()
{
global $xhtml;
$xhtml = preg_match('/application\/xhtml\+xml(?![+a-z])(;q=(0\.\d{1,3}|[01]))?/i',
$_SERVER['HTTP_ACCEPT'], $xhtml) && (isset($xhtml[2])?$xhtml[2]:1) > 0 ||
strpos($_SERVER["HTTP_USER_AGENT"], "W3C_Validator")!==false ||
strpos($_SERVER["HTTP_USER_AGENT"], "WebKit")!==false;
header('Content-Type: '.($xhtml?'application/xhtml+x':'text/ht').'ml; charset="utf-8"'); #IE doesn't support application/xhtml+xml - workaround
echo '';
}
function GenerujListeStron()
{
global $cnt;
global $page;
$content = '';
if ($page>1)
{
$content .= '«';
$content .= ' < ';
}
#wygeneruj strony
for ($i=1;$i<=$cnt;$i++)
{
if ($i==$page)
{
if ($i == $cnt)
{
$content .= ''.$i.'';
}
else
{
$content .= ''.$i.''.' | ';
}
}
else
{
if ($i == $cnt)
{
$content .= ''.$i.' ';
}
else
{
$content .= ''.$i.' | ';
}
}
}
#dodaj linka "+1 strona" oraz do ostatniej
if ($page<$cnt)
{
$content .= '>';
$content .= ' »';
}
#dodaj linka do ostatniej strony
echo $content;
}
function Przekieruj($url='index.php', $tresc='')
{
if ($tresc!='')
{
die('
'.$tresc);
}
else
{
die('');
}
}
?>