query(' SELECT * FROM blogi WHERE subdomain="'.$SUBDOMAIN.'" AND active="1" LIMIT 1 '); if($DB->num_rows($sql)==0) exit(); $dane=$DB->fetch_array($sql); $BLOG_ID = $dane['id']; $BLOG_ADDRESS='http://www.'.$SUBDOMAIN.'.'.$BASE_DOMAIN; $RSS_TITLE = $SUBDOMAIN.'.blog.bielsko.pl | '.substr(htmlspecialchars($KOMPONENTY->string_filter_out($dane['title']),null,'iso-8859-1'),0,100); $KEYWORDS=substr(htmlspecialchars($KOMPONENTY->string_filter_out($dane['title']),null,'iso-8859-1'),0,100); $dane=$DB->fetch_array($DB->query(' SELECT data FROM news WHERE blog_id="'.$BLOG_ID.'" AND active="1" ORDER BY data DESC LIMIT 1 ')); $tmp=$dane['data']; $d=substr($tmp,8,2); $m=substr($tmp,5,2); $y=substr($tmp,0,4); $h=substr($tmp,11,2); $i=substr($tmp,14,2); $s=substr($tmp,17,2); $build_date=gmdate("r", mktime($h,$i,$s,$m,$d,$y)); //$build_date=str_replace('+0000','-0700',$build_date); $header=' blog.bielsko.pl '.$RSS_TITLE.' '.$RSS_TITLE.' http://www.blog.bielsko.pl/ pl-pl '.$copyright.' '.$build_date.' '.$build_date.' 5 '; $footer=' '; function relToAbs($text, $base) { if(empty($base)) return $text; // base url needs trailing / // if(substr($base, -1, 1)!="/") $base.="/"; /* // Replace links $pattern = "/]*) "."href=\"[^http|ftp|https]([^\"]*)\"/"; $replace = "query(' SELECT * FROM news WHERE blog_id="'.$BLOG_ID.'" AND active="1" ORDER BY data DESC, id DESC LIMIT 25 '); while($dane=$DB->fetch_array($sql)) { $tmp=$dane['data']; $d=substr($tmp,8,2); $m=substr($tmp,5,2); $y=substr($tmp,0,4); $h=substr($tmp,11,2); $i=substr($tmp,14,2); $s=substr($tmp,17,2); $data=gmdate("r", mktime($h,$i,$s,$m,$d,$y)); // $data=str_replace('+0000','-0700',$data); $title=htmlspecialchars($KOMPONENTY->string_filter_out($dane['title']),null,'iso-8859-1'); $news=$KOMPONENTY->string_filter_out($dane['content']); $news=relToAbs($news, $BLOG_ADDRESS.'/'); $news=htmlspecialchars($news,null,'iso-8859-1'); $title2=str_replace('"','', $title); $title2=str_replace('"','', $title2); $title2=str_replace('%22','', $title2); $link=$BLOG_ADDRESS.'/blog_news,'.$dane['id'].'.html'; $content.=' '.$title.' '.$link.' '.$link.' '.$data.' '.$news.' '; } print($header.$content.$footer); //file_put_contents('rss_log/'.date('YmdHis').'.txt', var_export($_SERVER, true)); ?>