How to use Email-Cloaking in modules and Components

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
behrus
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Sep 29, 2009 1:54 pm

How to use Email-Cloaking in modules and Components

Postby behrus » Tue Sep 29, 2009 2:01 pm

Hi there,

the emailcloaking plugin in joomla! works only in content.

What's know with emailadresses in modules?

Is it possible to make the plugin also working with modules?

Thanks

lehtori
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Fri Apr 03, 2009 9:32 am

Re: How to use Email-Cloaking in modules and Components

Postby lehtori » Fri Oct 16, 2009 9:17 am

i have the same problem.
anyone has a solution?

NaGGi
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Apr 20, 2006 8:19 am

Re: How to use Email-Cloaking in modules and Components

Postby NaGGi » Wed Nov 04, 2009 12:23 pm

I'd like to know the same answer. Is there any way to get the email cloaking work on modules(or components) in joomla 1.5.14?
Last edited by ooffick on Mon Nov 09, 2009 11:34 am, edited 1 time in total.
Reason: Mod Note: Bump post deleted, please do not bump your posts.

vdizzle
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Nov 06, 2009 7:37 am

Re: How to use Email-Cloaking in modules and Components

Postby vdizzle » Fri Nov 06, 2009 8:30 am

I've been searching for this too and found this -- trying it in my own component, so maybe it will help someone else.

Code: Select all

$email = [email protected]';
$emcloaked = JHTML::_('Email.cloak',$email);
echo $emcloaked;

NaGGi
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Apr 20, 2006 8:19 am

Re: How to use Email-Cloaking in modules and Components

Postby NaGGi » Fri Nov 06, 2009 8:47 am

Yeah I got pretty much the same answer from other site too.

My main concern is to get it work on Joomla's Custom module but there is no code for that module except mod_custom.xml file so Im kinda clueless where should I put that code. Normally for modules there is some xxx.php files where I could put that but with mod_custom there is none.

Any ideas for this?

Custom module is very ideal for presenting contact information but it definately needs that email cloaking.

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: How to use Email-Cloaking in modules and Components

Postby mcsmom » Mon Nov 09, 2009 10:53 am

Are you sure it's not working? I believe that it is fires.

I'm going to move this to the appropriate forum, since it's not a bug report.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

NaGGi
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Apr 20, 2006 8:19 am

Re: How to use Email-Cloaking in modules and Components

Postby NaGGi » Mon Nov 09, 2009 12:10 pm

That is easy to test. Just make Custom module and write some email there and see from the source code is it cloaked or not. It is definately not cloaked.

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11063
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: How to use Email-Cloaking in modules and Components

Postby ooffick » Mon Nov 09, 2009 12:12 pm

You cannot use any content plugins in the Custom HTML module.

But you could use the following module instead:
http://extensions.joomla.org/extensions ... dules/4175

Olaf
Olaf Offick - Global Moderator
http://learnskills.org

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: How to use Email-Cloaking in modules and Components

Postby mcsmom » Tue Nov 10, 2009 10:41 pm

Sigh, yup I was remembering that it was added to section and category descriptions.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
erickaps
Joomla! Intern
Joomla! Intern
Posts: 91
Joined: Thu Aug 17, 2006 9:27 am
Location: United Kingdom
Contact:

Re: How to use Email-Cloaking in modules and Components

Postby erickaps » Fri Jun 04, 2010 10:57 am

Here's a solution to cloak an email address in a module using the same script code that Joomla! creates with the standard content plugin, that doesn't require installation of other plugins etc. (which I always prefer for security reasons, it means less extensions to maintain):

Create a standard contact in the Joomla! Contacts component, just entering the required email address to be cloaked.

Create a menu item linking to this contact you have created.

View the contact page on the site and view the source of the page. In the source, find the script that Joomla! inserts to cloak the email address. Tip: search for 'addy' and you will find it.

Copy the whole script (there are three <script> blocks) and paste into your custom module editor.

