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

Categories fail outside of current month
Old 04-29-2005, 01:33 AM   #1
lynne
lynne
 
lynne's Avatar
 
lynne is offline
Join Date: Apr 2005
Location: rochester, ny
Posts: 28
Default Categories fail outside of current month

Version 6.1.0

When selecting a specific category of events, moving to the next month loses the category selection criteria.

Selecting a category while residing in the next month returns the current month.

In other words, I have an event in May, under category "Community".

I am in April. I select the category Community, nothing shows up.

I move to May. I get all events.

I choose the category Community again.

I am returned to April, and no events display in April. (Because there were no Community events in April).

Don'tcha just love this kind of circular spaghetti logic problems?



But I still love the calendar, I really do.
 

Old 04-29-2005, 11:26 AM   #2
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

I'm not sure where in the script to select a category as the only place this appears is in the Event Manager.

Is this where you see this occur or are you using your own category filter drop-down on your display page(s)?
__________________
-- Brian

Questions?

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

Old 04-29-2005, 05:03 PM   #3
lynne
lynne
 
lynne's Avatar
 
lynne is offline
Join Date: Apr 2005
Location: rochester, ny
Posts: 28
Talking

Ah, that question is it's own answer. Yes, I did install a Category drop down on my page, so of course it's outside of the script. [img]images/icons/icon10.gif[/img]

I added this code after lifting it out of the events module thinking that wherever the variable containing the current month was for the Calendars << == >> functions, it would carry through to the categorical querying also:


<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<=50; $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>

And it almost works! As long as you only want to filter on categories for the current month, it's fine.
 

Old 04-29-2005, 07:21 PM   #4
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Actually, it's easily fixable... add this first piece of code before your drop down (these are PHP statements so should be enclosed in <?php ?> tags).
PHP Code:
import_request_variables("GP");
if (!isset(
$mo)) $mo date("m");
if (!isset(
$yr)) $yr date("Y"); 
And then add these two fields to your form to retain the values of the displayed month and year (this is plain HTML, so just add it to your form).
HTML Code:
<input type="hidden" name="yr" value="<?php echo $yr;?>">
<input type="hidden" name="mo" value="<?php echo $mo;?>">

Last edited by ve9gra; 04-29-2005 at 07:56 PM.
 

Old 04-29-2005, 07:49 PM   #5
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Tested and it works (somewhat)... If you click to change month, you will lose which category is selected, but if you change month and then choose the category, you will stay on the month you were and the category will show up (as well as stay selected in the drop down).

Hope this helped.
 

Old 04-30-2005, 10:59 AM   #6
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

I believe (i.e. untested) that if you change your category form from post to get method="get" this issue may be corrected? It may be necessary to post the hidden mo and yr variables in this form.
__________________
-- Brian

Questions?

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

Old 04-30-2005, 02:11 PM   #7
lynne
lynne
 
lynne's Avatar
 
lynne is offline
Join Date: Apr 2005
Location: rochester, ny
Posts: 28
Default

:
Perfect!

Exact code as follows integrating both your suggestions works perfectly.
-----------
<body>

<?php $OL=1; require ("calendar/calendar.php"); ?>

<?
import_request_variables("GP");
if (!isset($mo)) $mo = date("m");
if (!isset($yr)) $yr = date("Y");
?>


<form action="<?php echo $PHP_SELF?>" method="get" name="filterForm" id="filterForm">

<input type="hidden" name="yr" value="<?php echo $yr;?>">
<input type="hidden" name="mo" value="<?php echo $mo;?>">


<span class="smallText">Select Category:
</span>
<select name="showCat" class="formElements" id="showCat">
<option value="">
<?php
// CATEGORY OPTIONS
for ($N=1; $N<=50; $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>

...etc., etc., etc

</body>
 

Old 04-30-2005, 08:39 PM   #8
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

This should almost be a how-to instead of a bug report.
 
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
Clickable month titles in MUTLI view alexjudd General Support 1 08-25-2005 08:40 AM
Any limitations on number of events in a month? Dave G General Support 5 01-22-2005 08:57 PM
event categories oliver General 1 10-21-2004 11:13 AM
HELP: ESCAL Moves a day Forward for rest of Month and then OK again?? jvilla General Support 5 09-24-2004 08:45 AM



All times are GMT -4. The time now is 09:19 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 |