zengun

weblog

20021030

meanwhile, in Corsica…

Following the redesign, some code updates on this site:

  • An RSS/RDF feed: if your aggregator supports the content:encoded element, you can from now on get my updates in their full, shiny HTML glory.
  • An RSS 2.0 feed, shamelessly inspired on Mark Pilgrim’s RSS 2.0 MT template. With content:encoded goodness too.
  • A PHP version of Brad Choate’s MT/Perl macro to convert acronyms and other user-definable strings into markup: it should have converted this post’s acronyms, at least.
    It is buggy, though: at the moment it only converts the last match, instead of the first one, which seems like a bug with preg_replace. If you’re good at PHP and regexes, feel free to visit this thread on SitePointForums and help me debug it!
    Update: looks like I fixed it, I still don’t know why the regex wasn’t working as expected.
    Update2: still buggy. Damn the regex, or damn PHP?
  • Cleaner pingback excerpts. It won’t make past pingbacks cleaner, but will help with future pingbacks :) Ideally, I should convert parts of Mark Pilgrim’s Further Reading code into PHP to get even better excerpts.
  • Sil’s searchhi script, to highlight search keywords. This way, all you sickos who come here searching for a naked grandmother or a trillian pro serial get to quickly see you’ve been misguided. Now go recite 20 Pater Noster and stop searching for that stuff mmk?

7 responses

  1. This is exactly what I needed! BTW, what happened to the pingback links?

    #1 matt2002/10/31 at 1:37

  2. Well, now they’re only displayed when there’s been a pingback. Instead of specifying a string for ‘no pingbacks’, I put an empty string. IF there are pingbacks, then the string is the comma, space, and then pingback numbers string.

    #2 michel — 2002/10/31 at 14:01

  3. Erm, how u go abt that?

    #3 Gam2002/10/31 at 17:14

  4. Very simple!
    <a href=”<?php pingback_link() ?>” class=”blogcommentslink”><?php pingback_number(”, ‘, one pingback’, ‘, % pingbacks’) ?></a>

    The only drawback is that the comma that comes after the trackback link is part of the pingback link.

    #4 michel — 2002/10/31 at 18:37

  5. That’s makes sense, since it isn’t people will ever need to click on unless there actually are pingbacks. Of course I’ve never gotten a pingback before so I don’t know what even happens :).

    #5 matt2002/10/31 at 20:06

  6. PHP Goodness All Around
    Michael has some very cool stuff going on at his site. If you use Cafélog or just like seeing wicked PHP code, check it out. I can’t believe I just said wicked. If I get any free time tonight I’m going to look at the regex stuff he’s do…

    #6 photomatt2002/10/31 at 20:19

  7. Michel : That is what I thought too, i thought u r able to get rid of the comma in the link

    Hehe

    #7 GamerZ2002/11/01 at 15:26

Your words


Required fields:
Are marked by this sign: *
XHTML:
You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
On comment spam/irrelevance:
Your comment may be moderated or considered as spam by the leprechauns running this server. If you get a 412 error or a mean message, it may be that they thought it was spam: try wording the comment differently or remind me to put up a contact form so you can warn me about the problem.
Of course, once the leprechauns are done doing their magic, I reserve the right to delete any comment for any reason.