Changeset 3304173
- Timestamp:
- 06/01/2025 07:38:34 AM (7 months ago)
- Location:
- video-manager-for-peertube
- Files:
-
- 14 added
- 4 edited
-
tags/1.5.1 (added)
-
tags/1.5.1/README.md (added)
-
tags/1.5.1/add_single_video.php (added)
-
tags/1.5.1/css (added)
-
tags/1.5.1/css/style.php (added)
-
tags/1.5.1/inc (added)
-
tags/1.5.1/inc/conf.php (added)
-
tags/1.5.1/inc/form.php (added)
-
tags/1.5.1/readme.txt (added)
-
tags/1.5.1/show_last_videos.php (added)
-
tags/1.5.1/show_last_videos_channel.php (added)
-
tags/1.5.1/show_last_videos_list.php (added)
-
tags/1.5.1/uninstall.php (added)
-
tags/1.5.1/video-manager-for-peertube.php (added)
-
trunk/README.md (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/show_last_videos_channel.php (modified) (4 diffs)
-
trunk/video-manager-for-peertube.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
video-manager-for-peertube/trunk/README.md
r3304036 r3304173 20 20 21 21 [cbvmfp-last-channel-videos] 22 23 with offset - start list with video no. 3 24 25 [cbvmfp-last-channel-videos offset='2'] -
video-manager-for-peertube/trunk/readme.txt
r3304165 r3304173 3 3 Donate link: http://www.ericmaechler.com 4 4 Tags: Peertube, Video, Fediverse 5 Version: 1.5 6 Stable tag: 1.5 5 Version: 1.5.1 6 Stable tag: 1.5.1 7 7 Requires at least: 6.0 8 8 Tested up to: 6.8 … … 17 17 ### Comming Soon 18 18 a shortcode that recognises whether a livestream is running and then displays it or if none is running a video is displayed 19 19 20 20 21 ### Available Shortcodes … … 42 43 43 44 45 Displays a list of embedded videos from a specific Peertube channel with offset 46 here the list is started with video no. 3 from your channel 44 47 48 `[cbvmfp-last-channel-videos offset='2']` 45 49 46 50 -
video-manager-for-peertube/trunk/show_last_videos_channel.php
r3304036 r3304173 6 6 $cbvmfp_peertube_anzahl_videos = get_option('cbvmfp_peertube_anzahl_videos'); 7 7 $cbvmfp_peertube_channel = get_option('cbvmfp_peertube_channel'); 8 8 9 // Shortcode-Attribute mit Standardwerten 9 10 $atts = shortcode_atts([ 10 11 'instance' => $cbvmfp_peertube_url, 11 12 'channel' => $cbvmfp_peertube_channel, 12 'count' => $cbvmfp_peertube_anzahl_videos 13 ], $atts, 'peertube-manager-channel'); 13 'count' => $cbvmfp_peertube_anzahl_videos, 14 'offset' => 0 15 ], $atts, 'cbvmfp-last-channel-videos'); 14 16 15 17 // Prüfen, ob Kanalname angegeben ist … … 18 20 } 19 21 20 // API-URL für Kanalvideos 22 $offset = intval($atts['offset']); 23 $count = intval($atts['count']); 24 25 // API-URL (wir holen mehr Videos, damit wir später "offset" anwenden können) 26 $fetchCount = $offset + $count; 27 21 28 $channelName = urlencode($atts['channel']); 22 $apiUrl = $atts['instance'] . '/api/v1/video-channels/' . $channelName . '/videos?sort=-publishedAt&count=' . intval($atts['count']);29 $apiUrl = $atts['instance'] . '/api/v1/video-channels/' . $channelName . '/videos?sort=-publishedAt&count=' . $fetchCount; 23 30 24 31 // cURL anstoßen … … 43 50 } 44 51 52 $videos = array_slice($data['data'], $offset, $count); 53 54 if (empty($videos)) { 55 return '<p>' . __('No videos found after applying offset.', 'wordpress-peertube-manager') . '</p>'; 56 } 57 45 58 // HTML-Ausgabe mit eingebetteten Videos 46 59 $output = '<div class="cbvmfp-video-embed-wrapper">'; 47 foreach ($ data['data']as $video) {60 foreach ($videos as $video) { 48 61 $embedUrl = esc_url($atts['instance'] . '/videos/embed/' . $video['uuid']); 49 62 $output .= '<div class="cbvmfp-video">'; … … 53 66 $output .= '</div>'; 54 67 55 56 57 68 return $output; 58 69 } -
video-manager-for-peertube/trunk/video-manager-for-peertube.php
r3304036 r3304173 5 5 Description: Integrate Peertube Videos into your WordPress (<a href="options-general.php?page=cbvmfp_settings">Settings</a>) 6 6 Author: Eric-Oliver Mächler 7 Version: 1.5 7 Version: 1.5.1 8 8 Author URI: https://www.chefblogger.me 9 9 Requires at least: 6.0
Note: See TracChangeset
for help on using the changeset viewer.