\n";
$theme->footer();
}
function headline_page() {
global $type;
switch($type) {
case "rdf":
headline_rdf();
break;
default:
headline_blocks();
}
}
function headline_cron() {
$result = db_query("SELECT * FROM channel");
while ($channel = db_fetch_object($result)) {
$backend = new Backend($channel->id);
}
}
function headline_help() {
?>
Drupal's headline module both imports and exports RDF/RSS headlines.
A lot of news-oriented websites are now publishing news (headlines) and make their content available through XML, RSS and RDF backend files. They syndicate content for free and allow retrieval and further transmission, aggregation, or online publication. At the current state, drupal's headline module supports RDF and RSS backends.
RSS was originally developed by Netscape to be able to add news channels to "My Netscape" sites, but has since become adopted as the defacto standard for distributing headlines and brief descriptions of things that change around the net.
The headline module goes out to a list of configured news sites once an hour or so (driven from cron), downloads new RSS/RDF data and makes it available to your visitors. In addition, your headlines are exported as well and can be retrieved at http://yourdomain.com/export/headlines.rdf.
}
function headline_block() {
$result = db_query("SELECT * FROM channel");
while ($channel = db_fetch_object($result)) {
$backend = new Backend($channel->id);
if ($backend->headlines) {
unset($content);
foreach ($backend->headlines as $headline) {
$content .= "
$headline
\n";
}
}
else {
$content = "no headlines available";
}
$blocks[$channel->id]["subject"] = $backend->site;
$blocks[$channel->id]["content"] = $content;
$blocks[$channel->id]["info"] = "$backend->site headlines";
$blocks[$channel->id]["link"] = $backend->url;
}
return $blocks;
}
function headline_admin_display() {
global $theme;
// Get channel info:
$result = db_query("SELECT * FROM channel ORDER BY id");
$output .= "
\n";
$output .= "
site
contact
last update
operations
\n";
while ($channel = db_fetch_object($result)) {
// Load backend from database:
$backend = new backend($channel->id);
$output .= "