Skip to content

Commit

Permalink
V1.3 - W3.css
Browse files Browse the repository at this point in the history
  • Loading branch information
boiteasite committed Dec 27, 2017
1 parent 4a6d4c6 commit 4348967
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Added with a Shortcode in the content of the page or directly in the template.

### Versions ###

* 1.3 - 27/12/2017 : W3.css compatibility
* 1.2.2 - 15/03/2017 : Fix issue when unknow lang
* 1.2.1 - 07/03/2017 : Send with PHPMailer if the Newsletter plugin is installed
* 1.2 - 14/10/2016 : Use PHP-Gettext in place of gettext
Expand Down
14 changes: 7 additions & 7 deletions contactCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
session_start();
if($_POST['contactCaptcha']!=$_SESSION['captcha']['code'])
{
echo T_('Captcha error');
echo '<h3>'.T_('Captcha error').'</h3>';
Exit;
}
}
Expand Down Expand Up @@ -47,14 +47,14 @@
// PHPMailer
require '../newsletter/PHPMailer/PHPMailerAutoload.php';
$phm = new PHPMailer();
$phm->CharSet = "UTF-8";
$phm->charSet = "UTF-8";
$phm->setFrom($mail, 'No Reply');
$phm->AddAddress($mail);
$phm->addAddress($mail);
$phm->isHTML(true);
$phm->Subject = stripslashes($sujet);
$phm->Body = stripslashes($msgH);
$phm->AltBody = stripslashes($msgT);
if($l>10 && $phm->Send())
$phm->subject = stripslashes($sujet);
$phm->body = stripslashes($msgH);
$phm->altBody = stripslashes($msgT);
if($l>10 && $phm->send())
{
if(!$happy) echo T_('OK');
else echo ' '.$happy;
Expand Down
20 changes: 12 additions & 8 deletions contactMake.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if(file_exists('data/_sdata-'.$sdata.'/'.$Ubusy.'/contact.json'))
{
// {"t":"te","l":"Pr\u00e9nom"}
$o1 = "\r\n".'<div class="contactBloc" id="contactBloc">'."\r\n\t".'<form>'."\r\n";
$o1 = "\r\n".'<div class="'.(isset($Uw3['input']['w3-container'])?$Uw3['input']['w3-container']:'w3-container').' contactBloc" id="contactBloc">'."\r\n\t".'<form>'."\r\n";
$q1 = file_get_contents('data/_sdata-'.$sdata.'/'.$Ubusy.'/contact.json');
$a1 = json_decode($q1,true);
$s1 = '';
Expand All @@ -16,21 +16,25 @@
$v2 = strtr($v2, 'áàâäãåçéèêëíìîïñóòôöõúùûüýÿ -', 'aaaaaaceeeeiiiinooooouuuuyy__');
$v2 = preg_replace("/[^a-zA-Z0-9\d_]+/","",$v2);
$s1 .= '&'.$v2.'="+document.getElementById(\''.$v2.'\').value+"';
$o1 .= "\t\t".'<label>'.stripslashes(str_replace('_',' ',$v1['l'])).'</label>';
if ($v1['t']=='te') $o1 .= '<input type="text" name="'.$v2.'" id="'.$v2.'" />'."\r\n";
else if ($v1['t']=='ta') $o1 .= '<textarea name="'.$v2.'" id="'.$v2.'"></textarea>'."\r\n";
$o1 .= "\t\t".'<div class="w3-section"><label>'.stripslashes(str_replace('_',' ',$v1['l'])).'</label>';
if ($v1['t']=='te') $o1 .= '<input class="'.(isset($Uw3['input']['w3-input'])?$Uw3['input']['w3-input']:'w3-input').'" type="text" name="'.$v2.'" id="'.$v2.'" />';
else if ($v1['t']=='ta') $o1 .= '<textarea class="'.(isset($Uw3['input']['w3-input'])?$Uw3['input']['w3-input']:'w3-input').'" name="'.$v2.'" id="'.$v2.'"></textarea>';;
$o1 .= '</div>'."\r\n";
$s2 .= 'document.getElementById(\''.$v2.'\').value="";';
}
if($a1['captcha']==1)
{
$s1 .= '&contactCaptcha="+document.getElementById(\'contactCaptcha\').value+"';
$s2 .= 'document.getElementById(\'contactCaptcha\').value="";';
$o1 .= "\t\t".'<label>Captcha</label><input type="text" name="contactCaptcha" id="contactCaptcha" /><img src="" title="Captcha" id="imageCaptcha" style="height:30px; width:72px" />'."\r\n";
$o1 .= "\t\t".'<div class="w3-section"><label>Captcha</label>';
$o1 .= '<input class="'.(isset($Uw3['input']['w3-input'])?$Uw3['input']['w3-input']:'w3-input').' contactCaptcha" type="text" name="contactCaptcha" id="contactCaptcha" />';
$o1 .= '<img class="imageCaptcha" src="" title="Captcha" id="imageCaptcha" style="height:30px; width:72px" /></div>'."\r\n";
$Uonload .= 'var x=new XMLHttpRequest();x.open("POST","uno/plugins/contact/captcha.php",true);x.setRequestHeader("Content-type","application/x-www-form-urlencoded");x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.onreadystatechange=function(){if(x.readyState==4 && x.status==200){document.getElementById("imageCaptcha").src=x.responseText;}};x.send();'."\r\n";
}
$o1 .= "\t\t".'<div><button type="button" onClick="contactSend();">'.$a1['send'].'</button></div>'."\r\n";
$o1 .= "\t".'</form>'."\r\n".'</div><!-- .contactBloc -->'."\r\n";
$Ustyle .= ".contactBloc{max-width:480px;margin:10px;}.contactBloc label{text-transform:capitalize;}.contactBloc input,.contactBloc textarea{display:block;width:100%;margin:0 0 5px;padding:0}.contactBloc textarea{height:120px;}.contactBloc button{margin:7px 0 0;padding:4px 12px;}#contactCaptcha{display:inline-block;margin:10px 0 10px 10px;max-width:80px;}#imageCaptcha{margin:-10px 10px;}\r\n";
$o1 .= "\t\t".'<div><button class="'.(isset($Uw3['input']['w3-button'])?$Uw3['input']['w3-button']:'w3-button').'" type="button" onClick="contactSend();">'.$a1['send'].'</button></div>'."\r\n";
$o1 .= "\t".'</form>'."\r\n".'</div><!-- #contactBloc -->'."\r\n";
if(empty($Ua['w3'])) $Ustyle .= ".contactBloc{max-width:480px;margin:10px;}.contactBloc label{text-transform:capitalize;}.contactBloc input,.contactBloc textarea{display:block;width:100%;margin:0 0 5px;padding:0}.contactBloc textarea{height:120px;}.contactBloc button{margin:7px 0 0;padding:4px 12px;}";
$Ustyle .= "input.contactCaptcha{display:inline-block;margin:10px;max-width:80px;}.imageCaptcha{margin:-10px 10px;}\r\n";
$Ucontent = str_replace('[[contact]]',$o1,$Ucontent);
$Uhtml = str_replace('[[contact]]',$o1,$Uhtml);
//
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.2.2","host":"https://github.com/cmsunoPlugins/contact/"}
{"version":"1.3","host":"https://github.com/cmsunoPlugins/contact/"}

0 comments on commit 4348967

Please sign in to comment.