Archive for the "Code" Tag

Filed in: , , ,
Posted On: 2008 / 07 / 02

A WordPress install is a bunch of directories and files, but two of them are particular: the file wp-config.php and the directory wp-content/ are personal and don't get overwritten when you upgrade your blog. In WordPress 2.6, they get so personal that you can even move them out of the WordPress root. This must bring [...] → Read more

Filed in: , , ,
Posted On: 2008 / 06 / 30

Stephen, on his geek blog Nerdaphernalia, is running a series of excellent posts giving advices to plugin authors for neat subtle effects: adding a "Configure" link right next to the "Activate" link on the Plugins page, or how to give credit to your plugin without cluttering the page (I'm a big fan of the "Configure" [...] → Read more

Filed in: , ,
Posted On: 2008 / 05 / 16

I've updated my Projects page, which was missing quite some works. It should now be up to date with all the stuff I've coded in the past few years. Hey, this page is starting to give me a little warm feeling of pride ;)[...] → Read more

Filed in: , ,
Posted On: 2008 / 04 / 27

For my next stuff I needed the Javascript equivalents of PHP functions basename() and dirname(). Nothing genius: PLAIN TEXT JAVASCRIPT: function basename(path) {     return path.replace(/\\/g,'/').replace( /.*\//, '' ); }   function dirname(path) {     return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, '');; } It obviously supports paths like /home/ozh/stuff.php, http://site.com/file.ext or double backslashed Win32 paths such as [...] → Read more

Filed in: , , ,
Posted On: 2008 / 03 / 28

WordPress 2.5 comes with a very handy API that plugin authors should love: shortcodes, ie. BBcode-like tags, that are parsed when found in post contents. The API is very easy to use, and well done enough that it's relatively foolproof. Shortcode types The API allows for all the possible combinations and forms you'd think of: [...] → Read more

PLAIN TEXT PHP: query_posts($query_string.'posts_per_page=-1');        while(have_posts()) {        the_post();        the_time();        the_title(); } This will display the time and title for all your posts. This could result in a very long page, and a more usable way of doing it would be to change the posts_per_page [...] → Read more

Filed in: , , , ,
Posted On: 2007 / 11 / 23

I named 47 HTML elements in 5 minutes. Damn. I missed 44.[...] → Read more

Filed in: , , , ,
Posted On: 2007 / 10 / 27

If you have shell access to your webserver, upgrading to the latest WordPress build can be a matter of painless seconds. As usual there is more than one way to do it, and here is one of these ways -- the script I am using. PLAIN TEXT CODE: #!/bin/bash CURDIR=$(pwd) SITE="http://yoursite.com/blog" echo Updating WordPress in [...] → Read more

Filed in: , , , ,
Posted On: 2007 / 10 / 10

Yet another minor update for Who Sees Ads which was requested by people using popularish and conflicting plugins: ImageManager and WP-Contact-Form. Current version of Who Sees Ads, 1.2.2, adds support for WP-Contact-Form's terrible code. I hate to say this and I mean no offense to Ryan who wrote the plugin, but the code is really [...] → Read more

Filed in: , , ,
Posted On: 2007 / 08 / 26

Hot from the press: I got 4th spot (also known as "Consolation Prize":) at the WordPress Plugin Competition, with my (uberleet) plugin Who Sees Ads (also known as "The Ultimate Ad Management Plugin"). I'm pretty happy about it, especially given how my plugin is not geared toward the majority of WP users: most are not [...] → Read more