[R63] Furnidata to Productdata

MasterJiq

Member
Jul 8, 2016
385
23
Hello!

I am gonna release my works which can convert furnidata to product data easily.
I've take 10 minutes to code this actually. lol
Code:
<?php

/* Hide all error */
error_reporting(0);

/* Fetch the furnidata */
$File = file_get_contents(dirname(__FILE__).'/furnidata.txt');

/* Debug */
if (!$File)
{
    die('DEBUG ERROR: Could not find the furnidata. Please put the furnidata in the same of this file.');
}

/* Explode line by line */
$Skip = explode("],", $File);

foreach ($Skip as $Part)
{
    /* It will be repeated if some of furnidata not following the format */
    $Swf = 'horse_hairdye_17';
    $Name = 'horse_hairdye_17 name';
    $Desc = 'horse_hairdye_17 desc';
    /* Explode line by line */
    $Explode = explode('","', $Part);
    /* Check if the furnidata is empty */
    if (!empty($Explode[2]))
    {
        $Swf = $Explode[2];
    }
    if (!empty($Explode[8]))
    {
        $Name = $Explode[8];
    }
    if (!empty($Explode[9]))
    {
        $Desc = $Explode[9];
    }
    /* Printing the productdata */
    print '["'.$Swf.'", "'.$Name.'", "'.$Desc.'"],<br>';
    $Write = '["'.$Swf.'", "'.$Name.'", "'.$Desc.'"],';
    /* Automatically write to product data. Surely it is not working */
    //file_put_contents(dirname(__FILE__).'/productdata.txt', $Write);
    /* Get generated time in seconds line by line */
    //echo '<script>alert("Generated in '.microtime(true).'");</script>';
}
?>

Name anything to php file such as Generate.php and put furnidata same to directory of this file.

Thanks!
 
Or visit here
 

Users who are viewing this thread

Top