Thread Rating:
  • 3 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PlugIn Contact Form Getsimple
Hi kaborka, vtsimple and charlsouma;

I forgot to add the class phpmailer to plugin. Upload to extend the contact form with class phpmailer v5.1.

kaborka Wrote:I have added the plugin to an existing site (3.3.3). In /plugins I put cbcontact_form.php and the cbcontact folder from the download. The plugins page shows "Description: Getsimple contactform.
Version 5.8.2 — Author: Cumbe" as Activated.

In the GS Page Editor I added "(% cbcontact admin, true %)" (no quotes) to an existing page, but no form was generated. It just shows the same text string. What did I do wrong?
R: This is right. Check permissions of contact_form.php and folder cbcontact for 'Other'.

Always is possible to call the plugin from template:
Code:
- in template with a php funtion:
<?php cbcontact_page('nameofuser', true or false ,true or false, true,'user or email', 'user or email'); ?>


vtsimple Wrote:Just a few more questions:

1.) I see that you changed the name of cbcontact.php to cbcontact_form.php -- is this necessary?

2.) I see that you added PHPMailer_v5.1 to the plugins -- is this plugin available from GetSimple Extensions? I can't find it.

3.) What files are in your plugins/cbcontact/ folder -- what is that directory structure?
R:
1) the name of file plugin is: cbcontact_form.php
2) Upload to extend in plugin contact-form.
3) Structure in directory Plugin:
- contact_form.php
- folder contact:
* arial.ttf
* comprueba.php
* img_cpt.php
* .htaccess.
* folder lang: with 3 languages: fr_FR.php, es_ES.php and en_US.php
* folder form: with 6 models of form with its images. The enable form has to be called cbcontact.php and the css cbcontact.css. Rename the form that more you like it.
The folder PHPMailer_v5.1: is important that this folder is in /plugins
Reply
I have tried to even further simplify, with no Captcha and no PHPMailer, and just the user (admin) on a blank contact page:

Code:
(% cbcontact admin,false,false,false,admin %)

I have cbcontact.php in the /plugins/ top level, and have activated the plugin.

I get:

Code:
Notice: Undefined variable: cbcontactform in ...../Cheryl/plugins/cbcontact.php on line 3

Notice: Undefined variable: mi_arrayq in...../Cheryl/plugins/cbcontact.php on line 4

Notice: Undefined variable: mi_arrayq in ...../Cheryl/plugins/cbcontact.php on line 13

Notice: Undefined variable: mi_arrayq in ...../Cheryl/plugins/cbcontact.php on line 22

Notice: Undefined variable: mi_arrayq in ...../Cheryl/plugins/cbcontact.php on line 31

Notice: Undefined variable: captcha in ....../Cheryl/plugins/cbcontact.php on line 39

Notice: Undefined variable: captcha in ...../Cheryl/plugins/cbcontact.php on line 39


And the page looks like this:

Contact Me


(% cbcontact admin,false,false,false,admin %)
Reply
(2014-09-30, 01:49:51)cumbe Wrote: Hi kaborka, vtsimple and charlsouma;

1) the name of file plugin is: cbcontact_form.php

Where is this file in your package 5.8.2?

Quote:2) Upload to extend in plugin contact-form.

I don't understand what this means.

Quote:3) Structure in directory Plugin:
- contact_form.php

Where does this come from?

Quote:- folder contact:
* arial.ttf
* comprueba.php
* img_cpt.php
* .htaccess.
* folder lang: with 3 languages: fr_FR.php, es_ES.php and en_US.php
* folder form: with 6 models of form with its images. The enable form has to be called cbcontact.php and the css cbcontact.css. Rename the form that more you like it.

I am leaving the names cbcontact.php and the css cbcontact.css as they were (default).

Was cbcontact.php supposed to be renamed to cbcontact_form.php and moved up to the /plugins folder??
Reply
(2014-09-30, 02:08:10)vtsimple Wrote:
(2014-09-30, 01:49:51)cumbe Wrote: )
the name of file plugin is: cbcontact_form.php
Where is this file in your package 5.8.2?
R: Inside contact-form.zip

vtsimple Wrote:Just a few more questions:
...
2.) I see that you added PHPMailer_v5.1 to the plugins -- is this plugin available from GetSimple Extensions? I can't find it.
I don't understand what this means.
...
2) Upload to extend in plugin contact-form. Inside contact-form.zip that I upload today there is a folder "PHPMailer_v5.1" that has the class phpmailer.


