query("select content_list_1.*, categories2004.NAME, ksiegi.BT as ksiega_BT, teksty2.BT as tekst_BT from content_list_1 inner join categories2004 on content_list_1.U_KATEGORIA = categories2004.ID inner join ksiegi on content_list_1.U_KSIEGA = ksiegi.ID inner join teksty2 on content_list_1.S_ID = teksty2.ID where S_ID = " . $rssItem . " limit 1")); $_rssItem = array( 'kategoria' => $res['NAME'], 'werset' => $res['tekst_BT'], 'ksiega' => $res['ksiega_BT'], 'rozdzial' => $res['U_ROZDZIAL'], 'biblia' => 'Biblia Tysiąclecia', 'kontekst' => $res['U_KONTEKST'], 'nazwa_listy' => 'Słowo Dnia', 'dzien_listy' => $res['S_SENDED_DATE'], ); $rss->printItem($_rssItem); $rss->statlog($db, $rssItem, 1); } else { $res = $db->query("select content_list_1.*, categories2004.NAME, ksiegi.BT as ksiega_BT, teksty2.BT as tekst_BT from content_list_1 inner join categories2004 on content_list_1.U_KATEGORIA = categories2004.ID inner join ksiegi on content_list_1.U_KSIEGA = ksiegi.ID inner join teksty2 on content_list_1.S_ID = teksty2.ID where S_ALREADY_SENDED = 1 order by S_ID desc limit 20"); $_rssData = array(); foreach($res as $v) { $_rssData[] = array( 'title' => ($v['S_SENDED_DATE'] ? ($v['S_SENDED_DATE'] . ': ') : '') . $v['ksiega_BT'] . ' ' . $v['U_ROZDZIAL'], 'data' => $v['tekst_BT'], 'category' => $v['NAME'], 'id' => $v['S_ID'], 'timestamp' => $v['S_SENDED_DATE'], ); } $rss->loadGenerate($_rssData, 'slowo_dnia', 'Słowo Dnia'); $rss->statlog($db, 0, 1); } ?>