Events Made Easy Forums How do I … #_CONTACTEMAIL and plugin cryptX

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #54187
    Anonymous
    Inactive

    I use the placholder #_CONTACTEMAIL in a template to display the single event.
    On my site I use the plugin cryptX to the email addresses to encrypt, this works well. Only the placeholder #_CONTACTEMAIL is not encrypted.
    Can you help me?

    Thanks Friedhelm

    #54188
    Franky
    Keymaster

    Probably the plugin cryptX doesn’t use the EME filter eme_email_obfuscate_filter.
    Read the EME filter doc, and add the call to encryptx to it, see the screenshot
    https://s.w.org/plugins/cryptx/screenshot-2.png?r=1154441

    #54189
    Anonymous
    Inactive

    Very nice, thank you!
    The email adress are encrypted, but the layout is broken.

    I use this in my function.php

    add_filter( 'eme_email_obfuscate_filter', 'eme_fj_contactemail', 10, 1 );
    function eme_fj_contactemail($content){
        $args = array(
        	'text' 		=> '',
    	'css_class'	=> '',
    	'css_id'	=> '',
    	'echo'		=> 1
    	);
        if (function_exists('encryptx')) {
            return encryptx($content, $args);
        } else {
            return sprintf('<a href="mailto:%s" id="%s" class="%s">%s</a>', $content, $args['css_id'], $args['css_class'], ($args['text'] != '' ? $args['text'] : $content));
        }
    }

    In the template I use this:

    ...
        <tr>
            <th>Ansprechpartner:</th>
            <td>#_CONTACTNAME</td>
            <td>#_CONTACTEMAIL</td>
        </tr>
    ...

    Now the email adress are displayed above the content. You can look hier:
    http://lkc-lueneburg.de/termine/519/deutsche-meisterschaft-der-jugend-und-junioren/

    Is the problem in my code to search, or a problem with eme or cryptX?

    #54190
    Franky
    Keymaster

    set the value of “echo” to 0, that does the trick 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top