Text style editor
Posted by hoowoo
Re: Text style editor October 07, 2007 05:22PM |
Registered: 20 years ago Posts: 65 |
Hi,
I suppose there is a bug with the 'Insert URL' button when you want to insert a mailto instead of http://
For example, I use this button with "toto@freetoto.fr" an print into the js box "mailto:toto@freetoto.fr"
This give it to me :
toto@freetoto.fr
and not :
toto@freetoto.fr
I've tried to solve it but I'm not good in regular expressions
Thank you in advance for your help
I suppose there is a bug with the 'Insert URL' button when you want to insert a mailto instead of http://
For example, I use this button with "toto@freetoto.fr" an print into the js box "mailto:toto@freetoto.fr"
This give it to me :
toto@freetoto.fr
and not :
toto@freetoto.fr
I've tried to solve it but I'm not good in regular expressions
Thank you in advance for your help
Re: Text style editor October 12, 2007 07:32AM |
Registered: 19 years ago Posts: 49 |
Quote
notre-planete.info
Hi,
I suppose there is a bug with the 'Insert URL' button when you want to insert a mailto instead of http://
For example, I use this button with "toto@freetoto.fr" an print into the js box "mailto:toto@freetoto.fr"
This give it to me :
toto@freetoto.fr
and not :
toto@freetoto.fr
I've tried to solve it but I'm not good in regular expressions
Thank you in advance for your help
Hallo, I do not think this is a text editor bug but I do not understand the code perfectly. This is interesting: if you write any BB-code tag into a text of a message than the BB-code modul is activated and than you get a good trasnscription.
I try to think about a solution and I'll write if I'll find any.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Re: Text style editor October 12, 2007 09:05AM |
Admin Registered: 20 years ago Posts: 8,532 |
I don't understand what you are trying to say hoowoo, sorry.
About the mailto: not working: that is because the bbcode module apparently looks at mailto://... and not mailto:... This is a bug, but till now it didn't really get noticed I think (it's probably not used a lot by forum users). I'll take a look at the code. In the meanwhile, you can also use ... for placing a clickable email address in the message. Or even put in the bare email address, since that one will be converted to a clickable address automatically too.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
About the mailto: not working: that is because the bbcode module apparently looks at mailto://... and not mailto:... This is a bug, but till now it didn't really get noticed I think (it's probably not used a lot by forum users). I'll take a look at the code. In the meanwhile, you can also use ... for placing a clickable email address in the message. Or even put in the bare email address, since that one will be converted to a clickable address automatically too.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Text style editor October 12, 2007 10:44AM |
Registered: 19 years ago Posts: 49 |
Yes, I understand, mmakaay. If you want to write an email address, you put it between and tags.
It's possible to add an "Email" button to the editor too (like it is seen here, it is very nice :-) : you add e.g.
<input type=button value="<?php echo $PHORUM['DATA']['LANG']['mod_styleedit']['TEemail']?>" onclick="tag('email');" class="PhorumSubmit" onmouseover="help('<?php echo $PHORUM['DATA']['LANG']['mod_styleedit']['TEemailhelp']?>');" accesskey="e">
line to the format.php or to the bb_texteditor.php among buttons at the bottom of these files. At the same time you add a line
echo "index['email'] = true;\n";
among similar lines at the top of these files and add language translations for "Email" and "Email help" for this line into language files at mods/styleedit/lang.
But (this modality I can see in my P 5.0) if you write a clear text message (with no BB-code formating tags anywhere else) with a plain text email address - it isn't converted to a clickable email address.
And this is changed at the moment when you use any other (not only ... tag) BB-code tag somewhere else. At this moment a plain text email address without BB-code tags for email are converted too.
CU!
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 2 time(s). Last edit at 10/13/2007 05:43AM by hoowoo.
It's possible to add an "Email" button to the editor too (like it is seen here, it is very nice :-) : you add e.g.
<input type=button value="<?php echo $PHORUM['DATA']['LANG']['mod_styleedit']['TEemail']?>" onclick="tag('email');" class="PhorumSubmit" onmouseover="help('<?php echo $PHORUM['DATA']['LANG']['mod_styleedit']['TEemailhelp']?>');" accesskey="e">
line to the format.php or to the bb_texteditor.php among buttons at the bottom of these files. At the same time you add a line
echo "index['email'] = true;\n";
among similar lines at the top of these files and add language translations for "Email" and "Email help" for this line into language files at mods/styleedit/lang.
But (this modality I can see in my P 5.0) if you write a clear text message (with no BB-code formating tags anywhere else) with a plain text email address - it isn't converted to a clickable email address.
And this is changed at the moment when you use any other (not only ... tag) BB-code tag somewhere else. At this moment a plain text email address without BB-code tags for email are converted too.
CU!
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 2 time(s). Last edit at 10/13/2007 05:43AM by hoowoo.
Re: Text style editor October 12, 2007 11:08AM |
Admin Registered: 20 years ago Posts: 8,532 |
Quote
At this moment a plain text email address without BB-code tags for email are converted too.
I see. I can reproduce that at the phorum.org forums too. If I try to reproduce it on my latest 5.1 and 5.2 (which has a rewritten bbcode module) installations, I don't see this behavior. I'm not exactly sure right now where the difference is.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Text style editor October 13, 2007 06:06AM |
Registered: 19 years ago Posts: 49 |
Quote
But (this modality I can see in my P 5.0) if you write a clear text message (with no BB-code formating tags anywhere else) with a plain text email address - it isn't converted to a clickable email address.
I thought it can be fixed using "Simple Text Replacement Mod" at the admin area of the Phorum. You can set replacement (as PCRE!) for
^ ([_a-zA-Z0-9\.\-]+)@([_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4})$
(do not forget to leave an empty characteristic after "^" at the beginning otherwise it looks to make messes with the BB-code module) to
<a href="mailto:$1@$2">$1@$2</a>
(an empty characteristic at the beginning of the phrase again). I have tested this method and first time it looks working fine. You get a clickable email address from a plain text one in this way. It doesn't allow to make a clickable text (any text without a visible email) with an email as a link still. It would require a javascript function like that used by writing links and changes at BB-code module.
Second time it doesn't work at all. It's outlandish.
CU!
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 5 time(s). Last edit at 10/13/2007 06:22AM by hoowoo.
Sorry, only registered users may post in this forum.