Entity Tag

Started by vbgamer45, November 12, 2009, 10:47:57 AM

Previous topic - Next topic

vbgamer45

Link to Mod

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
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Marcus Forsberg


Arantor

Thanks :)

Took me a little while to figure out that regular expression though... (about two hours solid)
Holder of controversial views, all of which my own.


darrenbeige

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.

Arantor

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.
Holder of controversial views, all of which my own.


darrenbeige

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.


Apllicmz

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&atilde;o';
$txt['bbc_code_entn'] = 'Tag de entidade num&eacute;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&atilde;o';
$txt['bbc_code_entn'] = 'Tag de entidade num&eacute;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&atilde;o';
$txt['bbc_code_entn'] = 'Tag de entidade num&eacute;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&atilde;o';
$txt['bbc_code_entn'] = 'Tag de entidade num&eacute;rica';
]]></add>
        </operation>
    </file>





Advertisement: