PDA

View Full Version : Remove hyperlinking.Please read this thread.


Z@N@
09-29-2006, 02:53 AM
Guys,

I will cut to the chase. I wont to be able to DISABLE REMOVE hyperlinking / url parsing.

I am using VB3.6.1.

I know its in the attached code - class_bbcode.php

Somewhere in these lines of this file -

/**
* Handles a [url] tag. Creates a link to another web page.
*
* @param string If tag has option, the displayable name. Else, the URL.
* @param string If tag has option, the URL.
*
* @return string HTML representation of the tag.
*/
function handle_bbcode_url($text, $link)
{
$rightlink = trim($link);
if (empty($rightlink))
{
// no option -- use param
$rightlink = trim($text);
}
$rightlink = str_replace(array('`', '"', "'", '['), array('`', '"', ''', '['), $this->strip_smilies($rightlink));

if (!preg_match('#^[a-z0-9]+(?<!about|javascript|vbscript|data):#si', $rightlink))
{
$rightlink = "http://$rightlink";
}

if (!trim($link) OR $text == $rightlink)
{
$tmp = unhtmlspecialchars($rightlink);
if (vbstrlen($tmp) > 55 AND $this->is_wysiwyg() == false)
{
$text = htmlspecialchars_uni(substr($tmp, 0, 36) . '...' . substr($tmp, -14));
}
}

// remove double spaces -- fixes issues with wordwrap
$rightlink = str_replace(' ', '', $rightlink);

// standard URL hyperlink
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
}


I have tried replacing lines, removing bits of this code, I got it to work at one stage, the links I was posting in a test thread were just text, but they had the

Tags at the ends of my just text links, in other words links were not clickable at all, but had these tags on each end.

I have seaqrched google, vb.org, vbulletin.com I have tried all idea's in about the 20 threads I had found, but none have worked.

Please help.

DaveTomneyUK
09-29-2006, 09:30 AM
Have you tried this within the code you posted above.

Search for :
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";

Change to :
return "$text";

Z@N@
09-29-2006, 09:48 AM
Dave,

Cheers for this, worked a treat. Funny thing is I had also played with that line, bu instead of replacing with the text you said, I was actually removing that whole bit of code.

Thanks again.