Page 1 of 1

Mailto: not working in Joomal 1.0.13, with Email Mambot version 1.0.0

Posted: Mon Oct 22, 2007 9:35 pm
by bigbassfish
I finally got my Mailto to work in for my website.  It was working fine and then I couldn't enter mailto:"xxxx.xxx.xxx"
the link wasn't working at all so I read the boards and then went into
mosemailcloak.php file and found this -

Code: Select all

$_MAMBOTS->registerFunction( 'onPrepareContent', 'botMosEmailCloak' );

/**
* Mambot that Cloaks all emails in content from spambots via javascript
*/
function botMosEmailCloak( $published, &$row, &$params, $page=0 ) {
	global $database, $_MAMBOTS;

	// check whether mambot has been unpublished
	if ( !$published ) {
		return true;
	}
	
	// simple performance check to determine whether bot should process further
	if ( strpos( $row->text, '@' ) === false ) {
		return true;
	}
		
	// simple check to allow disabling of bot
	$regex = '{emailcloak=off}';
	if ( strpos( $row->text, $regex ) !== false ) {
		$row->text = str_replace( $regex, '', $row->text );
		return true;
	}
	
	// check if param query has previously been processed
	if ( !isset($_MAMBOTS->_content_mambot_params['mosemailcloak']) ) {
		// load mambot params info
		$query = "SELECT params"
		. "\n FROM #__mambots"
		. "\n WHERE element = 'mosemailcloak'"
		. "\n AND folder = 'content'"
I changed the code to -

Code: Select all

$_MAMBOTS->registerFunction( 'onPrepareContent', 'botMosEmailCloak' );

/**
* Mambot that Cloaks all emails in content from spambots via javascript
*/
function botMosEmailCloak( $published, &$row, &$params, $page=0 ) {
	global $database, $_MAMBOTS;

	// check whether mambot has been unpublished
	if ( !$published ) {
		return true;
	}
	
	// simple performance check to determine whether bot should process further
	if ( strpos( $row->text, '@' ) === false ) {
		return true;
	}
		
	// simple check to allow disabling of bot
	$regex = '{emailcloak=off}';
	if ( strpos( $row->text, $regex ) == false ) {
		$row->text = str_replace( $regex, '', $row->text );
		return true;
	}
	
	// check if param query has previously been processed
	if ( !isset($_MAMBOTS->_content_mambot_params['mosemailcloak']) ) {
		// load mambot params info
		$query = "SELECT params"
		. "\n FROM #__mambots"
		. "\n WHERE element = 'mosemailcloak'"
		. "\n AND folder = 'content'"
Hope it works for you!

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Mon May 05, 2008 12:17 am
by benya
Oops!!! At first I thought this was the fix i needed, but then when I took a look at the rendered HTML I found out that the so called fix above simply turns the MOS EMAIL CLOAK MAMBOT off! So now all my email addresses are no longer cloaked. YIKES! Looking at the code change above shows this to be true when you see that logic is inverted...

Below was my first optimistic response Sorry about that if it caused any confusion for others...

"Dude! it works for me as well! Thanks!!! btw, the above link is for email links that were created in the editor as: clickable links. If you just type in a plain text email address within any content on the Joomla site without making it clickable (i.e. WITHOUT using the <a> tag either directly in HTML or using a WYSIWYG editor), the mambot (or rather plugin) works fine with or without the above fix, sees an email address and cloaks it."

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Mon May 05, 2008 12:52 am
by benya
BTW, Here is my problem if anyone is experiencing the same, and or has found a solution:

The Email Cloaking Mambot: "mosemailcloak.php" is failing to pick up the class attribute within the <a> tag where a the MAILTO link exists... So, any CSS styles I try to apply to an email link do not get rendered once this bot rewrites the HTML code...

Any ides on how to fix this folks? I will take a look at the code later in the week and try to fix it when I have time... :) Guess I will start by searching on the expression "class=" to see if its even in the code somewhere...

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Mon May 05, 2008 4:57 am
by bigbassfish
benya wrote:BTW, Here is my problem if anyone is experiencing the same, and or has found a solution:

The Email Cloaking Mambot: "mosemailcloak.php" is failing to pick up the class attribute within the <a> tag where a the MAILTO link exists... So, any CSS styles I try to apply to an email link do not get rendered once this bot rewrites the HTML code...

Any ides on how to fix this folks? I will take a look at the code later in the week and try to fix it when I have time... :) Guess I will start by searching on the expression "class=" to see if its even in the code somewhere...
Hello there

when I put "mailto:xxxx.xxxx.xxx" in Joomla's link or hyperlink area after
I have added text to the text area in Joomla's editor page.

Such as :

Please email me at Myemail address.

And then you highlight Myemail and then to go link or hyperlink
button in and you enter mailto:xxxxxx.xxxxx.xxxxxx
You don't have to enter a class. You can put for title -mymailto.
then click - update.
that is it.

remember you can for mailto:xxxxx.xxxx.xxx do this : mailto:xxxxxx.xxx.xxx?subject=new news
so it enters the topic (subject) in the email .

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Mon May 05, 2008 5:02 am
by bigbassfish

Code: Select all

    $_MAMBOTS->registerFunction( 'onPrepareContent', 'botMosEmailCloak' );

    /**
    * Mambot that Cloaks all emails in content from spambots via javascript
    */
    function botMosEmailCloak( $published, &$row, &$params, $page=0 ) {
       global $database, $_MAMBOTS;

       // check whether mambot has been unpublished
       if ( !$published ) {
          return true;
       }
       
       // simple performance check to determine whether bot should process further
       if ( strpos( $row->text, '@' ) === false ) {
          return true;
       }
          
       // simple check to allow disabling of bot
       $regex = '{emailcloak=off}';
       if ( strpos( $row->text, $regex ) === false ) {
          $row->text = str_replace( $regex, '', $row->text );
          return true;
       }
       
       // check if param query has previously been processed
       if ( !isset($_MAMBOTS->_content_mambot_params['mosemailcloak']) ) {
          // load mambot params info
          $query = "SELECT params"
          . "\n FROM #__mambots"
          . "\n WHERE element = 'mosemailcloak'"
          . "\n AND folder = 'content'"
Here are new changes again. Again all I did was put a '=' in there because
there was a " | " before the == false.

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Mon Jun 09, 2008 6:22 pm
by corrado444
Greetings, I am not sure how old this post is and I should add that I found it while searching for a reason why my email cloaking mambot is not working at all.

In any case, I read th post and it seemed to me that replacing the core code of the mambot to fix the issue the poster is having is a bit of over engineering.

If the mambot prevents the class from working inside the <a> tag, why not try to change the look of the link using the "cascading" effect of CSS? In other words, you can affect any tag by pointing to the parent. If the email was in a div for instance (<div class="foobar">) then to point to that <a> tag would look like this:

.foobar a {some style here}

It should wrk. If you don;t have a div to use, wrap the email in a <span> with a class in it.

NOTE: I have not tested this with the mambot, I am not sure if it will fix it but it's worth a shot.

Good luck.

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Fri Jun 13, 2008 4:47 pm
by benya
This post is not that old, and I was still interested in replies, so thanks for the cascading tip! that will work fine and its easy enough to add a div using the JCE editor. I wonder why I did not think of that easy solution myself :-[ Guess I was not thinking in terms of scope with respect to what the the mambot rewrites.

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Wed Jun 18, 2008 11:44 am
by bobysolo
I was wondering if there is any way of making the emailcloaking bot work in Facileforms component? For now it works fine on the content items and modules, but it doesn't at all in the Facileforms component.

Is there a way of calling the cloacking function from inside the component via javascript or something?

Thanks.

Re: Mailto: not working in Joomal 1.0.13, with Email Mambot ver

Posted: Wed Aug 27, 2008 7:19 am
by firos
Dear friends,

Disable the plugin Email Cloaking in joomla administration to enable the mail to functioning.

Step:

1. Login as Joomla Administrator
2. Extentions - > Plugin Manager
3. Check the plugin "Content - Email Cloaking" and click Disable

Now your mailto code will work

Thanks