Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
F
FediEmbedi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MediaFormat
FediEmbedi
Commits
c58a3528
Commit
c58a3528
authored
Jan 14, 2021
by
MediaFormat
Browse files
Options
Browse Files
Download
Plain Diff
Merge tag 'v0.11.1' into develop
no message
parents
41dc0933
4fc8038a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
29 deletions
+42
-29
fediembedi-mastodon-widget.php
fediembedi-mastodon-widget.php
+8
-9
fediembedi-peertube-widget.php
fediembedi-peertube-widget.php
+5
-6
fediembedi-pixelfed-widget.php
fediembedi-pixelfed-widget.php
+4
-5
fediembedi-widget.php
fediembedi-widget.php
+1
-1
fediembedi.php
fediembedi.php
+12
-4
readme.md
readme.md
+4
-0
readme.txt
readme.txt
+4
-0
templates/mastodon.tpl.php
templates/mastodon.tpl.php
+2
-2
templates/peertube.tpl.php
templates/peertube.tpl.php
+1
-1
templates/pixelfed.tpl.php
templates/pixelfed.tpl.php
+1
-1
No files found.
fediembedi-mastodon-widget.php
View file @
c58a3528
...
...
@@ -17,13 +17,13 @@ class FediEmbedi_Mastodon extends WP_Widget {
}
/**
* Outputs the content for the current
Search
widget instance.
* Outputs the content for the current
Mastodon
widget instance.
*
* @since 2.8.0
*
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current
Search
widget instance.
* @param array $instance Settings for the current
Mastodon
widget instance.
*/
public
function
widget
(
$args
,
$instance
)
{
$title
=
!
empty
(
$instance
[
'title'
]
)
?
$instance
[
'title'
]
:
''
;
...
...
@@ -40,7 +40,7 @@ class FediEmbedi_Mastodon extends WP_Widget {
$pinned
=
(
!
empty
(
$instance
[
'pinned'
]))
?
$instance
[
'pinned'
]
:
''
;
$exclude_replies
=
(
!
empty
(
$instance
[
'exclude_replies'
]))
?
$instance
[
'exclude_replies'
]
:
''
;
$exclude_reblogs
=
(
!
empty
(
$instance
[
'exclude_reblogs'
]))
?
$instance
[
'exclude_reblogs'
]
:
''
;
$
number
=
isset
(
$instance
[
'number'
]
)
?
absint
(
$instance
[
'number'
]
)
:
5
;
$
limit
=
isset
(
$instance
[
'number'
]
)
?
absint
(
$instance
[
'number'
]
)
:
5
;
$height
=
isset
(
$instance
[
'height'
]
)
?
esc_attr
(
$instance
[
'height'
]
)
:
'100%'
;
echo
$args
[
'before_widget'
];
...
...
@@ -49,7 +49,7 @@ class FediEmbedi_Mastodon extends WP_Widget {
};
//getStatus from remote instance
$status
=
$client
->
getStatus
(
$only_media
,
$pinned
,
$exclude_replies
,
null
,
null
,
null
,
$
number
,
$exclude_reblogs
);
$status
=
$client
->
getStatus
(
$only_media
,
$pinned
,
$exclude_replies
,
null
,
null
,
null
,
$
limit
,
$exclude_reblogs
);
//if(WP_DEBUG_DISPLAY === true): echo '<details><summary>Mastodon</summary><pre>'; var_dump($status); echo '</pre></details>'; endif;
$account
=
$status
[
0
]
->
account
;
include
(
plugin_dir_path
(
__FILE__
)
.
'templates/mastodon.tpl.php'
);
...
...
@@ -58,7 +58,7 @@ class FediEmbedi_Mastodon extends WP_Widget {
}
/**
* Outputs the settings form for the
Search
widget.
* Outputs the settings form for the
Mastodon
widget.
*
* @since 2.8.0
*
...
...
@@ -72,7 +72,7 @@ class FediEmbedi_Mastodon extends WP_Widget {
$pinned
=
(
!
empty
(
$instance
[
'pinned'
]))
?
$instance
[
'pinned'
]
:
NULL
;
$exclude_replies
=
(
!
empty
(
$instance
[
'exclude_replies'
]))
?
$instance
[
'exclude_replies'
]
:
NULL
;
$exclude_reblogs
=
(
!
empty
(
$instance
[
'exclude_reblogs'
]))
?
$instance
[
'exclude_reblogs'
]
:
NULL
;
$
number
=
isset
(
$instance
[
'number'
]
)
?
absint
(
$instance
[
'number'
]
)
:
5
;
$
limit
=
isset
(
$instance
[
'number'
]
)
?
absint
(
$instance
[
'number'
]
)
:
5
;
$height
=
isset
(
$instance
[
'height'
]
)
?
esc_attr
(
$instance
[
'height'
]
)
:
''
;
?>
...
...
@@ -138,7 +138,7 @@ class FediEmbedi_Mastodon extends WP_Widget {
</p>
<p>
<label
for=
"
<?php
echo
$this
->
get_field_id
(
'number'
);
?>
"
>
<?php
_e
(
'Number of posts to display:'
);
?>
<br>
<input
class=
"tiny-text"
id=
"
<?php
echo
$this
->
get_field_id
(
'number'
);
?>
"
name=
"
<?php
echo
$this
->
get_field_name
(
'number'
);
?>
"
type=
"number"
step=
"1"
min=
"1"
value=
"
<?php
echo
$
number
;
?>
"
size=
"3"
/>
<input
class=
"tiny-text"
id=
"
<?php
echo
$this
->
get_field_id
(
'number'
);
?>
"
name=
"
<?php
echo
$this
->
get_field_name
(
'number'
);
?>
"
type=
"number"
step=
"1"
min=
"1"
value=
"
<?php
echo
$
limit
;
?>
"
size=
"3"
/>
<small>
Max: 20
</small>
</label>
</p>
...
...
@@ -152,7 +152,7 @@ class FediEmbedi_Mastodon extends WP_Widget {
}
/**
* Handles updating settings for the current
Search
widget instance.
* Handles updating settings for the current
Mastodon
widget instance.
*
* @since 2.8.0
*
...
...
@@ -174,5 +174,4 @@ class FediEmbedi_Mastodon extends WP_Widget {
$instance
[
'height'
]
=
sanitize_text_field
(
$new_instance
[
'height'
]
);
return
$instance
;
}
}
fediembedi-peertube-widget.php
View file @
c58a3528
...
...
@@ -17,13 +17,13 @@ class FediEmbedi_PeerTube extends WP_Widget {
}
/**
* Outputs the content for the current
Search
widget instance.
* Outputs the content for the current
PeerTube
widget instance.
*
* @since 2.8.0
*
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current
Search
widget instance.
* @param array $instance Settings for the current
PeerTube
widget instance.
*/
public
function
widget
(
$args
,
$instance
)
{
$title
=
!
empty
(
$instance
[
'title'
]
)
?
$instance
[
'title'
]
:
''
;
...
...
@@ -48,7 +48,7 @@ class FediEmbedi_PeerTube extends WP_Widget {
//getVideos from remote instance
$status
=
$client
->
getVideos
(
$actor
,
$is_channel
,
$count
,
$nsfw
);
if
(
WP_DEBUG_DISPLAY
===
true
)
:
echo
'<details><summary>PeerTube</summary><pre>'
;
var_dump
(
$status
);
echo
'</pre></details>'
;
endif
;
//
if(WP_DEBUG_DISPLAY === true): echo '<details><summary>PeerTube</summary><pre>'; var_dump($status); echo '</pre></details>'; endif;
if
(
!
is_null
(
$is_channel
)){
$account
=
$status
->
data
[
0
]
->
channel
;
}
else
{
...
...
@@ -61,7 +61,7 @@ class FediEmbedi_PeerTube extends WP_Widget {
}
/**
* Outputs the settings form for the
Search
widget.
* Outputs the settings form for the
PeerTube
widget.
*
* @since 2.8.0
*
...
...
@@ -149,7 +149,7 @@ class FediEmbedi_PeerTube extends WP_Widget {
}
/**
* Handles updating settings for the current
Search
widget instance.
* Handles updating settings for the current
PeerTube
widget instance.
*
* @since 2.8.0
*
...
...
@@ -175,5 +175,4 @@ class FediEmbedi_PeerTube extends WP_Widget {
$instance
[
'height'
]
=
sanitize_text_field
(
$new_instance
[
'height'
]
);
return
$instance
;
}
}
fediembedi-pixelfed-widget.php
View file @
c58a3528
...
...
@@ -17,13 +17,13 @@ class FediEmbedi_Pixelfed extends WP_Widget {
}
/**
* Outputs the content for the current
Search
widget instance.
* Outputs the content for the current
Pixelfed
widget instance.
*
* @since 2.8.0
*
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current
Search
widget instance.
* @param array $instance Settings for the current
Pixelfed
widget instance.
*/
public
function
widget
(
$args
,
$instance
)
{
$title
=
!
empty
(
$instance
[
'title'
]
)
?
$instance
[
'title'
]
:
''
;
...
...
@@ -61,7 +61,7 @@ class FediEmbedi_Pixelfed extends WP_Widget {
}
/**
* Outputs the settings form for the
Search
widget.
* Outputs the settings form for the
Pixelfed
widget.
*
* @since 2.8.0
*
...
...
@@ -155,7 +155,7 @@ class FediEmbedi_Pixelfed extends WP_Widget {
}
/**
* Handles updating settings for the current
Search
widget instance.
* Handles updating settings for the current
Pixelfed
widget instance.
*
* @since 2.8.0
*
...
...
@@ -177,5 +177,4 @@ class FediEmbedi_Pixelfed extends WP_Widget {
$instance
[
'height'
]
=
sanitize_text_field
(
$new_instance
[
'height'
]
);
return
$instance
;
}
}
fediembedi-widget.php
View file @
c58a3528
...
...
@@ -68,7 +68,7 @@ class WP_Widget_fediembedi extends WP_Widget {
case
'PeerTube'
:
//getVideos from remote instance
$status
=
$client
->
getVideos
();
if
(
WP_DEBUG_DISPLAY
===
true
)
:
echo
'<details><summary>'
.
$instance_type
.
'</summary><pre>'
;
var_dump
(
$status
);
echo
'</pre></details>'
;
endif
;
//
if(WP_DEBUG_DISPLAY === true): echo '<details><summary>'. $instance_type .'</summary><pre>'; var_dump($status); echo '</pre></details>'; endif;
include
(
plugin_dir_path
(
__FILE__
)
.
'templates/peertube.tpl.php'
);
break
;
default
:
...
...
fediembedi.php
View file @
c58a3528
...
...
@@ -4,7 +4,7 @@
* Plugin URI: https://git.feneas.org/mediaformat/fediembedi
* GitLab Plugin URI: https://git.feneas.org/mediaformat/fediembedi
* Description: Widgets and shortcodes to show your Fediverse profile timeline
* Version: 0.11.
0
* Version: 0.11.
1
* Author: mediaformat
* Author URI: https://mediaformat.org
* License: GPLv3
...
...
@@ -170,6 +170,7 @@ class FediConfig
'limit'
=>
5
,
'exclude_reblogs'
=>
false
,
'show_header'
=>
true
,
'height'
=>
'100%'
,
),
$atts
,
'mastodon'
);
//getStatus from remote instance
...
...
@@ -199,11 +200,12 @@ class FediConfig
'limit'
=>
9
,
'exclude_reblogs'
=>
false
,
'show_header'
=>
true
,
'height'
=>
'100%'
,
),
$atts
,
'pixelfed'
);
//getStatus from remote instance
$status
=
$client
->
getStatus
(
$atts
[
'only_media'
],
$atts
[
'pinned'
],
$atts
[
'exclude_replies'
],
null
,
null
,
null
,
$atts
[
'limit'
],
$atts
[
'exclude_reblogs'
]);
//if(WP_DEBUG_DISPLAY === true): echo '<details><summary>
Mastodon
</summary><pre>'; var_dump($client->getStatus($atts)); echo '</pre></details>'; endif;
//if(WP_DEBUG_DISPLAY === true): echo '<details><summary>
Pixelfed
</summary><pre>'; var_dump($client->getStatus($atts)); echo '</pre></details>'; endif;
$show_header
=
$atts
[
'show_header'
];
if
(
$account
=
$status
[
0
]
->
account
){
ob_start
();
...
...
@@ -221,9 +223,14 @@ class FediConfig
'actor'
=>
null
,
'is_channel'
=>
null
,
'limit'
=>
9
,
'nsfw'
=>
null
,
'show_header'
=>
true
,
'height'
=>
'100%'
,
),
$atts
,
'peertube'
);
$atts
[
'instance'
]
=
\esc_attr
(
$atts
[
'instance'
],
'https'
);
$client
=
new
\FediClient
(
$atts
[
'instance'
]);
//getVideos from remote instance
...
...
@@ -234,10 +241,11 @@ class FediConfig
$account
=
$status
->
data
[
0
]
->
account
;
}
//
if(WP_DEBUG_DISPLAY === true): echo '<details><summary>PeerTube</summary><pre>'; var_dump($status); echo '</pre></details>'; endif;
if
(
WP_DEBUG_DISPLAY
===
true
)
:
echo
'<details><summary>PeerTube</summary><pre>'
;
var_dump
(
$status
);
echo
'</pre></details>'
;
endif
;
$show_header
=
$atts
[
'show_header'
];
$height
=
$atts
[
'height'
];
ob_start
();
include
(
plugin_dir_path
(
__FILE__
)
.
'templates/peertube.tpl.php'
);
include
(
plugin_dir_path
(
__FILE__
)
.
'templates/peertube.tpl.php'
);
return
ob_get_clean
();
}
...
...
readme.md
View file @
c58a3528
...
...
@@ -53,6 +53,10 @@ and redirected to your site with a secure token. Similar to how you would connec
## Changelog
### 0.11.1
*
Bug fix: Shortcode limit attribute.
*
Document: Shortcodes on options page.
### 0.11.0
*
Feature: PeerTube widget NSFW option.
*
Fix: PeerTube number of posts to display.
...
...
readme.txt
View file @
c58a3528
...
...
@@ -64,6 +64,10 @@ and redirected to your site with a secure token. Similar to how you would connec
== Changelog ==
= 0.11.1 =
* Bug fix: Shortcode limit attribute.
* Document: Shortcodes on options page.
= 0.11.0 =
* Feature: PeerTube widget NSFW option.
* Fix: PeerTube number of posts to display.
...
...
templates/mastodon.tpl.php
View file @
c58a3528
<!-- mastodon -->
<div
class=
"
scrollable fediembedi-mastodon"
<?php
if
(
!
empty
(
$height
))
:
echo
'style="height: $height;"'
;
endif
;
?>
>
<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"
>
...
...
@@ -112,4 +112,4 @@
<?php
}
?>
</div>
</div>
<?php
\ No newline at end of file
<?php
templates/peertube.tpl.php
View file @
c58a3528
<!-- peertube -->
<div
class=
"
scrollable fediembedi-peertube"
<?php
if
(
!
empty
(
$height
))
:
echo
'style="height: $height;"'
;
endif
;
?>
>
<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"
>
...
...
templates/pixelfed.tpl.php
View file @
c58a3528
<!-- pixelfed -->
<div
class=
"
scrollable fediembedi-pixelfed"
<?php
if
(
!
empty
(
$height
))
:
echo
'style="height: $height;"'
;
endif
;
?>
>
<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
)
:
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment