Fullcalendar Into Phpmakercode
Fullcalendar Into Phpmakercode
The directory in which the calendar is located must be placed next to the directory that PHPmaker
has generated.
In this case that was:
/fullcalendar (the PHPmaker generated code)
/kaltest2 (tha calendar made by Paul Wolbers)
A wish of
The title of every event starts with the user_id. (example: 11-)
If the event is made by the administrator then the title starts with A-
Make changes to phpmaker-generated code
1
[required]
In header.php :
2
In the new page “blankpage.php” on the following lines:
!! the name ‘blankpage’ should be replaced with another name, otherwise the page will be
overwritten if you add another blankpage
1
[required]
Kaltest2/include/default.inc.php on line 7, set the correct path to the ‘configs’ directory:
if(file_exists('/home/.../public_html/kaltest2/configs/config.php')) {
require_once '/home/.../public_html/kaltest2/configs/config.php';
} else if(file_exists('../configs/config.php')) {
require_once '../configs/config.php';
}
Originally this was not necessary to change, but somehow the config.php can’t be found otherwise.
(I will do some testing on my server and when I find a solution I will let you know)
2
[optional]
In Kaltest2/script/script.js set the option showAgendaButton to true or false to show or hide the
agendabutton in the calendar.
Find the next piece of code and add ‘showAgendaButton: true,’
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
showAgendaButton: true,
…
Make changes to Fullcalendar.js
1
Setting correct paths and constants
/**
* FULLCALENDAR INCLUDES
*/
if($_SERVER["HTTP_HOST"] == 'localhost' OR $_SERVER["HTTP_HOST"] == '127.0.0.1') {
// for local testing on your computer
define('FULLCAL_DIR','/home/.../public_html/paulwolbers/kaltest2');
define('FULLCAL_URL','http://localhost/paulwolbers/kaltest2');
define('EXTERNAL_URL',FULLCAL_URL.'/external');
}else{
// PATH DEFINES HERE
define('FULLCAL_DIR','/home/.../public_html/paulwolbers/kaltest2');
define('FULLCAL_URL','YOUR_SITE/kaltest2');
define('EXTERNAL_URL',FULLCAL_URL.'/external');
}
define('CONFIG_DIR',FULLCAL_DIR.'/configs');
define('EXTERNAL_DIR',FULLCAL_DIR.'/external');
define('INCLUDE_DIR', FULLCAL_DIR.'/include');
define('CLASSES_DIR', FULLCAL_DIR.'/model');
/**
* LANGUAGE
*/
define('LANGUAGE', 'DE'); // supported NL, EN, FR, DE, not complete
/**
* CALENDAR
*/
define('USE_CALENDAR_COLOR_FOR_EVENT', true);
define('REDIRECT_TO_LOGIN_WHEN_NOT_LOGGEDIN', true);
/**
* AGENDAVIEW
*/
define('LIMIT_AMOUNT_AGENDA_DAYS', 15); // amount of days that are shown in
// the agendaview
/**
* DRAG AND DROP
*/
define('SHOW_LOGINNAME_IN_CALENDAR', true); // above drag and drop part
define('LOGINNAME_LABEL', 'Logged in: ');
define('REMOVE_AFTER_DROP', true); // show or hide the checkbox
/**
* DRAG AND DROP TEXTS
*/
define('DRAG_AND_DROP_TEXT', 'Drag and drop from this list');
define('REMOVE_AFTER_DROP_TEXT', 'remove after drop');
/**
* EDIT POPUP CONFIG
*/
define('SHOW_DATE_SELECTION', true);
define('SHOW_YEAR', true);
define('START_YEAR', '-2');
define('END_YEAR', '+2');
define('MINHOUR', 5);
define('MAXHOUR', 20);
define('MINUTE_INTERVAL', 15); // timepicker: interval in minutes
define('SHOW_COLOR_SELECTION', true);
if($_SERVER["HTTP_HOST"] == 'localhost') {
// for local testing on your computer
$str_hostname = 'localhost';
$str_username = 'root';
$str_password = '';
$str_database = 'DBNAME';
} else {
// online settings here
$str_hostname = 'localhost';
$str_username = 'USERNAME';
$str_password = 'PASSWORD';
$str_database = 'DBNAME';
}
Events table:
CREATE TABLE IF NOT EXISTS `events` (
`event_id` int(11) NOT NULL auto_increment,
`title` varchar(255) default NULL,
`date_start` date default NULL,
`time_start` time default NULL,
`date_end` date default NULL,
`time_end` time default NULL,
`allDay` tinyint(1) NOT NULL default '0',
`calendartype` varchar(155) NOT NULL,
`user_id` int(11) NOT NULL,
`color` varchar(10) NOT NULL,
PRIMARY KEY (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;