PDA

Zobacz pełną wersję : Formularz kontaktowy w kilku języch.



czarny_85
19-04-2011, 13:24
Panowie idzie podstawowy formularz kontaktowy (komponent) przetłumaczyć na kilka języków? Używam joomfish do wielu języków na stronie.

Bez instalowania dodatkowych formularzy przetłumaczyć podstawowy.

Imię, Nazwa, Wiadomość.

palyga007
19-04-2011, 13:32
@czarny_85

Wolniej i dokładniej.

Przy pomocy Joomfish! nie możesz? (nie sprawdzałem nigdy także nie wiem)

czarny_85
19-04-2011, 13:50
W joomfish nie idzie przetłumaczyć Imię, Nazwa, Wiadomość. Tych informacji nie idzie przetłumaczyć.

Wcześniej nie było problemu z formularzem ponieważ mam swój własny, lecz teraz strona jest na innym serwerze na którym mój własny formularz nie działa. Gdy go osadzę w Joomli nie działa ale testowałem go w osobnym folderze i działał. Dziwne;/

A jego budowa jest taka:

plik contant.php


<?php

$to = "mail@mail.pl"; //This is the email address you want to send the email to
$subject_prefix = ""; //Use this if you want to have a prefix before the subject

if(!isset($_GET['action']))
{
die("You must not access this page directly!"); //Just to stop people from visiting contact.php normally
}

/* Now lets trim up the input before sending it */

$name = trim($_GET['name']); //The senders name
$email = trim($_GET['email']); //The senders email address
$subject = trim($_GET['subject']); //The senders subject
$message = trim($_GET['msg']); //The senders message

mail($to,$subject,$message,"From: ".$email.""); //a very simple send

echo 'contactarea|Dziekuje '.$name.', twoja wiadomosc zostala wyslana.'; //now lets update the "contactarea" div on the contact.html page. The contactarea| tell's the javascript which div to update.
?>


Oraz index.php


<html>
<head>
<title>Formularz tekstowy</title>
<style type="text/css">
body {
margin:50px 0px; padding:0px;
text-align:center;
}

#contactarea {
width:350px;
margin:0px auto;
text-align:left;
padding:15px;
font-weight: none;
font-family: Verdana, Arial;
font-size: 12px;
}

#inputbox {
border: 1px solid #000;
width: 270;
padding: 2px;
font-weight: none;
font-family: Verdana, Arial;
font-size: 12px;
}

#inputlabel {
font-weight: none;
font-family: Verdana, Arial;
font-size: 12px;

}

#textarea {
border: 1px solid #000;
padding: 2px;
font-weight: none;
font-family: Verdana, Arial;
font-size: 12px;
width:330;
}

#submitbutton {
border: 1px solid #000;
background-color: #eee;

}
</style>

<script language="javascript">

function createRequestObject() {
var ro;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
ro = new ActiveXObject("Microsoft.XMLHTTP");
}else{
ro = new XMLHttpRequest();
}
return ro;
}

var http = createRequestObject();

function sendemail() {
var msg = document.contactform.msg.value;
var name = document.contactform.name.value;
var email = document.contactform.email.value;
var subject = document.contactform.subject.value;
document.contactform.send.disabled=true;
document.contactform.send.value='Sending....';

http.open('get', 'contact.php?msg='+msg+'&name='+name+'&subject='+subject+'&email='+email+'&action=send');
http.onreadystatechange = handleResponse;
http.send(null);
}

function handleResponse() {
if(http.readyState == 4){
var response = http.responseText;
var update = new Array();

if(response.indexOf('|' != -1)) {
update = response.split('|');
document.getElementById(update[0]).innerHTML = update[1];

}
}
}
</script>
</head>
<body>
<div id="contactarea">
<form name="contactform" id="contactform">
<span id="inputlabel">Imie:</span> &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="name" id="inputbox"><br /><br />
<span id="inputlabel">Email:</span> &nbsp;&nbsp;&nbsp;<input type="text" name="email" id="inputbox"><br /><br />
<span id="inputlabel">Temat:</span> &nbsp;<input type="text" name="subject" id="inputbox"><br /><br />
<span id="inputlabel">Wiadomosc:</span><br />
<textarea name="msg" rows="10" id="textarea"></textarea>
<br /><br />
<input type="button" value="Wyslij" name="send" onClick="sendemail();" id="submitbutton">

</form>
</div>
</body>
</html>


Jest cały czas info sending... i nie wysyła jak go osadzę w artykule.