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


Go Back   Easy PHP Calendar > General Discussion > General Support

General Support Questions about using the Easy PHP Calendar. (Not installation or customizations)

Closed Thread
 
Thread Tools Search this Thread Display Modes

Let visitor select which category is displayed in the monthly calendar
Old 03-17-2005, 02:40 PM   #1
mvoelkening
Calendar User
 
mvoelkening is offline
Join Date: Mar 2005
Location: Kamloops, BC - Canada
Posts: 10
Default Let visitor select which category is displayed in the monthly calendar

Hi,

If you a lot of event in the calendar it gets confusing fast. Is there a possibility to let the visitor select which categories of events is displayed in the monthly calendar view (like a select field)?

Thanks

Martin
 

Old 03-17-2005, 02:45 PM   #2
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,885
Default

Sure, just add a category drop-down to your page by inserting the code below:

PHP Code:
<form action="<?php echo $PHP_SELF?>" method="post" name="filterForm" id="filterForm">
   <span class="smallText">Select Category: 
   </span>
   <select name="showCat" class="formElements" id="showCat">
   <option value="">
     <?php
 
// CATEGORY OPTIONS
 
for ($N=1$N<=8$N++) {
   if (
$cat[$N]!="") echo "<option class=\"s2".$N."\" value=\"$N\"";
    if (
$showCat==$N) echo " SELECTED";
    echo 
">$cat[$N]</option>";
   }
   
?>
   </select> 
   <input name="filterButton" type="submit" class="formButtons" id="filterButton" value="Go">
 </form>
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Thanks, works great
Old 03-17-2005, 02:58 PM   #3
mvoelkening
Calendar User
 
mvoelkening is offline
Join Date: Mar 2005
Location: Kamloops, BC - Canada
Posts: 10
Default Thanks, works great

Brian,

Thanks for your fast help. That worked great!

Martin
 

Old 04-10-2005, 11:05 AM   #4
jabi
Calendar User
 
jabi's Avatar
 
jabi is offline
Join Date: Dec 2004
Location: Vero Beach, FL
Posts: 64
Default

Have modified the code to clean up the html and allow use a dynamic count of categories.

add before form: <?php $count_cat = count($cat); ?>
reason: To allow dynamic count of categories

<form action="<?php echo $PHP_SELF?>" method="post" name="filterForm" id="filterForm">
<span class="smallText">Select Category: </span>
<select name="showCat" class="formElements" id="showCat">
change: <option value="">
to: <option value="">--- Show All ---</option>
reason: Add selection and close option tag
<?php
// CATEGORY OPTIONS
change: for ($N=1; $N<=8; $N++) {
to: for ($N=1; $N<=$count_cat; $N++) {
reason: Substitute actual count for fixed value
if ($cat[$N]!="") echo "<option class=\"s2".$N."\" value=\"$N\"";
if ($showCat==$N) echo " SELECTED";
add: if ($cat[$N]!="") echo ">$cat[$N]</option>\n";
reason: eliminate extra "></option>" lines added for empty categories with original code.
}
?>
</select>
<input name="filterButton" type="submit" class="formButtons" id="filterButton" value="Go">
</form>
 
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
Category views dan_cameron General 1 08-31-2005 08:43 PM
Calendar does whatever it wants, but not what its supposed to do! Gee General Support 9 08-26-2005 08:05 AM
Problems with monthly listing nmdunn General Support 2 06-07-2005 07:49 AM
Multiple calendar views on a site jenniferwilde General Support 0 03-03-2004 01:41 PM



All times are GMT -4. The time now is 11:06 PM.


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 |