installed plugin FediEmbedi
version 0.11.1
This commit is contained in:
115
wp-content/plugins/fediembedi-master/templates/mastodon.tpl.php
Normal file
115
wp-content/plugins/fediembedi-master/templates/mastodon.tpl.php
Normal file
@ -0,0 +1,115 @@
|
||||
<!-- mastodon -->
|
||||
<div class="fediembedi fediembedi-mastodon scrollable" <?php if (!empty($height)) : echo "style='height: $height;'"; endif; ?>>
|
||||
<div role="feed">
|
||||
<?php if($show_header): ?>
|
||||
<div class="account-timeline__header">
|
||||
<div class="account__header">
|
||||
<div class="account__header__image">
|
||||
<div class="account__header__info"></div>
|
||||
<?php if ($account->header): echo "<img src=" . $account->header . " loading='lazy'>"; endif; ?>
|
||||
</div>
|
||||
<div class="account__header__bar">
|
||||
<div class="account__header__tabs">
|
||||
<a href="<?php echo $account->url; ?>" class="avatar" rel="noreferrer noopener" target="_blank">
|
||||
<div class="account__avatar" style="width:90px; height: 90px; background-image: url('<?php echo $account->avatar; ?>'); background-size: cover;"></div>
|
||||
</a>
|
||||
<div class="spacer"></div>
|
||||
<div class="account__header__tabs__buttons">
|
||||
<a href="<?php echo $account->url; ?>" rel="noreferrer noopener" class="button logo-button"><?php _e('Follow', 'fediembedi'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="account__header__tabs__name">
|
||||
<h1>
|
||||
<span><?php echo apply_filters('fedi_emoji', $account->display_name, $account->emojis); ?></span>
|
||||
<small><a href="<?php echo $account->url; ?>" target="_blank" rel="noreferrer noopener"><?php echo $account->url; ?></a></small>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="account__header__extra">
|
||||
<div class="account__header__bio">
|
||||
<div class="account__header__content">
|
||||
<?php echo apply_filters('fedi_emoji', $account->note, $account->emojis); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($status as $statut) { ?>
|
||||
<article>
|
||||
<div tabindex="-1">
|
||||
<div class="status__wrapper status__wrapper-public focusable" tabindex="0">
|
||||
<div class="status__prepend">
|
||||
<?php
|
||||
if(!is_null($statut->reblog)): ?>
|
||||
<div class="status__prepend-icon-wrapper"><i role="img" class="fa fa-retweet status__prepend-icon fa-fw"></i></div>
|
||||
</div><?php
|
||||
else: echo '</div>';
|
||||
endif; ?>
|
||||
|
||||
<div class="status status-public">
|
||||
<div class="status__info">
|
||||
<a href="<?php if(is_null($statut->reblog)): echo $statut->url; else: echo $statut->reblog->url; endif; ?>" class="status__relative-time" target="_blank" rel="noopener">
|
||||
<time datetime="<?php echo $statut->created_at; ?>"><?php
|
||||
printf( _x( '%1$s ago', '%2$s = human-readable time difference', 'fediembedi' ),
|
||||
human_time_diff(
|
||||
wp_date("U", strtotime($statut->created_at))
|
||||
)
|
||||
);
|
||||
?></time>
|
||||
</a>
|
||||
<a href="<?php if(is_null($statut->reblog)): echo $statut->account->url; else: echo $statut->reblog->account->url; endif; ?>" class="status__display-name" rel="noopener noreferrer" target="_blank">
|
||||
<div class="status__avatar">
|
||||
<div class="account__avatar" style="background-image: url(<?php if(is_null($statut->reblog)): echo $statut->account->avatar; else: echo $statut->reblog->account->avatar; endif; ?>); background-size: 40px; width: 40px; height: 40px;"></div>
|
||||
</div>
|
||||
<span class="display-name"><?php
|
||||
if(is_null($statut->reblog)):
|
||||
echo apply_filters('fedi_emoji', $statut->account->display_name, $statut->account->emojis);
|
||||
else:
|
||||
if(empty($statut->reblog->account->display_name)):
|
||||
echo $statut->reblog->account->username;
|
||||
else:
|
||||
echo apply_filters('fedi_emoji', $statut->reblog->account->display_name, $statut->reblog->account->emojis);
|
||||
endif;
|
||||
endif; ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="status__content"><?php
|
||||
if(!is_null($statut->reblog)):
|
||||
$statut = $statut->reblog;
|
||||
endif;
|
||||
if(empty($statut->spoiler_text)):
|
||||
echo apply_filters('fedi_emoji', $statut->content, $statut->emojis);
|
||||
if(!is_null($statut->card)): ?>
|
||||
<a href="<?php echo $statut->card->url; ?>" class="status-card compact" target="_blank" rel="noopener noreferrer">
|
||||
<div class="status-card__image"><div class="status-card__image-image" style="background-image: url(<?php echo $statut->card->image; ?>);"></div></div>
|
||||
<div class="status-card__content">
|
||||
<strong class="status-card__title" title="<?php echo $statut->card->title; ?>"><?php echo htmlentities($statut->card->title); ?></strong>
|
||||
<p class="status-card__description"><?php echo wp_trim_words(htmlentities($statut->card->description), 10); ?></p>
|
||||
<span class="status-card__host"><?php echo $statut->card->url; ?></span>
|
||||
</div>
|
||||
</a>
|
||||
<?php
|
||||
endif;
|
||||
else: echo '<details><summary>' . apply_filters('fedi_emoji', $statut->spoiler_text, $statut->emojis) . '</summary>'. apply_filters('fedi_emoji', $statut->content, $statut->emojis) . '</details>';
|
||||
endif;
|
||||
if(!empty($statut->media_attachments)):
|
||||
foreach ($statut->media_attachments as $attachment) {
|
||||
if (!empty($attachment->preview_url) && $attachment->type === 'image'): ?>
|
||||
<img src="<?php echo $attachment->preview_url; ?>" class="media-gallery__item" alt="<?php echo $attachment->description; ?>" loading="lazy">
|
||||
<?php elseif($attachment->type === 'video'): ?>
|
||||
<video src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">
|
||||
<?php elseif($attachment->type === 'audio'): ?>
|
||||
<audio src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">
|
||||
<?php endif;
|
||||
}
|
||||
endif;
|
||||
?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
@ -0,0 +1,54 @@
|
||||
<!-- peertube -->
|
||||
<div class="fediembedi fediembedi-peertube scrollable" <?php if (!empty($height)) : echo "style='height: $height;'"; endif; ?>>
|
||||
<div role="feed">
|
||||
<?php if($show_header): ?>
|
||||
<div class="peertube-timeline__header">
|
||||
<div class="actor">
|
||||
<img class="avatar" alt="Avatar" src="<?php echo esc_url($account->host) . $account->avatar->path; ?>" loading='lazy'>
|
||||
<div class="actor-info">
|
||||
<div class="actor-names">
|
||||
<a href="<?php echo $account->url; ?>" class="actor-display-link" rel="noreferrer noopener" target="_blank">
|
||||
<div class="actor-display-name"><?php echo $account->displayName; ?></div>
|
||||
</a>
|
||||
<div class="actor-name"><?php echo $account->name; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="videos">
|
||||
<?php foreach ($status->data as $statut) : ?>
|
||||
<article class="video">
|
||||
<div class="video-inner">
|
||||
<div class="video-miniature">
|
||||
<a href="<?php echo esc_url($account->host) . '/videos/watch/' . $statut->uuid; ?>" title="<?php echo $statut->name; ?>" class="video-thumbnail" target="_blank" rel="noopener">
|
||||
<img src="<?php echo esc_url($account->host) . $statut->previewPath; ?>">
|
||||
<div class="video-thumbnail-duration-overlay"><?php echo ($statut->duration > 3600 ? gmdate("g:i:s", $statut->duration) : gmdate("i:s", $statut->duration)); ?></div>
|
||||
<div class="play-overlay">
|
||||
<div class="icon"></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="video-bottom">
|
||||
<div class="video-miniature-information">
|
||||
<a class="video-miniature-name" title="<?php echo $statut->name; ?>" href="<?php echo esc_url($account->host) . '/videos/watch/' . $statut->uuid; ?>"><?php echo $statut->name; ?></a>
|
||||
<div class="video-miniature-created-at-views">
|
||||
<time datetime="<?php echo $statut->publishedAt; ?>"><?php
|
||||
printf( _x( '%1$s ago', '%2$s = human-readable time difference', 'fediembedi' ),
|
||||
human_time_diff(
|
||||
wp_date("U", strtotime($statut->publishedAt))
|
||||
)
|
||||
);
|
||||
?></time>
|
||||
<span class="views"><?php printf( _x( '%1$s views', '%2$s = number of views', 'fediembedi' ), $statut->views); ?></span>
|
||||
</div>
|
||||
<!-- <a class="video-miniature-account" href="<?php echo esc_url($account->host) . $account->avatar->path; ?>"><?php echo $statut->account->name; ?></a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
@ -0,0 +1,63 @@
|
||||
<!-- pixelfed -->
|
||||
<div class="fediembedi fediembedi-pixelfed scrollable" <?php if (!empty($height)) : echo "style='height: $height;'"; endif; ?>>
|
||||
<div role="feed" class="embed-card pixelfed">
|
||||
<div class="pixelfed-inner card status-card-embed card-md-rounded-0 border">
|
||||
<?php if($show_header): ?>
|
||||
<div class="pixelfed-header card-header d-inline-flex align-items-center justify-content-between bg-white">
|
||||
<div class="pixelfed-account">
|
||||
<img src="<?php echo $account->avatar; ?>" height="32px" width="32px" style="border-radius: 32px;">
|
||||
<a href="<?php echo $account->url; ?>" class="username font-weight-bold pl-2 text-dark" rel="noreferrer noopener" target="_blank"><?php echo $account->username; ?></a>
|
||||
</div>
|
||||
<div class="pixelfed-instance">
|
||||
<a class="small font-weight-bold text-muted pr-1" href="<?php echo $instance_url; ?>"><?php echo parse_url($instance_url, PHP_URL_HOST); ?></a>
|
||||
<img src="<?php echo plugin_dir_url( __FILE__ ) . '../img/pixelfed.svg';?>" width="26px" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="pixelfed-body card-body pb-1">
|
||||
<div class="pixelfed-meta d-flex justify-content-between align-items-center">
|
||||
<div class="text-center">
|
||||
<div class="mb-0 font-weight-bold prettyCount"><?php echo $account->statuses_count; ?></div>
|
||||
<div class="mb-0 text-muted text-uppercase small font-weight-bold"><?php _e('Posts', 'fediembedi'); ?></div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="mb-0 font-weight-bold prettyCount"><?php echo $account->followers_count; ?></div>
|
||||
<div class="mb-0 text-muted text-uppercase small font-weight-bold"><?php _e('Followers', 'fediembedi'); ?></div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="mb-0 font-weight-bold prettyCount"><?php echo $account->following_count; ?></div>
|
||||
<div class="mb-0 text-muted text-uppercase small font-weight-bold"><?php _e('Following', 'fediembedi'); ?></div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="mb-0">
|
||||
<a href="<?php echo $instance_url . '/i/intent/follow?user='. $account->acct; ?>" class="pixelfed-follow btn btn-primary btn-sm py-1 px-4 text-uppercase font-weight-bold" target="_blank"><?php _e('Follow', 'fediembedi'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pixelfed-images row mt-4 mb-1 px-1">
|
||||
<?php foreach ($status as $statut) { ?>
|
||||
<article class="col-4 mt-2 px-0"><?php
|
||||
$attachment = $statut->media_attachments[0];
|
||||
if (!empty($attachment->preview_url) && $attachment->type === 'image'): ?>
|
||||
<a href="<?php echo $statut->url; ?>" class="card info-overlay card-md-border-0 px-1 shadow-none" target="_blank" rel="noopener">
|
||||
<div class="square">
|
||||
<div style='background-image: url(<?php echo $attachment->preview_url; ?>);' class='square-content' alt='<?php $attachment->description; ?>'></div>
|
||||
<div class="info-text-overlay"></div>
|
||||
</div>
|
||||
</a><?php
|
||||
elseif($attachment->type === 'video'): ?>
|
||||
<video src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pixelfed-footer card-footer bg-white">
|
||||
<div class="text-center mb-0">
|
||||
<a href="<?php echo $account->url; ?>" class="font-weight-bold" target="_blank" rel="noreferrer noopener"><?php _e('View More Posts', 'fediembedi'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
Reference in New Issue
Block a user