Member
Member
vikaskbh   2008-02-02, 10:47
#1

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

Administrator
Administrator
acrylian   2008-02-02, 11:58
#2

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...

Member
Member
vikaskbh   2008-02-02, 16:35
#3

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.

Member
Member
vikaskbh   2008-02-02, 17:47
#4

Is it...

if ($new) {

// Set default data for a new Album (title and parent_id)
$parentalbum = $this->getParent();
$title = strreplace(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??

Member
Member
vikaskbh   2008-02-02, 18:00
#5

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?

Member
Member
sbillard   2008-02-02, 18:08
#6

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.

Member
Member
vikaskbh   2008-02-02, 18:19
#7

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.

Member
Member
vikaskbh   2008-02-02, 18:20
#8

So, my newly added images show that old images as new images.

Member
Member
vikaskbh   2008-02-02, 18:42
#9

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.

Member
Member
sbillard   2008-02-02, 19:43
#10

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?

Member
Member
vikaskbh   2008-02-02, 20:22
#11

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?

Member
Member
vikaskbh   2008-02-03, 05:16
#12

Have you done any load testing for large application?

Administrator
Administrator
acrylian   2008-02-03, 10:07
#13

See here: http://www.zenphoto.org/support/topic.php?id=2255&replies=3

Member
Member
vikaskbh   2008-02-04, 18:44
#14

Sorry, I Found it, it's the problem of zenphoto plugin created my me....

Member
Member
sbillard   2008-02-04, 19:27
#15

Thanks for letting us know.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.