View Full Version : Adding the calander to a existing php page
cyberchick
01-14-2004, 02:59 PM
Respected Webmaster's will you be able to help this growing webmaster
THE ISSUE:
I installed the calendar also installed mysql database everything seems to work ok.
Check the following url
http://simpletamil.com/vithigoodcalander/demo.php
The Problem
I want to add this calander to my existing php page. Even though people have requested help about this there is nobody with a perfect solution. I have seen people mentioning to do this look at the demo. I have not been able to do anything about this by going through the demo page.
I tried a certain method by just taking the whole script in the demo page and adding (paste it) in the section where i want in the existing php section.
Then I even tried the other method by just adding the following php script <? include("/hsphere/local/home/vithiyat/simpletamil.com/vithigoodcalander/demo.php"); ?>
in the section of my existing page.
THE MAIN PROBLEM
IN both instance the main demo.php seems to show up BUT WHEN I CLICK THE NEXT OR FORWARD BUTTON RATHER THAN SHOWING IT IN THE SAME EXISTING PAGE WHERE I INSERTED PHP PAGE IT IS JUST SHOW UP IN A NEW WINDOW TO BE EXACT IN THE ORIGINAL
http://simpletamil.com/vithigoodcalander/demo.php
how to avoid this problem or there is a better way to add it to a existing page. Please people you help is much appreciated by me and many others like me.
Please provide the complete code with explanations.
Advance thanks counting on you guys :D
Here is the page which i have added the calander to my existing php page
http://simpletamil.com/vithigoodcalander/test.php
punaboy
01-18-2004, 11:50 PM
I just downloaded the calendar and started testing it. I put the demo.php into a php include and had the same problem, whenever you clicked to a forward/back month it would link to the original and not where I had the include.
I only used the flatline, I would assume it would be the same with MySQL. After snooping around I found that all you need to do is update the demo.php file. Towards the bottom you'll need to change the three php echo "demo.php" codes. Just replace the demo.php (3 of them) with the file of your existing page.
That should solve the problem of going to the original demo page and keeping it linked to your existing page. I hope that helps you, it worked for me.
ve9gra
01-19-2004, 12:05 AM
You guys are using some dang hard ways to get what you need...
Let's say that you have two extra values... $website_path and $calendar_path...
$website_path being the path to the root of your website.. (ie: c:/inetpub/wwwroot)
$calendar_path is the path to your calendar installation relative to your website root... (ie: /escal44)
PS: the / is not a typo for an IIS installation... it's easier to do / than \\ ... ;)
once you have declared those two variables, just paste this where you want the calendar...
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript" src="<?echo $calendar_path ?>/overlib_mini.js"><!-- overLIB (c) Erik Bosrup --></script>
<? @require $website_path.$calendar_path.'/escal.php'; ?>
then you can configure the look of the calendar by tweaking the .css file. When you upgrade to a new version, just change the value of $calendar_path and boom, new calendar. ;) No need to change the code of your page...
hope this helps
ve9gra
01-19-2004, 12:16 AM
The previous post was the easy way to get the calendar going..... now i'll show you the more advanced way to add the back and forward functions..... the little
<< -=- >>things under the calendar...
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="3" align="center" width="100%">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript" src="<?echo $calendar_path ?>/overlib_mini.js"><!-- overLIB (c) Erik Bosrup --></script>
<? @require $website_path.$calendar_path.'/escal.php';
if (!$mo) $mo=date("m");
if (!$yr) $yr=date("Y");
$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;}
$returnString = "";
if ($_SERVER['QUERY_STRING']) {
$queryString = explode("&",$_SERVER['QUERY_STRING']);
for ($i=0;$i<count($queryString);$i++) {
$v = explode("=",$queryString[$i]);
if (($v[0] != "mo") && ($v[0] != "yr")) {
$returnString .= "&".$queryString[$i];
}
}
}
?>
</td></tr>
<tr>
<td><a href="<? echo "$PHP_SELF?mo=$mb&yr=$yb".$returnString; ?>"><<</a></td>
<td align="center"><a href="<? echo $PHP_SELF ?>">-=-</a></font></td>
<td align="right"><a href="<? echo "$PHP_SELF?mo=$mf&yr=$yf".$returnString; ?>">>></a></font></td>
</tr>
</table>
Here you have the whole thing... it will even detect if you are using other values to your script... (ie: website.com/script.php?member=1001&mo=2&yr=2004) and leave them alone and just add the "&mo=XX&yr=XXXX" at the end of the URI...
Brian
01-19-2004, 10:40 AM
Something similar (if not exactly :) ) will be added to a future version. Probably Version 4.6, if not Version 4.5.
boles
01-26-2004, 12:46 PM
I also tried to add the calendar into an existing php-page.
Everything works great except for one thing.
When I click to the next or previous month the calendar is being loaded into the whole page instead of into the existing php-page.
The code with which I added my calendar into the existing page:
<%phpinclude(http://mypage/escal/calender.php)%>
The code of my calendar page:
<body>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript" src="overlib_mini.js"><!-- overLIB © Erik Bosrup --></script>
<div align="center">
<?php require ("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">"><< (<?php echo )</font></td>
<td align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">">-=- (<?php echo )</font></td>
<td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">">>> (<?php echo )</font></td>
</tr>
</table>
</body>
Can anyone tell me how to solve this??
Originally posted by boles@Jan 26 2004, 09:46 AM
I also tried to add the calendar into an existing php-page.
Everything works great except for one thing.
When I click to the next or previous month the calendar is being loaded into the whole page instead of into the existing php-page.
The code with which I added my calendar into the existing page:
<%phpinclude(http://mypage/escal/calender.php)%>
The code of my calendar page:
<body>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript" src="overlib_mini.js"><!-- overLIB © Erik Bosrup --></script>
<div align="center">
<?php require ("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">"><< (<?php echo )</font></td>
<td align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">">-=- (<?php echo )</font></td>
<td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">">>> (<?php echo )</font></td>
</tr>
</table>
</body>
Can anyone tell me how to solve this??
Look at the last few lines of your 'calendar.php' file you will see
<?php echo "escal/demo.php' on three separate occasions. Change the escal/demo.php to escal/calendar.php.
Happy hunting,
tomB
boles
01-28-2004, 04:11 AM
I feel so stupid :unsure:
I should have seen that myself.
thanks
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.