2009
11.27

After many hours of searching and not finding any examples for query profiling I liked, I decided to “bite the bullet” and write my own. This extends the default MySQLi class and adds the query profiling I was looking for with a very minimal amount of code. The joys of OOP. :)

<?php
//mysqlii.php

//Create class
class mysqlii extends mysqli
{
	//Create properties
	var $query_time;
	var $query_count;

	//Override default method
	function query($query)
	{
		//Start timer, run query, stop timer
		$query_begin = microtime(TRUE);
		$result = parent::query($query);
		$query_end = microtime(TRUE);

		//Die if query problem
		if($this->error):
			die('An error has occurred! Please try your request again shortly.');
		endif;

		//Set properties
		$this->query_time += $query_end - $query_begin;
		$this->query_count++;

		//Return query results
		return $result;
	}
}
?>

Usage example. This also includes page profiling.

<?php
//Start timer
$page_begin = microtime(TRUE);

//Include new class
include('mysqlii.php');

//Open connection to database
$db = @new mysqlii('host', 'username', 'password', 'database');

//Die if connection error
if($db->connect_error):
	die('Unable to connect to the database!');
endif;

//Build and run query
$query = "SELECT * FROM test";
$db->query($query);

//Continue your code

//Close connection to database
$db->close();

//Stop timer and set variable
$page_end = microtime(TRUE);
$page_time = $page_end - $page_begin;

printf('Page generation: %fs', $page_time); //Page generation: 0.257650s
printf('DB queries: %u (%fs)', $query_count, $query_time) //DB queries: 1 (0.002195s)
?>
2009
11.27

I know it hasn’t been long since the last release but this version brings many new features that I feel shouldn’t wait.

This version includes the following changes:

  • Added action confirmation
  • Minor adjustments to the top stats page
  • Changed signature font to DejaVu Sans Mono
  • Added ogame.cz to domains
  • Redesigned changelog and faq pages

Enjoy.

2009
11.22

This version includes the following changes:

  • Code optimizations
  • Added FAQs
  • Added top stats (currently showing top 10)
  • Added information to the footer

Enjoy.

2009
11.18

After many months of anticipation Apple has finally approved Trillian for iPhone!

2009
11.17

I hear more and more people around me talking about playing OGame from their mobile phone and I thought to myself “This would be a good time to blog about the Mobile Skin I host.” This skin is very similar to the default one with 2 changes:

  • Coloring for different missions on the Overview
  • No background image

The background image was removed to help speed up load times on mobile phones.

I have used this skin day in and day out for months and I love it. It’s default, functional and fast. Without further ado I preset the URI:

http://mirror.id10t.us/skins/mobile/

Please keep the following in mind:

  • You cannot visit this URI directly. Please place it in your Skin path.
  • Copy the entire URI including the trailing slash if you decide to use this skin.
  • This is identical to the “iPhone specific” skin I host.
2009
11.15

This version includes the following changes:

  • Added “Remember Me” (with profile options)
  • Fixed the empire view reader for Google Chrome
  • Fixed negative planet temperature bug (again)

Enjoy.

2009
11.11

Universe Fornax, the 64th Universe at ogame.com.es, opened today. This Universe runs at 4x the normal speed and sports the new 1.x redesign. It has already been added to the Mine Signatures and Emergency Login menus. Enjoy.

2009
11.11

Universe Draco, the 44th Universe at ogame.it, opened today. This Universe runs at 4x the normal speed and sports the new 1.x redesign. It has already been added to the Mine Signatures and Emergency Login menus. Enjoy.

2009
11.10

Universe Electra, the 48th Universe at ogame.org, opened today. This Universe runs at 4x the normal speed and sports the new 1.x redesign. It has already been added to the Mine Signatures and Emergency Login menus. Enjoy.

2009
11.10

After setting up a few WordPress blogs for other people I finally decided to set one up for myself. phpBB is great but it just doesn’t cut it for me anymore so this will replace BOTH phpBB forums.

Stay tuned for more updates.