Raised This Month: $ Target: $400
 0% 

New fvault custom function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.MMYTH.
BANNED
Join Date: Sep 2010
Location: Brasil - RS
Old 01-01-2011 , 16:47   New fvault custom function
Reply With Quote #1

I make a new function to add to my custom fvault and i want know if is correct:

PHP Code:
stock fvault_remove_data(const vaultname[], const key[], const data[])
{
    new 
filename[128];
    
_FormatVaultName(vaultnamefilenamesizeof(filename) - 1);
    
    if( !
file_exists(filename) )
    {
        return;
    }
    
    new 
file fopen(_temp_vault"wt");
    
    new 
vault fopen(filename"rt");
    
    new 
_data[512], _other[3];
    
    while( !
feof(vault) )
    {
        
fgets(vault_datasizeof(_data) - 1);
        
parse(_data_keysizeof(_key) - 1_othersizeof(_other) - 1);
        
        
replace(_datacharsmax(_data), data"")
        
trim(data)
    }
    
    
fclose(file);
    
fclose(vault);

?
.MMYTH. is offline
Send a message via MSN to .MMYTH.
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 01-01-2011 , 17:04   Re: New fvault custom function
Reply With Quote #2

Quote:
Originally Posted by .MMYTH. View Post
I make a new function to add to my custom fvault and i want know if is correct:

PHP Code:
stock fvault_remove_data(const vaultname[], const key[], const data[])
{
    new 
filename[128];
    
_FormatVaultName(vaultnamefilenamesizeof(filename) - 1);
    
    if( !
file_exists(filename) )
    {
        return;
    }
    
    new 
file fopen(_temp_vault"wt");
    
    new 
vault fopen(filename"rt");
    
    new 
_data[512], _other[3];
    
    while( !
feof(vault) )
    {
        
fgets(vault_datasizeof(_data) - 1);
        
parse(_data_keysizeof(_key) - 1_othersizeof(_other) - 1);
        
        
replace(_datacharsmax(_data), data"")
        
trim(data)
    }
    
    
fclose(file);
    
fclose(vault);

?
Suggestion: Test it
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-01-2011 , 17:32   Re: New fvault custom function
Reply With Quote #3

Already included in FVault.

Code:
/**  * Removes a key from a vault  *  * @param vaultname    Vault name to look in  * @param key        Key to remove  * @return        No return  */ fvault_remove_key(const vaultname[], const key[])

Also, that code is far from correct.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-01-2011 , 18:24   Re: New fvault custom function
Reply With Quote #4

I doubt anyone has already succeeded in delete or add any data without writing anything in any file.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode