• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Hide past date...

umekolle3

New Member
Is it possible to make the table to hide past date (the rows including date that has already past the actual date) through filtering?

I would like the users to have a choice to only see the upcoming events in the table!
 
You should be able to do this with a table filter, using a subquery (which means you'll have to be using the SVN version, as this was added since the last ZIP was built).

The problem is, you can't do straight '<' or ,'>' logic on MySQL dates, you have to use the MySQL date calc functions. And we don't (yet) provide any pre-built options for that. But luckily we can work round this with a subquery. So set your filter up thusly:

FIELD: your_primary_key
Condition: IN
Value: SELECT your_primary_key FROM your_table_name WHERE DATEDIFF(your_date_element,CURDATE()) >= 0
Eval: subquery

Although in SQL terms, this is slightly inefficient, it should work just fine. I tested it on my server, seems to work OK.

This should give you all rows where your_date_element is set to todays date or greater. If you don't want to include 'today', make it > 0 instead of >= 0.

-- hugh
 
Hey Hugh,

I'm trying to do this with a list of events and I've tried the fix you've posted above but it doesn't seem to be happy with that (breaks the whole site with an error message that looks like it's not finding the right database table)

Is this solution still current? and if so in the 'Value' is it ok to put SELECT Date FROM events WHERE DATEDIFF(Date,CURDATE()) >= 0

events = database table
Date = field that I want it to filter by

or do I have to put events___Date in that last part?

Cheers,
Mandie
 
You are posting in a 4-year-old fabrik1.0 thread:eek:
The prefilter should do, but you must select your primary key (usually 'id' in fabrik), so

FIELD: id
Condition: IN
Value:SELECT id FROM events WHERE DATEDIFF(Date,CURDATE()) >= 0
Type: query

id and Date are your (short) element names (= column names in your MySQL database table)
 
ahhh Troester you're a lifesaver when my stupidity appears to have no bounds ... but that didn't work - it doesn't show any data at all with that filter in place


and incidentally I should have posted this in Fabrik 2.0 .. ugh >.<
 
What are your prefilter settings?

I assume you are using fabrik2 (Joomla1.5), not fabrik3?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top