For most people that find and read this blog, this new website created by Google will not be that useful (although its still a fun visit for their use of CSS3 and Javascript) as you probably already know most if not all of the content.

However, with the holidays coming up, you will find yourself surrounded by many family members and friends that “don’t quite get it” or really don’t have a clue as to what you do, and how the “Internets” provide them with pretty pictures when they click on that “Blue E” on their desktop.

When that happens, grab your laptop and show them this:

20 Things I Learned about Browsers and the Web

What you will find is an immersive (it’s navigation is setup like a book) engaging, and informative website covering a wide variety of subjects ranging from Cloud Computing to HTML5 to How Modern Browsers can Protect you from Malware and Phishing.

Enjoy, and wishing all of you a safe and happy holiday season!

07
Dec

December 1st – 24th has become an especially rewarding time for web developer geeks.

I believe “24 Ways” was the first, starting up in 2005, but several more have popped up in other areas such as PHP, HTML5, and performance. Check in on each of the links below, once a day til the end of the advent season for useful web related tips, tutorials, and inspirations!

http://24ways.org/ — The original, and covers a wide range of web related topics – 6 years running!

http://html5advent.com/ – new this year, a visual treat with links to some fun HTML5 examples

http://phpadvent.org/ – PHP, a server side language

http://calendar.perfplanet.com/2010/ – web technology performance tips

If you know of any that I haven’t listed, please leave a comment.

Enjoy, and Happy Holidays!

Since, it took me over an hour to diagnose and fix this issue in one of my own WordPress installations, I thought I would write up a quick how-to on the solution to this issue to hopefully save others in wasting their own time.

Symptom:

Accessing the Edit screen via WordPress Admin showed a blank screen in several versions of WordPress 2.8. The rest of the Admin was working fine.

Cause:

I use Subversion to automate the update/upgrade to new versions of WordPress. This has worked great for me for awhile without incident. In the most recent update, the post.php file was updated and the Subversion update command changed the ownership of the file to the user root, which my script was running as.

This permission changed caused a subtle PHP error, and since the recent version of PHP 5 on my server has the default behavior of not displaying errors – a blank white screen was being shown in WordPress.

Fix:

Reset the permissions recursively on your entire WordPress install.

For example, if your user and group were joesmith and users, run the following command at the root of your WordPress install folder:

chown -R joesmith:users *

You should then be back in business!

So the moral of this story is, if you update your WordPress blog via Subversion – fix your file permissions afterwards.

When I set out to add database driven player info at NuggetsHoops.com, I knew that I wanted to include code that would display some of the many images that I had set aside for each NBA player. I also knew that I would continue to add new pictures. Application code that could easily display old and new images, without additional effort for each added image would work best.

I had already written PHP code that could look at a folder and create a list of images to be displayed. When I ran across the powerful jQuery Cycle Plugin, I had found a great way to display them.

Let’s get coding. This tutorial depends on PHP 5, jQuery 1.2.3 or later, jQuery Cycle Plugin version 2.51 or later.

Add the following Javascript to your PHP/HTML to enable and call the Cycle Plugin:

 Javascript |   |? 
1
<script src="/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
2
<script src="/scripts/jquery.cycle.all.min.js" type="text/javascript"></script>
3
<script type="text/javascript">
4
$(document).ready(function(){
5
	$('#myslides').cycle({
6
		fit: 1
7
	});
8
});
9
</script>

Note that there are many options and styles of animation provided by the powerful Cycle plugin.

Add the following PHP to iterate over any folder and dynamically generate img tags using any images found in the folder:

 PHP |   |? 
01
$directory = 'images/players/' . $row['imageName']; 
02
try {    
03
	// Styling for images
04
	echo "<div id=\"myslides\">";
05
	foreach ( new DirectoryIterator("../" . $directory) as $item ) {			
06
		if ($item->isFile()) {
07
			$path = "/" . $directory . "/" . $item;
08
			echo "<img src=\"" . $path . "\" />";
09
		}
10
	}
11
	echo "</div>";
12
}
13
catch(Exception $e) {
14
	echo 'No images found for this player.<br />';
15
}

Any img tags within an HTML element of class ‘myslides’ (or whatever you initialized the Cycle plugin with in the Javascript) will have the slideshow behavior added to it. The $row array on line 1 is referencing a database query result, but could be set in a number of ways for your specific needs. The DirectoryIterator reference on line 5 is a builtin class in PHP5.

Here’s the CSS to style the images being displayed in the slideshow:

 CSS |   |? 
01
#myslides {
02
width: 340px;
03
float: right;
04
        padding: 0;
05
        margin:  0 auto;
06
margin-top: 20px;
07
} 
08
 
09
#myslides img {
10
    padding: 10px;
11
    border:  1px solid rgb(100,100,100);
12
    background-color: rgb(230,230,230);
13
    width: 320px;
14
    top:  0;
15
    left: 0
16
}

So, there’s a very quick walk thru a working example to generate a dynamic slideshow from any folder of images. If you’d like a full download of the code, or any further explanation, please leave a comment!

You can see this code in action by just clicking on any player’s name at the NuggetsHoops.com Roster page.

New – download the code for this Tutorial

Code for Dynamic Image Slideshow with PHP and JQuery (4039)

Demo

One of the best presents a web developer can receive thru-out the year has arrived in December each of the last four years. 

If you have been a web developer during that span, you most likely are already aware, but just in case, I will share with you:

2008 24 Ways

Each year, a new web themed tip is posted each of the 24 days leading up to Christmas, in a fun holiday themed format. These tips are individual gems, all coming from internet industry super-stars and difference makers.

So do yourself a favor this holiday season and grab your laptop, another glass of eggnog, and head over to 24 Ways and bask in the generously shared ideas and knowledge.

Happy Holidays to All from AmpedWebStandards.com!

Get Adobe Flash playerPlugin by wpburn.com wordpress themes