Webmastersite.net
Register Log In

Events Directory

Comments on Events Directory

webflair
Forum Regular

Usergroup: Customer
Joined: Nov 27, 2006

Total Topics: 187
Total Comments: 465
Posted May 21, 2010 - 6:48 PM:

If I want to create a directory where instead of links, the listingd are all events...

I want listings to be in order of the event start date, and I want events that have happened to delete automatically.

I know I can set a start date and expirty date for each listing, but I want events to display as soon as they are submitted but be in odrder of event start time. If I used the standard listing start time as the event date, the listing would not show until the event date.

If I create a custom field for the event start times, I'm unsure how to set the field up such that I can display listings in event date order.

Can this be achieved?

How is this best done?

Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 31, 2010 - 11:12 AM:

If you create a field in mysql's date format (use phpmyadmin) you can order by that. That'd mean you have to enter it consistently as YYYY-MM-DD though.

For its native fields, WSN doesn't use mysql's date field format and stores everything as unix timestamps instead. Doing that for a custom field is something I'll need to look into in the future.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Jul 28, 2010 - 1:53 AM:

Whilst we input in the format YYYY-MM-DD, is it possible to display it DD-MM-YYY ??
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 30, 2010 - 4:42 AM:

With a mysql date field? Only with some php to rearrange it: <?php $parts = explode("-", "{THEDATEFIELD}"); echo "{$parts[2]}-{$parts[1]}-{$parts[0]}"; ?>
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Jul 30, 2010 - 4:59 AM:

Thanks Paul, That exact string gave me a weird format - 04 00:00:00-08-2010

Just with {LINKEVENTDATE} displays it as 2010-08-04 00:00:00
I need it to display as: 04-08-2010 (dd-mm-yy no time)

I am guessing I need to adjust the script a bit? But sadly I am more than useless with php
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Aug 05, 2010 - 4:52 PM:

Forgot about the time bit. <?php $dt = explode(" ", "{THEDATEFIELD}"); $parts = explode("-", $dt[0]); echo "{$parts[2]}-{$parts[1]}-{$parts[0]}"; ?>
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Aug 06, 2010 - 12:01 AM:

Thanks Paul, That worked.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.