3) Structure in directory(folder) "plugins":
- contact_form.php
- folder cbcontact:
* arial.ttf
* comprueba.php
* img_cpt.php
* .htaccess.
* folder lang: with 3 languages: fr_FR.php, es_ES.php and en_US.php
* folder form: with 6 models of form with its images. The enable form has to be called cbcontact.php and the css cbcontact.css. Rename the form that more you like it.

vtsimple Wrote:I am leaving the names cbcontact.php and the css cbcontact.css as they were (default).

Was cbcontact.php supposed to be renamed to cbcontact_form.php and moved up to the /plugins folder??
R: only you have that rename the form that more you like it, inside folder cbcontact/form...

Regards
Reply
Okay, progress! I can see the form now that I've downloaded the plugin zip and replaced the old one with the updated zip file contents.

Both cbcontact_form and PHPMmailer_v5.1/ folder are there, and I was able to see the form in the web page. Thank you, Cumbe.
Reply
The contact form is visible and seems to be working, but I'm getting one error message:

Code:
Warning: session_start() [function.session-start]: Cannot send session cache limiter
- headers already sent (output started at ...../Cheryl/theme/Seascape/template.php:20)
in ......Cheryl/plugins/cbcontact_form.php on line 258
Reply
Hi vitsimle,

I have upload other version to extend 5.2.8.1 fixed the problem of session_start.... and fixed the security problem of email (kaborka).

There is to check if it works right.

Regards
Reply
Okay, thanks Cumbe. Will download and check Smile
Reply
I've tried it out and so far this works now. without error messages in debug:

Code:
(% cbcontact admin,true,false,false,admin %)

When I use:

Code:
(% cbcontact admin,true,true,false,admin %)

I get an error message after hitting <Send> :

Code:
FOLDER PHPMAILER_V5.1 DOES NOT EXIST INSIDE FOLDER PLUGINS OR FILE CLASS.PHPMAILER.PHP IS MISSING.

However, the folder PHPMailer_v5.1 DOES exist in /plugins/ and class.phpmailer.php IS present in that folder.

Permissions on the folder are drwxr-xr-x
Permissions on the file are -rw-r--r--

Spelling (and cases) are:
PHPMailer_v5.1
class.phpmailer.php
Reply
Hi vtsimple,

yes, you are right.

I have to fix it, and other small bugs in form if you don't use captcha.

Regards.
Reply
cumbe: I found the problem that prevented the contact form from working when I added it to an existing site: The plugin Exec-PHP was installed. After I deactivated it, your form worked fine.

Thanks for fixing the security issue.
Reply
Hi kaborka,

yes kaborka, exec plugin causes this problem...

Regards
Reply
Hello Cumbe / Everyone

I like your Contact Form !

You say your Contact Form supports i18n ?

I am using your Contact Form on a multilanguage website where I can change the language with language switcher links, but the label text of your form is NOT changing language when I change language. I am using the latest version 5.8.2.1 . Can you help ?

More details :
I have a website which has multilingual switching and so I am using the i18n plugin. Each page is written in English, German, amd French .. so I have a page title and body text in each language. On each displayed page I have a set of language links as a language switcher. If a certain page is displayed in one language, eg en, then when the user clicks another language link, eg fr, then the page displays that text in the new language .. This all works well and with no problem. So the setlang = fr / en / de is working fine

I have also created a page using your Contact Form. For this I have made 3 pages in the back end, one for each language en, de, fr, slug names contactform (default), contactform_de, contactform_fr. Each has a title and some body text in that language, and then I have inserted your Contact Form using the (%…%) tags into the body of each page. This inserted code is exactly the same for each page

When I display the page I see your form with the labels in English, but when I switch to another language, eg fr, the page text and title I have written changes language, BUT the label text of your form does NOT change … Can you think what the problem may be ?

I assume the language should change automtaically, there is no language param id the form function (& &) tag

PS : You have lang files en_US, es_Es, fr_FR .. I temporarily copied the Spanish file as the German file de_DE, just for testing

Thanks for any help

Aldebaran
Reply
Hi aldebaran,

you are right; There was a small bug in this version.

Upload a new version 5.8.2.2 to extend with bug fixed.

Regards
Reply
(2015-01-10, 18:48:48)cumbe Wrote: Hi aldebaran,

you are right; There was a small bug in this version.

