Tagged: php Toggle Comment Threads | Keyboard Shortcuts

  • Joe 00:16 on November 8, 2006 Permalink
    Tags: php   

    WP Themes and Microsummary plugin 

    After a few more bug reports, I updated my WP-Microsummaries plugin again.

    This time, I removed all fancy rewrite stuff, which didn’t play well with some custom rewrite rules. That should be fixed now.

    Also, I tested the plugin with the upcoming WordPress v. 2.1 (alpha 3). And it appears to work just fine.

    Finally, there were reports about missing wp_head() calls in some WordPress templates. That is a problem, because wp_head is a so called hook that is needed for plugins to insert stuff into the html head section of the blog pages.

    (More …)

    • Otto 02:32 on November 9, 2006 Permalink

      Nice. I was going to do this after I noticed this in FF 2.0, but you did it for me. 🙂

      Tip: In the plugin, if you change “get_settings(‘home’)” to “$_SERVER[‘REQUEST_URI’]”, then you’ll find it will also work for categories, pages, archives, even single posts. So if somebody bookmarks a category, they will see only the latest in that category.

      However, the plugin will currently only work with “pretty” permalinks. You may want to consider supporting those people with normal permalinks as well.

  • Joe 23:18 on October 17, 2006 Permalink
    Tags: , Java, JSON stream, php   

    PHP, Reflection and JSON: stream your objects 

    Amongst all the improvements in PHP 5 is the concept of Reflection. If you’re a Java person, you will be familiar with this concept.

    In just a few words, Reflection means that Objects are open to (self-) inspection, so that you can interrogate an object for all kinds of properties at runtime.

    Now if you have classes with getter (and setter) methods, there are some very elegant techniques with reflection. Normally, these getters and setters are used to give access to the data contained in the object. Good Object Oriented practice makes use of these Data Objects to build a clean boundary between the data and implementation details.

    So, let’s assume that you have painfully crafted a class definition with accessors and you want to serialize the contained data as JSON over the wire. Of course, you can write a getJsonString() method for every class. But Reflection gives you a much nicer option.

    An example of serialization into JSON, entirely based on Reflection:
    (More …)

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc

Twitter links powered by Tweet This v1.8.3, a WordPress plugin for Twitter.