Search

I’m currently using 2.0.8 RC3 and I’m trying to get that “next/previous article”-thing working as described over here. The basic setup is already working just fine - meaning I can navigate to the next/previous article based on the date of the currently displayed article (using output parameter $ds-vd-post).

The problem is that it doesn’t work correctly when there are two articles on the same day. I suspect that the DS filter criterion “[earlier|later] than” doesn’t consider the time, just the date. Is that correct?

I already tried “hacking” the method __buildRangeFilterSQL() used in symphony/lib/toolkit/fields/field.date.php - but due to my lack of PHP/MySQL skill without any success.

Does anybody has a solution for this? wisolman already posted some kind of workaround here but it requires using hard-coded table names which I didn’t manage to fit to my needs yet.

Thanks for the hint - unfortunately this doesn’t solve it. I will try to give an example.

I have three articles:

Article 1 - published ‘2010-07-10 23:12:00’

Article 2 - published ‘2010-07-17 17:03:00’

Article 3 - published ‘2010-07-17 22:07:00’

I have three data-sources:

current-article (output param -> [Date]’published’)

prev-article (no output param)

next-article (no output param)

prev-article and next-article are used to generate a link to the previous/next article regarding the date contained in $ds-current-article. This is done using the filter criterion “[earlier|later] than”.

Now the problem scenario:

$ds-current-article     '2010-07-17 22:07:00'

In the above case the data-source next-article returns a reference to the same item that’s currently displayed. It should not be containing any data since there are no articles with a date later than ‘2010-07-17 22:07:00’.

IMO the problem is that the function invoked by filter later than doesn’t take into account the time.

I will paste the according snippet from function *__buildRangeFilterSQL()* later today…

As mentioned above the __buildRangeFilterSQL function doesn’t seem to include the time in the query that it builds.

This is also the case in the current version of Nils’ Date/Time field extension.

I’m not sure if this is as intended or an oversight, but in my case I need it to take the exact time into account.

Adding in the appropriate %H:%i:%s / H:i:s values seems to make it correctly take the time into account.

This has been discussed several times, and I don’t remember why it has never been implemented.

Would you please post it on the issue tracker so that it will be discussed again when the next version of Symphony is built?

No worries Michael, done.

I’ve updated the issue with a fix I’ve implemented a few weeks ago for a project.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details