You are not logged in.

#1 2010-05-30 10:56:53

markg85
Member
Registered: 2009-06-27
Posts: 149

Please change URL representation to full instead with dots.

Hi,

I came across this a few times now and it's irritating.

What's the issue? Well i copied some repository information like below:

As you can see there are DOTS appearing in "long" url's! That makes it impossible to just copy it and paste it in (in this case) pacman.conf!

The code section doesn't have this "issue" but not everyone uses code tags to paste something that isn't code..

So, please just don't put points in the url's to "shorten" them.

Side note.. I find it pointless to even shorten url's at all on forums.. it's not like you have to save on characters like you have on twitter messages.

Regards,
Mark

EDIT
Oke, i made it a lot easier to fix this issue.
The issue seems be be HARD CODED in FluxBB and seems to be done extremely poorly if i may say so.
Open the file: "include/parser.php" and find:

function handle_url_tag($url, $link = '')
{
    global $pun_user;

    $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
    if (strpos($url, 'www.') === 0)            // If it starts with www, we add http://
        $full_url = 'http://'.$full_url;
    else if (strpos($url, 'ftp.') === 0)    // Else if it starts with ftp, we add ftp://
        $full_url = 'ftp://'.$full_url;
    else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah))     // Else if it doesn't start with abcdef://, we add http://
        $full_url = 'http://'.$full_url;

    // Ok, not very pretty :-)
    $link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' … '.substr($url, -10) : $url) : stripslashes($link);

    return '<a href="'.$full_url.'">'.$link.'</a>';
}

Replace it with:

function handle_url_tag($url, $link = '')
{
    global $pun_user;

    $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
    if (strpos($url, 'www.') === 0)            // If it starts with www, we add http://
        $full_url = 'http://'.$full_url;
    else if (strpos($url, 'ftp.') === 0)    // Else if it starts with ftp, we add ftp://
        $full_url = 'ftp://'.$full_url;
    else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah))     // Else if it doesn't start with abcdef://, we add http://
        $full_url = 'http://'.$full_url;

    // Ok, not very pretty :-)
    $link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' … '.substr($url, -10) : $url) : stripslashes($link);

    return '<a href="'.$full_url.'">'.$full_url.'</a>';
}

Note the only thing that changed:

return '<a href="'.$full_url.'">'.$link.'</a>';

to

return '<a href="'.$full_url.'">'.$full_url.'</a>';

Just posted the function since it might be easier to find that instread of just the ruturn line.

And DAMN that code is UGLY with all those globals and non changable defaults! (like this url stuff)... i'm amazed the project is even in developement lol tongue
Note that on PHP 5.3 i also get spawned with this message:

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /srv/http/fluxbb/include/functions.php on line 639 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /srv/http/fluxbb/include/functions.php on line 640 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /srv/http/fluxbb/include/functions.php on line 641 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /srv/http/fluxbb/include/functions.php on line 649 Today 13:18:39

^_^ a wonder this forum is still up if you ask me.

Last edited by markg85 (2010-05-30 11:34:30)

Offline

#2 2010-05-30 11:30:28

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,485
Website

Re: Please change URL representation to full instead with dots.

You have a choice.  Links automatically become clickable and get abbreviated, or they don't...   That looks like the only options.

Anyway, as you said, use code blocks for anything that needs cut an paste.   There are no guarantees otherwise.


Edit: file a bug report at fluxbb upstream.  We will not be manually patching it.  Note that we will be updating to v1.4 once theming is sorted.

Offline

#3 2010-05-31 21:20:33

FSX
Member
Registered: 2009-08-06
Posts: 57

Re: Please change URL representation to full instead with dots.

markg85 wrote:

... i'm amazed the project is even in developement lol tongue

I suggest you make something better. big_smile

Offline

Board footer

Powered by FluxBB