Forums

A Feature Request (9 posts)

  1. JPigford
    Member
    Posted 4 years ago #

    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]

  2. Anonymous
    Member
    Posted 4 years ago #

    Can't you just ask commenters to add their links in a civilised fashion? ;)

  3. JPigford
    Member
    Posted 4 years ago #

    Haha...rrrrriiigggghtt.

  4. mdawaffe
    Member
    Posted 4 years ago #

    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.

  5. Kafkaesqui
    Moderator
    Posted 4 years ago #

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

    http://codex.wordpress.org/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, '- '); ?>

  6. Kafkaesqui
    Moderator
    Posted 4 years ago #

    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.

  7. cdturri
    Member
    Posted 4 years ago #

    TinyURL is a good alternative solution:

    http://tinyurl.com/

  8. mdawaffe
    Member
    Posted 4 years ago #

    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.

  9. Kafkaesqui
    Moderator
    Posted 4 years ago #

    mdawaffe: I provide support for the name, too:

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.