WordPress.org

Ready to get started?Download WordPress

Forums

Simple Events Calendar
[resolved] Events disappear before scheduled time (5 posts)

  1. stocksohio
    Member
    Posted 1 year ago #

    Events disappear from my page about 3 hours before they are scheduled to start. I even tried playing with the time zone setting to try to fix this issue, but to no avail. Any ideas? http://iamachildofdivorce.com/schedule/

    http://wordpress.org/extend/plugins/simple-events-calendar/

  2. stocksohio
    Member
    Posted 1 year ago #

    It's inexact I'm sure because I am not a coder, but I got it to work. I changed:

    if(isset($atts['label'])) $label = strtolower($atts['label']);
    if(isset($atts['limit']) && $atts['limit'] > 0) { $limit = "LIMIT 0, " . $atts['limit']; } else { $limit = ""; }

    if( isset($age) && isset($label) ) {
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE event_label = '$label' AND $range ORDER BY event_start $limit", "ARRAY_A");
    } elseif(isset($age)) {
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE $range ORDER BY event_start $limit", "ARRAY_A");
    } elseif(isset($label)) {
    $currentTime = time();
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE event_label = '$label' AND event_end >= $currentTime ORDER BY event_start $limit", "ARRAY_A");
    } else {
    $currentTime = time();
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE event_end >= $currentTime ORDER BY event_start $limit", "ARRAY_A");
    }

    TO

    if(isset($atts['label'])) $label = strtolower($atts['label']);
    if(isset($atts['limit']) && $atts['limit'] > 0) { $limit = "LIMIT 0, " . $atts['limit']; } else { $limit = ""; }

    if( isset($age) && isset($label) ) {
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE event_label = '$label' AND $range ORDER BY event_start $limit", "ARRAY_A");
    } elseif(isset($age)) {
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE $range ORDER BY event_start $limit", "ARRAY_A");
    } elseif(isset($label)) {
    $currentTime = time()-14400;
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE event_label = '$label' AND event_end >= $currentTime ORDER BY event_start $limit", "ARRAY_A");
    } else {
    $currentTime = time()-14400;
    $allevents = $wpdb->get_results(" SELECT * FROM $table_name WHERE event_end >= $currentTime ORDER BY event_start $limit", "ARRAY_A");
    }

    This subtracted four hours off the time code and caused my events to show up until they shouldn't anymore.

  3. Set Sail Media
    Member
    Posted 1 year ago #

    I don't know whether you've looked in "Advanced Settings" (beneath the Donate button) but there is a place to control your time zone relative to the server time. You may be able to adjust there, rather than in the raw code. I'm betting your hosting is in a timezone different from your actual geo location, and the difference is the 4 hours you're talking about. I could be wrong though.

  4. Jerry G. Rietveld
    Member
    Plugin Author

    Posted 1 year ago #

    Hi stocksohio,

    I'm in the process of getting a fix for this as you shouldn't have to set your timezone in the plugin when WordPress already knows this info.

    It's a bit tricky as it will require an update of your database - so I'm careful with the release until I'm 100% sure that it does this without issues.

    Hopefully I have some time to solve this soon.

    Cheers,
    Jerry

  5. MBTDavid
    Member
    Posted 10 months ago #

    Thank God this post was here! I couldn't figure out for the life of me how to fix this. Thanks for posting a solution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.