Hi Zack,
Excellent Addon first of all, but I'm sure you've heard that before :P
I have multiple forms all for capturing football results from each specific team to display on separate team pages through the season. I also have a single page where I want to display just the previous week's results for every team. I'll be using a separate directory line for each one but I want to be able to query just the last 7 days worth of results from each form.
Is there a way to do that using the filters or tags within the directory query line, or can you only apply to the functions.php file and therefore will apply to all forms?
http://wordpress.org/extend/plugins/gravity-forms-addons/
Neat idea - I'll look into how this might be added.
It turns out I already added this functionality :-)
Okay, so you can add the start_date and end_date attributes to your [directory] code to filter by date, formatted like so: 2011-08-26 22:39:10 or 2011-08-26.
[directory form="#" start_date="2011-08-26" end_date="2011-09-07"] would show listings from August 26 to September 9th.
Zack, you legend!
Thanks for that, it's exatcly what I needed!
Zack... Not working... I've set the filter and the form is still displaying all the results. Can you double check the format you gave me is correct?
It worked for me...try using the latest version (3.0) of the plugin and let me know if that helps.
V3 has killed the plugin!
I cant approve any of the entries and nothing is displaying as a result. Some of the displays show a PHP fatal error!
Fatal error: Call to undefined method GFDirectory::get_lead_details_table_name() in /home/********/public_html/wp-content/plugins/gravity-forms-addons/gravity-forms-addons.php on line 2190
Thanks for reporting neo. I'll fix tomorrow. If you change self::get_lead_table_name() to RGFormsModel::get_lead_table_name() and self::get_lead_details_table_name() to RGFormsModel::get_lead_details_table_name() around those lines, it should fix that error.
Like I said, I'll post the fix ASAP.
I've amended self::get_lead_table_name() to RGFormsModel::get_lead_table_name() and the form displays now but still with no entries, and I get the following error when trying to approve any entries:
Warning: Invalid argument supplied for foreach() in /home/redhouse/public_html/wp-content/plugins/gravity-forms-addons/gravity-forms-addons.php on line 1739
Still cant approve anything, and the "approve" field is empty when you select it in the form editor (nothin under "properties", "advanced" or "directory" and you can't even edit the "Untitled" title.
I love the plugin but I'm thinking this version need a little more work before it's relaunched?
Date filtering is better supported in version 3.0.1, just released - it has its own settings in the Insert Directory window.
Also, please try the Approval process again once upgrading to 3.0.1 and let me know how it goes.
@neo - This should be fixed in version 3.0.2, just released.
There was code that was only compatible with Gravity Forms 1.6, and because I had installed 1.6 already, my database tables were altered by the upgrade. When I downgraded to test for compatibility, the database tables were still in their modified state. So that's why I was unable to replicate the issue.
Please upgrade to 3.0.2 and let me know if that fixes things for you.
Almost, but not quite!
At first the directory was not displaying but I started removing tags and when I removed the "sort" tag the entries appeared. So it looks like you've knocked off the sort tag to sort by specific column?
Also, the date range is a little erratic. I have a a list of forms with multiple entries and I've set up a row of identical directories to pull the same date range from each form. Most of them display the correct entries for hose dates but there are a few which either include entries outside the date range, or display no entries where there are entries to display in the date range.
I didn't modify anything with the sort functionality - also it's working fine for me. Regarding the date range, that's done using the following MySQL code:
datediff(date_created, '$end_date') <=0 and
datediff(date_created, '$start_date') >=0
That uses the date_created field for each entry. Not sure why yours may not be working properly. Sending me links helps; making me a login is better.
Ahhhhh.... silly me. I have a date field and for some reason I thought it would set the range on that. It makes sense now, however that functionality doesn't help me. Pity, but I'm guessing there's no way to set the date range based on a user entered date field (maybe using the variable function)?
I'll test the sort issue again but it was def removing the directory when set.
Tested the sort function again and still the same issue. When I don't use sort, it works fine. As soon as I add sort="8", I get the "form has no entries" message...!??
Try adding ?sort=8 to the URL and see if that works.
Otherwise, send me a link or login. I can't help more otherwise.
Nope, that didnt work either. What lvl of login do you need? The page in question is at http://redhousefarmjfc.co.uk/?page_id=2013...
If you're in europe, the format might be different; it might be yyyy-dd-mm. It's whatever format your date_created field is in in the wp_rg_lead table.
I need whatever level has access to the Directory. With the Members plugin, that can be specified. Otherwise, it's level 7 (editor?).
Thanks Zack, the date range is working fine (I didn't realise it was created_date rather than user defined date field). Could I modify the core plugin files to change created_date to "variable for date field in form" so the date range applied is based on the user defined date?
With the "sort" issue, I've discovered that if I put a field name like "Team" instead of the number 8, it lists the entries (although unsorted) so I'm thinking maybe "8" is not assigned to any field which is why is returns no entries. How can I see what ID is assigned to each field in a form?
By the way, really appreciate the effort you're putting in to get these issues sorted. So many plug-ins fall down because of lack of support. Credit to you!
On the Gravity Forms "Edit Forms" page, hover over the form and click the link called "IDs" that appears. That'll tell you the field IDs.
Thanks Zack... The team field is def 8 and the entries still disappear when I add sort="8"??!
I'll email you login details. If you could have a look when you get a change that would be much appreciated.
Hi Zack,
Did you have any luck figuring out my "sort" problem?