• Alright, I’m working on a plugin that will allow one to use Everything2 Pipe Links in their posts (and soon, comments). After messing around with regular expressions and the like, I’ve got it pretty much working. You can check it out at http://sugardeath.net/e2-pipe-linker-plugin/

    The problem is as follows:
    [Crazy like a fox|I think you are insane] would produce a link to the “Crazy like a fox” node at Everything2 with the link text “I think you are insane.” The first bit of text has all the spaces changed to +’s to make it URL friendly. This first bit of text is also used in the title attribute of the A tag, but I can’t figure out how to grab that first bit AGAIN without the +’s.

    The source can be seen at
    http://sugardeath.net/wordpress/wp-content/plugins/e2pipe.phps

    I have tried something like
    $title = preg_replace_callback( '#([w[^]]+)|#', 'title_return', $content);
    where the function title_return just returns the string with no changes, but whenever I call $title in
    ‘$content = preg_replace( ‘#\[(\w[^\]]+)\|([^\]]+)\]#’, ‘< a href=”http://everything2.org/?node=$1&#8243; title=”$title” >$2< /a >’, $content);’

    it just outputs “$title” in the title attribute no matter what I do.

    Anyone have any ideas?

    Now, keep in mind, this is my very first plugin for WordPress. This is also the first time I’ve done more than just mess with variables and such.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter satoshi

    (@satoshi)

    No on likes me -_-

    satoshi: I don’t think it’s a matter of whether we like you or not. It’s a matter of “can we help you?”. And the answer seems to be no.

    Regular expressions and callback functions are advanced topics, and beyond the scope of these forums. You might get help at on the WordPress Hackers mailing list, but I can’t guarantee it.

    Alternatively you may find help on good php help forums / websites with I guess better qualified php professional.

    Unfortunately, you haven’t got a reply like podz above because we wouldn’t know what to reply :-S

    Thread Starter satoshi

    (@satoshi)

    Heh, I know. I’m basing the “no one likes me” thing on the fact that none of my other topics ever get answered either… Oh well, thanks for the help. I’ll look into those. I didn’t know there was a WordPress Hackers mailing list. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Making Everything2 Plugin, Have Question…’ is closed to new replies.