From 769d6089de4b2025b33145f4c30269dc083d2596 Mon Sep 17 00:00:00 2001 From: Ian Denhardt Date: Wed, 11 Aug 2010 12:39:10 -0400 Subject: [PATCH] photos now work across status.net installs. needs to be cleaned up though. --- plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php | 10 +++++----- plugins/GNUsocialPhotos/classes/gnusocialphoto.php | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php index a18d039e41..480f4ca46e 100644 --- a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php +++ b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php @@ -48,12 +48,12 @@ class GNUsocialPhotosPlugin extends Plugin case 'PhotouploadAction': include_once $dir . '/lib/photolib.php'; include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; + include_once $dir . '/classes/gnusocialphoto.php'; break; default: break; } - include_once $dir . '/classes/gnusocialphoto.php'; return true; } @@ -75,14 +75,14 @@ class GNUsocialPhotosPlugin extends Plugin return true; } - /* function onStartActivityDefaultObjectType(&$notice, &$xs, &$type) + function onStartActivityDefaultObjectType(&$notice, &$xs, &$type) { $photo = GNUsocialPhoto::staticGet('notice_id', $notice->id); if($photo) { $type = ActivityObject::PHOTO; } - } */ - + } +/* function onStartShowNoticeItem($action) { $photo = GNUsocialPhoto::staticGet('notice_id', $action->notice->id); @@ -98,5 +98,5 @@ class GNUsocialPhotosPlugin extends Plugin return false; } return true; - } + } */ } diff --git a/plugins/GNUsocialPhotos/classes/gnusocialphoto.php b/plugins/GNUsocialPhotos/classes/gnusocialphoto.php index 96288731e0..c724db1f1c 100644 --- a/plugins/GNUsocialPhotos/classes/gnusocialphoto.php +++ b/plugins/GNUsocialPhotos/classes/gnusocialphoto.php @@ -86,7 +86,9 @@ class GNUsocialPhoto extends Memcached_DataObject $photo->path = $path; $photo->owner_id = $profile_id; - $notice = Notice::saveNew($profile_id, 'http://' . common_config('site', 'server') . $path, $source); + $rend = sprintf('', common_config('site', 'server'), $path, common_config('site', 'server'), $thumb_path); + + $notice = Notice::saveNew($profile_id, 'http://' . common_config('site', 'server') . $path, $source, array('rendered' => $rend)); $photo->notice_id = $notice->id; $photo_id = $photo->insert(); if (!$photo_id) {