Easy PHP Calendar - We really take care of your dates!


Go Back   Easy PHP Calendar > General Discussion > Customizations (Themes / Templates)

Customizations (Themes / Templates) Help with customizing the themes and templates. Post your own custom themes for others to enjoy.

Closed Thread
 
Thread Tools Search this Thread Display Modes

Dynamic Listing dropdown
Old 12-18-2005, 04:51 PM   #1
bangonthedrum
Calendar User
 
bangonthedrum is offline
Join Date: Sep 2004
Posts: 7
Default Dynamic Listing dropdown

Hey, I created a dynamic form to display on your page to use the List module to have an easy archive of years:
(i tried making this code generic, hopefully i didn't mess it up in the process..also, this is for version 5.7)

Code:
 
<?php
$nextyear = date("Y")+1;
//show curent year when landing on page
if(!$_POST["posted"]){
$thedate = date("Y");
$LIST=1;
$listYear = $thedate;
$DF = "m/d/y";
$template="templatefile.php";
//Show Form 1 before selecting
print '<div align="right">';
print '<form name="dates" method="post" action="thepagethathasthiscode.php">';
printf("Archive:&nbsp;<select name=\"calyear\">");
printf("<option value=\"\">%s</option>", 'Year');
 for($i = $nextyear; $i > 2000; $i--){
    $selected = $_POST["calyear"];
    printf("<option value=\"%s\" %s>%s</option>", $i, $selected, $i);
  }
printf("</select>");
print '<input type="hidden" name="posted" value="1"/>';
print '&nbsp;&nbsp;<input style="background-color:#ffffff" type="submit" value="submit" name="submitme"  />';
print '</form>';
print '</div>';
require ("escal/showCalendar.php");
}
if($_POST["posted"]){
//show form 2 after selecting
print '<form name="dates" method="post" action="thepagethathasthiscode.php">';
print '<div align="right">';
printf("Archive:&nbsp;<select name=\"calyear\">");
printf("<option value=\"\">%s</option>", $_POST["calyear"]);
 for($i = $nextyear; $i > 2000; $i--){
    $selected = $_POST["calyear"];
      printf("<option value=\"%s\" %s>%s</option>", $i, $selected, $i);
 
}
printf("</select>");
print '<input type="hidden" name="posted" value="1"/>';
print '&nbsp;&nbsp;<input style="background-color:#ffffff" type="submit" value="submit" name="submitme"  />';
print '</form>';
print '</div>';
$thedate = $_POST["calyear"];
$LIST=1;
$listYear = $thedate;
$DF = "m/d/y";
$template="templatefile.php";
require ("escal/showCalendar.php");
}
 
?>
 
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-size the listing table devashanti Customizations (Themes / Templates) 3 12-14-2005 06:50 AM
listing module with only future events rbrst10 General Support 1 08-19-2005 02:48 PM
Problems with monthly listing nmdunn General Support 2 06-07-2005 07:49 AM
Listing edits bobscape General 11 05-03-2005 10:56 AM
How do I display the Year in Events Listing? cbworks General Support 4 01-21-2005 01:12 PM



All times are GMT -4. The time now is 12:33 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2009 NashTech, Inc.

| Home | Register | Today's Posts | Search | New Posts |