Newsletter Archive
4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 16, 2014 (RSS)
By Toledoh - March 10, 2014
Hi Guys,
The standard dsiplay of archived newsletters is:
<?php foreach ($archivedNewsletters as $record): ?>
<?php $isSelected = ($record['num'] == $latestNewsletter['num']); ?>
<?php if ($isSelected) { print "<b>"; } ?>
<a href="?<?php echo $record['num']; ?>"><?php echo htmlencode($record['subject']) ?></a><br/>
<?php if ($isSelected) { print "</b>"; } ?>
<?php endforeach ?>
How can I change the order of how they are displayed? ie. orderBy => 'num DESC'
Tim (toledoh.com.au)
By gregThomas - March 14, 2014
Hi Tim,
If you're using the default code generator code, around line 15 you should see this:
$archivedNewsletters = mysql_select('_nlb_messages', "send IN ('all','archive') ORDER BY sent_date DESC");
The second variable in the mysql_select function is the where and order by statement for the archived newsletters. If you wanted to order them by num value you could change it to:
$archivedNewsletters = mysql_select('_nlb_messages', "send IN ('all','archive') ORDER BY num DESC");
Let me know if you have any questions.
Thanks!
Greg
PHP Programmer - interactivetools.com
By Toledoh - March 16, 2014
Thanks Greg - I don't know how I missed that... sorry.
Tim (toledoh.com.au)