At first you need to remove the leading line numbers. Then, you need to add the PHP code somewhere it gets parsed.
Something like that:
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2014 Coppermine Dev Team
v1.0 originally written by Gregory Demar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.5.30
$HeadURL: https://svn.code.sf.net/p/coppermine/code/trunk/cpg1.5.x/anycontent.php $
$Revision: 8721 $
**********************************************/
/**
* This file gets included in index.php if you set the option on the configuration panel: "content of the main page".
* It can be used to display any content from any program, it is to be edited according to one's tastes.
*/
if (!defined('IN_COPPERMINE')) {
die('Not in Coppermine...');
}
starttable("100%", $lang_index_php['welcome']);
echo <<< EOT
<tr>
<td class="tableb">
EOT;
$rss = new DOMDocument();
$rss->load('http://site.com/feed/');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}
$limit = 5;
for($x=0;$x<$limit;$x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$link = $feed[$x]['link'];
$description = $feed[$x]['desc'];
$date = date('l F d, Y', strtotime($feed[$x]['date']));
echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
echo '<small><em>Posted on '.$date.'</em></small></p>';
echo '<p>'.$description.'</p>';
}
echo <<< EOT
</td>
</tr>
EOT;
endtable();
?>