Got database inserts for photos working.
This commit is contained in:
		| @@ -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(); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -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); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user