PLEASE don't ask questions here, post the actual tip or trick. Many of the JReviews 2 Tips & Tricks posts are still valid so you can refer to those, but since there are also many that are no longer valid we have this JReviews 3 dedicated board.
If you have experience building sites with JReviews, either with design or with development, feel free to advertise your services here. This should become a resource for all JReviews users to find trustworthy freelancers to work on their projects.
3rd party vendors can advertise their JReviews products here. It is a requirement that a pre-sales and support url or email are provided with your post. If your code makes use of any JReviews proprietary code you must get permission from us before you share or sell your product. We reserve the right to remove a post without prior notice. We also ask that you lock your posts to prevent this from becoming a support forum for 3rd party products.
So this is what I've come up with based on the workaround idea I mentioned in the last post. It definitely works, just not sure if there's a better way?
<?php $expired = $listing['Listing']['publish_down'] != NULL_DATE && strtotime($listing['Listing']['publish_down']) < time(); ?>
<?php if($expired == "0"):?>
<!–– listing template --!>
Yeah that sounds like what's happening. Only issue is that we need to be able to stop the listing outputting part way through the day as it relates to offers which we're not supposed to show after they've expired. Setting to end a day early would't work either as for big events they're only live for part of one day so they wouldn't show at all. Plus interest peaks closer to when the offer ends so again wouldn't want it to end early.
We'd previously been using a butchered version of the joomla banner system to contain these but wanted to use the related listing functions of jreviews.
What if we checked the current time in the module theme file and compared to the joomla expiration time field. We'd have the module on a short cache so there would be a bit of overlap (but we'd have that anyway with the cache, whichever way we did it) but means the database query could still be cached, right?
Not necessarily. For performance reasons, JReviews doesn't include the current time in database queries. That's because if it did, then every time the page loaded the query would be different and MySQL is not able to cache it. So checking for expired listings is done based on the beginning of the day. So the queries look for listings that have an expiration date/time higher than the beginning of today. I guess this could turn into an issue if Joomla considers an article expiring at noon as expired, but JReviews allows it to show for the entire day since it was after all higher than the beginning of today. The only solution here, so as not to mess up with performance, would be to expire the listing one day before so that if the expiration is noon today, it will only show till the end of the previous day.
Does any of this make sense and sounds like it could be the issue based on what you are seeing? There's also the issue with server time vs. real time, but hopefully, that's not something that's affecting this as well as there are built-in methods to take care of that.
We've not upgraded to 3.x but it is the latest version of 2.7 (v188.8.131.52).
So after doing a bit more digging it seems that they are expiring but the time is ignored - ie: ones expired yesterday are removed but ones expired earlier today are still showing.
Is that by design?