Upload a new version 5.8.2.2 to extend with bug fixed.

Regards


Hi Cumbe

Thanks for the bug fix .. I downloaded your update version 5.8.2.2 - All works fine ! - On switching the website language, the labels of the Contact Form change to that language.

BUT I now see the following problems (NOT connected with the above lang switch bug fix )

1. You left a debug echo in at cbcontact_form.php > line 283
2. You forgot to include the PHPMailer_v5.1 directory in the plugin
3. No version number in the name of the plugin zip file

4. I am wanting to use the PHPMailer class to send mails, because I need to use the SMTP username/ password. As a result I found that, for me I am having problems with relative paths
comprueba.php , line 136, 137 => the relative paths used in is_dir(….), file_exists(…..) and require(…) do not seem to work, at least in my setup on localhost and on my hoster .. ?


I looked at Point 4 and found the following

File comprueba.php :

So lines 136 and 137 in full are :

if (is_dir('../PHPMailer_v5.1') and file_exists('../PHPMailer_v5.1/class.phpmailer.php')){
require('../PHPMailer_v5.1/class.phpmailer.php'); … }

… For me in my setup, this does not work .. it cannot find the file

I did some googling and found that in PHP relative paths seem to be relative to the originally / initially called php file … in our case this is the top index.php file

So I temporarily changed the relative paths to :

is_dir('plugins/PHPMailer_v5.1') , file_exists('plugins/PHPMailer_v5.1/class.phpmailer.php'), and
require('plugins/PHPMailer_v5.1/class.phpmailer.php')

… and this worked

I also tried is_dir(dirname(__FILE__).'/../PHPMailer_v5.1') etc, … and this also worked , where dirname(__FILE__) returns the directory containing this file, ie comprueba.php


File cbcontact_form.php

But in file cbcontact_form.php, you have several includes such as :

include ("cbcontact/comprueba.php"); … and this works ! .. so where the relative path is relative to cbcontact_form.php, ie not relative to index.php

But this also works : include ("plugins/cbcontact/comprueba.php"); , ie rel to index.php


So my question is what’s happening ? What is the difference between the two files cbcontact_form.php and comprueba.php ? ? Is it to do with the include_path directive ?

Aldebaran
Reply
(2015-01-12, 02:30:50)aldebaran Wrote: Hi Cumbe
Thanks for the bug fix .. I downloaded your update version 5.8.2.2 - All works fine ! - On switching the website language, the labels of the Contact Form change to that language.

BUT I now see the following problems (NOT connected with the above lang switch bug fix )

1. You left a debug echo in at cbcontact_form.php > line 283
2. You forgot to include the PHPMailer_v5.1 directory in the plugin
3. No version number in the name of the plugin zip file

4. I am wanting to use the PHPMailer class to send mails, because I need to use the SMTP username/ password. As a result I found that, for me I am having problems with relative paths
comprueba.php , line 136, 137 => the relative paths used in is_dir(….), file_exists(…..) and require(…) do not seem to work, at least in my setup on localhost and on my hoster .. ?

!!!the haste is bad!!!
Upload to extend new version 5.8.2.3.

4) I have changed the relative path to absolute path using GSPLUGINPATH constant because in some hosts there are problems with this.

Regards
Reply
Hi all!

I'm new with GetSimple and the Plugins.

Can you tell me if there is a german language file for this Plugin?

Thank you!
Christian
Reply
(2015-01-12, 04:45:17)cumbe Wrote:
(2015-01-12, 02:30:50)aldebaran Wrote: Hi Cumbe
Thanks for the bug fix .. I downloaded your update version 5.8.2.2 - All works fine ! - On switching the website language, the labels of the Contact Form change to that language.

BUT I now see the following problems (NOT connected with the above lang switch bug fix )

1. You left a debug echo in at cbcontact_form.php > line 283
2. You forgot to include the PHPMailer_v5.1 directory in the plugin
3. No version number in the name of the plugin zip file

4. I am wanting to use the PHPMailer class to send mails, because I need to use the SMTP username/ password. As a result I found that, for me I am having problems with relative paths
comprueba.php , line 136, 137 => the relative paths used in is_dir(….), file_exists(…..) and require(…) do not seem to work, at least in my setup on localhost and on my hoster .. ?

!!!the haste is bad!!!
Upload to extend new version 5.8.2.3.

4) I have changed the relative path to absolute path using GSPLUGINPATH constant because in some hosts there are problems with this.

