header("Location:index.php"); die; } else { $id_korisnika = $_SESSION["id_korisnika"]; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>CMS</title> <?php require "includes/header.php"; ?> </head> <body> <div class="container"> <?php if (isset($_GET["id"])) { $vest = new Vest(sanitize($_GET["id"])); $reci = $vest->get_words(); foreach ($reci as $rec) { echo $rec; echo "<br/>"; } } else { echo "Greska u GET id"; } ?> </div> </body> </html>
public function test() { $suma = 0; $rss_array = $this->link_rss(); foreach ($rss_array as $rss) { $raw_rss = file_get_contents($rss["link_rss"]); $xml_rss = new SimpleXMLElement($raw_rss); foreach ($xml_rss->channel->item as $news) { $title = $news->title->__toString(); $desc = $news->description->__toString(); $link = $news->link->__toString(); $vr = $news->pubDate->__toString(); $vr = strtotime($vr); $vreme = date("Y-m-d H:i:s", $vr); $id = Vest::ubaci_vest($title, $link, 1, $vreme, $desc, $this->id_novina, 0); $vest = new Vest($id); $reci = $vest->get_words(); $suma = $suma + count($reci); } } echo 'Broj reci = ' . $suma; }