Archive

Archive for the ‘Website’ Category

Dropbox File Sync Available & Works With Vista MKLINK Symbolic Links

September 15th, 2008 Mark 1 comment

Just a quick post about Dropbox – it’s now out of beta and anyone can sign up.. I just have and I was pretty glad to find out that you don’t need to copy all your stuff into the folder that Dropbox creates on each machine (at least with Vista).

If you’re using Vista, navigate to your Dropbox folder via the command line and type:

mklink

e.g.

mklink CM2004 c:\projects\cm2004

Now Dropbox is happily syncing away as if the folder had just been copied into the Dropbox folder

WordPress Upgrade

August 13th, 2007 Mark No comments

I’ve upgraded WordPress on this domain to the latest version and will be upgrading all my other WordPress installs as soon as possible. Someone managed to upload an eggdrop via a WordPress 2.0.6 exploit..

Some stuff isn’t looking quite right, e.g. code in posts is currently bursting out of the content space into the sides – I’ll fix it as soon as I get a minute

Categories: Website Tags:

Loss of traffic headache!!

July 18th, 2007 Mark No comments

If you change the structure of your website, check the damn AdWords Ads still point to the correct location!

Doh..

Categories: Website Tags:

*nix – deleting all files in a folder (0000′s)

May 8th, 2007 Mark No comments

When ‘rm’ says ‘too many arguments’, use the following to erase all the files in a folder:

find . -type f -print | xargs -n 20 rm
Categories: Linux, SysAdmin, Website Tags:

Why isn’t Amavis scanning certain mails?

October 19th, 2006 Mark No comments

Doh.. because they’re too big!

I noticed in my mail server logs that some emails weren’t getting SA scanned and tagged and wondered why.. they weren’t internal emails and should have been scanned.. then I remembered that there’s a size limit to the scanning :)

Categories: SysAdmin, Website Tags:

WordPress: Speed up ‘Manage Pages’ admin page

September 25th, 2006 Mark 1 comment

One of my websites about health, fitness and bodybuilding uses a lot of pages in WordPress (i.e. uses WordPress as a CMS)

The Manage -> Pages screen always times out (php script >30sec execution time)

The solution is to edit admin-functions.php and find the ‘page_rows()’ function

Now comment out the following line:


   start_wp();

so it looks like this:


   // start_wp();

Voila, almost instant listing of all pages. I’m quite sure that ‘start_wp()’ function has no place there anyway after reading the description of what it does

Categories: Website Tags:

phpBB mods: bbcode for ifilm, youtube and google video embedding

September 21st, 2006 Mark 16 comments

I wanted to be able to embed videos from various services into forum posts on CoopersGuns Health, Fitness & BodyBuilding Forums so I decided to have a play with modifying the bbcode processor and here’s what I’ve come up with..

Modification instructions

Make the following modifications to forum/includes/bbcode.php

  • Find the bbencode_first_pass function
  • Locate the end of the function

	// Remove our padding from the string..
	return substr($text, 1);
  • Add the following just before the above:

	// [ifilm] and [/ifilm]
	$text = preg_replace("#\[ifilm=([0-9]+[,][0-9]+[,][0-9]+)\](.*?)\[/ifilm\]#si", "[ifilm=\\1:$uid]\\2[/ifilm:$uid]", $text);

	// [youtube] and [/youtube]
	$text = preg_replace("#\[youtube=([0-9]+[,][0-9]+[,][0-9a-z\-_]+)\](.*?)\[/youtube\]#si", "[youtube=\\1:$uid]\\2[/youtube:$uid]", $text);

	// [gvid] and [/gvid]
	$text = preg_replace("#\[gvid=([0-9]+[,][0-9]+[,][0-9a-z\-_]+)\](.*?)\[/gvid\]#si", "[gvid=\\1:$uid]\\2[/gvid:$uid]", $text);
  • Find the bbencode_second_pass function
  • Locate the part that deals with [QUOTE]

	// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
	$text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text);
	$text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text);
  • Add the following code after the above:

	// [ifilm] and [/ifilm]
	$text = preg_replace("#\[ifilm=([0-9]+)[,]([0-9]+)[,]([0-9]+):$uid\](.*?)\[/ifilm:$uid\]#si", "", $text); 	

	// [youtube] and [/youtube]
	$text = preg_replace("#\[youtube=([0-9]+)[,]([0-9]+)[,]([0-9a-z\-_]+):$uid\](.*?)\[/youtube:$uid\]#si", ""."[/youtube:$uid]", $text);
	$text = str_replace("[/youtube:$uid]", "", $text); 		

	// [gvid] and [/gvid]
	$text = preg_replace("#\[gvid=([0-9]+)[,]([0-9]+)[,]([0-9a-z\-_]+):$uid\](.*?)\[/gvid:$uid\]#si", ""."[/gvid:$uid]", $text);
	$text = str_replace("[/gvid:$uid]", "", $text);
  • Save your changes to bbcode.php and upload the modified file (if you downloaded it to modify)

That’s it.. you can now embed iFilm, YouTube and Google Video videos into your forum posts

Usage

The syntax is similar for all three:

[ifilm=width,height,id]description[/ifilm]

[youtube=width,height,id]description[/youtube]

[gvid=width,height,id]description[/gvid]

Example:
CoopersGuns Health, Fitness & BodyBuilding Forums Post

Categories: Internet, Programming, Website Tags:

WordPress 2.0.4

August 17th, 2006 Mark 1 comment

I’ve just updated this site to use WordPress 2.0.4 (was using 2.0.3 + a plugin which fixed a few 2.0.3 flaws).

Unfortunately I forgot that I’d manually modified the k2 theme and overwrote my changes with the update.  My sidebar has therefore resorted to its former glory and is missing my dugg items and Google starred items.. did I have a backup anywhere?  of course I didn’t!

Oh well, I’ll add them back again when I get a minute

Thankfully, I’m feeling a little better now, still have a nasty cough though which is quite annoying

Categories: Website Tags:

Google Reader Starred & Dugg Items Added

July 5th, 2006 Mark No comments

I’ve added a couple of new lists to my sidebar:

  • Google Reader Starred Items (Most recent 20)
    • I generally star items that are of interest to me from the many RSS feeds I subscribe to)
  • Recently Dugg Stories (Most recent 20)
    • Just interesting stories I’ve seen on digg and dugg!

I ended up burning the source feeds with Feedburner and using MagpieRSS to read them – didn’t really want to do it this way but had a lot of issues with both MagpieRSS and SimplePie when trying to parse Atom feeds (e.g. Google Reader starred items)

Categories: Website Tags:

WordPress 2.0.3 bugs & fix

June 7th, 2006 Mark No comments

I’ve updated most of my WordPress installs to 2.0.3 and there’s a few dodgy bugs which are quite annoying – confimation when editing stuff that shouldn’t be there and also extra backslashes being inserted when editing things

Fortunately Mark Jaquith has produced a plugin which fixes these bugs

Categories: Internet, WebDev, Website Tags: