Pini: PHP Ini File System | v1.1 (Dini in PHP)
#1

As you can see in title, it's PHP Ini File System, you can manage your files with PHP. It's originaly created by DracoBlue and it's wrapped into PHP by DowNlOaD_(Me) and Gamer_Z.

A lot of people are happy to hear that MySQL Plugin exists for SA-MP and want to use it, but files are much better and quicker, databases would totally lag your server if it would not be on the same host.

Functions:
• pini_Exists($filename);
• pini_Remove($filename);
• pini_Create($filename);
• pini_Get($filename, $key);
• pini_IntGet($filename, $key);
• pini_Set($filename, $key, $value);
• pini_IntSet($filename, $key, $value);
• FTP_pini_Exists($filename, $host, $user, $password, $path);
• FTP_pini_Remove($filename, $host, $user, $password, $path);
• FTP_pini_Create($filename, $host, $user, $password, $path);
• FTP_pini_Get($filename, $key, $host, $user, $password, $path);
• FTP_pini_IntGet($filename, $key, $host, $user, $password, $path);
• FTP_pini_Set($filename, $key, $value, $host, $user, $password, $path);
• FTP_pini_IntSet($filename, $key, $value, $host, $user, $password, $path);
• udb_encode($nickname);
• udb_decode($nickname);
• udb_hash($buf);

Example:

Code:
<?php

include('pini.php'); //includes Pini :)

//Example of how to use Pini in PHP

$ftp_server = "***"; //Server
$ftp_user = "***"; //User
$ftp_pass = "***"; //Pass

//Connecting with FTP
$conn_id = ftp_connect($ftp_server);
ftp_login($conn_id, $ftp_user, $ftp_pass);

if(!empty($_POST[submit])) //Checks if submit button has been pressed
{
	$res = ftp_size($conn_id, 'scriptfiles/'.udb_encode($_POST[nick]));
	if ($res != -1) //checks if file exists, you could use pini_Exists if the file would be on the same host
	{
		ftp_get($conn_id, udb_encode($_POST[nick]), 'scriptfiles/'.udb_encode($_POST[nick]), FTP_BINARY); //saves the file
		echo 'You are viewing stats of '.$_POST[nick].'<br />';
		echo 'Player has $'.pini_Get(udb_encode($_POST[nick]), "Money").' dollars!'; //reads the ammount of money
		unlink(udb_encode($_POST[nick])); //deletes the file
	}
	else //if file does not exist, this message shows up :)
	{
		echo 'User '.$_POST[nick].' is not registered!';
	}
}
else //if submit button has not been pressed
{
	echo '<form action="'.basename($_SERVER['SCRIPT_FILENAME']).'" method="post">Enter player\'s nickname: <input type="text" name="nick"><br /><input type="submit" 

value="Submit" name="submit"></form>';
}

ftp_close($conn_id); //closes the connection

?>
Downloads:

v1.0
Download 1 (If that doesn't work, try the other one)
Download 2

v1.1
Download 1
Download 2


More functions will be added in few days

PLEASE REPORT ANY BUGS
Reply
#2

What does that example do?
Check the submitted players money? If no then sorry for being a retard.
Reply
#3

it shows how you can use some functions

regards, DowNlOaD_

//edit:

you enter player's nickname and it shows how much money he has
and it's not pawn, its PHP for website
Reply
#4

i its not pawn, why on pawno forums anyway looks cool tho i will use maybe
Reply
#5

Yeah i noticed, very nice !
We need more of these php stuff nowadays, great release.
Reply
#6

Quote:
Originally Posted by luigifan9
i its not pawn, why on pawno forums anyway looks cool tho i will use maybe
well, it's like a addon to dini and dudb includes
Reply
#7

SA-MP Scripting and Plugins
Reply
#8

Quote:
Originally Posted by ikarus❶❸❸❼
SA-MP Scripting and Plugins
This is mainly meant FOR SA-MP
Reply
#9

Great Job DowNlOaD_ and Gamer_Z
Reply
#10

Quote:
Originally Posted by FakeMan
Great Job DowNlOaD_ and Gamer_Z
thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)