syndication 2.3.0: Drop subtome JS plugin
This commit is contained in:
parent
0590b97c67
commit
d2fb86fc2f
@ -13,12 +13,11 @@ class serendipity_plugin_syndication extends serendipity_plugin {
|
|||||||
$propbag->add('description', SHOWS_RSS_BLAHBLAH);
|
$propbag->add('description', SHOWS_RSS_BLAHBLAH);
|
||||||
$propbag->add('stackable', true);
|
$propbag->add('stackable', true);
|
||||||
$propbag->add('author', 'Serendipity Team');
|
$propbag->add('author', 'Serendipity Team');
|
||||||
$propbag->add('version', '2.2.4');
|
$propbag->add('version', '2.3.0');
|
||||||
$propbag->add('configuration', array(
|
$propbag->add('configuration', array(
|
||||||
'title',
|
'title',
|
||||||
'big_img',
|
'big_img',
|
||||||
'feed_format',
|
'feed_format',
|
||||||
'subToMe',
|
|
||||||
'show_comment_feed',
|
'show_comment_feed',
|
||||||
'separator',
|
'separator',
|
||||||
'iconURL',
|
'iconURL',
|
||||||
@ -33,17 +32,13 @@ class serendipity_plugin_syndication extends serendipity_plugin {
|
|||||||
|
|
||||||
$propbag->add('legal', array(
|
$propbag->add('legal', array(
|
||||||
'services' => array(
|
'services' => array(
|
||||||
'subtome' => array(
|
|
||||||
'url' => 'https://www.subtome.com',
|
|
||||||
'desc' => 'Enables visitors to easily subscribe to RSS feeds. The visitor loads a JavaScript from their servers, thus the IP address will be known to the service.'
|
|
||||||
),
|
|
||||||
'feedburner.com' => array(
|
'feedburner.com' => array(
|
||||||
'url' => 'https://www.feedburner.com',
|
'url' => 'https://www.feedburner.com',
|
||||||
'desc' => 'Feedburner can be used to track your feed subscription statistics. If used, a tracking pixel is loaded from FeedBurner.com servers and the IP address of the visitor will be known to the service.'
|
'desc' => 'Feedburner can be used to track your feed subscription statistics. If used, a tracking pixel is loaded from FeedBurner.com servers and the IP address of the visitor will be known to the service.'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'frontend' => array(
|
'frontend' => array(
|
||||||
'To allow easy subscription to feeds and optional tracking statistics, the subtome or feedburner services can be used.',
|
'To allow easy subscription to feeds and optional tracking statistics, the legacy feedburner services can be used.',
|
||||||
),
|
),
|
||||||
'backend' => array(
|
'backend' => array(
|
||||||
),
|
),
|
||||||
@ -129,13 +124,6 @@ class serendipity_plugin_syndication extends serendipity_plugin {
|
|||||||
$propbag->add('default', '');
|
$propbag->add('default', '');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'subToMe':
|
|
||||||
$propbag->add('type', 'boolean');
|
|
||||||
$propbag->add('name', SYNDICATION_PLUGIN_SUBTOME);
|
|
||||||
$propbag->add('description', SYNDICATION_PLUGIN_SUBTOME_DESC);
|
|
||||||
$propbag->add('default', false);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'custom_url':
|
case 'custom_url':
|
||||||
$propbag->add('type', 'boolean');
|
$propbag->add('type', 'boolean');
|
||||||
$propbag->add('name', SYNDICATION_PLUGIN_CUSTOMURL);
|
$propbag->add('name', SYNDICATION_PLUGIN_CUSTOMURL);
|
||||||
@ -164,7 +152,6 @@ class serendipity_plugin_syndication extends serendipity_plugin {
|
|||||||
if ($custom_img != 'none' && $custom_img != "feedburner") {
|
if ($custom_img != 'none' && $custom_img != "feedburner") {
|
||||||
$custom_img = serendipity_getTemplateFile($custom_img);
|
$custom_img = serendipity_getTemplateFile($custom_img);
|
||||||
}
|
}
|
||||||
$subtome = serendipity_db_bool($this->get_config('subToMe', true));
|
|
||||||
$fbid = $this->get_config('fb_id');
|
$fbid = $this->get_config('fb_id');
|
||||||
$custom_url = serendipity_db_bool($this->get_config('custom_url', false));
|
$custom_url = serendipity_db_bool($this->get_config('custom_url', false));
|
||||||
$feed_format = $this->get_config('feed_format', 'rss');
|
$feed_format = $this->get_config('feed_format', 'rss');
|
||||||
@ -215,44 +202,33 @@ class serendipity_plugin_syndication extends serendipity_plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$onclick = "";
|
|
||||||
if ($subtome) {
|
|
||||||
$onclick = $this->getOnclick($mainFeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "\n".'<ul id="serendipity_syndication_list" class="plainList">';
|
echo "\n".'<ul id="serendipity_syndication_list" class="plainList">';
|
||||||
echo $this->generateFeedButton($mainFeed, ($icon == $small_icon ? ($useRss ? "RSS $FEED" : "Atom $FEED") : ""), $onclick, $icon, $icon == $small_icon);
|
echo $this->generateFeedButton($mainFeed, ($icon == $small_icon ? ($useRss ? "RSS $FEED" : "Atom $FEED") : ""), $icon, $icon == $small_icon);
|
||||||
|
|
||||||
if ($useRss && (isset($useAtom) && $useAtom)) {
|
if ($useRss && (isset($useAtom) && $useAtom)) {
|
||||||
echo $this->generateFeedButton(serendipity_rewriteURL(PATH_FEEDS .'/atom10.xml'), "Atom $FEED",
|
echo $this->generateFeedButton(serendipity_rewriteURL(PATH_FEEDS .'/atom10.xml'), "Atom $FEED", $small_icon);
|
||||||
($subtome ? $this->getOnclick(serendipity_rewriteURL(PATH_FEEDS .'/atom10.xml')) : ""), $small_icon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (serendipity_db_bool($this->get_config('show_2.0c', false)) || serendipity_db_bool($this->get_config('show_comment_feed', false))) {
|
if (serendipity_db_bool($this->get_config('show_2.0c', false)) || serendipity_db_bool($this->get_config('show_comment_feed', false))) {
|
||||||
if ($useRss) {
|
if ($useRss) {
|
||||||
echo $this->generateFeedButton( serendipity_rewriteURL(PATH_FEEDS .'/comments.rss2'),
|
echo $this->generateFeedButton( serendipity_rewriteURL(PATH_FEEDS .'/comments.rss2'),
|
||||||
$COMMENTS . ($useAtom ? " (RSS)": ""),
|
$COMMENTS . ($useAtom ? " (RSS)": ""),
|
||||||
($subtome ? $this->getOnclick(serendipity_rewriteURL(PATH_FEEDS .'/comments.rss2')) : ""),
|
|
||||||
$small_icon);
|
$small_icon);
|
||||||
}
|
}
|
||||||
if ($useAtom) {
|
if ($useAtom) {
|
||||||
echo $this->generateFeedButton( serendipity_rewriteURL(PATH_FEEDS .'/comments.atom10'),
|
echo $this->generateFeedButton( serendipity_rewriteURL(PATH_FEEDS .'/comments.atom10'),
|
||||||
$COMMENTS . ($useRss ? " (Atom)": ""),
|
$COMMENTS . ($useRss ? " (Atom)": ""),
|
||||||
($subtome ? $this->getOnclick(serendipity_rewriteURL(PATH_FEEDS .'/comments.atom10')) : ""),
|
|
||||||
$small_icon);
|
$small_icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</ul>\n";
|
echo "</ul>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateFeedButton($feed, $label, $onclick, $icon, $small = false)
|
function generateFeedButton($feed, $label, $icon, $small = false)
|
||||||
{
|
{
|
||||||
$link = 'href="'.$feed.'" '. $onclick;
|
$link = 'href="'.$feed.'" ';
|
||||||
$output = '<li>';
|
$output = '<li>';
|
||||||
$class = "";
|
$class = "";
|
||||||
if ($onclick != "") { # this might be not a good solution, but right now works to add the subtome-class only when subtome is on
|
|
||||||
$class = "subtome";
|
|
||||||
}
|
|
||||||
if ($small) {
|
if ($small) {
|
||||||
$class .= " serendipity_xml_icon";
|
$class .= " serendipity_xml_icon";
|
||||||
}
|
}
|
||||||
@ -265,11 +241,6 @@ class serendipity_plugin_syndication extends serendipity_plugin {
|
|||||||
return $output .= "</li>\n";
|
return $output .= "</li>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOnclick($url)
|
|
||||||
{
|
|
||||||
return "onclick=\"document.subtomeBtn=this;document.subtomeBtn.dataset['subtomeFeeds']='". urlencode($url). "';var s=document.createElement('script');s.src='https://www.subtome.com/load.js';document.body.appendChild(s);return false;\"";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user