Support

Home Forums Event Espresso Premium Change default number of database entries

Change default number of database entries

Posted: March 6, 2015 at 8:46 am

Viewing 7 reply threads


Willow Marketing

March 6, 2015 at 8:46 am

This is probably an incredibly stupid question, but I need to change the default number of database entries that are displayed from ’50’ to ‘500’ but I have no idea what file to look in to fix this.

Our client wants all of their attendees and events displayed when they view the page. They don’t want to have to keep using pagination to see them and the ‘Retrieve’ function is not the answer for them.

Best,
Andy


Tony

  • Support Staff

March 6, 2015 at 8:57 am

Hi Andy,

Which version number of Event Espresso are you using?


Willow Marketing

March 6, 2015 at 8:58 am

Hi! Sorry for omitting that. It’s version 3.1.37.0.P.


Tony

  • Support Staff

March 6, 2015 at 9:34 am

No problem 🙂

The reason the ‘Retrieve’ filter was added was to prevent timeouts when the server is accessing so much information, changing the default from 50 to 500 will very likely cause those timeouts.

I highly recommend again doing this and we can not support issue from increasing this default, however the file you need to edit is:

\event-espresso\includes\event-management\queries.php

On line 19 you’ll find:

$max_rows = isset($_REQUEST['max_rows']) & !empty($_REQUEST['max_rows']) ? absint($_REQUEST['max_rows']) : 50;

50 is the default value.

You’ll need to make this change on each update to Event Espresso.


Willow Marketing

March 6, 2015 at 10:13 am

I just changed the default variable and it didn’t work. Is there something I’m missing?


Tony

  • Support Staff

March 10, 2015 at 5:09 am

That value changes how many rows for the table are called in by the query, if you notice on the bottom left of the table you’ll see the total number now matches the value you input – http://take.ms/XnTTv

Is it the pagination that hasn’t changed?

We use the dataTables jQuery plugin to display the tables which should store the value you set in the dropdown within the cache, this will be used across the tables until the cache expires, this value – http://take.ms/IUZFF


Willow Marketing

March 12, 2015 at 12:45 pm

Hey Tony!

Yeah, the dataTables jQuery plugin is what needs modified. I need it to pull in ALL records. Not just the first 100 in the database. The default is set at 50 and I need all of them to display.

If this is not possible, let me know.

Best,
Andy


Lorenzo Orlando Caum

  • Support Staff

March 13, 2015 at 11:09 am

Hi Andy,

That resource file is loaded through the WP dashboard (WP-admin):

	wp_enqueue_script('dataTables', EVENT_ESPRESSO_PLUGINFULLURL . 'scripts/jquery.dataTables.min.js', array('jquery')); //Events core table script

You could dequeue the existing resource and then load one from a custom location such as this:

/wp-content/uploads/espresso/js/

The js folder above would need to be created and then you could add a modified copy of the dataTables file there.

http://codex.wordpress.org/Function_Reference/wp_dequeue_script


Lorenzo

Viewing 7 reply threads

The support post ‘Change default number of database entries’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso