Plugin Directory

Changeset 2010502


Ignore:
Timestamp:
01/11/2019 10:58:56 AM (7 years ago)
Author:
podigee
Message:

Added support for multiple podcasts

Location:
podigee
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • podigee/trunk/admin/class-podigee-qp.php

    r1971402 r2010502  
    5858        $subdomain = $options['pfex_slug'];
    5959        $token = $options['pfex_token'];
    60         if ($subdomain == false) $default = ""; else $default = "https://".$subdomain.".podigee.io/feed/mp3/";
    61 
     60
     61        if ($subdomain == false) $default = ""; else {
     62            $subdomain = explode(",", $subdomain);
     63           
     64            if (count($subdomain) > 1) {
     65                $sd_choice = "<label for=\"pfex-subdomain-select\">Choose subdomain:</label><br />";
     66                $sd_choice .= "<select name=\"pfex-subdomain-select\" id=\"pfex-subdomain-select\" class=\"postbox pfex-ep-input\">";
     67                foreach ($subdomain as $sd) {
     68                    $domain = "https://".$sd.".podigee.io/feed/mp3/";
     69                    $sd_choice .= "<option value=\"$domain\">$sd</option>";
     70                }
     71                $sd_choice .= "</select>";
     72            } else $default = $domain = "https://".$subdomain[0].".podigee.io/feed/mp3/";
     73        }
    6274        ?>
    6375        <div id="pfex-container">
    6476            <div id="pfex-step-1" class="">
     77                <?php echo $sd_choice; ?>
    6578                <label for="pfex-feed-url">Feed URL:</label><br />
    6679                <input name="pfex-feed-url" id="pfex-feed-url" class="postbox pfex-ep-input" readonly value="<?php echo $default; ?>" /><br />
    6780                <input id="pfex-fetch" name="pfex-fetch" type="button" class="button button-primary pfex-feed-fetch-button" value="fetch feed" /><span id="pfex-feed-info"><?php
    68                 if ($this->check_authorization($subdomain, $token) == false) {
     81                if ($this->check_authorization($subdomain[0], $token) == false) {
    6982                    echo "There seems to be a problem with your Podigee authorization. Please check your <a href=\"options-general.php?page=podigee-wpqp-plugin\">settings</a>.";
    7083                }
     
    156169        $token = $options['pfex_token'];
    157170        $subdomain = $options['pfex_slug'];
     171
     172        $subdomains = explode(",", $options['pfex_slug']);
     173        $subdomain = $subdomains[0];
    158174
    159175        if ($this->check_authorization($subdomain, $token) == false) {
  • podigee/trunk/admin/podigee-qp-admin.js

    r1971402 r2010502  
    194194
    195195
     196        /**
     197        * Switching subdomain has to update the feed URL input field.
     198        */
     199        $('#pfex-subdomain-select').on('change', function(){
     200            $('#pfex-feed-url').val($(this).val());
     201            localStorage['pfex-last-selection'] = $(this).val();
     202        });
     203
     204        var lastselection = localStorage['pfex-last-selection'] || '';
     205
     206        if (lastselection == "") {
     207            $('#pfex-subdomain-select').trigger('change');
     208        } else {
     209            $('#pfex-subdomain-select').val(lastselection);
     210            $('#pfex-feed-url').val(lastselection);
     211        }
    196212   });
    197213
     
    291307    }
    292308
     309
    293310    /**
    294311    * Resetting input fields on change. 
  • podigee/trunk/podigee-quick-publish.php

    r1986749 r2010502  
    44* Plugin URI:  https://podigee.com
    55* Description: Let's you import metadata from your Podigee podcast feed right into the Wordpress post editor. Not (yet) compatible to Gutenberg. Developed for Podigee by Jürgen Krauß (https://www.es-ist-ein-krauss.de/).
    6 * Version:     0.6.4
     6* Version:     0.7
    77* Author:      Podigee
    88* Author URI:  https://podigee.com
     
    103103    $options = get_option('pfex_plugin_options');
    104104    echo "<input id='pfex_slug' name='pfex_plugin_options[pfex_slug]' size='40' type='text' value='{$options['pfex_slug']}' />";
    105     echo "<br /><small>Please do not enter the full podcast URL here – only the subdomain as configured in the <i>General</i> section of your podcast&apos;s settings.<br /><i>Example</i>: If your Podcast is located at <strong>https://mypreciouspodcast.podigee.io</strong> – you would only need to enter <strong>mypreciouspodcast</strong>.</small>";
    106     $mp3feed = "https://".$options['pfex_slug'].".podigee.io/feed/mp3/";
    107     if (isset($options['pfex_slug']) && trim($options['pfex_slug']) != "") echo " <br /><br /><small>If configured correctly, you should be able to reach your feed at <a href=\"$mp3feed\" target=\"_blank\">$mp3feed</a></small>.";
     105    echo "<p>Please do not enter the full podcast URL here – only the subdomain as configured in the <i>General</i> section of your podcast&apos;s settings.<br /><i>Example</i>: If your Podcast is located at <strong>https://mypreciouspodcast.podigee.io</strong> – you would only need to enter <strong>mypreciouspodcast</strong>.</p>";
     106    if (isset($options['pfex_slug']) && trim($options['pfex_slug']) != "") {
     107        $subdomains = explode(",", $options['pfex_slug']);
     108       
     109        if (count($subdomains) > 0) {
     110            echo "<br /><p>If configured correctly, you should be able to reach your feed at: <br /><ul>";
     111            foreach ($subdomains as $subdomain) {
     112                $mp3feed = "https://".$subdomain.".podigee.io/feed/mp3/";
     113                 echo "<li><a href=\"$mp3feed\" target=\"_blank\">$mp3feed</a></li>";
     114            }
     115            echo "</ul></p>";
     116        }
     117    }
     118    echo "<p><strong>NEW:</strong>You can add multiple subdomains in a comma-separated list.</p>";
    108119}
    109120
     
    114125    $options = get_option('pfex_plugin_options');
    115126    echo "<input id='pfex_token' name='pfex_plugin_options[pfex_token]' size='40' type='text' value='{$options['pfex_token']}' />";
    116     echo "</br /><small>Please enter the auth token as displayed <small><a href=\"https://app.podigee.com/settings#applications\" target=\"_blank\">here</a>.</small>";
     127    echo "</br />Please enter the auth token as displayed <a href=\"https://app.podigee.com/settings#applications\" target=\"_blank\">here</a>.";
    117128}
    118129
     
    126137        $options['pfex_token'] = '';
    127138    }
    128     $options['pfex_slug'] = strtolower(trim($input['pfex_slug']));
    129     if(!preg_match('/^[a-z0-9-_]+$/i', $options['pfex_slug'])) {
     139    $options['pfex_slug'] = strtolower(trim(str_replace(" ", "", $input['pfex_slug'])));
     140    if(!preg_match('/^[a-z0-9-_,]+$/i', $options['pfex_slug'])) {
    130141        $options['pfex_slug'] = '';
    131142    }
  • podigee/trunk/readme.txt

    r1986753 r2010502  
    33Tags: podcast, feed
    44Requires at least: 3.9
    5 Tested up to: 4.9
     5Tested up to: 5.0.3
    66Requires PHP: 5.2.4
    7 Stable tag: 0.6.4
     7Stable tag: 0.7
    88License:     MIT License
    99License URI: https://opensource.org/licenses/MIT
     
    6666== Changelog ==
    6767
     68= 0.7 =
     69* Added support for multiple subdomains
     70
    6871= 0.6.4 =
    6972* Bug fix to allow hyphens in subdomain
     
    8891== Upgrade Notice ==
    8992
     93= 0.7 =
     94* You can now fetch information from all the podcasts in your podigee account.
     95
    9096= 0.6 =
    9197* New options key 'pfex_plugin_options', the old one 'pfex_feed_url' is deprecated and can be removed from the Wordpress option database
Note: See TracChangeset for help on using the changeset viewer.