why does updated column not reflect album changes
|
freakout
Joined: 2011-05-15
Posts: 6 |
Posted: Tue, 2012-07-03 13:15
|
|
i use gallery3 not only by itself, but also with a standalone app. for a specific reason i need to know when there are new images or how can i change that? any tips or source code fragments would be fine. Thanks alot |
|
| Login or register to post comments |

Posts: 25961
You could write a module that has a listener for the creation and deletion of a item and in that function update a table or do something else:
item_before_create
item_before_delete
look for those functions for a clue.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 6
I have made a module (my first) - it activates without problem - has only helper inside - but simply does nothing - no error messages - no log - deletes item - no update of album - please help:
modules/album_updated/helpers/album_updated.php :
<?php defined("SYSPATH") or die("No direct script access."); class album_updated_Core { static function item_before_delete($itemi) { if ($itemi->is_photo()) { $albumi = $itemi->parent(); $albumi->updated = time(); $albumi->save(); } } } ?>Posts: 25961
I'm just guessing here...
The two or three other modules that use the item_before_delete() function have a class name that is:
class quotas_event_Core {
or
class videos_event_Core {
or
class keeporiginal_event_Core {
So I guess the _event_Core should be in the class name?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 6
does nothing - have also restarted webserver and de-/reactivated the module:
modules/album_updated/helpers/album_updated_event.php:
<?php defined("SYSPATH") or die("No direct script access."); class album_updated_event_Core { static function item_before_delete($itemi) { error_log('album_updated_event_Core::item_before_delete'); } } ?>when i patch this error_log into the core-code i see the log.
i'm lost here.
Posts: 25961
So am I. I just copy and paste other modules code till I get something to work.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team