News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

2.0.18 Subs.php custom tag adaptation

Started by spiros, February 02, 2021, 03:16:29 AM

Previous topic - Next topic

spiros

I am using this extra tag, I am not sure how exactly these should be edited for php 7.4/SMF 2.0.18 compatibility

array(
'tag' => 'google',
'type' => 'unparsed_content',
'content' => '<a href="https://www.google.com/search?q=&quot;$1&quot;" target="_blank" rel="nofollow noreferrer noopener">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
                'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_content' => '<span style="color: red;">Google Search: $1</span>',
),
array(
'tag' => 'google',
'type' => 'unparsed_equals',
'before' => '<a href="https://www.google.com/search?q=&quot;$1&quot;" target="_blank" rel="nofollow noreferrer noopener">',
                'after' => '</a>',
                'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_before' => '<span style="color: red;">',
                'disabled_after' => ' ($1)</span>',
),


I can see in the operations for the upgrade

Find
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(

Replace
'validate' => function(&$tag, &$data, $disabled)
{
$data = strtr($data, array('<br>' => ''));
},
),
array(


Not sure whether this change should be applied to that tag or whether anything else needs to change.

vbgamer45

Just the 'validate' part needs to change

'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),

To

'validate' => function(&$tag, &$data, $disabled)
{
$data = strtr($data, array('<br>' => ''));
},
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

spiros


Advertisement: