WordPress.org

Ready to get started?Download WordPress

Forums

WP Calendar
[resolved] orderdir="desc" not working? (6 posts)

  1. Ted Rouse
    Member
    Posted 1 year ago #

    I'm using the shortcode to display a list of past events as follows:

    {events_printlist; datefrom="2010-01-01 00:00:00"; dateto="now"; orderdir="desc"; before="<div class="eventlist">"; after="</div>"}

    The orderdir paramater doesn't seem to be having any effect. Any ideas?

    Previously it had worked if orderby was set to tsfrom – but since upgrading the plugin to 1.5.0, the tsfrom SQL entry is set to NULL, which means events created after upgrading all end up at the bottom.

    Thanks very much.

    -Ted.

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

  2. faebu
    Member
    Plugin Author

    Posted 1 year ago #

    have you tried to set orderby to from?

  3. tedzio
    Member
    Posted 1 year ago #

    I too have a problem with orderdir. I want to show my events in reverse chronological order. I've tried different combinations of suggestions I found on this and other forums. I'm running WP-Calendar 1.5.0 on WordPress 3.4.2. My 'tsfrom' entries are NULL as in Ted's case above. I've tried 'orderby' => 'from' and 'orderby' => array('from') and it doesn't seem to work, however, if I use 'orderdir' => 'eventid' it works, which could suggest there's a problem somewhere in the date handling. Or maybe I'm missing something. Any help appreciated.

    echo fse_print_events(array(
    			'number' => 6,
          			'datefrom' => mktime(23,59,59,1,1,2010),
          			'orderby' => 'from',
          			'orderdir' => 'DESC',
          			'categories' => 5,
          			'pagination' => 1,
          			'before' => '<div id="back_issues_wrap">',
          			'after' => '<div class="clear_float"></div></div>',
          			'template' => '<div class="back_issue">{event_subject}<br />{event_description}</div>'));
  4. tedzio
    Member
    Posted 1 year ago #

    Ok, I got it sorted out, in the file fsCalendar.php, in the part:

    static $valid_fields = array('eventid',
    	 	 'subject',
    		 'tsfrom',
    		 'tsto',
    		 'allday',
    		 'description',
    		 'location',
    		 'categories',
    		 'author',
    	 	 'createdate',
    		 'publishauthor',
    		 'publishdate',
    		 'state'
    	 );

    replace 'tsfrom' and 'tsto' with 'from' and 'to'

  5. Ted Rouse
    Member
    Posted 1 year ago #

    Thanks tedzio, that did the trick for me as well.

    Next hurdle: getting the "dateto" parameter to actually cut off at "now" - So far, still showing future events in the list.

    -Ted.

  6. faebu
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Ted

    Thanks for your fix. Applied in next update.

    Fabian

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.