Regards

Thanks for that .. all the file paths now work fine !
Aldebaran
Reply
Hi ch.tanzer,

I don't know if there is a german language. You can do it:
1) copy file lang/en_US.php in other file de_DE.php
2) translate each one.

Regards.


(2015-01-12, 07:58:01)ch.tanzer Wrote: Hi all!

I'm new with GetSimple and the Plugins.

Can you tell me if there is a german language file for this Plugin?

Thank you!
Christian
Reply
russian language http://get-simple.info/extend/plugin-lan...-form/901/
Reply
Hi Cumbe

1. First, Sorry I have written so much ! !

2. I am using your Contact Form plugin in the main body of a page, using the tag format (% cbcontact …. %) . Also I am wanting to use the PHPMailer option for sending an email because I need SMTP authorisation with username and password

3. Note I have implemented the code for the PHPMailer which now seems to work for me. Note the SMTP settings are specific to me, eg I defined the server as localhost, because on the hoster, the smtp mail server is local, etc .. I attach the moded comprueba.php for info

4. But in the process, I have seen a few problems with Contact Form .. in the area of the PHPMailer and also disabling captcha validation ….


Serious problems

5. If have a mail send SMTP problem with PHPMailer, eg the server name is not valid or bad To address, then we get a crash with no form display, because of the following PHPMailer uncaught exception
a. Fatal error: Uncaught exception 'phpmailerException' with message 'SMTP Error: Could not connect to SMTP host.' …
b. Adding in a try catch block solves this … see attached code


6. For the PHPMailer you need a foreach loop to add the other GS user TO addresses … see attached code

7. You have $message->FromName = $from; .. where $from is the from email address from the form field ‘Email’ , but $message->FromName is intended for the from name that appears infront of the from email address , eg From : fromName <me@myemail.com>

a. This gives a mail send SMTP Error

b. This should be
i. $message->From = $from;
ii. $message->FromName = $_POST['contact'][i18n_r('cbcontact/Nb')]; .
c. Where
i. $message->From is the from email address
ii. $message->FromName is the name that appears infrin of the from email address , eg From : fromName <me@myemail.com>

8. $ captcha problem …
a. If I enter false or true in (% cbcontact …. %) for the $captcha boolean parameter, then the function ALWAYS wants to validate the captcha code.

b. That is, it seems that in the captcha validate code the IF statement : if ($captcha == "true" or $captcha == true) ALWAYS returns true, independent of the value of $captcha …

c. I did a test to confirm this, where in my case I am using the (% .. %) syntax, and found that $captcha is a STRING, and it seems from the reference below, that if $captcha = “true” or “false”, then the statement if ($captcha = = true) ALWAYS returns true. It only returns false if $captcha = “0” or “”

d. Check ref : http://stackoverflow.com/questions/47752...lue-in-php

e. Note - I understand that if I use the function directly then the variable $captcha is a boolean … so IN GENERAL it can be EITHER a string or a boolean …
i. In a boolean comparison, String "" and "0" are considered FALSE, else true
ii. if ($mybool == "hello") => It looks like it converts the left hand side to "" if false, or "1" if true, and then does the comp
iii. if ($mystring == true) => It looks like if $mystring is equal to "0" or "", then the IF equates to false, else it equates to true … so if (“false” == true) equates to TRUE !!

f. Also have the same problem with

if ($sendphpmail == false or $sendphpmail == 'false') {
… Use simple PHP mail()
} else if ($sendphpmail == true or $sendphpmail== 'true') {
… Use PHPMailer class
}

… but here this works … for all cases “false”, false, “true”, true … because the first IF tests for “false”/false and not “true”/true …

BUT I think the following would NOT work , even though the sense is the same

if ($sendphpmail == true or $sendphpmail== 'true') {
… Use PHPMailer class
} else if ($sendphpmail == false or $sendphpmail == 'false') {
… Use simple PHP mail()
}

… because the first test ($sendphpmail == true) would return true for BOTH strings “true” and “false” .. ! !

g. SUGGESTION
i. Convert $captcha (which can be either string or boolean) to a DEFINITE boolean, eg $captchaboolean, BEFORE it is used in the captcha validation code … and then it is clear what is happening … Then the validation code can use a simple

if ($captchaboolean = = = true) { do captcha validation }

ii. Looking at the above url ref, I think the following works

