MyBB Community Forums

Full Version: [url][/url] show full link?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[url]http://www.yoursomedomain.com/somedir/somedir/somedir/this-is-file-name-such-as-etc.html[/url]

will be show:
http://www.yoursomedomain.com/somedir/so...s-etc.html

I want full link, please help me, Thank you.
do you mean you want the parser to not shorten the link by inserting the "..." in the middle? if so, that is added to minimize the chance of breaking the layout with really long URLs
yes, i want really long URLs, but i want link yet, if breaking the layout, it will not be parsed.
open class_parser.php and find

if(my_strlen($url) > 55)
{
	$name = my_substr($url, 0, 40)."...".my_substr($url, -10);
}

and change 55 to the length you want that works with your layout. So any URL longer than the 55 (or its new value) will get shortened, otherwise the full URL will be shown.
Sorry for bumping this rather old thread, I just wated to check if that has changed in the meanwhile: Looking at the surrounding code in version 1.6.12 (1612):

		if($name == $url && (!isset($this->options['shorten_urls']) || $this->options['shorten_urls'] != 0))
		{
			if(my_strlen($url) > 55)
			{
				$name = my_substr($url, 0, 40)."...".my_substr($url, -10);
			}
		}

This seems to use an option called shorten_urls to decide if URLs should be truncated or not.

Therefore, wouldn't it be cleaner to set this in a config file - or even better, on the Admin site - rather than hacking the PHP? I did a quick settings search for "shorten" and "url" on the Admin Configuration/Settings page, but that didn't bring up anything related.
$this->options['shorten_urls'] means it's an option specified for parser class, not in MyBB settings. It's disabled only in printthread as I see, but you can add it anywhere by "hacking the PHP". No other way to do it currently.