WebmasterSite.net

Events Directory

Version: 5.1.34
URL:

PrintPrint


Events Directory
jayweb
Forum Regular

Usergroup: Customer
Joined: Nov 27, 2006

Total Topics: 131
Total Posts: 384
quote post #1
Posted 05/21/10 - 3: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
Avatar

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

Total Topics: 65
Total Posts: 7614
quote post #2
Posted 05/31/10 - 8: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.

Edited by Paul on 05/31/10 - 8:15 AM
babrees
Expert
Avatar

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

Total Topics: 392
Total Posts: 1287
quote post #3
Posted 07/27/10 - 10:53 PM:

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

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

Total Topics: 65
Total Posts: 7614
quote post #4
Posted 07/30/10 - 1: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
Avatar

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

Total Topics: 392
Total Posts: 1287
quote post #5
Posted 07/30/10 - 1: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
Avatar

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

Total Topics: 65
Total Posts: 7614
quote post #6
Posted 08/05/10 - 1:52 PM:

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

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

Total Topics: 392
Total Posts: 1287
quote post #7
Posted 08/05/10 - 9:01 PM:

Thanks Paul, That worked.
 
Search thread for
Download thread as


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