Posted on April 25th, 2007 at 6:09 pm by Andrew
Posted on April 18th, 2007 at 9:46 pm by Andrew
I think everyone starts PHP this way and I remember the satisfaction it gave me when I first used this (back on AlienActivity.com), it's just a nice nifty little tool to get you started on PHP and it's something many sites wouldn't be without!
To keep it simple I've chosen just to use text files rather than databases, you'll need to CHMOD the file you store your counts in to 777. Here goes, once again it's a fairly self-explanatory script that I'll just annotate in-line.
PHP:
-
<?
-
$file = "counts.inc"; // Where we store the counting
-
$counts=$counts+1; // Add 1 to the current counter value
-
-
/* It's worth noting that it is in fact necessery to close the file and re-open it in order to write the incremented count, I originally wrote this script without doing so and discovered an error where it counted up in unuaul integers of 1, 2, 13, 1214, 12131215, for more info please read here: http://www.moon-hosting.co.uk/php/tutorials/PHP_Lecture4 _Files.doc */
-
?>
How easy was that?!
Posted on April 18th, 2007 at 7:33 pm by Andrew
In this tutorial I will be teaching you to make a really basic text on plain/no background system. I'll be using the GD library so check you have that installed ;).
Simple enough idea, you can allow users to edit the text appearing on the image with GET details. The idea is that you can adapt this simple script into your own site. It's been coded for Bozebo so he can use it to put emails in profiles into images and stop bots from grabbing. It can be adapted to take data from a database and display it, you could even make an image verification system with it!
I'm not going to go through it line by line, instead I'll just annotate it as I go. Enjoy...
PHP:
-
<?
-
-
-
-
-
$number = ($number*7)+9; // Times this by 7 and add 9 to make it look the right size.
-
-
$im = imagecreate($number, 24); // Create the basic size, $number x 24
-
-
$colour1 = imagecolorallocate($im, 0, 0, 0); // Background (RGB) black.
-
-
$colour2 = imagecolorallocate($im, 255, 255, 255); // Background white.
-
-
imagestring($im, 3, 5, 5, $text, $colour2); // Add the text to the image.
-
-
imagepng($im); // Create and display the image.
-
-
imagedestroy($im); // Cast the image from the server (will cause lag eventually if you don't).
-
-
?>
Posted on April 18th, 2007 at 6:28 pm by Andrew
Yep, will now be posting intricate and detailed tutorials for all to read. I imagine it'll mostly be php but we'll try some other stuffs too :).
Posted on April 12th, 2007 at 9:13 pm by Andrew
HELLO, I'M BRIAN BLESSED.
LIONS AND TIGERS AND BEARS.. OH MY.
BAI.
Posted on April 10th, 2007 at 4:27 pm by Andrew
Just thought I'd give this a test with some words like lyrics and journey and journey - greatest hits. I like journey myself. Anyway, ignore this post, just a test.
And Turn they will.
Posted on April 10th, 2007 at 1:19 pm by Andrew
Hmm..
Intriguing night was last night. Intriguing indeed. It was Martha's 16th and she had a piss up, her mum returned home at 10ish and hid away in a room for a while but by 10.30ish she'd come out to see the damage and about 11ish she kicked everyone out.. understandibly realy. So I ended up roaming the streets with random people, walked about 5 miles up and down Richmond before returning home at about 1ish. Of course, to return home I had to walk from the other end of town, though town centre..wearing a floral hat.. an old lady's floral hat. Don't worry, I didn't mug an old lady for it. I just casually took it off her hat and walked away wearing it.
Yep.
Night.
Posted on April 2nd, 2007 at 10:29 am by Andrew
Yep, last month saw the accidental break-up of phpBB.com (the V2 edition site) and re-creation into the BB3 version. Looks like all the old mods not saved on things like phpbbhacks have been lost for good. I've, therefore, decided that it'd be a good idea to get to work with phpBB3 and try to get the feel of it for a couple of my sites' sakes.
It's nice. I think the biggest thing is the HUGE numbers of new features. I'm pretty sure it beats vBulletin now.. It's all in OOP. It's just nice. It has a very complex cache system, saving huge amounts of bandwidth and it's database at last has some sense to it!
I've created a theme called RSAlliance.co.uk. I was amazed at just how easy and how clever the template system is. For example, in order to change the size of an image, you first go to the imageset.cfg file, you find the image and dimensions, change it to what you want and save. You'd think that'd do it- Nope. You then have to go to image set control in the styles panel in admin and click Refresh, this loads all the images and their dimensions onto the database, automatically turning any images into template variables and cacheing it. Clever.
Will keep ya posted.
Posted on April 1st, 2007 at 10:03 pm by Andrew
Yeahuh, think I'm neglecting this place, had about 6 posts last month. Perhaps 5. Maybe 7. Either way, it's not good.
Currently I'm spending my days sitting about revising, doing homework and attending various gatherings. The latest being Christians 3rd party, a camp out in one of his massive equistrand fields. I got a huge fire going and tended it as my baby until 5am when max awoke and decided we should walk back. So friday at 5am I was walking from Gilling to Richmond in the pitch black, arriving 7/8ish. Sadly, however, my house was locked and I knew if I went home I'd be stuck so I just sat in town until 9am, watching the various market folk (Savage!!!) unpack and tit about. Anyhow, the party was good fun, mainly caus I got to play with a huge fire, but also down to the general atmosphere, everyone seemed decent, even the twats like Borthwick seemed half-decent. I left with 12 lighters, a hip flask filled with whisky, a carton of soya milk, 6 pints of JS and 30 fire-lighters.. quite a good turnout.
It's the Easter holidays and I'm a bit buggered for stuff to do. I'm off to Max's for a shindig and mess on his PS3 tomorrow. Working some days and paintballing sometime this week or next week. Other than that I'm a little bored.
