WordPress.org

Ready to get started?Download WordPress

Forums

WP Calendar
[resolved] filter months (2 posts)

  1. dsg257
    Member
    Posted 1 year ago #

    how can i change this code in the fsCalendarAdmin.php file to show future months

    <select name="event_start">
    					<option value="-1"<?php echo (!isset($filter['datefrom']) ? ' selected="selected"' : ''); ?>><?php _e('Show all dates', fsCalendar::$plugin_textdom); ?></option>
    					<option value="0"<?php echo (isset($filter['datefrom']) && !isset($filter['dateto']) ? ' selected="selected"' : ''); ?>><?php _e('Show future dates only', fsCalendar::$plugin_textdom); ?></option>

    I have loads of events min 19 per month and in the dashboard filtering by category does not reduce the amount filtering by month would filter them to a manageable size to find the correct event to edit

    any help sugestions welcome

    http://wordpress.org/extend/plugins/wp-calendar/

  2. dsg257
    Member
    Posted 1 year ago #

    Managed to get this fixed
    with the help of vtxyzzy

    i wanted the dropdown to show future months and after finding the code that controlled it in fsCalendarAdmin.php
    i asked Mac for help the code should have shown months but the to and from were stopping it
    The lines Before are

    $min = $wpdb->get_var('SELECT MIN(from) AS min FROM '.$wpdb->prefix.'fsevents');
    $max = $wpdb->get_var('SELECT MAX(to)   AS max FROM '.$wpdb->prefix.'fsevents');

    These were changed to

    $min = $wpdb->get_var('SELECT MIN(fsev.from) AS min FROM '.$wpdb->prefix.'fsevents fsev');
    $max = $wpdb->get_var('SELECT MAX(fsev.to)   AS max FROM '.$wpdb->prefix.'fsevents fsev');

    This basically just forced MySQL to recognize 'from' and 'to' as field names rather than reserved words by using a table alias.

    Hope this helps someone else

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic