Okay.. you may have or may not have noticed that I have made some coding changes to the site, I now have the menu, header, footer and image in seperate files and using PHP Include I have “embedded” them in to the page.
You will notice now that on the main site the photo is chosen at random (out of 4 or 5 photos I think), I like this because it means i can add more photos or change it at a later date.. this is also in a document i am using for PHP include, so if i wanted to add more photos I wouldn’t have to edit every page to do it.
I know, i havent yet changed the theme on my blog and it is “default” i will be getting round to this but at the moment i have more important things to do.. I have had to find time to even write this blog post….
Just to be geeky.. hehe, here are the pages that are used in PHP Include (If you have time to take a look)
This means i can change say the “menu.php” document and it will change the Menu on every page…
Also on image.php you will see that it shows a random picture, like it does above the Links bar.. here is the coding that makes that work (It is quite complicated but oh well)
/* show a random pic */
$pics = Array();
/* define pics here, start from 0, no gaps between numbers allowed */
$pics["src"] = "cool.jpg";
$pics["txt"] = "Me =)";
$pics["src"] = "fueholiday2007.jpg";
$pics["txt"] = "Fuerteventura 2007";
$pics["src"] = "beer.jpg";
$pics["txt"] = "Enjoying Glass of Beer =)";
$pics["src"] = "bass.jpg";
$pics["txt"] = "Playing bass in Eric's studio";
$pics["src"] = "blue.jpg";
$pics["txt"] = "Niall's blue hair";
/* end of pics */
/* make random number generator more random */
srand((double) microtime() * 1000000);
/* choose a random number */
$i = rand(0, (count($pics)-1));
$img = $pics[$i]["src"];
$txt = $pics[$i]["txt"];
/* output the tag */
Its i suppose quite hard to understand for a beginner, for people who understand PHP, they will know what that means.
So yh.. some major changes (mainly PHP Include) and also the “updating picture thing”
Thanks for reading,