PDA

View Full Version : Display The Calendar Starting At The Current Month And Not The Previous Month


guylevy
04-04-2008, 08:01 PM
Hi,

I am using the Easy PHP calendar on our site:
http://www.gotbubble.com/birthdays.asp

The issue that I have is when the end user open the birthdays page the calendar should look for the current date and display that month and highlight the current day.


If the current date = Fri April 14 2008

when the end user open the birthdays page the month should be set to April and the day (14) should be highlighted.



This is the exact behavior I see when I click on the 'Today' button in the calendar, but we shouldn't expect the end user to click on this when they first open the page, this is more for when they explore other months and they want to go back to the current date type of feature.



I have looked at the easyphpcalendar support page and found that I need to update the however I am calendar/events/headerCustom.inc.php file


https://www.easyphpcalendar.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=43 (https://www.easyphpcalendar.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=43)




Event Manager startup at current month

https://www.easyphpcalendar.com/support/themes/client_default/space.gif
SolutionThe Event Manager by default opens with the previous, current and next months events displayed. If you would like to have it open displaying the current month and the next two months (no previous month), add the code below to the calendar/events/headerCustom.inc.php file:

<?php
// THE CODE BELOW WHEN INSERTED INTO THE
// calendar/events/headerCustom.inc.php FILE WILL
// DISPLAY THE CALENDAR STARTING AT THE
// CURRENT MONTH AND NOT THE PREVIOUS MONTH
if (!$_REQUEST['mo'] && !$mo) {
$mo = date("m");
$yr = date("Y");
$mo++;
if ($mo>12) {
$mo=1;
$yr++;
}
$_REQUEST['mo'] = $mo;
$_REQUEST['yr'] = $yr;
}
?>



Looking at the calendar/events/headerCustom.inc.php file I have the same code.

How do DISPLAY THE CALENDAR STARTING AT THE CURRENT MONTH AND NOT THE PREVIOUS MONTH




Thanks,

-guy

ve9gra
04-04-2008, 08:39 PM
That solution and your problem have nothing to do with each other.

Your problem is caused because your iframe is specifically calling /calendar/index.php?mo=2&yr=2008 instead of simply /calendar/index.php

guylevy
04-04-2008, 08:41 PM
Thank you for the reply, could you please help me to fix this problem?
Where would I go to fix the iframe?

Thanks,
guy

guylevy
04-04-2008, 08:44 PM
Oh, I see it's in the html code of the birthday page:

<table> <tr> <td align="left"><!-- CALENDER GORES HERE! --> <img src="media/bday_event.gif"><br><br> <iframe src="http://calendar.gotbubble.com/calendar/index.php?mo=2&yr=2008" width="725" height="625" scrolling="no" align="left" frameborder="0"></iframe> <br><br> </td> </tr> </table>So it's hard coded in the html code?-guy

guylevy
04-04-2008, 08:49 PM
Thank you!!! Thank you!!! Thank you!!!!

It's working!! YEH :-)

ve9gra
04-04-2008, 08:50 PM
That's got nothing to do with the calendar... it's with the way it was integrated. My guess is in your birthdays.asp file, but there's no way for us to check that. If you aren't the one that integrated the calendar, I suggest you contact the person who did.

An iframe loads a page within a page. You provide it with a URL and size settings for the frame. The URL that was provided contains the month and year hard-coded, and it should not.

You have this code towards the end of the file.. you can see the URL in there.

<td align="left"><!-- CALENDER GORES HERE! -->
<img src="media/bday_event.gif"><br><br>
<iframe src="http://calendar.gotbubble.com/calendar/index.php?mo=2&yr=2008" width="725" height="625" scrolling="no" align="left" frameborder="0"></iframe>
<br><br>
</td>
If you can find that bit of code in your birthdays.asp, erase the ?mo=2&yr=2008in the URL.

guylevy
04-04-2008, 08:59 PM
I did find it and deleted it and it's working fine now!

Thank you So very much ve9gra!

-guy