[Tutorial] Server stats signature
#1

Greetings, i decide to make a tutorial how to make the server stats signature.

I have to explain to you just one thing,that thing is "createsig.php" (HOW TO CREATE):

Quote:

<?php
include_once("functions.php");
$sign = !isset($_GET['s']) ? 1 : $_GET['s'];
$uname = !isset($_GET["name"]) ? "None" : $_GET['name'];
// Connection & Website Settings
$ftpad = "ip-adress";//Write IP Adress for server FTP
$ftpuser = "username";//Write username for server FTP
$ftppass = "pass";//write password for FTP server
$comm = "SAMP";
$weburl = "www.zbsamp.com";
$usersdir = "/scriptfiles";//Where are accounts...
//
$ftpcon = ftp_connect($ftpad,21) or die("ERROR");
$login = ftp_login($ftpcon,$ftpuser,$ftppass);
$uname = "";
* * * *$ime = $_GET['name'];
ftp_pasv($ftpcon,true);
$fhandle = fopen("tempsign_".hash('sha256',"$ime").".tmp","w+ ");
ftp_fget($ftpcon,$fhandle,"$usersdir/$ime.ini",FTP_ASCII);
$str = parse_ini_file2("tempsign_".hash('sha256',"$ime"). ".tmp");
fclose($fhandle);
* * * *$skin = $str['pSkin'];//Definition of players skin in .ini file
$rImg = ImageCreateFromPNG("./signs/1.png");//Signature piceture
if (file_exists("./signs/skins/$skin.jpg"))
{
* *$skinImg = ImageCreateFromjpeg("./signs/skins/$skin.jpg");//Create piceture of players skin in signature
}
else
{
* *$skinImg = ImageCreateFromjpeg("./signs/skins/0.jpg");//else if skin doesen't exist
} *
$cor_black = imagecolorallocate($rImg,0,0,0);
$cor_blue = imagecolorallocate($rImg,0,0,255);
$cor_lblue = imagecolorallocate($rImg,30,144,255);
$cor_green = imagecolorallocate($rImg,69,139,116);
$cor_red = imagecolorallocate($rImg,220,20,65);
$cor_wh = imagecolorallocate($rImg,255,255,255);
if(ftp_size($ftpcon,"$usersdir/$ime.ini") == -1 || $ime == "None")//Checks if player account exist
{
* * echo "<center><br/><br/><br/><br/><font color='#FF3333'>That player doesen't exist<br/><br/></font></center>";
return 1;
}
else//if exist
{
ftp_pasv($ftpcon,true);
$fhandle = fopen("tempsign_".hash('sha256',"$ime").".tmp","w+ ");
ftp_fget($ftpcon,$fhandle,"$usersdir/$ime.ini",FTP_ASCII);
$str = parse_ini_file2("tempsign_".hash('sha256',"$ime"). ".tmp");
fclose($fhandle);
imagettftext($rImg,11,0,127,48,$cor_wh,"gothicb.TT F",urldecode($ime));//Players name
imagettftext($rImg,11,0,139,66,$cor_wh,"gothicb.TT F",urldecode($str['pLevel']));
* * * * * * * *imagettftext($rImg,11,0,172,85,$cor_wh,"gothicb.T TF",urldecode($str['pExp']));
* * * * * * * *imagettftext($rImg,11,0,140,104,$cor_wh,"gothicb. TTF",urldecode($str['pDeaths']));
* * * * * * * *imagettftext($rImg,11,0,310,67,$cor_wh,"gothicb.T TF",urldecode($str['pTimeOnline']));
* * * * * * * *imagettftext($rImg,11,0,313,85,$cor_wh,"gothicb.T TF",urldecode($str['pKills']));
* * * * * * * *imagettftext($rImg,11,0,286,104,$cor_wh,"gothicb. TTF",urldecode($str['pRatio']));
* * * * * * * *imagecopymerge($rImg, $skinImg, 6,6,0,0,80,100,100);
//Writes players information on signature

}
ftp_close($ftpcon);
unset($str);
unset($ftpad);
unset($ftpuser);
unset($ftppass);
unset($ftpcon);
unset($login);
header('Content-type: image/png');
imagepng($rImg);
* * * *imagepng($skinImg);
?>

How looks empty signature:



[size=12pt]Download .rar:[/size] http://www.solidfiles.com/d/dd60b04009/ (Croatian language,just copy ENG version of createsig.php (izradapotpisa.php)
[size=12pt]Demo:[/size] www.xeptic.info/dmpotpisi
Reply
#2

Meh, this ain't a Tutorial man.
Reply
#3

[Tutorial] How to write a tutorial
Reply
#4

Quote:
Originally Posted by gtakillerIV
View Post
Meh, this ain't a Tutorial man.
^^. Learn to write a tutorial first dude.
Reply
#5

Um, Thank You. However, this isn't a tutorial. If i didn't know PHP I'd be looking at a bunch of random numbers, symbols, and letters.

I can't even say you tried, Sorry mate.
Reply
#6

My apologises !

I will make a new one or edit this one a soon as possible.


And i'm sorry for croatian language in the signature...
Reply
#7

tags exist. Use them!
Reply
#8

You should've post it here

http://forum.sa-mp.com/forumdisplay.php?f=82
Reply
#9

Also can you make with mysql please.
Reply
#10

I made one similar to this, you just made it better and secure and nice ! Congrats for that. But yes, explanations needed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)