Archive

Archive for the ‘Internet’ Category

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:

Windows Live Writer

August 14th, 2006 Mark 1 comment

Due to holidays and now illness (flu!), I’ve been away from the online world for a couple of weeks.. however few posts on my Google Reader subscription list were regarding this new Windows Live Writer.. so I decided to post this from it!

It’s good, I got it setup in less than a minute, detected my WordPress and can download existing posts and hopefully post new stuff (this :) )

The interface is clean and it even downloads your current theme to preview your posts as they would appear on your weblog.. nice

I’ll post a more detailed review after I’ve had more chance to use it, right now however I’m a bit under the weather so will retire now back to bed!

Categories: Internet Tags:

New Netscape Exploited

July 26th, 2006 Mark 3 comments

It seems the new netscape digg clone has a few unfortunate bugs!

Netscape exploit screenshot thumb

Netscape exploit message

Whoever did it only used alert to put up a couple of messageboxes, I think a digg.com redirect would’ve been better for comedy value :)

Categories: Internet Tags:

StumbleUpon, Analytics, Mint & Adsense!

July 13th, 2006 Mark No comments

People who read this blog (yes, that’s you two over there!) might know that I’m currently working on a health/fitness/bodybuilding website in my spare time

We’ve created a pretty useful exercise encyclopedia full of instructional exercise videos

The only problem is getting it noticed! I don’t really want to pay for a link from a high traffic/high PR website.. I want the SEO to be natural, i.e. site geared for optimal user experience = natural SEO

I stumbled upon an interesting site that helps you to discover great websites on the web that others have visited and rated highly. Yesterday I placed a comment on Coopers Guns via StumbleUpon and since then there’s been a steady stream of traffic from StumbleUpon.. the techy nature of the users of StumbleUpon means little to no ad revenue but I’m more interested in mere eyeballs at the moment

Here’s some Analytics graphs to illustrate the above:

Visitors and Page Views

Visits By Source

Geo Map Overlay

New vs Returning Visitors

I’ve also purchased a licence for Shaun Inman‘s Mint.. I like analytics but Mint gives me a clearer and more concise picture of 0-second statistics

Most visitors to the site use Firefox:

Browser Family

And not many use a resolution below 1024×768 (thankfully!)

Screen Resolution

I was a bit worried that Adsense wasn’t counting impressions properly as the “page view” count difference between Analytics and Adsense was off by quite a margin. I realised though that quite a lot of savvy/techy web surfers actually use stuff like adblock, etc… that explains the difference!

Categories: Internet, WebDev Tags:

Spam email subjects list

July 7th, 2006 Mark No comments

The spam quarantine directory on my mail server just reached around ~200MB and ~22k emails so I decided it was time for a cleanout.. before that though I compiled a list of the subjects from all the emails for your viewing pleasure!

spam subjects list

spam subjects top 100

Categories: Internet, SysAdmin Tags:

Google Reader Update

June 28th, 2006 Mark No comments

I don’t know how long this update has been out but Google have finally added a fast way to limit your reading list to a certain subscribed feed or label set.. about time too! :)

Google Reader Update Screenshot
Categories: Internet, Opinion Tags:

Unobtrusive onkeypress with behaviour.js

June 21st, 2006 Mark No comments

The following seems to work quite well for some AJAXified forms I have (a behaviour.js rule):

'#form_field_id' : function(element){
	element.onkeypress = function(e){
		e = (e)?e:window.event;
		var kc = e.keyCode ? e.keyCode : e.charCode;
		if(kc == 13) {
			do_something();
			return false;
		}
	}
}
Categories: Internet, WebDev 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:

Google Spreadsheets

June 6th, 2006 Mark 1 comment

Just seen this on DiggGoogle Spreadsheets

Google Spreadsheets

Looks very interesting!

Categories: Internet Tags:

Medion MD40734 XP SP2 SIS AGP fix

December 22nd, 2005 Mark 12 comments

If you’ve got a Medion MD40734 laptop and are having trouble getting Windows XP SP2 to function (garbled/frozen screen on bootup, even safemode won’t work) then this is for you..

You can get Windows working if you boot with your XP CD and go to the recovery console.. then type:

disable uagp35
exit

Now windows will boot but your display will be extremely slugish

That should sort it out for you

Categories: Hardware, Internet, Windows Tags: