PDA

View Full Version : Wrong Year/Month


Rand
12-04-2006, 11:18 PM
Hi,
Hoping this symptom might point to something specific I did wrong.
I set up a page on an existing site putting two calendars on the page, one regular mode and one TOC. The regular one showed the coming month. All worked great.

On another site (new license) I put the page and files up and copied the php insert from the test page into the new site's page. The new site's Management area and Event Area seemed to be working fine, takes events and says the calendar has been updated. The problem is on the page displaying the calendar it is displaying in both areas as January 2006, so really I can't say the Event Manager area isn't working, if I could get to December 2006 the test entries might show. (I can't get there as there is no navigation.)

Does this possibly point (for someone who knows more than me) to a file that was not uploaded in the correct mode?
Thanks,
Rand

Rand
12-05-2006, 02:26 AM
Hello, again.
I have looked at the demo, it displays the current month and test events fine.

I have deleted one calendar and then the other (plus the category filter on the page) and isolated it to be the regular mode calendar that is causing the problem. Below is what I used so no navigation would show below it but I still had the navigation 'top with flip tab and all' at the top of the TOC mode calendar. Also the regular mode was showing the following month rather than the current month which was the TOC mode.

On another site I was testing the above it worked fine but it is version 6.3.18. The new site, newest version, that the exact code, (I copied and pasted) displays the error, in that it does not show the current month in either mode calendar but December 2006. The code I used I put below, could any one tell me what it should be to work under the new version?
(maybe the old version was forgiving of a mistake the new one isn't?)

The 'call' for the regular mode calendar to display the following month and not have navigation arrows under it without affecting the top navigation on the TOC calendar on the same page.

<?php
$MULTI=1;
$epcMultiWidth = "100px";
$epcMultiPad = 1;
$epcMultiNav = "100px";
$epcMultiCol = 1;
$epcMultiRow = 1;
$noNav="1";
$mo++;
if ($mo>12) {
$mo=1;
$yr++;
}
require ("../calendar/calendar.php"); ?>

Thanks for any help you can give me.
Rand

ve9gra
12-05-2006, 07:13 AM
This is because you're for some reason using the multi-calendar generator to display a single calendar. The function of the generator is that it will output several calendars and change the month for each.

So take out everything from $MULTI to $epcMultiRow.

If you leave what's between the $noNav line and the require, it will make the small calendar display not the current month but next month.

Rand
12-05-2006, 09:54 AM
Thanks!
I cannot search effectively is one reason. I saw a multi cal post and thought maybe it would work with me wanting 2 calendars on the page. I did understand the post and reply were referring to some other effect.

I tried:
<?php
$mo++;
if ($mo>12) {
$mo=1;
$yr++;
}
require ("calendar/calendar.php"); ?>

and....

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

but I get December 2006 in both calendars still. The nonav in the regular mode again took away the top navigation stuff in the TOC mode calendar. I took it out and in the css file changed the nav font to 1 px and the color to white so, in effect, it isn't there. The top navigation now shows in the TOC mode calendar but the search doesn't work. I put in December 2006 and it returns January 2007 in both instances of the calendar. Once in Jan 07, future searches are stuck on that month and year.

If I take off the regular calendar from my page, my TOC calendar works fine.

I mentioned the versions because in searching for possible solutions I wasn't paying attention to post dates and thought maybe code change between versions might have required something other on the page and I had read an older post referring to an earlier version.

I saw in the Set Up Manager a Yes/No about nav on the regular mode so will try choosing no there.

Thanks again for your reply.
Rand

Brian
12-05-2006, 11:17 AM
Can you possible post a link to your page so we can see what's happening?

Rand
12-05-2006, 11:27 AM
Hi,
I have two,
http://www.plymouthcalendar.com/index505.php
has code for two calendar modes/months

http://www.plymouthcalendar.com/index508.php
has both calendar modes but not trying to get the next month showing in the regular one.

Thanks,
Rand

Brian
12-05-2006, 11:29 AM
Is one of those working correctly? (I'm not sure I understand your descriptions under the links in your previous post).

Rand
12-05-2006, 11:34 AM
I'm sorry.
http://www.plymouthcalendar.com/index508.php
This one functions correctly. But I want the regular calendar to show the next month, not the same one. The other link showed what was happening when I tried that. January 2006 shows up in both and the search feature doesn't work right.

I wonder if it is something on my page other than the calendar code that interfers. ?

Brian
12-05-2006, 08:19 PM
What comes first in your code; the regular or TOC calendar?

Rand
12-05-2006, 08:29 PM
Hi,
The regular calendar comes first.

Just in case you look at the files:
I was messing around trying different things but just changed them back to the state I mentioned above.

Brian
12-05-2006, 08:48 PM
Add this BEFORE the regular calendar (untested):

<?php
$mo = $_REQUEST['mo'];
if ($mo<1) $mo = date("m");
$yr = $_REQUEST['yr'];
if ($yr<1) $yr = date("Y");

$oldYR = $yr;
$oldMO = $mo;

$mo++;

if ($mo>12) {
$mo = 1;
$yr++;
}
?>
Add this AFTER the regular calendar and before the TOC:

<?php
$mo = $oldMO;
$yr = $oldYR;
?>

Rand
12-05-2006, 08:56 PM
That did it.
Thank you very much!
Rand

Rand
12-05-2006, 09:03 PM
Brian,
Just something I wondered about. This evening I went into the Set Up manager and clicked to disable the navigation below any regular tables and that also made the navigation menu at the top of the TOC calendar disappear. Do you think that this problem or the above could be caused by some file not being correct? Or is that how it is set to work?

I ask as I would rather upload all files again and watch them all before they actually use this and have entered a bunch of stuff .

I am using a flatfile database now but once I hear from my server tech I am hooking it to a mySQL database.
Thanks for the fantastic product and support to match.
Rand

Brian
12-05-2006, 10:52 PM
If you disable it in the Setup Manager, it's universal for all calendar modes.

Just try setting $noNav="1"; before the regular calendar then unset($noNav); before the TOC calendar (again, this is untested).