• 1. Turn long links into [Link] or something like that. Like say somebody posts a comment with a link that has like 150 characters…it will screw my layout up because the link doesn’t break to the next line. So it would be cool if it was either a feature or a hack for automatically turning long links to something like [Link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can’t you just ask commenters to add their links in a civilised fashion? ??

    Thread Starter jpigford

    (@jpigford)

    Haha…rrrrriiigggghtt.

    I think Kafkaesqui was working on a plugin for this problem, but I can’t find it in the forums, possibly because some of his comments have mysteriously disappeared.

    I hear if you say his name three times to a mirror in the dark, though, he comes and answers your questions.

    The trick is saying his name right.

    Yes, I cobbled together a plugin to deal with this:

    https://codex.www.ads-software.com/User:Kafkaesqui/Projects#Break_Text

    mdawaffe is correct in that the forum post about it was wiped (I’m seeing a lot of this…), so here’s a brief explanation of use:

    Install plugin, activate it, and in wp-comments.php, replace

    <?php comment_text(); ?>

    with

    <?php break_text(comment_text); ?>

    The parameters are:

    <?php break_text(func, 'args', cols, 'cut'); ?>

    func -> WP function name – this is the function name break_text() replaces, without all the php syntax. In this case, comment_text.

    args -> Parameter(s) passed to the WP function.

    cols -> Number of columns or characters to break a line of text at. Defaults to 60.

    cut -> Character(s) to use for the break. Defaults to a space.

    Another example is:

    <?php break_text(comment_text, '', 72, '- '); ?>

    Note: I still prefer Anonymous’ recommendation. :)

    mdawaffe: Emphasis is on the first and third syllables. That’s why I took so long. The mirror is optional.

    TinyURL is a good alternative solution:

    https://tinyurl.com/

    tinyurl has it’s own problems… I’ll say no more – just trust your source.

    Kafkaesqui: Well, I had the stresses right; must have been one of those vowels. I’m betting on the second syllable. Of course, I’ve assumed all along there were four syllables total. I suppose there wouldn’t have to be.

    But I’ll let you keep your secrets.

    mdawaffe: I provide support for the name, too:

    https://guff.szub.net/2003/06/24/in-the-nom

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘A Feature Request’ is closed to new replies.