]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
photos now work across status.net installs. needs to be cleaned up though.
authorIan Denhardt <ian@zenhack.net>
Wed, 11 Aug 2010 16:39:10 +0000 (12:39 -0400)
committerIan Denhardt <ian@zenhack.net>
Wed, 11 Aug 2010 16:39:10 +0000 (12:39 -0400)
plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php
plugins/GNUsocialPhotos/classes/gnusocialphoto.php

index a18d039e41f7aae4112b563f80a589e41a392060..480f4ca46e7a90f771fafeafb6c4f915628e5d51 100644 (file)
@@ -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;
-    }
+    } */
 }
index 96288731e065433dcb14a223c997fc42b2bb61f9..c724db1f1c27a063b359d5504c8ab3ad54fb38ed 100644 (file)
@@ -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('<a href="http://%s%s"><img src="http://%s%s" /></a>', 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) {