Save the module and that's it.

hansi99
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sun Jun 01, 2008 5:55 pm

Re: How to use Email-Cloaking in modules and Components

Postby hansi99 » Sat Jun 26, 2010 5:09 pm

The editor strips out the javascript when it is saved.

garstud
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Fri Apr 10, 2009 8:36 am
Location: France (South)

Re: How to use Email-Cloaking in modules and Components

Postby garstud » Sun Jun 27, 2010 3:00 pm

A solution for Joomla developers 8)

http://www.kirbymixedmedia.com/hacks-ma ... -in-joomla

i test it in J!1.5.17, it works ;)
But you need to install a "PHP code module" such as mod_html or mod_php to make it works !

szympans
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Jul 14, 2010 1:33 pm

Re: How to use Email-Cloaking in modules and Components

Postby szympans » Sun Jul 18, 2010 11:43 am

<?php if ($module->module == 'mod_custom') {
$module->content = JHTML::_('content.prepare', $module->content);
}?>

added in templates/system/html/modules.php
applies all active plugins in the custom html module

It does the work for me but breaks MVC...

szympans
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Jul 14, 2010 1:33 pm

Re: How to use Email-Cloaking in modules and Components

Postby szympans » Mon Jul 19, 2010 6:01 pm

Actually I have digged a bit in the joomla spec.
Have a look here: http://docs.joomla.org/What_is_module_chrome%3F

Using that you just need to specify chrome module in your template and apply the code I have proposed.

That way you can define additional name of inculde in temate and apply a specific style to that as a result you can mange from Administartor to which modules you want to apply plug-ins and to which don't.

1. Define module chrome in your template (html/module.php in your template directory)

Code: Select all

<?php
function modChrome_applyPlg($module, &$params, &$attribs)
{
?>
      <div class="module<?php echo $params->get('moduleclass_sfx'); ?>">
         <?php if ($module->showtitle != 0) : ?>
            <h3><?php echo $module->title; ?></h3>
         <?php endif; ?>
         $module->content = JHTML::_('content.prepare', $module->content);
         echo $module->content; ?>
      </div>
   <?php
}

?>

2. Define in template area for your module with plug-in applied:

Code: Select all

<jdoc:include type="modules" name="left" style="applyPlg" />

3. Don't forget to update 'templateDetails.xml'
4. Form administrator publish your module in new area

User avatar
sn00ze
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Jul 15, 2009 11:01 am
Contact:

Re: How to use Email-Cloaking in modules and Components

Postby sn00ze » Sat Sep 11, 2010 11:00 am

this worked for me :D :

erickaps wrote:Here's a solution to cloak an email address in a module using the same script code that Joomla! creates with the standard content plugin, that doesn't require installation of other plugins etc. (which I always prefer for security reasons, it means less extensions to maintain):

Create a standard contact in the Joomla! Contacts component, just entering the required email address to be cloaked.

Create a menu item linking to this contact you have created.

View the contact page on the site and view the source of the page. In the source, find the script that Joomla! inserts to cloak the email address. Tip: search for 'addy' and you will find it.

Copy the whole script (there are three <script> blocks) and paste into your custom module editor.

Save the module and that's it.

User avatar
mojito
Joomla! Guru
Joomla! Guru
Posts: 635
Joined: Wed Sep 07, 2005 10:18 pm
Location: London
Contact:

Re: How to use Email-Cloaking in modules and Components

Postby mojito » Thu Jan 24, 2013 12:15 pm

vdizzle wrote:I've been searching for this too and found this -- trying it in my own component, so maybe it will help someone else.

Code: Select all

$email = [email protected]';
$emcloaked = JHTML::_('Email.cloak',$email);
echo $emcloaked;


This is working for me 2.5.8 thanks vdizzle
Check out the 'bad toilet' online !


Return to “Joomla! 1.5 Coding”

Who is online

Users browsing this forum: No registered users and 4 guests