DB_Grid($Doc, $DBObj);
$this->fileForProcessStoring = WWW_PATH . '/userfile/' . $this->fileForProcessStoring;
$this->htmlFileForProcessStoring = WWW_PATH . '/userfile/' . $this->htmlFileForProcessStoring;
}
function doList()
{
$this->processMembersUrlWithNotExistingImages($this->DBObj->getNotExistingProfileImages());
return true;
}
function printToScreenProcessedItems($id, $img)
{
echo ' ' . $id . ' / ' . $img . '';
echo '
';
}
function storedToFileProcessedItems($id, $img)
{
$editUrl = BASE_URL_HTTP . '/admin/member?action=edit&id=' . $id;
$str = $editUrl .' ------- ' . $img . "\n";
file_put_contents( $this->fileForProcessStoring, $str, FILE_APPEND | LOCK_EX);
$str = ' ' . $editUrl . '
' . "\n";
file_put_contents( $this->htmlFileForProcessStoring, $str, FILE_APPEND | LOCK_EX);
}
function deleteMemberPhotoRecord($id)
{
return $this->DBObj->deleteMemberPhotoRecord($id);
}
function processMembersUrlWithNotExistingImages($array = array())
{
if (!$this->isTestMode) {
unlink( $this->fileForProcessStoring);
unlink( $this->htmlFileForProcessStoring);
}
$imageDbFs = new ImageDB();
foreach ($array as $value) {
$this->printToScreenProcessedItems($value['id'], $value['img']);
$this->storedToFileProcessedItems($value['id'], $value['img']);
if (!$this->isTestMode) {
$this->deleteMemberPhotoRecord($value['id']);
$imageDbFs->delete($value['img']);
}
}
return true;
}
}