$captchaboolean = false;
if (($captcha == false) or (strtolower($captcha) == "false"))
{ $captchaboolean = false; }
else
{ $captchaboolean = true; }

iii. The above gives : $captcha -> $captchabool : "1" ->T, "true"->T, "TRUE"->T, "0"->F, "false"->F, "FALSE"->F, ""->F, "Any"->T, true->T, false->F


iv. … Also can do the same for $sendphpmail … and then do not have to have the complicated if statement above for $sendphpmail for choosing the mail send method. Instead can do

if ($sendphpmailboolean = = = false) {
… Use simple PHP mail()
}
else
{
… Use PHPMailer class
}

v. Also $echocontact .. ??

vi. Can put string/bool to Bool f conversion in a helper fn


Minor Problems

9. $result variable in comprueba.php
a. Mixes string and int .. confusing .. but seems to work
b. Just to say : the php simple mail() function returns a boolean true = success / false = send error
c. And the PHPMailer class send() function also returns boolean true/false
d. .. So why not assign / compare booölean values true/false instead of string / integer ?? … it would be less confusing

10. Why have $message->MsgHTML("$body") and not $message->MsgHTML($body); .. no “ ” around $body => but BOTH ways seem to work anyway.

11. If have a mail send SMTP problem with PHPMailer, eg the server name is not valid or bad To address, then the displayed form fields are reset to empty .. should these be left filled if we have an error ? … the user may think that he email has been sent ..

12. If have a mail send SMTP problem with PHPMailer, eg the server name is not valid or bad To address, then the Javascript alert box is not displayed … So you do not see in he alert box the error message "MSG_guestERR" => 'There was an error sending your message'. I added an echo statement directly before the Javascript alert code and this DOES SHOW the message 'There was an error sending your message' … ? I am not sure why the alert box does not show .. ..

13. Can you do a better docs text description of the installation / How to use the plugin / description of the cbcontact_page( ) function input parameteres … In the beginning I did not fully understand this !

14. Have a warning : Notice: Undefined index: cbcontact/CONTACT in … \plugins\cbcontact_form.php on line 43 ( Line : add_action('pages-sidebar','createSideMenu',array('cbcontact_form', $i18n['cbcontact/CONTACT'])); )


Feature request

15. Feature question - If disable captcha then also not display it ?


Other stuff

16. What does function vermensajes() do ?

Cheers Aldebaran



Moded comprueba.php file :

PHP Code:
<?php
//-----------------------------------------------------------------//
//--- comprueba.php: action if form is submit                      //
//-----------------------------------------------------------------//
if (!isset($_SESSION)) { session_start(); }

  
$imagenCadena $_SESSION["imagencadena"]; 
  
$pot trim(strtolower($imagenCadena));
  
$server_name getenv ("SERVER_NAME");       // Server Name
  
$request_uri getenv ("REQUEST_URI");       // Requested UR

// check antispam 
if (isset($_POST['contact-submit'])) {
    if (
$_POST['contact']['leaveso'] != 'leaveso' or $_POST['contact']['leaveblank']!=''){
       echo 
'<html>';
       echo 
'<head>';
       echo 
'</head>';
       echo 
'<body>';
       echo 
'<div style="padding: 20px; border: 4px double; margin: 20%;">';
       echo 
i18n_r('cbcontact/spam').'<br />';
       echo 
'<a href="'.$idpret.'">'.i18n_r('cbcontact/back').'</a>';
       echo 
'</div>';
       echo 
'</body>';
       echo 
'</html>';   
       exit; 
    }  
}

//------------------------
//START CONTACT
//------------------------
    
