Hi,
Can any one tell me, when zen photo automatically do re-entries for albums & images though its already exist?
i.g. One I have uploaded image & gave proper it's title & description.
But after some time, i have noticed that in my newly added images, old images coming again. because album & images entries are again added to database automatically by zenphoto.
Can any developer guide me how to disable it, I am still using old zen photo.
Regards
Comments
Anyway. you should hit the refresh database button in the admin from time to time, best doing it after every upload/change. And you might consider updating...
Otherwise I have to digg into entire code once again after 6 months.
if ($new) {
// Set default data for a new Album (title and parent_id)
$parentalbum = $this->getParent();
$title = str_replace(array('-','_','+','~'), ' ', $this->name);
if (!is_null($parentalbum)) {
$this->set('parentid', $parentalbum->getAlbumId());
$title = substr($title, strrpos($title, '/')+1);
}
// echo $this->id;
$this->set('title', $title);
$this->save();
}
Under...
// Constructor
function Album(&$gallery, $folder)
class-album.php??????
&
if ($new) {
$title = substr($this->name, 0, strrpos($this->name, '.'));
if (empty($title)) $title = $this->name;
$this->set('title', $title);
$this->save();
}
Under...
// Constructor
function Image(&$album, $filename)
class-image.php??
function load() {
// Get the database record for this object.
//echo 'SELECT * FROM ' . prefix($this->table) . getWhereClause($this->unique_set) . ' LIMIT 1;';
$entry = query_single_row('SELECT * FROM ' . prefix($this->table) .
getWhereClause($this->unique_set) . ' LIMIT 1;');
if (!$entry) {
$this->save();
return true;
} else {
$this->data = $entry;
$this->id = $entry['id'];
// print_r($this->data);
return false;
}
}
If I comment $this->save(); will it affect anywhere else?
If you have "orphan" records in your database, use the "refresh the database" button in admin or for individual albums on their edit page.
If you wish to get rid of an old image, you must delete it from your albums folder either through the admin interface or via FTP. Zenphoto will always add back images it finds that are not in the database.
& it's really a bug, i am with you guys to resolve this bug.
function load(), query entry = query_single_row('SELECT * FROM ' . prefix($this->table) .
getWhereClause($this->unique_set) . ' LIMIT 1;');
get's fail & next line
if (!$entry) {
$this->save();
return true;
}
get executed, so that duplicate entries are stored in database?