Ciao,
vorrei richiamare in questa home page le ultime 3 news di questa pagina.
Che codice devo usare per richiamare le news?
Questo è il codice php:
// Security stuff
unset($authortext);
unset($archive_content);
unset($en_paths);
unset($en_settings);
// Paths
$en_paths['script'] = '.'; // Path to the Script
// The following paths shouldn't be modified unless you know, what you're doing
$en_paths['data'] = $en_paths['script'] . '/data'; // Path to the data (without / at the end, can become closed by htaccess)
$en_paths['img'] = $en_paths['script'] . '/img'; // Path to the images (without / at the end)
$en_paths['templates'] = $en_paths['script'] . '/templates'; // Path for the templatefolder (without / at the end, can become closed by htaccess)
$en_paths['newsfile'] = $en_paths['data'] . '/news.dat'; // Path to the newsfile
require_once($en_paths['data'] . '/settings.php');
require_once($en_paths['data'] . '/design.php');
require_once($en_paths['script'] . '/functions.inc.php');
if ($en_settings['archive_header']) eval ('echo "' . en_gettemplate('archive_header') . '";');
// start
if ($en_settings['archive']) {
// read in newsfile
$newsfile = file($en_paths['newsfile']);
$newsfilesize = sizeof($newsfile);
if (!$en_settings['byday']) eval ('$archive_content .= "' . en_gettemplate('archive_block_start') . '";');
for($r = 0; $r < $newsfilesize; $r++) {
$newscontent = en_getdata(chop($newsfile[$r]), $en_newsscheme);
$newsdate = $newscontent['date'];
$newstime = $newscontent['time'];
// Note: &komma; is just a placeholder and not a valid HTML-Entity and AFAICS no browser supports it
$headline = str_replace('&komma;', ',', $newscontent['title']);
$postername = str_replace('&komma;', ',', $newscontent['author']);
$posteremail = str_replace('&komma;', ',', trim($newscontent['email']));
$commentid = $newscontent['commentid'];
$newsid = ($newsfilesize - $r);
if ($en_settings['byday']) {
if (!$currentdate or $newsdate != $currentdate) {
// display headline with date
if ($currentdate) eval ('$archive_content .= "' . en_gettemplate('archive_block_end') . '";');
eval ('$archive_content .= "' . en_gettemplate('archive_date') . '";');
eval ('$archive_content .= "' . en_gettemplate('archive_block_start') . '";');
$currentdate = $newsdate;
}
$dateortime = $newstime;
} else {
$dateortime = $newsdate;
}
if ($en_settings['author']) eval ('$authortext = "' . en_gettemplate('archive_author') . '";');
eval ('$archive_content .= "' . en_gettemplate('archive_line') . '";');
}
// close tags and display link back
eval ('$archive_content .= "' . en_gettemplate('archive_block_end') . '";');
eval ('echo "' . en_gettemplate('archive_main') . '";');
eval ('echo "' . en_gettemplate('archive_backhome') . '";');
} else {
eval ('echo "' . en_gettemplate('archive_notactive') . '";');
}
if ($en_settings['archive_header']) eval ('echo "' . en_gettemplate('archive_footer') . '";');