Image regeneration.

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

  • acrylian Administrator, Developer
    Generally zenphoto should only images/albums to the database if you change anything on the filesystem or delete the cache. I don't know where this could come from, but zenphoto before 1.1. had some problems with database garbage problems sometimes. Which version are you using?
    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...
  • Can you tell me, which file, function I can refer, to stop this... Once you point me, the function, where zenphoto do this database adding stuff, i can write wrapper function to deal with it...

    Otherwise I have to digg into entire code once again after 6 months.
  • Is it...

    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??
  • or in classes.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?
  • You should not mess with these functions. Things may not work correctly.

    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.
  • I don't know, what exactly happening, though image already is there in directory as well as database, sometimes it adds duplicate entries into database.
  • So, my newly added images show that old images as new images.
  • even it's adding robots.txt into database (because every search engine's find it)???? do you think, if you make unexpected requests... you can fill database with garbage??? Plz think about it...

    & it's really a bug, i am with you guys to resolve this bug.
  • Zenphoto will not add anything to the database that is a text file. Especially ones that are not in the albums folder. It sounds like there is something wrong with the pointer to your albums folder. Did you specify an external folder?
  • It may possible, sometimes so much parallel connection, in

    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?
  • Have you done any load testing for large application?
  • Sorry, I Found it, it's the problem of zenphoto plugin created my me....
  • Thanks for letting us know.
Sign In or Register to comment.