if (@$_GET['tp'] == 'contact') { 
        if (isset(
$_POST['contact-submit'])) {
      
         
// -------------------------------------------------- //
         //  Aldebaran Mod START                                //
         // -------------------------------------------------- //

         // $captcha -> $captchabool :  "1" ->T, "true"->T, "TRUE"->T, "0"->F, "false"->F, "FALSE"->F, ""->F, "Any"->T, true->T, false->F
         
$captchaboolean  false;  
         if ((
$captcha == false)  or  (strtolower($captcha) == "false"))
         { 
$captchaboolean false; }                          
         else 
         { 
$captchaboolean true; }
         
            
// Check captcha         
         
if ($captchaboolean === true)  {
         
// ORIG if ($captcha == "true" or $captcha == true) {
         
         // -------------------------------------------------- //
         //  Aldebaran Mod END                               //
         // -------------------------------------------------- //

                
if ( $pot == trim(strtolower($_POST['contact']['pot']))) {
                    
$err '';
                } else {
                    
$err i18n_r('cbcontact/MSG_CAPTCHA_FAILED');
                }
            }
          
            
//check name
            
if ( $_POST['contact'][i18n_r('cbcontact/Nb')] != '' ) {
                if (
$_POST['contact'][i18n_r('cbcontact/Nb')] == i18n_r('cbcontact/Nb')){
                    
$_POST['contact'][i18n_r('cbcontact/Nb')] = '';
                }
            }

            
//check email
            
if ( $_POST['contact'][i18n_r('cbcontact/Em')] != '' ) {
                if (
$_POST['contact'][i18n_r('cbcontact/Em')] == '(*)'.i18n_r('cbcontact/Em')) {
                    
$_POST['contact'][i18n_r('cbcontact/Em')] = ''//i18n_r('cbcontact/Em');
                
}
                if (
$_POST['contact'][i18n_r('cbcontact/Em')] != i18n_r('cbcontact/Em')){
                    
$from =  $_POST['contact'][i18n_r('cbcontact/Em')];
                } else {
                    
$_POST['contact'][i18n_r('cbcontact/Em')]='';
                }
            }
       
            
//check subject
            
$subject2 ''
            if ( 
$_POST['contact'][i18n_r('cbcontact/Sub')] != '' ) {
                if (
$_POST['contact'][i18n_r('cbcontact/Sub')] != i18n_r('cbcontact/Sub')){
                    
$subject stripslashes(html_entity_decode($_POST['contact'][i18n_r('cbcontact/Sub')]));
                } else { 
                    
$subject i18n_r('cbcontact/CONTACT_FORM_SUB').' '.i18n_r('cbcontact/WHO').' '.$SITENAME;
                    
$_POST['contact'][i18n_r('cbcontact/Sub')] = i18n_r('cbcontact/CONTACT_FORM_SUB').' '.i18n_r('cbcontact/WHO').' '.$SITENAME;
                    
$subject2 =  i18n_r('cbcontact/Sub');
                }
            } 

            
//check message
            
if ( $_POST['contact'][i18n_r('cbcontact/Ms')] != '' ) {
                if (
$_POST['contact'][i18n_r('cbcontact/Ms')] == '(*)'.i18n_r('cbcontact/Ms')) {
                    
$_POST['contact'][i18n_r('cbcontact/Ms')] = '';
                }
                if (
$_POST['contact'][i18n_r('cbcontact/Ms')] == i18n_r('cbcontact/Ms')){
                    
$_POST['contact'][i18n_r('cbcontact/Ms')] = '';
                }
            } 

            
$temp $_POST['contact'];

            
//release variables
            
unset($temp['pot']);
            unset(
$temp['contact-submit']);
            unset(
$temp['submit']);
            unset(
$temp['leaveso']);
            unset(
$temp['leaveblank']);

            if (
$err == '' && trim($_POST['contact'][i18n_r('cbcontact/Em')]) !='' && trim($_POST['contact'][i18n_r('cbcontact/Ms')]) !='') {

                
$headers "From: ".$from."\r\n";
                
$headers .= "Return-Path: ".$from."\r\n";
                
$headers .= "Content-type: text/html; charset=UTF-8 \r\n";

                
$body '"'.$subject.'": <a href="'.substr($idpret,0,-1).'">'.substr($idpret,0,-1).'</a>';
                
$body .= "<hr><br />";

                if ( ! 
file_exists($log_file) ) {
                    
$xml = new SimpleXMLExtended('<channel></channel>');
                } else {
                    
$xmldata file_get_contents($log_file);
                    
$xml = new SimpleXMLExtended($xmldata);
                }

                
$thislog $xml->addChild('entry');
                
$thislog->addChild('date'date('r'));
                
$cdata $thislog->addChild('captcha');
                
$cdata->addCData($captcha);
                
$cdata $thislog->addChild('ip_address');
                
$ip getenv("REMOTE_ADDR"); 
                
$cdata->addCData(htmlentities($ipENT_QUOTES'UTF-8'));
                
$body .= "Ip: "$ip ."<br />"
                foreach ( 
$temp as $key => $value ) {
                    if (
substr($key02) != 'q_') {
                        
$body .= ucfirst($key) .": "stripslashes(html_entity_decode($valueENT_QUOTES'UTF-8')) ."<br />";
                        
$cdata $thislog->addChild(clean_url($key));
                        
$cdata->addCData(stripslashes(html_entity_decode($valueENT_QUOTES'UTF-8')));
                    }
                }
                
XMLsave($xml$log_file);
                
//$seg = 2;  
                
$result 0;  // Aldebaran question, Why not  :  $result = false;  
            
                
if ($sendphpmail == false or $sendphpmail == 'false') {
                    
$result mail($EMAIL,$subject,$body,$headers);
                    if (
$usus != ''){
                        foreach (
$qusus as $key=>$value){
                            
$result =  mail($value,$subject,$body,$headers);
                            
$result1[$key] =  $result;
                        }
                    }
                } else if (
$sendphpmail == true or $sendphpmail== 'true') {
               
//echo 'GSPLUGINPATH: '.GSPLUGINPATH.'<br /<';
                    
if (is_dir(GSPLUGINPATH.'PHPMailer_v5.1') and file_exists(GSPLUGINPATH.'PHPMailer_v5.1/class.phpmailer.php')){
                        require(
GSPLUGINPATH.'PHPMailer_v5.1/class.phpmailer.php');   
                        
$message = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch

                      //GMAIL Configuration
                        /* $message->SMTPSecure = "ssl";                 // sets the prefix to the servier
                        $message->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP se
                        $message->Port       = 465;                   // set the SMTP port for the GMAIL server
                        $message->Username   = "....@gmail.com";   // GMAIL user account: youuser@gmail.com
                        $message->Password   = "....";         // GMAIL password 
                        $message->From   = "....@gmail.com";       // you GMAIL email 
                         */ //end GMAIL Configuration

                        //ONO configuration     
                        /*       $message->SMTPSecure = "";                  // sets the prefix to the servier
                        $message->Host       = "smtp.ono.com";       // sets ONO as the SMTP server
                        $message->Port       = 25;                   // set the SMTP port for the ONO server
                        $message->Username   = "username";               // ONO username 
                        $message->Password   = "pass";            // ONO password
                        $message->From   = "user@ono.com";           // you ono email 
                        */       //end ONO Configuration

                        //HOTMAIL configuration     
                        /*        $message->SMTPSecure = "tls";                   // sets the prefix to the servier
                        $message->Host       = "smtp.live.com";         // sets hotmail as the SMTP server
                        $message->Port       = 587;                     // set the SMTP port for hotmail server
                        $message->Username   = "youruser@hotmail.com";  // hotmail user account
                        $message->Password   = "yourpass";               // hotmail password
                        $message->From   = "youruser@hotmail.com";  */    // you hotmail email 
                        //end HOTMAIL Configuration

                  
                        
$message->CharSet "utf-8"
                        
$message->SMTPDebug false;    // enables SMTP debug information (for testing)
                                                        // false = disabled debug
                                                        // 1 = errors and messages
                                                        // 2 = messages only

                        
$message->IsSMTP();            // telling the class to use SMTP
                  
$message->SMTPAuth true;     // enable SMTP authentication
           

                  // -------------------------------------------------- //
                  //  Aldebaran Mod START                               //
                  // -------------------------------------------------- //
  
                  // Aldebaran : In my case I do not need to set this 
                  // $message->SMTPSecure = "ssl";   
                   
                  // Aldebaran : As this email.php script lives on the same server as 
                  // my email server I am  etting the HOST to localhost

                   
$message->Host "localhost";  // specify main and backup server
                   
$message->Port 25;  // Don't actually need to set this, 25 is the default anyway  
 
                   // Set the SMTP server username/password 
                   
$message->Username "myusername";  // SMTP username
                   
$message->Password "mypassword"// SMTP password

                  // set word wrap to 50 characters
                  
$message->WordWrap 50;

                  
// set email format to HTML
                  
$message->IsHTML(true);

                  
$fromEmail $from;  
                  
$fromName $_POST['contact'][i18n_r('cbcontact/Nb')];
                  
                  
$message->From $fromEmail;  //  The FROM email address - Form field 'Email'   
                  
$message->FromName $fromName;  // Form field 'Name' => The from name seen outside of the < > of the From email address 
                  
$message->Subject $subject// Form field 'Subject' 
                  
$message->MsgHTML($body);  // Set the message body 

                  // Add the TO email address of the main GS admin user. 
                  
$message->AddAddress($EMAIL''); 
                  
// echo 'Sent email to : '.$EMAIL.'<br>';
                  // Add the TO email addresses of the other GS users 
                   
                  
if ($usus != ''){
                           foreach (
$qusus as $key=>$value) { 
                        
$message->AddAddress($value''); 
                        
// echo 'Sent email to : '.$value.'<br>';
                           
}
                       } 

                  try {
                     
$result $message->Send();
                  }
                  catch (
phpmailerException   $ex){ 
                     
// echo $ex;
                  
}
                  catch (
Exception   $ex){ 
                     
// echo $ex;
                  
}
  
                  
// -------------------------------------------------- //
                  //  Aldebaran Mod END                               //
                  // -------------------------------------------------- //

                    
} else {
                        echo 
strtoupper(i18n_r('cbcontact/errphphmail'))."\n";
                    }
                }
           
                
//results    
               
if ($result == '1') {   //  Aldebaran question : Why not  :  if ($result == true) 
                    
$msgshw i18n_r('cbcontact/MSG_CONTACTSUC');
                } else {
                    
//$seg = 10;  
                    
$msgshw '<p>'.i18n_r('cbcontact/MSG_guestERR')."</p>\n";
                    
$msgshw .= "Mailer Error: " $message->ErrorInfo;
                }
            
            } 
// finaliza if $err=''
            
else 
            { 
// if $err != ''

                
if ($subject2 != '') {
                    
$temp[i18n_r('cbcontact/Sub')] = $subject2;
                }
                foreach(
$temp as $key=>$value){
                    
$mi_array[$key] = stripslashes(html_entity_decode($value));
                }

                if (
trim($err) !=''){
                    
$msgshw $err.'\nCaptcha code: '.$pot.'\nCode wrote: '.$_POST['contact']['pot'];
                } else {
                    
$msgshw '*** '.strtoupper(i18n_r('cbcontact/Co')).' ***';
                    
$err $msgshw;
                }
            }

        }
    }

   
