| 1 |
<?php |
| 2 |
/** |
| 3 |
* The Add Friend form. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
?> |
| 10 |
<section class="subscriptions add-friend-subscriptions"> |
| 11 |
<div class="card add-friend-card"> |
| 12 |
<div class="card-body"> |
| 13 |
<form id="add-subscription-form" action="" method="post"> |
| 14 |
<?php wp_nonce_field( 'friends_add_subscription' ); ?> |
| 15 |
<div class="add-subscription-input"> |
| 16 |
<textarea name="url" id="subscription-url" class="form-input" rows="4" placeholder="<?php esc_attr_e( 'Enter URLs, @user@instance handles, or paste OPML content', 'friends' ); ?>" required></textarea> |
| 17 |
<button type="submit" class="btn btn-primary"><?php esc_html_e( 'Review', 'friends' ); ?></button> |
| 18 |
</div> |
| 19 |
<p class="opml-file-hint"> |
| 20 |
<label for="opml-file"><?php esc_html_e( 'Or upload an OPML file:', 'friends' ); ?></label> |
| 21 |
<input type="file" id="opml-file" accept=".opml,.xml,application/xml,text/xml"> |
| 22 |
</p> |
| 23 |
</form> |
| 24 |
<div id="preview-subscription"></div> |
| 25 |
</div> |
| 26 |
</div> |
| 27 |
|
| 28 |
<div class="card add-friend-discovery-card"> |
| 29 |
<div class="card-body"> |
| 30 |
<h5><?php esc_html_e( 'Discover People', 'friends' ); ?></h5> |
| 31 |
<p><?php esc_html_e( 'Browse the local timeline of a Mastodon server to find interesting people. Copy their profile URL and paste it in the field above to follow them.', 'friends' ); ?></p> |
| 32 |
<ul> |
| 33 |
<?php |
| 34 |
$instances = apply_filters( |
| 35 |
'friends_mastodon_instances', |
| 36 |
array( |
| 37 |
'mastodon.social', |
| 38 |
'mastodon.online', |
| 39 |
'fosstodon.org', |
| 40 |
'hachyderm.io', |
| 41 |
'infosec.exchange', |
| 42 |
'indieweb.social', |
| 43 |
) |
| 44 |
); |
| 45 |
foreach ( $instances as $instance ) : |
| 46 |
?> |
| 47 |
<li><a href="<?php echo esc_url( 'https://' . $instance . '/public/local' ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $instance ); ?></a></li> |
| 48 |
<?php endforeach; ?> |
| 49 |
</ul> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
</section> |
| 53 |
|