Hi, I am trying to use a web based calendar on my site but I am having difficulty getting it running. Whilst the php program that I have seen in demo and live versions does exactly what I want... I can't get around this 'Cannot add header' problem. I am not a php guru and I am really struggling with this, the developer of the calendar does not offer any support by mail, telephone or forum and I'm stuck in a case of 'I want it' but 'it won't work'. The error I receive when going to the default.php page is inserted below:
Warning: Cannot add header information - headers already sent by (output started at /homepages/18/d24357956/htdocs/wayne186/selfbuild/calendar/common.php:328) in /homepages/18/d24357956/htdocs/wayne186/selfbuild/calendar/index.php on line 5
The content of the default.php file is:
<?
require("common.php"
//
// what view is the default? let's go there
Header("Location: ./".$glbl_DefaultView.".php?LocationID=".$LocationID);
exit;
?>
From what I can see the default.php file uses common.php for all of the variables ie conections to database, paths and variables. I have also pasted this file below.. I am sorry if this breaches net etiquet by posting the contents of the file, I would absolutley love to get this working and soon as I have a very real and practicle requirement for it. Please e-mail me or post a reply to this thread if you have any thoughts.
Thanks a lot.
content of common.php pasted below (with some obvious removals of passwords and variables).::
<?
/////////////////////////////////////////////////////////////////
// This is the configuration file for phpCommunityCalendar. //
// For installation instructions and more information, consult //
// the README file. //
// Full documentation is available in the docs directory and //
// on the web at //
/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// LICENSE AGREEMENT //
// phpCommunityCalendar is Open Source software and may be distributed //
// free of charge. AppIdeas.com also sells commercial installation and //
// support of the phpCommunityCalendar application. If you feel so //
// inclined, you may offer portions of your profits from sales of this //
// application to AppIdeas.com to help us continue development of Open //
// Source apps. //
// All installations of phpCommunityCalendar, including those that have //
// been heavily customized, must include this notice, in its entirety, //
// in a file called "common.php". phpCommunityCalendar carries no //
// warranty, either stated or implied, for any use. Furthermore, //
// AppIdeas.com will not be responsible for any damage, real or imagined, //
// that occurs as a result of the use of phpCommunityCalendar. Even //
// though this is free software, the images, coding and other material //
// herein is copyrighted material. Copyrights are held and maintained by //
// Christopher Ostmo and/or AppIdeas.com. The right to distribute this //
// software may be revoked by the author at any time. Certain features //
// may require registration for services from third party vendors or //
// companies. By using this software and these scripts, you are //
// agreeing to these terms. Please note: AppIdeas.com does not offer //
// free technical support for phpCommunityCalendar. AppIdeas.com staff //
// will delete any personal requests for free technical support. //
// Technical support for this and other Open Source applications is //
// available at: //
// //
// and discussion forums are available at: //
// //
// The current home page address for all of AppIdeas.com's Open Source //
// applications is: //
// //
// //
// You may contact AppIdeas.com for commercial installation and/or //
// support of phpCommunityCalendar or any other PHP/MySQL web project at: //
// AppIdeas.com //
// 2305-C Ashland St. #271 //
// Ashland, OR 97520 //
// Web: //
// E-mail: sales@appideas.com //
// //
// Be sure to check out our complete list of product offerings at: //
// //
// //
// Finally, a CVS-like system is available (or will be soon) at: //
// //
// If you have code to contribute, you can do so there. Updates and //
// new add-ons for this application will also be made available at this //
// site. Check in every once in a while to see if there are any new //
// features that you need or desire. //
// //
// ENJOY! //
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
// If the comment blocks within this file are read, most of the //
// features should be fairly self-explanatory. //
//////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// Replace these variables with information for connecting to your //
// database server //
/////////////////////////////////////////////////////////////////////
$DBHost = "db.mydomain.com";
$DBUser = "dbo38350525";
$DBPass = "mypassword";
$DBName = "db38350525";
mysql_pconnect("$DBHost","$DBUser","$DBPass"
// comment above and uncomment below if your hosting provider
// does not allow persistent database connections.
// mysql_connect("$DBHost","$DBUser","$DBPass"
/////////////////////////////////////////////////////////////////////////////////
// The $glbl_WebAddress, $glbl_WebRoot, $glbl_AdminRoot and $glbl_WebAdminRoot //
// variables are used to form URLs for inclusion in e-mail notifications to be //
// sent to admins on public event submission. They should not end with a //
// trailing forward slash. The other variables are reserved for future use. //
/////////////////////////////////////////////////////////////////////////////////
$glbl_WebAddress = "$glbl_UnixPath = "/usr/local/$glbl_WebRoot = "/calendar";
$glbl_AdminRoot = $glbl_WebRoot."/admin";
$glbl_WebAdminRoot = $glbl_WebRoot."/webadmin";
$glbl_ImagePath = $unixPath."/img";
$glbl_ImageRoot = $webRoot."/img";
$glbl_MailFrom = "calendar@localhost";
$glbl_EmailSubject = "Calendar Submission";
////////////////////////////////////////////////////////////////////
// The code below places the configuration options from the DB in //
// the global scope so that code doesn't have to be dropped into //
// every script to get the options. //
////////////////////////////////////////////////////////////////////
global $glbl_LocationTitle, $glbl_AllowPublicSubmission, $glbl_ApprovePublicSubmission, $glbl_ApprovalBySiteAdmin,
$glbl_ApprovalByLocationAdmin, $glbl_AllowCrossLocationSubmission, $glbl_DefaultView, $glbl_AllowMonth,
$glbl_AllowWeek, $glbl_AllowDay, $glbl_UseEventLocation, $glbl_TruncateLength, $glbl_SiteTitle, $glbl_AllowEventPrint,
$glbl_AdminEmail;
$result = mysql("$DBName","SELECT * FROM phpCalendar_Config" or die(mysql_error());
while ($row = mysql_fetch_row($result)) {
$glbl_LocationTitle = $row[0];
$glbl_AllowPublicSubmission = $row[1];
$glbl_ApprovePublicSubmission = $row[2];
$glbl_ApprovalBySiteAdmin = $row[3];
$glbl_ApprovalByLocationAdmin = $row[4];
$glbl_AllowCrossLocationSubmission = $row[5];
$glbl_DefaultView = $row[6];
$glbl_AllowMonth = $row[7];
$glbl_AllowWeek = $row[8];
$glbl_AllowDay = $row[9];
$glbl_UseEventLocation = $row[10];
$glbl_TruncateLength = $row[11];
$glbl_SiteTitle = $row[12];
$glbl_AllowEventPrint = $row[13];
$glbl_AdminEmail = $row[14];
}
//////////////////////////////////////////////////////////////////////
// commonHeader() defines the common site layout elements above and //
// to the left of the calendar content. To change the site layout, //
// alter the commonHeader() and commonFooter() functions. //
//////////////////////////////////////////////////////////////////////
function commonHeader($title) {
?>
<html>
<head>
<title><? echo $title; ?></title>
<!-- Changing the style sheet definitions below will change the default text
attributes throughout the site. You should not use "<body..." or "<font..."
tags to perform this task - those methods are becoming deprecated. -->
<style type="text/css">
<!--
body { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
small { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 9px; color: #000000}
big { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 16px; color: #000000}
a { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000099}
table { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
td { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
tr { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
th { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
h1 { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 26px; color: #000000}
h2 { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 22px; color: #000000}
h3 { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 18px; color: #000000}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table align="center" border="0">
<tr><td valign="top">
<?
}
//////////////////////////////////////////////////////////////////////
// commonFooter() defines the common site layout elements below and //
// to the right of the calendar content. //
//////////////////////////////////////////////////////////////////////
function commonFooter() {
if (date("Y" == 2001) {
$showDate = 2001;
} else {
$showDate = "2001 - ".date("Y"
}
?>
</td></tr>
<tr><td align="center">
<font size="-2">Calendar programming by </font>
<a href=" target="_new"><font size="-2">AppIdeas.com</font></a><br>
<font size="-2">Copyright © <? echo $showDate; ?></font><p>
</td></tr></table>
<?
}
///////////////////////////////////////////////////////////////////////
// popUp() defines the size of the javascript popups for event data. //
// These values can (and probably should) be changed from with the //
// scripts also. //
///////////////////////////////////////////////////////////////////////
function popUp($width="300",$height="200" { ?>
<script language='javascript'>
<!--
function openSmallWindow(url) {
window.open(url,"smallWindow","width=<? echo $width; ?>,height=<? echo $height; ?>,scrollbars,resizable"
return false;
}
// -->
</script>
<? }
////////////////////////////////////////////////////////////////////
// getEvent() displays events on the calendar for non-IE browsers //
////////////////////////////////////////////////////////////////////
function getEvent($ID, $AbbrTitle, $Date) {
echo "<a href=\"./event.php?ID=$ID&Date=$Date\" onClick=return(openSmallWindow('./event.php?ID=$ID&Date=$Date'))>$AbbrTitle</a>\n\n";
}
////////////////////////////////////////////////////////////////
// getEvent() displays events on the calendar for IE browsers //
// This distinction is made because IE is currently the only //
// browser on which the javascript mouseover effects work. //
////////////////////////////////////////////////////////////////
function getEventIE($ID, $LinkTitle, $AbbrTitle, $Date) {
$LinkTitle =ereg_replace("'","’",$LinkTitle);
$AbbrTitle =ereg_replace("'","’",$AbbrTitle);
echo "<script>
dLink('./event.php?ID=$ID&Date=$Date','$LinkTitle','$AbbrTitle');
</script>\n\n";
}
//////////////////////////////////////////////////////////////////
// expandItems() calls a javascript that replaces one string of //
// text with another on mouseover (IE only) //
//////////////////////////////////////////////////////////////////
function expandItems() {
?>
<script language="JavaScript"><!--
var no=0;
function mover(object,text) {
eval(object + '.innerText = text');
}
function mout(object,text) {
eval(object + '.innerText = text');
}
function dLink(href,text,txet) {
document.write('<a href="'+href+'" onMouseOut="mout(\'link'+no+'\',\''+txet+'\')" onMouseOver="mover(\'link'+no+'\',\''+text+'\')" id="link'+no+'" onClick=return(openSmallWindow(\''+href+'\'))>'+txet+'<\/a>');
no+=1;
}
//--></script>
<?
}
////////////////////////////////////////////////////////////////
// closeButton() is a javascript button for closing the event //
// data screens. //
////////////////////////////////////////////////////////////////
function closeButton() {
?>
<form name="form1" action="javascript:window.close();" method="post">
<input type="submit" value="Close This Window">
</FORM>
<?
}
/////////////////////////////////////////////////////////////////
// printButton() is a javascript button for printing the event //
// data screens. //
/////////////////////////////////////////////////////////////////
function printButton() {
?>
<form name="form2" action="javascript:window.print();" method="post" >
<input type="submit" name="Submit" value="Print This Page">
</form>
<?
}
//////////////////////////////////////////////////////////
// altBG() alternates table background colors in menus. //
// To change the alternating background colors, change //
// the values below. These currently only apply to the //
// menus in the admin areas. //
//////////////////////////////////////////////////////////
function altBG($lastColor) {
if ($lastColor == 1) {
echo "<tr bgcolor=\"#C9C9C9\">";
} elseif ($lastColor == 0) {
echo "<tr bgcolor=\"#E9E9E9\">";
}
}
////////////////////////////////////////////////////////////
// sessionGo() is used to track category admin users. For //
// insurance of proper functionality, these users should //
// have cookies enabled. If your server uses something //
// other than $PHPSESSID for the session identifier, //
// you'll need to reflect that change in the code below. //
////////////////////////////////////////////////////////////
function sessionGo() {
if (!$PHPSESSID) {
global $PHPSESSID;
ini_alter("session.auto_start","1"
session_start();
session_register();
}
}
//////////////////////////////////////////////////////////
// checkAdmin() is used to verify proper privileges for //
// category administration tools. //
//////////////////////////////////////////////////////////
function checkAdmin($PHPSESSID, $WebAdminRoot, $DBName) {
// place the LocationID in the global scope
global $glbl_LocationID;
// see if they're logged in
$result = mysql("$DBName","SELECT phpCalendar_AdminSessions.AdminUserID, phpCalendar_AdminUsers.LocationID
FROM phpCalendar_AdminSessions, phpCalendar_AdminUsers
WHERE phpCalendar_AdminSessions.SessionID = '$PHPSESSID'
AND phpCalendar_AdminSessions.AdminUserID = phpCalendar_AdminUsers.AdminUserID" or die(mysql_error());
$num = mysql_num_rows($result);
// if not, send them to the login page
if ($num < 1) {
Header("Location: ".$WebAdminRoot."/login.php"
exit;
// or else they're logged in, get the LocationID
} else {
while ($row = mysql_fetch_row($result)) {
$glbl_LocationID = $row[1];
}
}
}
?>
Warning: Cannot add header information - headers already sent by (output started at /homepages/18/d24357956/htdocs/wayne186/selfbuild/calendar/common.php:328) in /homepages/18/d24357956/htdocs/wayne186/selfbuild/calendar/index.php on line 5
The content of the default.php file is:
<?
require("common.php"
//
// what view is the default? let's go there
Header("Location: ./".$glbl_DefaultView.".php?LocationID=".$LocationID);
exit;
?>
From what I can see the default.php file uses common.php for all of the variables ie conections to database, paths and variables. I have also pasted this file below.. I am sorry if this breaches net etiquet by posting the contents of the file, I would absolutley love to get this working and soon as I have a very real and practicle requirement for it. Please e-mail me or post a reply to this thread if you have any thoughts.
Thanks a lot.
content of common.php pasted below (with some obvious removals of passwords and variables).::
<?
/////////////////////////////////////////////////////////////////
// This is the configuration file for phpCommunityCalendar. //
// For installation instructions and more information, consult //
// the README file. //
// Full documentation is available in the docs directory and //
// on the web at //
/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// LICENSE AGREEMENT //
// phpCommunityCalendar is Open Source software and may be distributed //
// free of charge. AppIdeas.com also sells commercial installation and //
// support of the phpCommunityCalendar application. If you feel so //
// inclined, you may offer portions of your profits from sales of this //
// application to AppIdeas.com to help us continue development of Open //
// Source apps. //
// All installations of phpCommunityCalendar, including those that have //
// been heavily customized, must include this notice, in its entirety, //
// in a file called "common.php". phpCommunityCalendar carries no //
// warranty, either stated or implied, for any use. Furthermore, //
// AppIdeas.com will not be responsible for any damage, real or imagined, //
// that occurs as a result of the use of phpCommunityCalendar. Even //
// though this is free software, the images, coding and other material //
// herein is copyrighted material. Copyrights are held and maintained by //
// Christopher Ostmo and/or AppIdeas.com. The right to distribute this //
// software may be revoked by the author at any time. Certain features //
// may require registration for services from third party vendors or //
// companies. By using this software and these scripts, you are //
// agreeing to these terms. Please note: AppIdeas.com does not offer //
// free technical support for phpCommunityCalendar. AppIdeas.com staff //
// will delete any personal requests for free technical support. //
// Technical support for this and other Open Source applications is //
// available at: //
// //
// and discussion forums are available at: //
// //
// The current home page address for all of AppIdeas.com's Open Source //
// applications is: //
// //
// //
// You may contact AppIdeas.com for commercial installation and/or //
// support of phpCommunityCalendar or any other PHP/MySQL web project at: //
// AppIdeas.com //
// 2305-C Ashland St. #271 //
// Ashland, OR 97520 //
// Web: //
// E-mail: sales@appideas.com //
// //
// Be sure to check out our complete list of product offerings at: //
// //
// //
// Finally, a CVS-like system is available (or will be soon) at: //
// //
// If you have code to contribute, you can do so there. Updates and //
// new add-ons for this application will also be made available at this //
// site. Check in every once in a while to see if there are any new //
// features that you need or desire. //
// //
// ENJOY! //
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
// If the comment blocks within this file are read, most of the //
// features should be fairly self-explanatory. //
//////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// Replace these variables with information for connecting to your //
// database server //
/////////////////////////////////////////////////////////////////////
$DBHost = "db.mydomain.com";
$DBUser = "dbo38350525";
$DBPass = "mypassword";
$DBName = "db38350525";
mysql_pconnect("$DBHost","$DBUser","$DBPass"
// comment above and uncomment below if your hosting provider
// does not allow persistent database connections.
// mysql_connect("$DBHost","$DBUser","$DBPass"
/////////////////////////////////////////////////////////////////////////////////
// The $glbl_WebAddress, $glbl_WebRoot, $glbl_AdminRoot and $glbl_WebAdminRoot //
// variables are used to form URLs for inclusion in e-mail notifications to be //
// sent to admins on public event submission. They should not end with a //
// trailing forward slash. The other variables are reserved for future use. //
/////////////////////////////////////////////////////////////////////////////////
$glbl_WebAddress = "$glbl_UnixPath = "/usr/local/$glbl_WebRoot = "/calendar";
$glbl_AdminRoot = $glbl_WebRoot."/admin";
$glbl_WebAdminRoot = $glbl_WebRoot."/webadmin";
$glbl_ImagePath = $unixPath."/img";
$glbl_ImageRoot = $webRoot."/img";
$glbl_MailFrom = "calendar@localhost";
$glbl_EmailSubject = "Calendar Submission";
////////////////////////////////////////////////////////////////////
// The code below places the configuration options from the DB in //
// the global scope so that code doesn't have to be dropped into //
// every script to get the options. //
////////////////////////////////////////////////////////////////////
global $glbl_LocationTitle, $glbl_AllowPublicSubmission, $glbl_ApprovePublicSubmission, $glbl_ApprovalBySiteAdmin,
$glbl_ApprovalByLocationAdmin, $glbl_AllowCrossLocationSubmission, $glbl_DefaultView, $glbl_AllowMonth,
$glbl_AllowWeek, $glbl_AllowDay, $glbl_UseEventLocation, $glbl_TruncateLength, $glbl_SiteTitle, $glbl_AllowEventPrint,
$glbl_AdminEmail;
$result = mysql("$DBName","SELECT * FROM phpCalendar_Config" or die(mysql_error());
while ($row = mysql_fetch_row($result)) {
$glbl_LocationTitle = $row[0];
$glbl_AllowPublicSubmission = $row[1];
$glbl_ApprovePublicSubmission = $row[2];
$glbl_ApprovalBySiteAdmin = $row[3];
$glbl_ApprovalByLocationAdmin = $row[4];
$glbl_AllowCrossLocationSubmission = $row[5];
$glbl_DefaultView = $row[6];
$glbl_AllowMonth = $row[7];
$glbl_AllowWeek = $row[8];
$glbl_AllowDay = $row[9];
$glbl_UseEventLocation = $row[10];
$glbl_TruncateLength = $row[11];
$glbl_SiteTitle = $row[12];
$glbl_AllowEventPrint = $row[13];
$glbl_AdminEmail = $row[14];
}
//////////////////////////////////////////////////////////////////////
// commonHeader() defines the common site layout elements above and //
// to the left of the calendar content. To change the site layout, //
// alter the commonHeader() and commonFooter() functions. //
//////////////////////////////////////////////////////////////////////
function commonHeader($title) {
?>
<html>
<head>
<title><? echo $title; ?></title>
<!-- Changing the style sheet definitions below will change the default text
attributes throughout the site. You should not use "<body..." or "<font..."
tags to perform this task - those methods are becoming deprecated. -->
<style type="text/css">
<!--
body { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
small { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 9px; color: #000000}
big { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 16px; color: #000000}
a { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000099}
table { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
td { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
tr { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
th { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 12px; color: #000000}
h1 { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 26px; color: #000000}
h2 { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 22px; color: #000000}
h3 { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 18px; color: #000000}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table align="center" border="0">
<tr><td valign="top">
<?
}
//////////////////////////////////////////////////////////////////////
// commonFooter() defines the common site layout elements below and //
// to the right of the calendar content. //
//////////////////////////////////////////////////////////////////////
function commonFooter() {
if (date("Y" == 2001) {
$showDate = 2001;
} else {
$showDate = "2001 - ".date("Y"
}
?>
</td></tr>
<tr><td align="center">
<font size="-2">Calendar programming by </font>
<a href=" target="_new"><font size="-2">AppIdeas.com</font></a><br>
<font size="-2">Copyright © <? echo $showDate; ?></font><p>
</td></tr></table>
<?
}
///////////////////////////////////////////////////////////////////////
// popUp() defines the size of the javascript popups for event data. //
// These values can (and probably should) be changed from with the //
// scripts also. //
///////////////////////////////////////////////////////////////////////
function popUp($width="300",$height="200" { ?>
<script language='javascript'>
<!--
function openSmallWindow(url) {
window.open(url,"smallWindow","width=<? echo $width; ?>,height=<? echo $height; ?>,scrollbars,resizable"
return false;
}
// -->
</script>
<? }
////////////////////////////////////////////////////////////////////
// getEvent() displays events on the calendar for non-IE browsers //
////////////////////////////////////////////////////////////////////
function getEvent($ID, $AbbrTitle, $Date) {
echo "<a href=\"./event.php?ID=$ID&Date=$Date\" onClick=return(openSmallWindow('./event.php?ID=$ID&Date=$Date'))>$AbbrTitle</a>\n\n";
}
////////////////////////////////////////////////////////////////
// getEvent() displays events on the calendar for IE browsers //
// This distinction is made because IE is currently the only //
// browser on which the javascript mouseover effects work. //
////////////////////////////////////////////////////////////////
function getEventIE($ID, $LinkTitle, $AbbrTitle, $Date) {
$LinkTitle =ereg_replace("'","’",$LinkTitle);
$AbbrTitle =ereg_replace("'","’",$AbbrTitle);
echo "<script>
dLink('./event.php?ID=$ID&Date=$Date','$LinkTitle','$AbbrTitle');
</script>\n\n";
}
//////////////////////////////////////////////////////////////////
// expandItems() calls a javascript that replaces one string of //
// text with another on mouseover (IE only) //
//////////////////////////////////////////////////////////////////
function expandItems() {
?>
<script language="JavaScript"><!--
var no=0;
function mover(object,text) {
eval(object + '.innerText = text');
}
function mout(object,text) {
eval(object + '.innerText = text');
}
function dLink(href,text,txet) {
document.write('<a href="'+href+'" onMouseOut="mout(\'link'+no+'\',\''+txet+'\')" onMouseOver="mover(\'link'+no+'\',\''+text+'\')" id="link'+no+'" onClick=return(openSmallWindow(\''+href+'\'))>'+txet+'<\/a>');
no+=1;
}
//--></script>
<?
}
////////////////////////////////////////////////////////////////
// closeButton() is a javascript button for closing the event //
// data screens. //
////////////////////////////////////////////////////////////////
function closeButton() {
?>
<form name="form1" action="javascript:window.close();" method="post">
<input type="submit" value="Close This Window">
</FORM>
<?
}
/////////////////////////////////////////////////////////////////
// printButton() is a javascript button for printing the event //
// data screens. //
/////////////////////////////////////////////////////////////////
function printButton() {
?>
<form name="form2" action="javascript:window.print();" method="post" >
<input type="submit" name="Submit" value="Print This Page">
</form>
<?
}
//////////////////////////////////////////////////////////
// altBG() alternates table background colors in menus. //
// To change the alternating background colors, change //
// the values below. These currently only apply to the //
// menus in the admin areas. //
//////////////////////////////////////////////////////////
function altBG($lastColor) {
if ($lastColor == 1) {
echo "<tr bgcolor=\"#C9C9C9\">";
} elseif ($lastColor == 0) {
echo "<tr bgcolor=\"#E9E9E9\">";
}
}
////////////////////////////////////////////////////////////
// sessionGo() is used to track category admin users. For //
// insurance of proper functionality, these users should //
// have cookies enabled. If your server uses something //
// other than $PHPSESSID for the session identifier, //
// you'll need to reflect that change in the code below. //
////////////////////////////////////////////////////////////
function sessionGo() {
if (!$PHPSESSID) {
global $PHPSESSID;
ini_alter("session.auto_start","1"
session_start();
session_register();
}
}
//////////////////////////////////////////////////////////
// checkAdmin() is used to verify proper privileges for //
// category administration tools. //
//////////////////////////////////////////////////////////
function checkAdmin($PHPSESSID, $WebAdminRoot, $DBName) {
// place the LocationID in the global scope
global $glbl_LocationID;
// see if they're logged in
$result = mysql("$DBName","SELECT phpCalendar_AdminSessions.AdminUserID, phpCalendar_AdminUsers.LocationID
FROM phpCalendar_AdminSessions, phpCalendar_AdminUsers
WHERE phpCalendar_AdminSessions.SessionID = '$PHPSESSID'
AND phpCalendar_AdminSessions.AdminUserID = phpCalendar_AdminUsers.AdminUserID" or die(mysql_error());
$num = mysql_num_rows($result);
// if not, send them to the login page
if ($num < 1) {
Header("Location: ".$WebAdminRoot."/login.php"
exit;
// or else they're logged in, get the LocationID
} else {
while ($row = mysql_fetch_row($result)) {
$glbl_LocationID = $row[1];
}
}
}
?>