Jeg må tilføje at der ellers er lagt op til at hente info fra index.php med den her kode:
<script type="text/javascript"> function dateChanged(calendar) { // Beware that this function is called even if the end-user only // changed the month/year. In order to determine if a date was // clicked you can use the dateClicked property of the calendar: if (calendar.dateClicked) { // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php var y = calendar.date.getFullYear(); var m = calendar.date.getMonth(); // integer, 0..11 var d = calendar.date.getDate(); // integer, 1..31 // redirect... window.location = "/" + y + "/" + m + "/" + d + "/index.php"; } };
Calendar.setup( { flat : "calendar-container", // ID of the parent element flatCallback : dateChanged // our callback function } ); </script>
Der test.php som jeg paster forneden Håber den kan sige noget, jeg er på bar bund :)
<?php
$lang = $_GET['lang']; if (!$lang) { $lang = $_REQUEST['lang']; } if (!$lang) { $lang = 'en'; } setcookie('lang', $lang);
?> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <title> Test for calendar.php </title>
<?php
// put here the correct path to "calendar.php"; don't move the file // "calendar.php" -- I think it's best if you leave it inside the // "/jscalendar/" directory. Just put here the correct path to it, such as // "../jscalendar/calendar.php" or something. require_once ('calendar.php');
// parameters to constructor: // 1. the absolute URL path to the calendar files // 2. the languate used for the calendar (see the lang/ dir) // 3. the theme file used for the clanedar, without the ".css" extension // 4. boolean that specifies if the "_stripped" files are to be loaded // The stripped files are smaller as they have no whitespace and comments $calendar = new DHTML_Calendar('/jscalendar/', $lang, 'calendar-win2k-2', false);
// call this in the <head> section; it will "echo" code that loads the calendar // scripts and theme file. $calendar->load_files();
<form action="test.php" method="get"> Select language: <select name="lang" onchange="this.form.submit()"> <?php $cwd = getcwd(); chdir('lang'); foreach (glob('*.js') as $filename) { $l = preg_replace('/(^calendar-|.js$)/', '', $filename); $selected = ''; if ($l == $lang) $selected = 'selected="selected" '; $display = $l; if ($l == 'en') $display = 'EN'; echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>'; } ?> </select> <blockquote style="font-size: 90%"> <b>NOTE</b>: as of this release, 0.9.6, only "EN" and "RO", which I maintain, function correctly. Other language files do not work because they need to be updated. If you update some language file, please consider sending it back to me so that I can include it in the calendar distribution. </blockquote> </form>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.