<?php
function dateV($format,$timestamp=null){
'l'=>array('dat'=>'N','str'=>array('Pon','Wt','Śr','Czw','Pt','Sob','Nie')),
'F'=>array('dat'=>'n','str'=>array('sty','lut','mar','kwi','maj','cze','lip','sie','wrz','paź','lis','gru')),
'f'=>array('dat'=>'n','str'=>array('stycznia','lutego','marca','kwietnia','maja','czerwca','lipca','sierpnia','września','października','listopada','grudnia'))
);
if ($pieces = preg_split('#[:/.\-, ]#', $format)){ if ($timestamp === null) { $timestamp = time(); } foreach ($pieces as $datepart){
$replace[] = $to_convert[$datepart]['str'][(date($to_convert[$datepart]['dat'],$timestamp)-1
)]; }else{
$replace[] = date($datepart,$timestamp); }
}
$result = strtr($format,array_combine
($pieces,$replace)); return $result;
}
}
include ('funkcje.php');
include ('szablony/szablony.php');
$konfig = file('dane_konf.php'); $banicja = file('banicja.php'); $skrypt = trim($konfig[1
]); $emot_path = trim($konfig[2
]); {
$newsy = file('newsy.txt'); die('<h4><span class="podswietlenie">Brak newsów!</span></h4>'); }
}
else{
die('<h4><span class="podswietlenie">Brak pliku!</span></h4>'); }
$go=$_GET['go'];
switch ($go) {
case '':
$a=$_GET['a'];
if (empty($a)) {$a = 1; } $l_odp_nastronie = trim($konfig[4
]); $l_odp_napasku = trim($konfig[8
]); $n_obrazek = tresc_wyjscie($n_obrazek);
$skrypt = $skrypt.'?';
$do = $l_odp - ($a * $l_odp_nastronie);
$od = $do + $l_odp_nastronie;
for($i=$od-1; $i>=$do; $i--){
list
($nr,$n_login,$n_data,$n_tytul,$n_tresc,$n_obrazek)=explode('||', $newsy[$i]); $skracanie = trim($konfig[3
]); $n_link = '... <br><a style="text-decoration: none;" href="'.$skrypt.'i='.($i+1).'&go=all"><input type="submit" class="gray nicebutton"style=" position: absolute; margin-top: -95px; float: left; " value=" Czytaj dalej... "></a>';
$n_tresc = skracaj_text($n_tresc,$skracanie,$n_link);
}
$n_tresc = emots($n_tresc,$emot_path);
$n_tresc = tresc_wyjscie($n_tresc);
$plik_kom = 'komentarze/'.$nr.'.txt';
$ile_kom=0;
$n_kom = '<a class="nieaktywny"> komentarze [0] </a>';
}
else{
$plik_kom=file($plik_kom); $ile_kom=count($plik_kom); $n_kom = '<a href="'.$skrypt.'i='.($i+1).'&go=kom#komentarze">komentarze</a><span class="podswietlenie"> ['.$ile_kom.'] </span>';
}
$n_dod = '<a class="skomentuj" href="'.$skrypt.'i='.($i+1).'&go=ad#komentarze">skomentuj</a>';
//$n_autor_link = pokaz_link($n_login);
//$n_autor = pokaz_nick($n_login);
//$n_autor = '<a'.$n_autor_link[1].''.$n_autor_link[0].'>'.$n_autor.'</a>';
$n_tytul = tresc_wyjscie($n_tytul);
$tmpl = new Template('szablony/news.tmpl');
$dane = Array('N_TYTUL'=>$n_tytul, 'N_DATA'=>$n_data,'N_TRESC'=>$n_tresc,'N_OBRAZEK'=>$n_obrazek,'N_AUTOR'=>$n_autor,'N_KOM'=>$n_kom,'N_DOD'=>$n_dod); $tmpl->add($dane);
}
}
pasek($l_odp,$l_odp_nastronie,$l_odp_napasku,$skrypt,$a);