Entires Date Filtering

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
peterneill
Posts: 2
Joined: Thu Feb 22, 2018 2:52 pm

Entires Date Filtering

Post by peterneill » Thu Feb 22, 2018 3:07 pm

Hi all,
Love S9y, just getting to grips with it for a project in my office.

I'm trying to hard code a set of dates into the fetch_Entries function.
You can see the screenshot here:
Image

I'm converting the dates to unix timestamps and adding those values to the array defined.

With this config, s9y falls over ( I get a page not working response when I visit the page ) When I revert the range value to null as it is by default works fine.

Does anyone have any ideas? I suspect I'm doing something wrong with my array?

Thanks

Pete

User avatar
garvinhicking
Core Developer
Posts: 30009
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Entires Date Filtering

Post by garvinhicking » Mon Mar 12, 2018 2:00 pm

Hi,

I must admit this might not be the ideal way to achieve it. Instead of patching a core file of serendipity, I would suggest to simply create your own custom template (you can use an existing template to modify, of course). There I would edit the entries.tpl file and simply add another loop on top of the main loop with your fixed manual dates?

Another way would be to actually create blog entries for the time you want and do some special ID checking or so, if you want those blog entries to behave differently.

Even more better, you could use the entryproperties plugin, define a specific property for an entry, and then query that inside the loop...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

peterneill
Posts: 2
Joined: Thu Feb 22, 2018 2:52 pm

Re: Entires Date Filtering

Post by peterneill » Tue Apr 03, 2018 2:00 pm

Thanks for this Garvin!

Appreciate it. Just coming back to this issue now. Is it possible to filter the date via the URL?

Such as something like in bold below..

http://blah.com/cms/index.php?frontpage&daterange=

or

http://blah.com/cms/index.php?frontpage ... end=YYYYYY[/b]
I ask this as if it was I could use some javascript I have in my project to generate the links i need as needed...

Cheers

Pete

Post Reply