WordPress.org

Ready to get started?Download WordPress

Forums

Photomatt's ABBR Hack (15 posts)

  1. scooter
    Member
    Posted 10 years ago #

    Okay, so I've installed PhotoMatt's Acronymit script into my-hacks.php, and everything has been working fine, except I can't figure out how to prevent this hack from breaking links!
    For example, check out http://www.jezzjournal.com/archives/2003/07/25/registration-is-done-finally/ at the bottom, the link is all messed.
    If anyone has any ideas, please let me know. Thanks so much!
    jeremy

  2. NuclearMoose
    Member
    Posted 10 years ago #

    Jeremy,
    Is there something in your list of ABBRs that is the same as in the link?

  3. antifuse
    Member
    Posted 10 years ago #

    That link had "IE" in it, which the acronym replacer replaced with an acronym... you can take IE out of the acronym replacer as a workaround for the moment...

  4. scooter
    Member
    Posted 10 years ago #

    Yes, but my question is if there is a way to make sure it stops using it when // or / are somewhere near the ABBR.
    I know I could just remove it, but I would like to avoid that for now.
    Thanks,
    Jeremy

  5. Dougal Campbell
    Member
    Posted 10 years ago #

    Another problem with that code is that it breaks on recursive acronyms, like "GNU" (GNU's Not Unix) or "PHP" (PHP Hypertext Processor). This can generally be worked around by changing the case of the definition. e.g. "Php Hypertext Processor".
    Getting it to stop molesting links is a more interesting problem. You could take the approach I used (which I borrowed from Simon Willison) in my WordPress Text filters.

  6. scooter
    Member
    Posted 10 years ago #

    I'm still not sure how to attack this problem, I'm not really a PHP guru, so I can't get around the code very easily. If anyone could help I would be very happy.

  7. NuclearMoose
    Member
    Posted 10 years ago #

    scooter,
    It is likely that someone who can write a decent regular expression formula to parse out those characters will solve this problem.
    Colour me clueless in this department.

  8. Jaykul
    Member
    Posted 10 years ago #

    To keep it from messing up links, just change your search expression so it requires a space (or other punctuation) around the acronym. It ought to be done that way to start with, I'd think (that's how mine is done)

  9. NuclearMoose
    Member
    Posted 10 years ago #

    Joel,
    Since I am a PHP noghead, can I assume that your definitions include the double quotes? So in the post you would have to write it as "HTTP" and then the function would acronym hack it?
    Sometimes the easiest way is not the first one thought of, eh? :)
    Craig.

  10. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Not a space, but do a word boundry, \w.

  11. NuclearMoose
    Member
    Posted 10 years ago #

    Matt,
    Could you expand on that, please?
    Craig.

  12. Kiddeath91
    Member
    Posted 9 years ago #

    BUMPING a way old post that didn't seem resolved:

    I'm using Matt's acronymit function on myhacks.php (Running WP 1.2) Over the past two days I have encountered situations where acronym tags were triggered in URL's. Having RSS and XML in the URL is something I can't control. These are the addresses to other sites.

    As a quick fix, I deleted these two from myhacks.php, but I really would like to have them auto acronym these in regular text. Is there a hack, or plugin that differentiates acronyms from wrapping inside of URL's???

    Thanks for any help.

  13. Kiddeath91
    Member
    Posted 9 years ago #

    BUMP Anybody???

  14. elfin
    Moderator
    Posted 9 years ago #

    http://www.huddledmasses.org/2004/04/19/wordpress-plugin-acronym-replacer/
    sorted out most of these problems with his version.

  15. Kiddeath91
    Member
    Posted 9 years ago #

    elfin...THANKS!!! That works great!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.