Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • xxfreshman

    (@xxfreshman)

    sorry made a typing fail

    REPLACE it under wp-content/plugins/wr-contactform/libraries/gadget/contactform-frontend.php

    and its for the version 1.1.11 it maybe works for 1.1.10 too

    xxfreshman

    (@xxfreshman)

    Here is the sollution, it took me and a friend more than 1 day to get it working, the problem is the preg_replace( ‘/\{\$([^\}]+)\}/ie’ command, we replaced it.

    REPLACE the following code from the file under wr-contactform1.1.10\libraries\gadget\contactform-frontend.php

    /**
    * Get Cotent Email
    *
    * @param type $emailTemplate email content
    * @param String $dataContentEmail Data content Email
    * @param Strig $nameFileByIndentifier Get name Field by Indentifier
    * @param String $requiredField required field
    * @param String $defaultSubject Default Subject Email
    *
    * @return stdClass
    */
    public function get_content_email( $emailTemplate, $dataContentEmail, $nameFileByIndentifier, $requiredField, $defaultSubject ) {
    if ( ! empty( $emailTemplate[ ‘message’ ] ) ) {
    /*$emailTemplate[ ‘message’ ] = preg_replace( ‘/\{\$([^\}]+)\}/i’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘message’ ] );*/
    $emailTemplate[ ‘message’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’,function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];},$emailTemplate[ ‘message’ ] );

    }
    else {
    $htmlMessage = array();
    if ( $dataContentEmail ) {
    $htmlMessage = $this->email_template_default( $dataContentEmail, $nameFileByIndentifier, $requiredField );
    }
    $emailTemplate[ ‘message’ ] = $htmlMessage;
    }

    /*$emailTemplate[ ‘subject’ ] = preg_replace( ‘/\{\$([^\}]+)\}/ie’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘subject’ ] );*/
    $emailTemplate[ ‘subject’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’, function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];}, $emailTemplate[ ‘subject’ ] );
    $emailTemplate[ ‘subject’ ] = ! empty( $emailTemplate[ ‘subject’ ] ) ? $emailTemplate[ ‘subject’ ] : $defaultSubject;
    /*$emailTemplate[ ‘from’ ] = preg_replace( ‘/\{\$([^\}]+)\}/ie’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘from’ ] );*/
    $emailTemplate[ ‘from’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’, function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];}, $emailTemplate[ ‘from’ ] );
    /*$emailTemplate[ ‘reply’ ] = preg_replace( ‘/\{\$([^\}]+)\}/ie’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘reply’ ] );*/
    $emailTemplate[ ‘reply’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’, function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];}, $emailTemplate[ ‘reply’ ] );
    $emailTemplate[ ‘subject’ ] = strip_tags( $emailTemplate[ ‘subject’ ] );
    $emailTemplate[ ‘from’ ] = strip_tags( $emailTemplate[ ‘from’ ] );
    $emailTemplate[ ‘reply’ ] = strip_tags( $emailTemplate[ ‘reply’ ] );

    return $emailTemplate;
    }

    /*And than it works with the ne PHP versions again :-)*/

    xxfreshman

    (@xxfreshman)

    Hi i found out if you use in the lables some stuff like this ‘ symbol, than you have problems to open the submissions, if you rename the lables of the fields without that symbol and maybee some other symbols than it works.

    @andrew Nevins ??? oh, sorry, i didnt know that iam posting a code here ??

    @knsmunts i found out what maked my prb, you are not alowed to use special char like ‘; and some others in the lables for the fields. the prb is that the software use the lable names as sql field names too, and that lets the code crashing it.

    cu

    Thread Starter xxfreshman

    (@xxfreshman)

    But there is a good solution for WR ContactForm if you need it for new database entrys, https://www.ads-software.com/plugins/contact-form-7-to-database-extension/
    and it works fine for me.

    cu

    Thx, for your help, now i have no fail, but i get a blank white page now, if i click show source code, than i see that are all the stuff, but it doesnt show. Maybe you know a aditional way?

Viewing 7 replies - 1 through 7 (of 7 total)