Loading app/Controllers/Admin/Podcast.php +10 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,9 @@ class Podcast extends BaseController 'location' => $this->request->getPost('location_name'), 'payment_pointer' => $this->request->getPost('payment_pointer'), 'custom_rss_string' => $this->request->getPost('custom_rss'), 'partner_id' => $this->request->getPost('partner_id'), 'partner_link_url' => $this->request->getPost('partner_link_url'), 'partner_image_url' => $this->request->getPost('partner_image_url'), 'is_blocked' => $this->request->getPost('block') === 'yes', 'is_completed' => $this->request->getPost('complete') === 'yes', 'is_locked' => $this->request->getPost('lock') === 'yes', Loading Loading @@ -263,6 +266,13 @@ class Podcast extends BaseController $this->podcast->custom_rss_string = $this->request->getPost( 'custom_rss' ); $this->podcast->partner_id = $this->request->getPost('partner_id'); $this->podcast->partner_link_url = $this->request->getPost( 'partner_link_url' ); $this->podcast->partner_image_url = $this->request->getPost( 'partner_image_url' ); $this->podcast->is_blocked = $this->request->getPost('block') === 'yes'; $this->podcast->is_completed = $this->request->getPost('complete') === 'yes'; Loading app/Database/Migrations/2020-05-30-101500_add_podcasts.php +14 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,20 @@ class AddPodcasts extends Migration ], 'custom_rss' => [ 'type' => 'JSON', ], 'partner_id' => [ 'type' => 'VARCHAR', 'constraint' => 32, 'null' => true, ], 'partner_link_url' => [ 'type' => 'VARCHAR', 'constraint' => 512, 'null' => true, ], 'partner_image_url' => [ 'type' => 'VARCHAR', 'constraint' => 512, 'null' => true, ], 'created_by' => [ Loading app/Entities/Episode.php +34 −12 Original line number Diff line number Diff line Loading @@ -483,19 +483,21 @@ class Episode extends Entity return $this; } public function getDescriptionHtml() { if ( $descriptionFooter = $this->getPodcast() ->episode_description_footer_html ) { return $this->attributes['description_html'] . '<footer>' . $descriptionFooter . '</footer>'; } return $this->attributes['description_html']; public function getDescriptionHtml($serviceSlug = null) { return (empty($this->getPodcast()->partner_id) || empty($this->getPodcast()->partner_link_url) || empty($this->getPodcast()->partner_image_url) ? '' : "<div><a href=\"{$this->getPartnerLink( $serviceSlug )}\" rel=\"sponsored noopener noreferrer\" target=\"_blank\"><img src=\"{$this->getPartnerImage( $serviceSlug )}\" alt=\"Partner image\" /></a></div>") . $this->attributes['description_html'] . (empty($this->getPodcast()->episode_description_footer_html) ? '' : "<footer>{$this->getPodcast()->episode_description_footer_html}</footer>"); } public function getDescription() Loading Loading @@ -624,4 +626,24 @@ class Episode extends Entity $this->attributes['custom_rss'] = null; } } function getPartnerLink($serviceSlug = null) { return rtrim($this->getPodcast()->partner_link_url, '/') . '?pid=' . $this->getPodcast()->partner_id . '&guid=' . urlencode($this->attributes['guid']) . (empty($serviceSlug) ? '' : '&_from=' . $serviceSlug); } function getPartnerImage($serviceSlug = null) { return rtrim($this->getPodcast()->partner_image_url, '/') . '?pid=' . $this->getPodcast()->partner_id . '&guid=' . urlencode($this->attributes['guid']) . (empty($serviceSlug) ? '' : '&_from=' . $serviceSlug); } } app/Entities/Podcast.php +3 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,9 @@ class Podcast extends Entity 'location_osmid' => '?string', 'payment_pointer' => '?string', 'custom_rss' => '?json-array', 'partner_id' => '?string', 'partner_link_url' => '?string', 'partner_image_url' => '?string', 'created_by' => 'integer', 'updated_by' => 'integer', ]; Loading app/Helpers/rss_helper.php +4 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,10 @@ function get_rss_feed($podcast, $serviceSlug = '') $locationElement->addAttribute('osm', $episode->location_osmid); } } $item->addChildWithCDATA('description', $episode->description_html); $item->addChildWithCDATA( 'description', $episode->getDescriptionHtml($serviceSlug) ); $item->addChild( 'duration', $episode->enclosure_duration, Loading Loading
app/Controllers/Admin/Podcast.php +10 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,9 @@ class Podcast extends BaseController 'location' => $this->request->getPost('location_name'), 'payment_pointer' => $this->request->getPost('payment_pointer'), 'custom_rss_string' => $this->request->getPost('custom_rss'), 'partner_id' => $this->request->getPost('partner_id'), 'partner_link_url' => $this->request->getPost('partner_link_url'), 'partner_image_url' => $this->request->getPost('partner_image_url'), 'is_blocked' => $this->request->getPost('block') === 'yes', 'is_completed' => $this->request->getPost('complete') === 'yes', 'is_locked' => $this->request->getPost('lock') === 'yes', Loading Loading @@ -263,6 +266,13 @@ class Podcast extends BaseController $this->podcast->custom_rss_string = $this->request->getPost( 'custom_rss' ); $this->podcast->partner_id = $this->request->getPost('partner_id'); $this->podcast->partner_link_url = $this->request->getPost( 'partner_link_url' ); $this->podcast->partner_image_url = $this->request->getPost( 'partner_image_url' ); $this->podcast->is_blocked = $this->request->getPost('block') === 'yes'; $this->podcast->is_completed = $this->request->getPost('complete') === 'yes'; Loading
app/Database/Migrations/2020-05-30-101500_add_podcasts.php +14 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,20 @@ class AddPodcasts extends Migration ], 'custom_rss' => [ 'type' => 'JSON', ], 'partner_id' => [ 'type' => 'VARCHAR', 'constraint' => 32, 'null' => true, ], 'partner_link_url' => [ 'type' => 'VARCHAR', 'constraint' => 512, 'null' => true, ], 'partner_image_url' => [ 'type' => 'VARCHAR', 'constraint' => 512, 'null' => true, ], 'created_by' => [ Loading
app/Entities/Episode.php +34 −12 Original line number Diff line number Diff line Loading @@ -483,19 +483,21 @@ class Episode extends Entity return $this; } public function getDescriptionHtml() { if ( $descriptionFooter = $this->getPodcast() ->episode_description_footer_html ) { return $this->attributes['description_html'] . '<footer>' . $descriptionFooter . '</footer>'; } return $this->attributes['description_html']; public function getDescriptionHtml($serviceSlug = null) { return (empty($this->getPodcast()->partner_id) || empty($this->getPodcast()->partner_link_url) || empty($this->getPodcast()->partner_image_url) ? '' : "<div><a href=\"{$this->getPartnerLink( $serviceSlug )}\" rel=\"sponsored noopener noreferrer\" target=\"_blank\"><img src=\"{$this->getPartnerImage( $serviceSlug )}\" alt=\"Partner image\" /></a></div>") . $this->attributes['description_html'] . (empty($this->getPodcast()->episode_description_footer_html) ? '' : "<footer>{$this->getPodcast()->episode_description_footer_html}</footer>"); } public function getDescription() Loading Loading @@ -624,4 +626,24 @@ class Episode extends Entity $this->attributes['custom_rss'] = null; } } function getPartnerLink($serviceSlug = null) { return rtrim($this->getPodcast()->partner_link_url, '/') . '?pid=' . $this->getPodcast()->partner_id . '&guid=' . urlencode($this->attributes['guid']) . (empty($serviceSlug) ? '' : '&_from=' . $serviceSlug); } function getPartnerImage($serviceSlug = null) { return rtrim($this->getPodcast()->partner_image_url, '/') . '?pid=' . $this->getPodcast()->partner_id . '&guid=' . urlencode($this->attributes['guid']) . (empty($serviceSlug) ? '' : '&_from=' . $serviceSlug); } }
app/Entities/Podcast.php +3 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,9 @@ class Podcast extends Entity 'location_osmid' => '?string', 'payment_pointer' => '?string', 'custom_rss' => '?json-array', 'partner_id' => '?string', 'partner_link_url' => '?string', 'partner_image_url' => '?string', 'created_by' => 'integer', 'updated_by' => 'integer', ]; Loading
app/Helpers/rss_helper.php +4 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,10 @@ function get_rss_feed($podcast, $serviceSlug = '') $locationElement->addAttribute('osm', $episode->location_osmid); } } $item->addChildWithCDATA('description', $episode->description_html); $item->addChildWithCDATA( 'description', $episode->getDescriptionHtml($serviceSlug) ); $item->addChild( 'duration', $episode->enclosure_duration, Loading