Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=2267)
Entity Tag
Original Author: Arantor
SMF Version: 2.0.x
Mod Version: 2.0
Description:
Adds two tags, [ent] and [entn], for specifying a variety of extended characters that may otherwise be difficult to type on the keyboard.
[ent] allows you to use the standard HTML entities, for example ™ is also ™ which can be entered with [ent]trade[/ent]
You can also use the full range of numeric entities from 3 to 6 digits, for example æ is æ, which can be entered with [entn]230[/entn]
Why Not Visit:
http://www.smfhacks.com (http://www.smfhacks.com)
Nice one, Arantor!
Thanks :)
Took me a little while to figure out that regular expression though... (about two hours solid)
Why is there a need for two tags? Couldn't they be combined into one tag [ent], and use a simple regex to check for all numbers, and run the code of the [entn] tag, otherwise running the default code.
Partly because the route taken is slightly different, ent issues &[contents]; versus entn issuing &#[contents];. The alternative would be evaluating one/both each call on [ent] which has performance considerations if you have multiple instances on a single page.
Quote from: Arantor on November 12, 2009, 11:10:06 AM
The alternative would be evaluating one/both each call on [ent] which has performance considerations if you have multiple instances on a single page.
True.
when UPDATE dont forget portuguese
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['bbc_code_ent'] = 'Tag de entidade Padrão';
$txt['bbc_code_entn'] = 'Tag de entidade numérica';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['bbc_code_ent'] = 'Tag de entidade Padrão';
$txt['bbc_code_entn'] = 'Tag de entidade numérica';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['bbc_code_ent'] = 'Tag de entidade Padrão';
$txt['bbc_code_entn'] = 'Tag de entidade numérica';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['bbc_code_ent'] = 'Tag de entidade Padrão';
$txt['bbc_code_entn'] = 'Tag de entidade numérica';
]]></add>
</operation>
</file>