// Aldebaran Mod  .. Add some Echos 
   
echo '<br> msgshw = '.$msgshw.'<br>'
   echo 
'<br>';
   echo 
'<br> JUST BEFORE Javascript Alert code <br>'
               
////////////////////////////////////////////////////////////////
//
//     html page or alert of javascript
//
////////////////////////////////////////////////////////////////
?>

    <script type="text/javascript">
<!--    
        alert ("<?php echo $msgshw?>");
-->
    </script>
<?php

/*
  echo '<html>';
  echo '<head>';
  echo '<meta http-equiv="Refresh" content="'.$seg.';url=http://'.$server_name.$MIURL.$miarr.'">';
  echo '</head>';
  echo '<body>';
  echo '<div style="padding: 20px; border: 4px double; margin: 20%;">';
  echo $msgshw;
  echo i18n_r('cbcontact/redir'].$seg.i18n_r('cbcontact/redir1'].i18n_r('cbcontact/back'].'.<br />';
  echo '<a href="http://'.$server_name.$MIURL.$miarr.'">'.i18n_r('cbcontact/back'].'</a>';
  echo '</div>';
  echo '</body>';
  echo '</html>';*/
?>
Reply
Hi Cumbe

Forgot to say : My problems refer to the latest version 5.8.2.3

cheers Aldebaran
Reply
(2015-01-13, 06:35:21)Oleg06 Wrote: russian language http://get-simple.info/extend/plugin-lan...-form/901/

If use that file of the Russian language, the plugin allows to send only one message, and then an error occurs in the CMS and the plugin does not work anymore until the cleanup cbcontactform.log

Errorlog file in the attachment:

.txt   errorlog.txt (Size: 13.37 KB / Downloads: 1)

P.S.: But the problem is not in the localization file. Probably this in the handling of Cyrillic characters.
Reply
Hi aldebaran,

Thanks for you comments and suggestions; I wll review the plugin when I have a time.

I know that the use of 'true' and 'false' in the plugin is not completely well done, but normally works good.

aldebaran Wrote:16. What does function vermensajes() do ?
This function displays the emails received from admin > pages.

Regards.
Reply
(2015-01-26, 03:45:08)cumbe Wrote: Thanks for you comments and suggestions; I wll review the plugin when I have a time.
Hi Cumbe
... OK no problem
Cheers Aldebaran
Reply




Users browsing this thread: 4 Guest(s)