scriptsUrl, $this_buffer); $this_buffer = str_replace("$" . "(copyRight)", $config->copyRight, $this_buffer); $this_buffer = str_replace("$" . "(publisherEmail)", $config->publisherEmail, $this_buffer); $this_buffer = str_replace("$" . "(creatorEmail)", $config->creatorEmail, $this_buffer); $articlesTable->SetFilter(); $wcCategory = 0; if (isset($SUBMIT_FORM_VARS["wcCategory"])){ $wcCategory = (int) $SUBMIT_FORM_VARS["wcCategory"]; } $wcHeadlines = 5; if (isset($SUBMIT_FORM_VARS["wcHeadlines"])){ $wcHeadlines = (int) $SUBMIT_FORM_VARS["wcHeadlines"]; } $name = ""; $row = $categoriesTable->selectById($wcCategory); if ($row != null){ $id = $row->id; $name = $row->category_name; $itemsCount = $articlesTable->getRowsCount($row->id); if ($row->parent_cat != 0){ $rowOne = $categoriesTable->selectById($row->parent_cat); $name = $rowOne->category_name . " --> " . $name; } } else { $name = $config->mainTitle; } $this_buffer = str_replace("$" . "(categoryName)", $name, $this_buffer); $rows = $articlesTable->selectByCategoryId($wcHeadlines,$wcCategory); //utvara image hack for ($i=0; $i<16; $i++){ if (isset($rows[$i])){ $item = new RssItem($rows[$i]->id); $item->title = $rows[$i]->title; $item->description = $item->short_descipt($rows[$i]->body); $item->image = $rows[$i]->image; $item->created = $rows[$i]->created; $item->category_id = $rows[$i]->category_id; if ($config->showFriendlyURL=='friendly') { $SEfriendly = $rows[$i]->SEfriendly; if (empty($SEfriendly)) $SEfriendly = $rows[$i]->id; $item->friendlyURL = $categoriesTable->friendly_path($item->category_id) . $SEfriendly . ".html"; $this_buffer = str_replace("$" . "(item" . $i . "Url)", "mainUrl . 'news/' . $item->friendlyURL . "\" />", $this_buffer); } else $this_buffer = str_replace("$" . "(item" . $i . "Url)", "mainUrl . "index.php?news=" . $rows[$i]->id . "\" />", $this_buffer); $this_buffer = str_replace("$" . "(item" . $i . ")", $item->toXml(), $this_buffer); } else{ $this_buffer = str_replace("$" . "(item" . $i . "Url)","",$this_buffer); $this_buffer = str_replace("$" . "(item" . $i . ")","",$this_buffer); } } echo $this_buffer; ?>