assistance in updating a mod with creat_function

Started by Kindred, February 04, 2021, 11:02:30 AM

Previous topic - Next topic

Kindred

Old mod... unsupported/discontinued by the author

My attempt to fix failed.  Can anyone give me a hand?

Quote from: Kindred on February 04, 2021, 11:00:44 AM
This mod was discontinued by the author some time ago -- however, if anyone still has it installed, be aware that the mod uses create_function which is deprecated in php 7.4 and removed in php 8.0.   Therefore, this mod will start throwing errors if your system is updated.



array(
'tag' => 'mod',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data = get_mod_comment($data, "mod", null, ' . ($smileys ? 'true' : 'false') . ', \'' . $cache_id . '\');'),
),
array(
'tag' => 'mod',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data[0] = get_mod_comment($data[0], "mod", $data[1], ' . ($smileys ? 'true' : 'false') . ', \'' . $cache_id . '\');'),
),




array(
'tag' => 'gmod',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data = get_mod_comment($data, "gmod", null, ' . ($smileys ? 'true' : 'false') . ', \'' . $cache_id . '\');'),
),
array(
'tag' => 'gmod',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data[0] = get_mod_comment($data[0], "gmod", $data[1], ' . ($smileys ? 'true' : 'false') . ', \'' . $cache_id . '\');'),
),



array(
'tag' => 'admin',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data = get_mod_comment($data, "admin", null, ' . ($smileys ? 'true' : 'false') . ', \'' . $cache_id . '\');'),
),
array(
'tag' => 'admin',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
'validate' => create_function('&$tag, &$data, $disabled', '$data[0] = get_mod_comment($data[0], "admin", $data[1], ' . ($smileys ? 'true' : 'false') . ', \'' . $cache_id . '\');'),
),

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

vbgamer45

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

vbgamer45

First set

array(
'tag' => 'mod',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => function (&$tag, &$data, $disabled) use ($smileys,$cache_id)
{
    $data = get_mod_comment($data, "mod", null, ($smileys ? 'true' : 'false'), $cache_id);
}
),
array(
'tag' => 'mod',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
'validate' => function (&$tag, &$data, $disabled) use ($smileys,$cache_id)
{
   $data[0] = get_mod_comment($data[0], "mod", $data[1], ($smileys ? 'true' : 'false'), $cache_id);
}

)


second set

array(
'tag' => 'gmod',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => function (&$tag, &$data, $disabled) use ($smileys,$cache_id)
                {
                    $data = get_mod_comment($data, "gmod", null, ($smileys ? 'true' : 'false'), $cache_id);
                }
),
array(
'tag' => 'gmod',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
                'validate' => function (&$tag, &$data, $disabled) use ($smileys,$cache_id)
                {
                    $data[0] = get_mod_comment($data[0], "gmod", $data[1], ($smileys ? 'true' : 'false'), $cache_id);
                }
),

third set

array(
'tag' => 'admin',
'type' => 'unparsed_content',
'content' => '$1',
'block_level' => true,
'validate' => function (&$tag, &$data, $disabled) use ($smileys,$cache_id)
                {
                    $data = get_mod_comment($data, "admin", null, ($smileys ? 'true' : 'false'), $cache_id);
                }
),
array(
'tag' => 'admin',
'type' => 'unparsed_equals_content',
'content' => '$1',
'block_level' => true,
                'validate' => function (&$tag, &$data, $disabled) use ($smileys,$cache_id)
                {
                    $data[0] = get_mod_comment($data[0], "admin", $data[1], ($smileys ? 'true' : 'false'), $cache_id);
                }
),
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

Kindred

Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting ')' in /..../Sources/Subs.php on line 1509

Ah -- I see... the "mod" edit was missing the comma after the closing parens.

fixed. Thanks VB!
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: