Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: playdiune on December 28, 2009, 07:32:38 PM

Title: question about reglink MOD
Post by: playdiune on December 28, 2009, 07:32:38 PM
Hello,

in the file subs.php the MOD looks for this code;

<search position="replace"><![CDATA[array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => '<a href="$1">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => '<a href="$1">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),]]></search>


I am using version 1.1.11 and have this code, instead;

array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => '<a href="$1">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => '<a href="$1">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);
elseif (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),


Is this because onother MOD installed, or is a an incompatible version ?

thanks
Title: Re: question about reglink MOD
Post by: Arantor on December 28, 2009, 07:34:53 PM
No, it's because the mod doesn't appear to have been updated for 1.1.11 yet.
Title: Re: question about reglink MOD
Post by: playdiune on December 28, 2009, 07:42:26 PM
The MOD just modify two lines. i think i can do it manualy;

dont i ?
Title: Re: question about reglink MOD
Post by: Arantor on December 28, 2009, 07:45:18 PM
You probably can just modify those two lines however they are different, and it might be best waiting for the mod author to update it.
Title: Re: question about reglink MOD
Post by: playdiune on December 28, 2009, 07:46:09 PM
it replaces

'content' => '<a href="$1">$1</a>',


for this

'content' => $user_info['is_guest'] ? $txt['no_view_links'] . "\n" . '<a href="' . $scripturl . '?action=register">' . $txt['txt_reg_links_register'] . '</a>&nbsp;' . $txt['txt_reg_links_or'] . '&nbsp;<a href="' . $scripturl . '?action=login">' . $txt['txt_reg_links_login'] . '</a>' : '<a href="$1">$1</a>',


Title: Re: question about reglink MOD
Post by: playdiune on December 28, 2009, 08:13:37 PM
well,

i did it manualy and it works like a charm ;)

thanks