diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/GNUsocialPhotos/actions/photoupload.php | 2 | ||||
-rw-r--r-- | plugins/GNUsocialPhotos/classes/gnusocialphoto.php | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/plugins/GNUsocialPhotos/actions/photoupload.php b/plugins/GNUsocialPhotos/actions/photoupload.php index aafa2d3fe..9a643dbe6 100644 --- a/plugins/GNUsocialPhotos/actions/photoupload.php +++ b/plugins/GNUsocialPhotos/actions/photoupload.php @@ -129,6 +129,8 @@ class PhotouploadAction extends Action $photo = new GNUsocialPhoto(); $photo->path = '/file/' . $filename; $photo->thumb_path = '/file/thumb.' . $filename; + $photo->owner_id = $cur->id; + $photo->object_id = 'DEFAULT'; $photo->insert(); } diff --git a/plugins/GNUsocialPhotos/classes/gnusocialphoto.php b/plugins/GNUsocialPhotos/classes/gnusocialphoto.php index 0e3d24eed..882d1026e 100644 --- a/plugins/GNUsocialPhotos/classes/gnusocialphoto.php +++ b/plugins/GNUsocialPhotos/classes/gnusocialphoto.php @@ -34,6 +34,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; class GNUsocialPhoto extends Memcached_DataObject { + public $__table = 'GNUsocialPhoto'; public $object_id; // integer public $path; // varchar(150) public $thumb_path; // varchar(156) @@ -54,4 +55,12 @@ class GNUsocialPhoto extends Memcached_DataObject } return parent::delete(); } + + function table() + { + return array('object_id' => DB_DATAOBJECT_INT, + 'path' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'thumb_path' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'owner_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL); + } } |