Re: [rez] category listings / finding last record
Hi there.
We aren't in on the weekends but here I am now :).
Based on the code you posted, the idea I started thinking about is already something you've setup for a different part of this page.
What you'll want to do is where the </event> tag needs to go, check if the current month equals the previous month. If it doesn't, add the </event> tag.
It's pretty much the same thing you are doing with the $old_group = ''; variable. Each loop, you are checking if the group name is the same.
What you'll want to do here is create another variable $lastDate and use it like this with the </events> tag:
<?php if $lastDate == date("d-m-Y", strtotime($record['date'])): ?>
</events>
<?php endif ?>
Does that make sense? My code isn't exactly setup for copy paste but I think that should give you an idea of what to do.
Let me know what you come up with :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/