neubeedoo
03-29-2006, 05:23 PM
OK -
I found the "How do I add a Date Selection Drop-down Menu?" in the knowledge base - not exactly what I needed, but a start!
I have an archive page that is list mode only.
If I was just interested in showing "last year", I would use:
$listYear=date(Y)-1;
and that works great.
BUT
What I want is that exact same page, to initially show all events in listmode for "last year"
WITH a dropdown selection to choose from all the years in the archive.
My archive only goes back to 2004.
I have successfully made the dropdown selection work (though I'm stumped on applying the 'echo SELECT' and making it work)
however the initial page load as 'last (full) year' is elluding me -
(In my playing around, got it once to onload show last year, but it only showed the current month of last year)
Here is my code:
<?php
$arcstart=date(Y)-1; //This sets start year of archive
?>
<form name="form3" method="post" action="<?php echo $PHP_SELF ?>">
<select name="arcyr" id="arcyr">
<?php
for ($N=2004;$N<=$arcstart; $N++) {
echo "<option";
//if ($N==WHAT?HERE?) echo " SELECTED"; //want selected to initially be $arcstart and then change and stick to selected when click go ?HOW??
echo ">$N</option>";
}
?>
</select>
<input type="submit" name="Submit" value="Go">
</form>
and the listMode code:<?php
// SHOW LISTINGS MODULE
$epcListMouseover=1;
$LIST=1;
$DF = "M jS, Y (D)";
$listYear= "$arcyr"; // THIS SUCCESSFULLY takes the submit, but how do I get the initial page load to display all last year ($arcstart)
$template="modern.php";
require("calendar.php");
?>
page in question here: http://s156360743.onlinehome.us/calendar/demo2.php
I'm not that great with php or code - as you can tell, but I'm really trying to grasp on!
Any pointers?
- kathy
I found the "How do I add a Date Selection Drop-down Menu?" in the knowledge base - not exactly what I needed, but a start!
I have an archive page that is list mode only.
If I was just interested in showing "last year", I would use:
$listYear=date(Y)-1;
and that works great.
BUT
What I want is that exact same page, to initially show all events in listmode for "last year"
WITH a dropdown selection to choose from all the years in the archive.
My archive only goes back to 2004.
I have successfully made the dropdown selection work (though I'm stumped on applying the 'echo SELECT' and making it work)
however the initial page load as 'last (full) year' is elluding me -
(In my playing around, got it once to onload show last year, but it only showed the current month of last year)
Here is my code:
<?php
$arcstart=date(Y)-1; //This sets start year of archive
?>
<form name="form3" method="post" action="<?php echo $PHP_SELF ?>">
<select name="arcyr" id="arcyr">
<?php
for ($N=2004;$N<=$arcstart; $N++) {
echo "<option";
//if ($N==WHAT?HERE?) echo " SELECTED"; //want selected to initially be $arcstart and then change and stick to selected when click go ?HOW??
echo ">$N</option>";
}
?>
</select>
<input type="submit" name="Submit" value="Go">
</form>
and the listMode code:<?php
// SHOW LISTINGS MODULE
$epcListMouseover=1;
$LIST=1;
$DF = "M jS, Y (D)";
$listYear= "$arcyr"; // THIS SUCCESSFULLY takes the submit, but how do I get the initial page load to display all last year ($arcstart)
$template="modern.php";
require("calendar.php");
?>
page in question here: http://s156360743.onlinehome.us/calendar/demo2.php
I'm not that great with php or code - as you can tell, but I'm really trying to grasp on!
Any pointers?
- kathy