This tutorial will explain how to create those very cool signatures that show your phpnuke stats and other informations. It is quite simple once you understand how to create queries. But I will show you how to create a few of the more common queries.
Steps
Create a new php file with your tags <?php ?> . The first thing in our file is to include nuke main functions and variables.
Mainfile.php already has our database connection and variables, so your first part of the code should look like the following:
Next we run a few queries, these are the stats that you want extracted from your nuke database. You can get these or other queries by searching some of your nuke blocks for the ones you need. The ones I will show you are Total Hits, Who's Online and User Count. These are the queries I used, if you understand a little about MySql then you should know what these queries does.
Now we tell the signature what to display on it and what image to use. First I will show you the code then I will explain what each does.
$image = "signature.png"; This part is used to define the png file that will be used in the signature, make sure it is wide and long enough to hold your stats. It is a good idea not to put too much graphics on it so the text can be shown. A nice gradient background will do.
$im = imagecreatefrompng($image); This is saying that the background should be created using the png file.
$wc = ImageColorAllocate ($im, 255, 255, 255); These are colors for your text, it should be written just like that, the only things that can be changed are $wc and 255, 255, 255. The numbers are RGB colors and the $wc is a variable to define the color. You must use a different one for each color.
ImageString($im, 2, 48, 15, "$pageview ", $wc); This part defines what's placed on the signature. The only things that should be changed are 2, 48, 15, "$pageview ", $wc . The first number ( 2 ) is the size of the text. The second and third numbers are the vertical and horizontal alignment (48, 15, ). You will have to continually adjust these to get the text at the perfect spot on the image. This ( "$pageview " ) is the variable defined from the database query. The rest of the code is just to finish the imagecreate function and close php. So your entire php file should look like the following.
Save your php file and upload to your nuke root directory, this is the same folder as config.php and mainfile.php. Create your png image and place inside that folder too. You can test it by linking to your php file. http://www.mysite.com/nuke/signature.php .To use this signature in a forum you would add the following to your signature.
[url=http://www.yoursite.com] [img]http://www.yoursite.com/nuke/signature.php[/img][/url]
Visit our forums for more help! A more detailed tutorial will be created with random images but that will be for subscribers only.