getCfg('offset')); $now = JFactory::getDate(); $now->setTimeZone($tz); $data = $this->_doc; $uri = JUri::getInstance(); $url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); $syndicationURL = JRoute::_('&format=feed&type=atom'); if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $data->title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $data->title, $app->getCfg('sitename')); } else { $title = $data->title; } $feed_title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); $feed = "language != "") { $feed .= " xml:lang=\"" . $data->language . "\""; } $feed .= ">\n"; $feed .= " " . $feed_title . "\n"; $feed .= " " . htmlspecialchars($data->description, ENT_COMPAT, 'UTF-8') . "\n"; if (empty($data->category) === false) { if (is_array($data->category)) { foreach ($data->category as $cat) { $feed .= " \n"; } } else { $feed .= " category, ENT_COMPAT, 'UTF-8') . "\" />\n"; } } $feed .= " \n"; $feed .= " " . str_replace(' ', '%20', $data->getBase()) . "\n"; $feed .= " " . htmlspecialchars($now->toISO8601(true), ENT_COMPAT, 'UTF-8') . "\n"; if ($data->editor != "") { $feed .= " \n"; $feed .= " " . $data->editor . "\n"; if ($data->editorEmail != "") { $feed .= " " . htmlspecialchars($data->editorEmail, ENT_COMPAT, 'UTF-8') . "\n"; } $feed .= " \n"; } $feed .= " " . $data->getGenerator() . "\n"; $feed .= ' \n"; for ($i = 0, $count = count($data->items); $i < $count; $i++) { $feed .= " \n"; $feed .= " " . htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8') . "\n"; $feed .= ' \n"; if ($data->items[$i]->date == "") { $data->items[$i]->date = $now->toUnix(); } $itemDate = JFactory::getDate($data->items[$i]->date); $itemDate->setTimeZone($tz); $feed .= " " . htmlspecialchars($itemDate->toISO8601(true), ENT_COMPAT, 'UTF-8') . "\n"; $feed .= " " . htmlspecialchars($itemDate->toISO8601(true), ENT_COMPAT, 'UTF-8') . "\n"; if (empty($data->items[$i]->guid) === true) { $feed .= " " . str_replace(' ', '%20', $url . $data->items[$i]->link) . "\n"; } else { $feed .= " " . htmlspecialchars($data->items[$i]->guid, ENT_COMPAT, 'UTF-8') . "\n"; } if ($data->items[$i]->author != "") { $feed .= " \n"; $feed .= " " . htmlspecialchars($data->items[$i]->author, ENT_COMPAT, 'UTF-8') . "\n"; if ($data->items[$i]->authorEmail != "") { $feed .= " " . htmlspecialchars($data->items[$i]->authorEmail, ENT_COMPAT, 'UTF-8') . "\n"; } $feed .= " \n"; } if ($data->items[$i]->description != "") { $feed .= " " . htmlspecialchars($data->items[$i]->description, ENT_COMPAT, 'UTF-8') . "\n"; $feed .= " " . htmlspecialchars($data->items[$i]->description, ENT_COMPAT, 'UTF-8') . "\n"; } if (empty($data->items[$i]->category) === false) { if (is_array($data->items[$i]->category)) { foreach ($data->items[$i]->category as $cat) { $feed .= " \n"; } } else { $feed .= " items[$i]->category, ENT_COMPAT, 'UTF-8') . "\" />\n"; } } if ($data->items[$i]->enclosure != null) { $feed .= " items[$i]->enclosure->url . "\" type=\"" . $data->items[$i]->enclosure->type . "\" length=\"" . $data->items[$i]->enclosure->length . "\" />\n"; } $feed .= " \n"; } $feed .= "\n"; return $feed; } }