I'm sorry to bother you again, but I've come across a couple of small
issues whilst adapting your fabulous script to my client's wishes.
First a small problem:
I've added extra language files for Dutch, French and German. Accents
and umlauts come across fine when entered into the basic language
translation section (ie for months, etc.). However when I use 'fermé'
for closed in the Booking States, the character é is displayed as 'é'
in the resulting Legend table.
... and then a question/request:
My client's site is split into 4 according to an initial language
choice. When opening the page containing the availability calender, is
it possible to force the language of the calender to a particular
language, rather than have the language pull-down menu? I tried
changing
var lang = '<?php echo LANG; ?>';
to
var lang = 'nl'; (or whichever other language code)
but this only successfully pre-set the language of the calender itself
and not the Booking Item or Booking States.
I'd be very grateful (again) for your thoughts.
Many thanks for your time.
Brian
As regards the language, appending &lang=nl to the url or hardgoing it
into the page that shows the calendar like this:
$_REQUEST["lang"]="nl";
should work (place this BEFORE you include the calendar file).
Note - This is one of the things that I need to simplify for the next
release version.
Chris
you're a genius!! I'm very grateful for your swift and clear reply.
Changing the charset for the page certainly solves the problem, although it remains strange that the és and û in the calendar were displayed perfectly, but those coming from the booking state didn't. Enfin - problem solved.
Also adding ?&lang= ... to the url does the job perfectly.
Incidentally I was unable to delete Spanish via the 'legal' route in the language admin section, so had to manually delete the language file from the server and remove the database tables. Once they're completed, if you'd like to include the language files I've made as standard with the program (Dutch, German and French) - I'll be more than happy to send them to you.
May I please bug you with one last question and then I think I can leave you in peace?
Underneath your calendar I've added a reservation form, as you can see here:
http://www.laserenade.eu/ls_resEN.php?&lang=en
I'm using the following script to send the form and return a 'Your reservation has been sent' message:
<?php
extract($_REQUEST);
if(isset($submit)) {
$body = "\r\nLa Serenade Reservation:\r\n\r\n $Achternaam\r\n ".
"$Voornaam\r\n $Email\r\n $Telefoon\r\n $Data\r\n $Wensen\r\n";
mail( "in...@laserenade.eu", "La Serenade Reservation Form", $body, "Van: in...@laserenade.eu" );
mail( $Email, "La Serenade Reservation Form", $body, "Van: in...@laserenade.eu" );
$status = '<br><b><font color="red">Your reservation has been sent. Many thanks!</font><br><br>';
}
?>
<?=$status?>
If these lines are placed after the calendar script before the form - eveything works fine, except that the Thankyou message is displayed too far down the page. So I moved the script up before the calendar script. As a result the calendar still works perfectly, but the roll-over texts for month forward/backward and the 'Last update' text are reduced to an 'e'. In the grand scheme of things not of vital importance, but a niggling don't-know-why which I can't seem to solve. Any thoughts?
Once again - very many thanks for your assistance.
Best wishes
Brian
> --
> You received this message because you are subscribed to the Google Groups "Ajax Availability Calendar" group.
> To post to this group, send email to ajax-availabi...@googlegroups.com.
> To unsubscribe from this group, send email to ajax-availability-c...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ajax-availability-calendar?hl=en.
>
>
>
Just further to what I've just described with the placement of my extra message sending script ... now I've finished the pages for all 4 languages, the 'e' appears to be the first letter of the language code, ie changes to 'f', 'd' and 'n'. Curiouser and curiouser!
Yours gratefully
Brian
This is because the "normal" texts are defined in a text file whereas
the booking states are saved in a database table nad are encoded
differently.
> As a result the calendar still works perfectly, but the roll-over texts for month forward/backward and the 'Last update' text are reduced to an 'e'. In the
> grand scheme of things not of vital importance, but a niggling don't-know-why which I can't seem to solve. Any thoughts?
I suspect that it has something to do with the extract() function that
you are using.
As you willl have seen from the language files, they define a variable
called "$lang".
As you have passed the lang=en in the url, it looks like the $lang
array for all the texts is being overwritten with this value.
If this is the case you could either modify the arrow icons along with
their titles BEFORE you include the form code that you posted (ie
create a couple of variables like this:
$calendar_controls='
<div id="cal_prev" title="'.$lang["prev_X_months"].'">'.
$icons["previous"].'</div>
<div id="cal_prev1" title="'.$lang["prev_month"].'">'.
$icons["previous_1"].'</div>
<div id="cal_reset" title="'.$lang["cal_2_current"].'">'.
$icons["current"].'</div>
<div id="cal_next1" title="'.$lang["next_month"].'">'.
$icons["next_1"].'</div>
<div id="cal_next" title="'.$lang["next_X_months"].'">'.
$icons["next"].'</div>
';
..... your form code.....
Then in the calendar code where you had the bottons simply echo the
new variable that you have created like this:
<div id="cal_controls">'.$calendar_controls.'</div>
Alternatively you could modify your code to not use extract() (never
used it myself) and simply use the posted values directly ie:
if(isset($_POST["submit"])) {
$body = "\r\nLa Serenade Reservation:\r\n\r\n $_POST["Achternaam"]\r
\n ".
"$Voornaam\r\n $Email\r\n $Telefoon\r\n $Data\r\n $_POST["Wensen"]\r
\n";
mail( "i...@laserenade.eu", "La Serenade Reservation Form",
$_POST["body"], "Van: i...@laserenade.eu" );
mail( $Email, "La Serenade Reservation Form", $_POST["body"], "Van:
i...@laserenade.eu" );
$status = '<br><b><font color="red">Your reservation has been sent.
Many thanks!</font><br><br>';
}
Personally I would opt for this last option but it is up to you ;)
Chris
On 10 mar, 13:22, Brian Galliford <i...@briangalliford.com> wrote:
> Hi Chris,
>
> you're a genius!! I'm very grateful for your swift and clear reply.
>
> Changing the charset for the page certainly solves the problem, although it remains strange that the és and û in the calendar were displayed perfectly, but those coming from the booking state didn't. Enfin - problem solved.
>
> Also adding ?&lang= ... to the url does the job perfectly.
>
> Incidentally I was unable to delete Spanish via the 'legal' route in the language admin section, so had to manually delete the language file from the server and remove the database tables. Once they're completed, if you'd like to include the language files I've made as standard with the program (Dutch, German and French) - I'll be more than happy to send them to you.
>
> May I please bug you with one last question and then I think I can leave you in peace?
>
> Underneath your calendar I've added a reservation form, as you can see here:http://www.laserenade.eu/ls_resEN.php?〈=en
>
> I'm using the following script to send the form and return a 'Your reservation has been sent' message:
>
> <?php
> extract($_REQUEST);
>
> if(isset($submit)) {
> $body = "\r\nLa Serenade Reservation:\r\n\r\n $Achternaam\r\n ".
> "$Voornaam\r\n $Email\r\n $Telefoon\r\n $Data\r\n $Wensen\r\n";
> mail( "i...@laserenade.eu", "La Serenade Reservation Form", $body, "Van: i...@laserenade.eu" );
> mail( $Email, "La Serenade Reservation Form", $body, "Van: i...@laserenade.eu" );
> $status = '<br><b><font color="red">Your reservation has been sent. Many thanks!</font><br><br>';
> }
> ?>
> <?=$status?>
>
> If these lines are placed after the calendar script before the form - eveything works fine, except that the Thankyou message is displayed too far down the page. So I moved the script up before the calendar script. As a result the calendar still works perfectly, but the roll-over texts for month forward/backward and the 'Last update' text are reduced to an 'e'. In the grand scheme of things not of vital importance, but a niggling don't-know-why which I can't seem to solve. Any thoughts?
>
> Once again - very many thanks for your assistance.
>
> Best wishes
>
> Brian
>
> Op 10 mrt 2010, om 12:47 heeft cbolson het volgende geschreven:
>
> >> ... However when I use 'fermé'
> >> for closed in the Booking States, the character é is displayed as 'é'
> >> in the resulting Legend table.
> > Hmmm, works fine in my version (just checked)
> > Have you checked what charset your page is using?
> > My version is using "utf-8":
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>
> > As regards the language, appending &lang=nl to the url or hardgoing it
> > into the page that shows the calendar like this:
>
> > $_REQUEST["lang"]="nl";
>
> > should work (place this BEFORE you include the calendar file).
>
> > Note - This is one of the things that I need to simplify for the next
> > release version.
>
> > Chris
>
> > On 10 mar, 12:08, Brian <i...@briangalliford.com> wrote:
> >> Dear Chris,
>
> >> I'm sorry to bother you again, but I've come across a couple of small
> >> issues whilst adapting your fabulous script to my client's wishes.
>
> >> First a small problem:
> >> I've added extra language files for Dutch, French and German. Accents
> >> and umlauts come across fine when entered into the basic language
> >> translation section (ie for months, etc.). However when I use 'fermé'
> >> for closed in the Booking States, the character é is displayed as 'é'
if(isset($_POST["submit"])) {
$body = "\r\nLa Serenade Reservation:\r\n\r\n ".
$_POST["Achternaam"]."\r\n".$_POST[["Voornaam"]."\r\n ".
$_POST["Email."]."\r\n".$_POST["Telefoon."]."\r\n ".$_POST["Data."]."\r
\n ".$_POST["Wensen"]."\r\n";
mail( "i...@laserenade.eu", "La Serenade Reservation Form", $body,
"Van: i...@laserenade.eu" );
mail( $_POST["Email"], "La Serenade Reservation Form",$body,
"Van:i...@laserenade.eu" );
$status = '<br><b><font color="red">Your reservation has been sent.
Many thanks!</font><br><br>';
}
Chris
I've put this these corrections place, no more fault messages, but now the status line doesn't come up after sending as called by
<?=$status?>
placed just after this code and before the calendar code.
I'm also not sure whether the mail was sent, since I haven't received the confirmation email which normally arrived a couple minutes after sending.
Brian
Chris