PHPBB short URL

English version

The PHPBB forums software change the displaying of the link when they are more than 55 characters thus resulting in three dots being shown. Here are the changes made to remove this feature and display the full links.

Edit the file PHPBB\includes\functions_content.php and find the following line

$short_url = (utf8_strlen($url) > 55) ? utf8_substr($url, 0, 39) . ' ... ' . utf8_substr($url, -10) : $url;

and change like the following :

$short_url = $url;

or modify the value (55) with another greater number.

If you have the s9e/mediaembed mod

in the following file PHPBB\phpbb\textformatter\s9e\link_helper.php comment or edit the value (55) with another greater number.

/**
* Truncate the replacement text set in a LINK_TEXT tag
*
* @param  \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @return bool                               Always true to indicate that the tag is valid
*/
public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag)
{
    $text = $tag->getAttribute('text');
    /*if (utf8_strlen($text) > 55)
    {
        $text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10);
    }*/

    $tag->setAttribute('text', $text);

    return true;
}

Version française

Le forum PHPBB modifie le visuel des liens quand ceux-ci font plus de 55 caractères résultant d’un affichage de trois points … dans le lien. Voici les modifications a effectuées afin d’enlever cette fonctionnalité et d’afficher les liens complets.

Dans le fichier PHPBB\includes\functions_content.php, trouvez la ligne suivante

$short_url = (utf8_strlen($url) > 55) ? utf8_substr($url, 0, 39) . ' ... ' . utf8_substr($url, -10) : $url;

et modifiez comme ceci :

$short_url = $url;

ou changez la valeur 55 par un nombre plus grand.

Si vous avez le mod s9e/mediaembed

Dans le fichier PHPBB\phpbb\textformatter\s9e\link_helper.php, commentez le bloc if ou changez la valeur 55 par un nombre plus grand.

/**
* Truncate the replacement text set in a LINK_TEXT tag
*
* @param  \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @return bool                               Always true to indicate that the tag is valid
*/
public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag)
{
    $text = $tag->getAttribute('text');
    /*if (utf8_strlen($text) > 55)
    {
        $text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10);
    }*/

    $tag->setAttribute('text', $text);

    return true;
}