1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

Filter listmode for year?

Discussion in 'Customizations (Themes / Templates)' started by neubeedoo, Nov 6, 2005.

Thread Status:
Not open for further replies.
  1. I have the calendar up on a site that need to archive their events in a particular way.

    I currently have a ListMode on page that is set to lists all the events for the current year for a particular category. I do not need the filter plug in for a category change, as this category will never change.

    But I would like some kind of dropdown YEAR selection - so that it shows the current year, but can view the previous year list by selecting the year in a dropdown -
    Code:
    <?php $LIST=1; $DF = "M d Y - l"; $listYear = "2005"; 
    $template="modern1_2.php"; $noOld = 0; $showCat="1|4|2|5|"; require ("calendar/calendar.php"); ?>
    So really, I'm just wanting to swap out the "$listYear=2005" with the year picked from the dropdown -
    problably dead simple php for those who know it, but I haven't a clue -
    any ideas or pointers - or possible future modification of the cat filter plugin?!!

    :classic:
    thanks
    - k
  2. Brian

    Brian EPC Developer Staff Member

    Just add a regular HTML form with the year selections in a drop-down and assign it to a name like selectYear.

    Then add some code to your page that says:
    PHP:
    <?php
    if (!$selectYear$selectYear=2005;
    ?>
    This way, it will default to 2005, but will allow selections from the form for other year(s).
  3. Like I said -- dead easy if you know this stuff - this is gonna take me 2 weeks ...:crybaby:
    I know this isn't the place for tutorials in the basics, so I understand if I can't get the answer here directly ...
    but just incase someone has a spare moment ...
    So if I have:
    Code:
    <?php
    if (!$selectYear) $selectYear=2005;
    ?> 
    then how do I plug in the result into the following:
    Code:
    <?php $LIST=1; $DF = "M d Y - l"; $listYear = "2005"; 
    $template="events1_all1.php"; $noOld = 0; $showCat="1|4|2|5|"; require ("calendar/calendar.php"); ?>
    $listYear="2005" in the above should now say what ... "$selectYear" ?? $listYear="$selectYear" ??
    And how do I make the Form talk to all of this?
    Code:
    <form name="selectYear" action=" ????" method="????  ">
    <div>
    <select name="selectYear">
    <option value="2004">2005</option>
    <option value="2005">2004</option>
    </select>
    </div>
    <input type="submit" name="Submit" value="???">
    </form>
    What would be the method and action?
    ---
    Off to google some form and php tutorials ...

    - k
  4. Brian

    Brian EPC Developer Staff Member

    I should have also said to change:

    $listYear = "2005"; to $listYear = $selectYear;

    Get or Post forms will work. You may need to chage the $selectYear variables to $_REQUEST[selectYear'] if your server has global variables disabled.
  5. thanks - I'll give it a go ...
Thread Status:
Not open for further replies.

Share This Page