XHanch Studio Log in | Register | Cart

Forum

Notifications
Clear all

[How to] Add nofollow attribute to URL tags in messages/post/topic content

1 Posts
1 Users
0 Likes
1,748 Views
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

To add rel="nofollow" attribute to URL tag (BBC code) in messages/post/topic content, you need to edit Sources/Subs.php.

Around line 1598, find these codes:

array(
    'tag' => 'url',
    'type' => 'unparsed_content',
    'content' => '<a href=""$1"" class="bbc_link" target="_blank">$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' => 'url',
    'type' => 'unparsed_equals',
    'before' => '<a href=""$1"" class="bbc_link" target="_blank">',
    'after' => '</a>',
    'validate' => create_function('&$tag, &$data, $disabled', '
        if (strpos($data, ' http://') !== 0 && strpos($data, ' https://') !== 0)
            $data = ' http://' . $data;
    '),
    'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
    'disabled_after' => ' ($1)',
),

and change it to

array(
    'tag' => 'url',
    'type' => 'unparsed_content',
    'content' => '<a href=""$1"" class="bbc_link" target="_blank" rel="nofollow">$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' => 'url',
    'type' => 'unparsed_equals',
    'before' => '<a href=""$1"" class="bbc_link" target="_blank" rel="nofollow">',
    'after' => '</a>',
    'validate' => create_function('&$tag, &$data, $disabled', '
        if (strpos($data, ' http://') !== 0 && strpos($data, ' https://') !== 0)
            $data = ' http://' . $data;
    '),
    'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
    'disabled_after' => ' ($1)',
),
 
Posted : 12/03/2011 8:00 am
Share:

× Close Menu