Hello, I have purchased a module which for the life of me i cannot get to work. (This module installs a "pre set" database of x number of members - ideally so a start up site is not empty) and unfortunately the seller is not replying at all so here I am...
The module runs a PHP script which during its installation pulls the members information from a .csv file (each column with respective fields information etc) however while the members do appear after install their pictures do not - so I have a fairly large number of members but without pictures...
The PHP script wont work if the photo's directory isnt present or is renamed so clearly it knows the file is there but for some reason will not/ cannot attach said pictures to said profiles.
Here is the relevant PHP script; (the part in question anyway).
bx_import('BxDolModuleDb');
$Module = new BxDolModuleDb();
echo "<BR><h2 style='color:green'><< 3K Member DB Installation >></h2>";
if(!$Module->isModule("photos") || !$Module->isModule("avatar")){
die("<h3 style='color:red;'>Oops!!! You havent installed Avatar and Photos Modules</h3>");
}
$source = $dir['root']."3KMembers/MemPics";
if(!file_exists($source)){
die("<h3 style='color:red;'>Oops! Directory MemPics does not exist. Please check the Instructions or contact the Moder</h3>");
}
if(!file_exists($source."/1.jpg")){
die ("<h3 style='color:red;'>File 1.jpg is not found in MemPics directory.</h3>");
}
$fh = fopen("MemData.csv", "r") or die ("Unable to open file");
echo "<h3>*** Installation may take several minutes ( 25 - 35 Mins), DO NOT interrupt the script.</h3>";
flush();
if(!db_value("SELECT id FROM sys_cron_jobs WHERE name='MemOnlineCron'")){
$sql = "INSERT INTO `sys_cron_jobs` ( `name`,`time`, `class`,`file`) VALUES ('MemOnlineCron', '*/16 * * * *', 'MemOnlineCron', 'MemOnlineCron.php')";
db_res($sql); @unlink($dir['cache']."db_sys_cron_jobs.php");
}
$oAvatar = BxDolModule::getInstance('BxAvaModule');
$oPC= new BxDolProfilesController();
$PP= new BxPhotosUploader();
$ii= 0;
while ($line = fgetcsv($fh, 1000, ","))
{
$aProfile1 = array(
"NickName" => $line[0],
"FirstName" => $line[1],
"LastName" => $line[2],
"Email" => $line[0]."@test3K.com",
"Password" => "testuser",
"Sex" => $line[3],
"EmailNotify" => 0,
"UpdateMatch" => 0,
"DateOfBirth" => $line[4],
"Country" => $line[5],
"City" => $line[6],
"zip" => $line[7],
"LookingFor" => array( "0" => ($line[3] == 'female') ? 'male' : 'female'),
"ProfilePhoto" =>$line[9],
);
list($iId1, $sStatus1) = $oPC->createProfile($aProfile1,false);
if($iId1)
{