echo '<div style="float:right; border: 1px solid lightgray; width: 200px; min-height:80px; padding: 3px">'; echo "<strong>{$xmlName}</strong><br>"; echo $projectsClass->create_project_menu($_GET['id'], $xmlMainBlock); echo '</div>'; switch ($_GET['body']) { default: $xmlMOTD = stripslashes(get_xml_element("motd", $xmlMain)); echo "<h3>" . $xmlName . "</h3>"; echo $xmlMOTD; break; case "description": $xmlDescription = stripslashes(get_xml_element("description", $xmlMain)); echo "<h3>" . $xmlName . ": description</h3>"; echo $xmlDescription; break; case "ToDo": $xmlToDo = stripslashes(get_xml_element("ToDo", $xmlMain)); echo "<h3>" . $xmlName . ": To-Do</h3>"; echo $xmlToDo; break; case "description": $xmlDescription = stripslashes(get_xml_element("description", $xmlMain)); echo "<h3>" . $xmlName . ": description</h3>"; echo $xmlDescription; break; case "ChangeLog": $xmlChangeLog = stripslashes(get_xml_element("ChangeLog", $xmlMain)); echo "<h3>" . $xmlName . ": ChangeLog</h3>"; echo $xmlChangeLog; break; }
/** * Auto-Generate an RSS file < * * @author basic source by Marco Segato <*****@*****.**> * @author Giovanni Piller Cottrer <*****@*****.**> * * @param string $id */ function project2RSS($id) { global $sitename, $siteurl, $newspp, $admin_mail; // tag apertura del feed $this->createXMLFile(); $body = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<rss version=\"2.0\">\n\t<channel>\n"; # general informations $body .= "\t\t<title>{$sitename}</title>\n\t\t<link>{$siteurl}</link>\n\t\t<description><![CDATA[\"{$sitename}\" HEADLINES]]></description>\n"; $body .= "\t\t<managingEditor>{$admin_mail}</managingEditor>\n\t\t<generator>Groupware RSS generator - XML class 1.0 by Gigasoft</generator>\n"; $body .= "\t\t<lastBuildDate>" . date("D, d M Y H:i:s", time()) . " GMT</lastBuildDate>\n"; # load news sorted by data $handle = opendir($id); $modlist = ""; while ($file = readdir($handle)) { if (!($file == "." or $file == "..") and (!ereg("^\\.", $file) and $file != "CVS")) { $modlist .= "{$file} "; } } closedir($handle); $modlist = explode(" ", $modlist); rsort($modlist); # create a Tag for every news for ($i = 0; $i < sizeof($modlist) - 1; $i++) { if ($i >= $newspp) { break; } $string = get_file("news/{$modlist[$i]}"); $mytitle = get_xml_element("fn:title", $string); $mydesc = str_replace("<br>", "<br />", get_xml_element("fn:header", $string)); $id = str_replace(".xml", "", $modlist[$i]); $body .= "\t\t<item>\n"; $body .= "\t\t\t<title>{$mytitle}</title>\n"; $body .= "\t\t\t<link>{$siteurl}/index.php?mod=read&id={$id}</link>\n\t\t\t<description><![CDATA[{$mydesc}]]></description>\n"; $body .= "\t\t\t<pubDate>" . date("D, d M Y H:i:s", $id) . " GMT</pubDate>\n"; $body .= "\t\t</item>\n"; } # last tag $body .= "\t</channel>\n</rss>"; # return Feed RSS return $body; }