Skip to content

Commit

Permalink
Fixed AKSW#28.Enabled preview of images.
Browse files Browse the repository at this point in the history
Previews are shown in activity streams and resource views. Still the need of enabling tagging of persons on images as described in Issue AKSW#21
  • Loading branch information
splattater committed Jun 3, 2013
1 parent b95db65 commit 55424d4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/Xodx/ActivityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,12 @@ public function getActivities ($resourceUri)
$objectQuery.= 'PREFIX aair: <http://xmlns.notu.be/aair#> ' . PHP_EOL;
$objectQuery.= 'PREFIX sioc: <http://rdfs.org/sioc/ns#> ' . PHP_EOL;
$objectQuery.= 'PREFIX foaf: <http://xmlns.com/foaf/0.1/> ' . 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;

Expand All @@ -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'];
Expand Down
5 changes: 5 additions & 0 deletions templates/person/show.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<a class="btn btn-mini btn-block" href="?c=feed&amp;a=getFeed&amp;uri=<?= urlencode($activity['object']) ?>">Show Feed of Object</a>
<button class="btn btn-mini btn-block" type="submit">Reply</button>
</div>
<?php if(isset($activity['objectImage'])) : ?>
<div class="span10">
<a href="<?= htmlentities($activity['object']) ?>"><img class="avatar size128 img-polaroid" src="<?= $activity['objectImage'] ?>"></img></a>
</div>
<?php endif; ?>
</form>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions templates/resource/show.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ foreach ($this->properties as $property) {
a <a href="<?= htmlentities($activity['object']) ?>">
<?= Saft_Tools::getSpokenWord($activity['type']) ?></a> at <?= $activity['pubDate'] ?>
<em><a href="?c=feed&amp;a=getFeed&amp;uri=<?= urlencode($activity['object']) ?>">
<?php if(isset($activity['objectImage'])) : ?>
<div class="span10">
<img class="avatar img-polaroid" src="<?= $activity['objectImage'] ?>"></img>
</div>
<?php endif; ?>
Show Feed of Object</a></em>
<?php else : ?>
<a href="<?= htmlentities($activity['object']) ?>"><?= ($activity['object']) ?></a>
Expand Down
5 changes: 5 additions & 0 deletions templates/user/home.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
<a class="btn btn-mini btn-block" href="?c=feed&amp;a=getFeed&amp;uri=<?= urlencode($activity['object']) ?>">Show Feed of Object</a>
<button class="btn btn-mini btn-block" type="submit">Reply</button>
</div>
<?php if(isset($activity['objectImage'])) : ?>
<div class="span10">
<a href="<?= htmlentities($activity['object']) ?>"><img class="avatar size128 img-polaroid" src="<?= $activity['objectImage'] ?>"></img></a>
</div>
<?php endif; ?>
</form>
</div>
</div>
Expand Down

1 comment on commit 55424d4

@white-gecko
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

Please sign in to comment.