Hello,
I have a news multi list page. On the detail page I have the following:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/finishs/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
list($news_pagesRecords, $news_pagesMetaData) = getRecords(array(
'tableName' => 'news_pages',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',));
list($onews_pagesRecords, $onews_pagesMetaData) = getRecords(array(
'tableName' => 'news_pages',));
$news_pagesRecord = @$news_pagesRecords[0];
if (!$news_pagesRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;}?>
The page is displayed as normal. In the sidebar I would like to list all the Other news items but NOT the current one as obviously the visitor is on it.
In the sidebar I have the following:
<ul class="latestnews">
<?php foreach ($onews_pagesRecords as $record): ?>
<li>
<img src="<?php echo $record['sidebar_list_url'] ?>" alt="<?php echo $record['list_title'] ?>" class="alignleft imgbox"/>
<span class="blogtitle"><a href="/news/<?php echo $record['url_keywords'] ?>-<?php echo $record['num'] ?>"><?php echo $record['list_title'] ?></a></span>
<p><?php echo $record['list_content'] ?></p>
</li>
<?php endforeach ?>
</ul>
How do I change the sidebar code to show all the latest news items other than the current one?
Thanks Jono