Skip to content

Commit

Permalink
fixes for adding the u-bookmark-of class
Browse files Browse the repository at this point in the history
fixes likes, reposts and bookmarks to have the proper class and avoids unnecessary rels.

adds `p-name` to the target post's name

adds `e-content` if the post has content, so that text you include in a bookmark shows up as content
  • Loading branch information
aaronpk committed Apr 17, 2017
1 parent b7cac1a commit fc49d8a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions IdnoPlugins/Like/templates/default/entity/Like.tpl.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<?php

$rel = '';
$class = '';
$icon = '';

if (!empty($vars['object']->likeof)) {
$rel = 'rel="like" class="u-like-of"';
$class = "u-like-of";
$icon = '<i class="fa fa-star-o"></i> ';
}
if (!empty($vars['object']->repostof)) {
$rel = 'rel="like" class="u-repost-of"';
elseif (!empty($vars['object']->repostof)) {
$class = "u-repost-of";
$icon = '<i class="fa fa-retweet"></i> ';
}
else {
$class = "u-bookmark-of";
}

if (!empty($vars['object']->pageTitle)) {
$body = $vars['object']->pageTitle;
Expand All @@ -25,21 +28,23 @@
if (empty($vars['feed_view'])) {

?>
<h2 class="idno-bookmark"><?=$icon?><a href="<?= $vars['object']->body; ?>" class="u-bookmark-of" rel="bookmark"
target="_blank"><?= $this->parseURLs(htmlentities(strip_tags($body)), $rel) ?></a>
<h2 class="idno-bookmark"><?=$icon?><a href="<?= $vars['object']->body; ?>" class="<?= $class ?> p-name"
target="_blank"><?= $this->parseURLs(htmlentities(strip_tags($body)), $rel) ?></a>
</h2>
<?php

}

if (!empty($vars['object']->description)) {
echo $this->__(['value' => $vars['object']->description, 'object' => $vars['object'], 'rel' => $rel])->draw('forms/output/richtext');
echo '<div class="e-content">';
echo $this->__(['value' => $vars['object']->description, 'object' => $vars['object']])->draw('forms/output/richtext');
echo '</div>';

}

if (!empty($vars['object']->tags)) {
?>
<p class="tag-row"><i class="icon-tag"></i><?=$this->parseURLs($this->parseHashtags(htmlentities(strip_tags($vars['object']->tags))),$rel)?></p>
<p class="tag-row"><i class="icon-tag"></i><?=$this->parseURLs($this->parseHashtags(htmlentities(strip_tags($vars['object']->tags))))?></p>
<?php
}

Expand Down

0 comments on commit fc49d8a

Please sign in to comment.