Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Tricky Date Range -> Article of Month

Quote Reply
Re: Tricky Date Range -> Article of Month In reply to
What about creating a select list for the featured date that you set, something like this:

Jan 2001
Feb 2001
Mar 2001
etc...

Cover for the next x years. You then use this in your link admin to modify the link's featured date.

Once set, modify your build to use today's date from your server and strip out the 'month' and 'year' portions. Once you've got those just run them through a 'check' to define the month, i.e.;

$thisyear = {strip year from $date}

if ($month eq '01') {$thismonth = "Jan"}
elsif ($month eq '02') {$thismonth = "Feb"}
etc...

$featureddate = ($thismonth & $thisyear)

Now use the $featureddate in your selection call:

----------------------
SELECT *
FROM tbl_AG_Articles
WHERE isFeatured = 'Y' AND FeatureDate = $featureddate
----------------------

Any good?


All the best
Shaun

Subject Author Views Date
Thread Tricky Date Range -> Article of Month Stealth 2487 Feb 13, 2001, 8:28 PM
Thread Re: Tricky Date Range -> Article of Month
qango 2451 Feb 14, 2001, 5:02 AM
Thread Re: Tricky Date Range -> Article of Month
Stealth 2447 Feb 14, 2001, 8:52 AM
Post Re: Tricky Date Range -> Article of Month
Stealth 2421 Feb 14, 2001, 8:14 PM