I proszę o przeniesienie tematu bo chyba zły dział

Kod
<?php
ob_start();// Bufor
session_start();
// Wcms 3.0 beta b�edy, sugestie, pomys�y zg�asza�: admin@wmaster.eu
// Pliki konfiguracyjne
require '../config/config.php';
require '../config/db_config.php';
if($_COOKIE['lang']) {
$lang=$_COOKIE['lang'];} else {
$lang=$default_lang;
}
define ('LANGUAGE', $lang);
require '../'.LANG_DIR.'/'.LANGUAGE.'.php';
require '../'.PHP_DIR.'/Sql.class.php';
require '../'.PHP_DIR.'/function.php';
require '../'.PHP_DIR.'/smarty/Smarty.class.php';
$sprawdz=0;
// Klasy
$sql= new Sql;
// Smarty
$tpl= new Smarty;
$tpl->template_dir = TEMPLATES_DIR;// Katalog szablonĂłw
$tpl->compile_dir = '../'.TEMPLATES_DIR.'_c';// Katalog tymczasowych szablonĂłw
function minia ($folder, $nazwa, $szer, $mi)
{
$extension=explode('.', $nazwa);
$lastelement=COUNT($extension)-1;
$roz=$extension[$lastelement];
if(substr($nazwa, -4, 4) == '.jpg' || substr($nazwa, -4, 4) == 'jpeg' || substr($nazwa, -4, 4) == 'JPEG' || substr($nazwa, -4, 4) == '.JPG')
{
$org = imagecreatefromjpeg(''.$folder.''.$nazwa.'');
}
elseif(substr($nazwa, -4, 4) == '.gif')
{
$org = imagecreatefromgif(''.$folder.''.$nazwa.'');
}
$s_org = imagesx($org);
$w_org = imagesy($org);
$wys = floor(($szer * $w_org) / $s_org);
$min = imagecreatetruecolor($szer, $wys);
ImageCopyResampled ($min, $org, 0, 0, 0, 0, $szer, $wys, $s_org, $w_org);
imagedestroy($org);
if(substr($nazwa, -4, 4) == '.jpg' || substr($nazwa, -4, 4) == 'jpeg' || substr($nazwa, -4, 4) == 'JPEG' || substr($nazwa, -4, 4) == '.JPG')
{
imagejpeg($min, ''.$folder.$mi.$nazwa.'', 100);
}
elseif(substr($nazwa, -4, 4) == '.gif' || substr($nazwa, -4, 4) == '.GIF')
{
imagegif($min, ''.$folder.$mi.$nazwa.'');
}
imagedestroy($min);
}
if ($_SESSION['admin']) {
//Header
require 'php/header.php';
// Tre�� strony
require 'php/tresc.php';
// Stopka strony
require PHP_DIR.'/foter.php';
ob_end_flush();
?>
ob_start();// Bufor
session_start();
// Wcms 3.0 beta b�edy, sugestie, pomys�y zg�asza�: admin@wmaster.eu
// Pliki konfiguracyjne
require '../config/config.php';
require '../config/db_config.php';
if($_COOKIE['lang']) {
$lang=$_COOKIE['lang'];} else {
$lang=$default_lang;
}
define ('LANGUAGE', $lang);
require '../'.LANG_DIR.'/'.LANGUAGE.'.php';
require '../'.PHP_DIR.'/Sql.class.php';
require '../'.PHP_DIR.'/function.php';
require '../'.PHP_DIR.'/smarty/Smarty.class.php';
$sprawdz=0;
// Klasy
$sql= new Sql;
// Smarty
$tpl= new Smarty;
$tpl->template_dir = TEMPLATES_DIR;// Katalog szablonĂłw
$tpl->compile_dir = '../'.TEMPLATES_DIR.'_c';// Katalog tymczasowych szablonĂłw
function minia ($folder, $nazwa, $szer, $mi)
{
$extension=explode('.', $nazwa);
$lastelement=COUNT($extension)-1;
$roz=$extension[$lastelement];
if(substr($nazwa, -4, 4) == '.jpg' || substr($nazwa, -4, 4) == 'jpeg' || substr($nazwa, -4, 4) == 'JPEG' || substr($nazwa, -4, 4) == '.JPG')
{
$org = imagecreatefromjpeg(''.$folder.''.$nazwa.'');
}
elseif(substr($nazwa, -4, 4) == '.gif')
{
$org = imagecreatefromgif(''.$folder.''.$nazwa.'');
}
$s_org = imagesx($org);
$w_org = imagesy($org);
$wys = floor(($szer * $w_org) / $s_org);
$min = imagecreatetruecolor($szer, $wys);
ImageCopyResampled ($min, $org, 0, 0, 0, 0, $szer, $wys, $s_org, $w_org);
imagedestroy($org);
if(substr($nazwa, -4, 4) == '.jpg' || substr($nazwa, -4, 4) == 'jpeg' || substr($nazwa, -4, 4) == 'JPEG' || substr($nazwa, -4, 4) == '.JPG')
{
imagejpeg($min, ''.$folder.$mi.$nazwa.'', 100);
}
elseif(substr($nazwa, -4, 4) == '.gif' || substr($nazwa, -4, 4) == '.GIF')
{
imagegif($min, ''.$folder.$mi.$nazwa.'');
}
imagedestroy($min);
}
if ($_SESSION['admin']) {
//Header
require 'php/header.php';
// Tre�� strony
require 'php/tresc.php';
// Stopka strony
require PHP_DIR.'/foter.php';
ob_end_flush();
?>