November 13, 2009

Generating a url using PHP

I was just adjusting a plugin on my blog, when I needed to shrink urls on the fly with

function getShortUrl($url) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, '' . $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 3);
$ret = curl_exec($c);
return $ret;

Have fun generating those links.

August 25, 2007

PHPIDS for wordpress

My first attempt to write a plugin for wordpress. It enables phpids for wordpress. There is no way yet to configure it. If I have time I will implement this feature as well as a Filter autoupdater.

Installation is easy:

  1. Copy the contents of the file to your wp-content/plugins folder
  2. Enable the plugin in the admin menu
  3. chmod 777 the file in wp-content/plugins/phpids/log.txt

tar.gz download here

zip download here

NOTE: check for new Filter releases at phpids to update the filter.