PDA

View Full Version : Need some help please


aris
01-10-2004, 11:09 AM
Hello Papa and All,

I am kind of newbie with scripts and php and have 2 hours that I found Easily Simple Calendar and still trying to make it work.

The demo.php is working fine but I have tried to have the script running in a .php page with other content as well.

The page is working fine and displays correctly the calendar for January 2004 but the links to next and previous months seem not to work!

I just copied the following code from the demo.php and entered it in the .php file (template1.php).

(Please note that the script files are all in the folder "calendar" but I want to display the calendar in other pages outside that folder...)


<div align="center">
<?php require ("http://www.domain.com/calendar/escal.php"); ?>
</div>

<?php
$yb=$yr;
$yf=$yr;
$mb=$mo-1;
if ($mb<1) {$mb=12; $yb=$yr-1;}
$mf=$mo+1;
if ($mf>12) {$mf=1; $yf=$yr+1;}
?>
<table width="175" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="<?php echo "http://www.domain.com/template1.php?mo=$mb&yr=$yb" ?>"><<</a></font></td>
<td align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="<?php echo "http://www.domain.com/template1.php" ?>">-=-</a></font></td>
<td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="<?php echo "http://www.domain.com/template1.php?mo=$mf&yr=$yf" ?>">>></a></font></td>
</tr>
</table>


The problem is that when I click on the Next or Previous month, the calendar still displays (correctly) only January and not the correct month.

Here is the URL displayed for the Next month of January that reloads the page and still displays only January:

http://www.domain.com/template1.php?mo=1&yr=


I guess this should be the problem. I don't use MySQL but the esdates.txt file that is working fine for January (it's the only I can see :( )

I would really appreciate your feedback and let me suggest that you enrich the instructions.htm file for newbies like me :)

Lastly, when I click on the date marked for an event I receive a PageNotFound pop-up window. Could anyone give me more info what is this and how I could turn this feature off?

Thank you so much for your help!!!

Aris
(Athens, Greece)

- The script seems to be really great. Thanks again and continue this excellent work!

Brian
01-10-2004, 08:36 PM
Try changing your code to:

<div align="center">
<?php

// CHECK PHP VERSION
$pv = explode(".",phpversion());
$pv = $pv[0].".".$pv[1];
$pv = $pv-4.1;

// SET VARIABLES
if ($pv>=0) {
if (!isset($mo)) $mo = $_REQUEST["mo"];
if (!isset($yr)) $yr = $_REQUEST["yr"];
}
if ($pv<0) {
if (!isset($mo)) $mo = $HTTP_GET_VARS["mo"];
if (!isset($yr)) $yr = $HTTP_GET_VARS["yr"];

require ("http://www.domain.com/calendar/escal.php");
?>
</div>
<?php
$yb=$yr;
$yf=$yr;
$mb=$mo-1;
if ($mb<1) {$mb=12; $yb=$yr-1;}
$mf=$mo+1;
if ($mf>12) {$mf=1; $yf=$yr+1;}
?>
<table width="175" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="<?php echo "http://www.domain.com/template1.php?mo=$mb&yr=$yb" ?>"><<</a></font></td>
<td align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="<?php echo "http://www.domain.com/template1.php" ?>">-=-</a></font></td>
<td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="<?php echo "http://www.domain.com/template1.php?mo=$mf&yr=$yf" ?>">>></a></font></td>
</tr>
</table>

Does this help?

aris
01-11-2004, 08:31 PM
Thank you very much for your reply Brian.

In fact I changed the code with the one you provided but I received a parse error.

I would appreciate your feedback.

Thank you again for your help!

Aris
Athens, Greece

Brian
01-11-2004, 08:34 PM
Can you post a link to the page that's having the problem?

aris
01-11-2004, 08:47 PM
Thank you for your immediate reply Brian!

Here is the link to the page:

My Webpage (http://www.endless-blue.com/template1.php)

Please note that the site is under construction!

Thanks again!

Aris

aris
01-12-2004, 11:05 AM
Hello Brian,

Do you have any news why the script is not working correct? I am still trying to find a solution but it seems I haven't catch it yet... :(

I cannot understand what I have done wrong as I have followed exactly the instructions. The only thing I did was to copy-paste the code of demo.php to another php page.

Have a nice day!

Aris
Athens, Greece

Brian
01-12-2004, 12:03 PM
Did you copy the escalEV.php file to the same folder as the web page you are calling the calendar from? (root folder).

Brian
01-12-2004, 12:04 PM
Can you email PM me the original php code for that page?

aris
01-12-2004, 05:43 PM
Hello Brian,

I just moved the escalEV.php to the root as I didnt know I should do such thing before but the problem is still there. I have sent you also the code of the webpage template1.php that the problem exists on.

I appreciate so much your help!

Aris

Brian
01-13-2004, 10:52 PM
You should have the modified code in your inbox.

aris
01-14-2004, 10:15 AM
Many thanx Brian! Everything is working excellent now!

I have two more issues to mention: :unsure:

1. Is it possible to post some more help for the six months calendar implementation? I read the related post but it was a little complicated for a non-expert...

2. When I click on a date with an event there is a pop-up window. Could you send me any information how I can disable this function please? (where is this function manipulated in the code?)

Let me thank you so much for your help!!!
I look forward to hearing for v.4.5!!

Best regards,
Aris
Athens, Greece

Brian
01-14-2004, 11:01 AM
Turn off the popup in the escalConfig.php file. To do this, set the $standardPopup variable on line 118 to 0 (zero).

$standardPop = 0;

aris
01-14-2004, 06:41 PM
Really helpful as always Brian!

Thank you for everything!

Aris