Topic: Signature without Links

Hi,
some of my Members use the Signature for Links to his homepage. I think the link on the left side (contact, etc.) is enough. How can i disable this function´? I would like the Signature free from URLs, Links ....
Its possible?

Greetings
Michaela

Re: Signature without Links

Easy smile

Open parser.php, find function parse_signature($text) and comment this line out (put /* */ around it):

    if ($pun_config['o_make_links'] == '1')
        $text = do_clickable($text);

Re: Signature without Links

elbekko wrote:

Easy smile

Open parser.php, find function parse_signature($text) and comment this line out (put /* */ around it):

    if ($pun_config['o_make_links'] == '1')
        $text = do_clickable($text);

Sorry if I'm mistaken, but wouldn't that only prevent plain text urls from being made into links, but leave BBCode links alone?

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Signature without Links

Hrmm, could be. Looks like it :S You'll have to modify the function do_bbcode to have the option (with a default to not mess stuff up) $is_signature and then in that function put a check around the links parsing. Harder, but still pretty doable smile

Re: Signature without Links

Hi guys,
it doesn't work ....

So, when i comment this line out, nothing happens ...

Greetings
Michaela

Re: Signature without Links

I can give you a solution that's a bit harder smile

Find function do_bbcode($text) and replace it with function do_bbcode($text, $nolinks = false)

Then, a bit further in that function, find this:

$pattern = array('#\[b\](.*?)\[/b\]#s',
                         '#\[i\](.*?)\[/i\]#s',
                         '#\[u\](.*?)\[/u\]#s',
                         '#\[url\]([^\[]*?)\[/url\]#e',
                         '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
                         '#\[email\]([^\[]*?)\[/email\]#',
                         '#\[email=([^\[]*?)\](.*?)\[/email\]#',
                         '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
    
        $replace = array('<strong>$1</strong>',
                         '<em>$1</em>',
                         '<span class="bbu">$1</span>',
                         'handle_url_tag(\'$1\')',
                         'handle_url_tag(\'$1\', \'$2\')',
                         '<a href="mailto:$1">$1</a>',
                         '<a href="mailto:$1">$2</a>',
                         '<span style="color: $1">$2</span>');
    
        // This thing takes a while! :)
        $text = preg_replace($pattern, $replace, $text);

Replace it with this:

if($nolinks)
        {
        $pattern = array('#\[b\](.*?)\[/b\]#s',
                         '#\[i\](.*?)\[/i\]#s',
                         '#\[u\](.*?)\[/u\]#s',
                         '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
    
        $replace = array('<strong>$1</strong>',
                         '<em>$1</em>',
                         '<span class="bbu">$1</span>',
                         '<span style="color: $1">$2</span>');
    
        // This thing takes a while! :)
        $text = preg_replace($pattern, $replace, $text);
        }
    else
        {
        $pattern = array('#\[b\](.*?)\[/b\]#s',
                         '#\[i\](.*?)\[/i\]#s',
                         '#\[u\](.*?)\[/u\]#s',
                         '#\[url\]([^\[]*?)\[/url\]#e',
                         '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
                         '#\[email\]([^\[]*?)\[/email\]#',
                         '#\[email=([^\[]*?)\](.*?)\[/email\]#',
                         '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
    
        $replace = array('<strong>$1</strong>',
                         '<em>$1</em>',
                         '<span class="bbu">$1</span>',
                         'handle_url_tag(\'$1\')',
                         'handle_url_tag(\'$1\', \'$2\')',
                         '<a href="mailto:$1">$1</a>',
                         '<a href="mailto:$1">$2</a>',
                         '<span style="color: $1">$2</span>');
    
        // This thing takes a while! :)
        $text = preg_replace($pattern, $replace, $text);
        }

Then, in the function parse_signature, find this line:

if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
    {
        $text = do_bbcode($text);

Replace it with:

if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
    {
        $text = do_bbcode($text, $nolinks = true);

This one should work smile

Re: Signature without Links

Thanks, it works ...

wink

Best regards
Michaela