From 55424d4de5814de361992458927eb362352427f3 Mon Sep 17 00:00:00 2001 From: Norman Radtke Date: Mon, 3 Jun 2013 14:22:38 +0200 Subject: [PATCH] Fixed #28.Enabled preview of images. Previews are shown in activity streams and resource views. Still the need of enabling tagging of persons on images as described in Issue #21 --- classes/Xodx/ActivityController.php | 6 +++++- templates/person/show.phtml | 5 +++++ templates/resource/show.phtml | 5 +++++ templates/user/home.phtml | 5 +++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/classes/Xodx/ActivityController.php b/classes/Xodx/ActivityController.php index 18faf34..b1a0722 100644 --- a/classes/Xodx/ActivityController.php +++ b/classes/Xodx/ActivityController.php @@ -525,11 +525,12 @@ public function getActivities ($resourceUri) $objectQuery.= 'PREFIX aair: ' . PHP_EOL; $objectQuery.= 'PREFIX sioc: ' . PHP_EOL; $objectQuery.= 'PREFIX foaf: ' . PHP_EOL; - $objectQuery.= 'SELECT ?type ?content ?date ' . PHP_EOL; + $objectQuery.= 'SELECT ?type ?content ?image ?date ' . PHP_EOL; $objectQuery.= 'WHERE { ' . PHP_EOL; $objectQuery.= ' <' . $objectUri . '> a ?type ; ' . PHP_EOL; $objectQuery.= ' sioc:created_at ?date . ' . PHP_EOL; $objectQuery.= ' OPTIONAL {<' . $objectUri . '> sioc:content ?content .} ' . PHP_EOL; + $objectQuery.= ' OPTIONAL {<' . $objectUri . '> aair:largerImage ?image .} ' . PHP_EOL; $objectQuery.= '} ' . PHP_EOL; $objectQuery.= 'ORDER BY DESC(?date)' . PHP_EOL; @@ -541,6 +542,9 @@ public function getActivities ($resourceUri) if (!empty($objectResult[0]['content'])) { $activity['objectContent'] = $objectResult[0]['content']; } + if (!empty($objectResult[0]['image'])) { + $activity['objectImage'] = $objectResult[0]['image']; + } // set data from activity to get valid feed } else { $activity['objectPubDate'] = $activity['pubDate']; diff --git a/templates/person/show.phtml b/templates/person/show.phtml index fdad4a5..55883fb 100644 --- a/templates/person/show.phtml +++ b/templates/person/show.phtml @@ -27,6 +27,11 @@ Show Feed of Object + +
+ +
+ diff --git a/templates/resource/show.phtml b/templates/resource/show.phtml index a1c48f7..dc50db2 100644 --- a/templates/resource/show.phtml +++ b/templates/resource/show.phtml @@ -36,6 +36,11 @@ foreach ($this->properties as $property) { a at + +
+ +
+ Show Feed of Object
diff --git a/templates/user/home.phtml b/templates/user/home.phtml index ae2f7bf..b12666e 100644 --- a/templates/user/home.phtml +++ b/templates/user/home.phtml @@ -78,6 +78,11 @@ Show Feed of Object + +
+ +
+