./paulOr

Eat bandwidth for breakfast!

WordPress Malfunctions

Posted on Mon 23rd Aug 2010 · Web · 0 Comments

If for any reason something happens to stop working on your WordPress install which appears to have happened for no damn reason; deactivate all plugins and reactivate one-by-one, checking the site each time one is activated.

99.999999999999999999% of the time its due to shoddy poetry within a plugin.

The exception to the rule is when you have WordPress installed under Magento, oh the rage.

</advice>

Parsing CSV files with PHP

Posted on Thu 1st Jul 2010 · Development · 0 Comments

Today at work I had the amazing job of importing around 50 different artists profiles in to a database - each with about 12 different columns of values in a CSV file.

I could copy & paste it from the document - or create a quick little import script... Yea, I made an import script :]

<?php
	$file_handle = fopen("file.csv", "r");
	while (!feof($file_handle)) {
		$data = fgetcsv($file_handle, 1024);

		## PARSE THE VALUES OF EACH CELL
		## STARTING AT 0 AND WORK YOUR WAY ALONG
		$data[0].'<br />';
		$data[1].'<br />';
		$data[2].'<br />';
		$data[3].'<br />';

		## AND SO ON...
	}

	fclose($file_handle);
?>

Show/Hide Elements w/ jQuery

Posted on Tue 29th Jun 2010 · Development · 0 Comments

I'm currently making a site which requires a rollover on an image that will show the images name and a description in a div which appears on hover.

Heres how I've done it.

<!-- JQUERY FROM GOOGLE AND JS UNDER IT -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$(".image_slide").hover(
		function() { $(this).children('.slide_info').show(); },
		function() { $(this).children('.slide_info').hide(); }
	);
});
</script>

<!-- HIDE BY DEFAULT WITH CSS :] -->
<style>
.slide_info {
	display: none;
}
</style>

<!-- HTML ELEMENTS -->
<div class="image_slide">
	Image
	<span class="slide_info">Image info & Description</span>  
</div>
<div class="image_slide">
	Image
	<span class="slide_info">Image info & Description</span>  
</div>
<div class="image_slide">
	Image
	<span class="slide_info">Image info & Description</span>  
</div>

Even Ninjas Have Dishes To Do

Posted on Fri 25th Jun 2010 · Video · 2 Comments

To the top!