Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed plugin update to version 1.0.1 #515

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 86 additions & 77 deletions fp-interface/sharedtpls/comment-form.tpl
Original file line number Diff line number Diff line change
@@ -1,99 +1,108 @@
{if !$entry_commslock}
<h4 id="addcomment">{$lang.comments.head}</h4>
{if not $flatpress.loggedin}
<p>{$lang.comments.descr}</p>
{/if}

<form id="commentform" method="post"
action="{$flatpress.params.entry|link:comments_link}#commentform"
enctype="multipart/form-data">

{if function_exists('plugin_feed_head')}
<p class="alignright">
<a href="{$flatpress.params.entry|link:comments_link}feed/rss2/" title="{$lang.plugin.feed.rss}" target="_blank"><span class="icon-rss"></span>RSS</a> |
<a href="{$flatpress.params.entry|link:comments_link}feed/atom/" title="{$lang.plugin.feed.atom}" target="_blank"><span class="icon-rss"></span>ATOM</a>
</p><br>
{/if}

{include file="shared:errorlist.tpl"}

<h4 id="addcomment">{$lang.comments.head}</h4>

{if not $flatpress.loggedin}
<p>{$lang.comments.descr}</p>
{/if}

{*<fieldset id="comment-userdata">*}
<div id="comment-userdata">
<form id="commentform" method="post"
action="{$flatpress.params.entry|link:comments_link}#commentform"
enctype="multipart/form-data">

<p>
{if isset($error) && isset($error.name) && !empty($error.name)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.name) && !empty($values.name)}
{assign var=namevalue value=$values.name}
{else}
{assign var=namevalue value=""}
{/if}
<input type="text" class="{$class}" name="name" id="name" value="{$namevalue|wp_specialchars:1|default:$cookie.name}">
<label class="textlabel" for="name">{$lang.comments.name}</label>
</p>

<p>
{if isset($error) && isset($error.email) && !empty($error.email)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.email) && !empty($values.email)}
{assign var=emailvalue value=$values.email}
{else}
{assign var=emailvalue value=""}
{/if}
<input type="text" class="{$class}" name="email" id="email" value="{$emailvalue|wp_specialchars:1|default:$cookie.email}">
<label class="textlabel" for="email">{$lang.comments.email}</label>
</p>

<p>
{if isset($error) && isset($error.url) && !empty($error.url)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.url) && !empty($values.url)}
{assign var=urlvalue value=$values.url}
{else}
{assign var=urlvalue value=""}
{/if}
<input type="text" class="{$class}" name="url" id="url" value="{$urlvalue|wp_specialchars:1|default:$cookie.url}">
<label class="textlabel" for="url">{$lang.comments.www}</label>
</p>

{* do action *}
{comment_form}
{include file="shared:errorlist.tpl"}

</div>

{/if}
{if not $flatpress.loggedin}

{if function_exists('plugin_bbcode_init') && $fp_config.plugins.bbcode.comments == true}
{include file="plugin:bbcode/comment_toolbar"}
{/if}
{*<fieldset id="comment-userdata">*}
<div id="comment-userdata">

<!-- BOF Custom toolbar -->{action hook=simple_toolbar_form}<!-- EOF Custom toolbar -->
<p>
{if isset($error) && isset($error.name) && !empty($error.name)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.name) && !empty($values.name)}
{assign var=namevalue value=$values.name}
{else}
{assign var=namevalue value=""}
{/if}
<input type="text" class="{$class}" name="name" id="name" value="{$namevalue|wp_specialchars:1|default:$cookie.name}">
<label class="textlabel" for="name">{$lang.comments.name}</label>
</p>

<div class="comment-content">
{if isset($error) && isset($error.content) && !empty($error.content)}
<p>
{if isset($error) && isset($error.email) && !empty($error.email)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.content) && !empty($values.content)}
{assign var=contentvalue value=$values.content}
{if isset($values) && isset($values.email) && !empty($values.email)}
{assign var=emailvalue value=$values.email}
{else}
{assign var=contentvalue value=""}
{assign var=emailvalue value=""}
{/if}
<p><textarea name="content" class="{$class}"
id="content" rows="10" cols="74">{$contentvalue|wp_specialchars:1}</textarea></p>
{*here will go a plugin hook*}
</div>
<input type="text" class="{$class}" name="email" id="email" value="{$emailvalue|wp_specialchars:1|default:$cookie.email}">
<label class="textlabel" for="email">{$lang.comments.email}</label>
</p>

<div class="buttonbar">
<input type="submit" name="submit" id="submit" value="{$lang.comments.submit}">
</div>
<p>
{if isset($error) && isset($error.url) && !empty($error.url)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.url) && !empty($values.url)}
{assign var=urlvalue value=$values.url}
{else}
{assign var=urlvalue value=""}
{/if}
<input type="text" class="{$class}" name="url" id="url" value="{$urlvalue|wp_specialchars:1|default:$cookie.url}">
<label class="textlabel" for="url">{$lang.comments.www}</label>
</p>

{* do action *}
{comment_form}

</div>

{/if}

{if function_exists('plugin_bbcode_init') && $fp_config.plugins.bbcode.comments == true}
{include file="plugin:bbcode/comment_toolbar"}
{/if}

</form>
<!-- BOF Custom toolbar -->{action hook=simple_toolbar_form}<!-- EOF Custom toolbar -->

<div class="comment-content">
{if isset($error) && isset($error.content) && !empty($error.content)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.content) && !empty($values.content)}
{assign var=contentvalue value=$values.content}
{else}
{assign var=contentvalue value=""}
{/if}
<p><textarea name="content" class="{$class}"
id="content" rows="10" cols="74">{$contentvalue|wp_specialchars:1}</textarea></p>
{*here will go a plugin hook*}
</div>

<div class="buttonbar">
<input type="submit" name="submit" id="submit" value="{$lang.comments.submit}">
</div>

</form>
{/if}
6 changes: 0 additions & 6 deletions fp-plugins/feed/img/License.md

This file was deleted.

Binary file removed fp-plugins/feed/img/atom-white.png
Binary file not shown.
Binary file removed fp-plugins/feed/img/atom.png
Binary file not shown.
Binary file removed fp-plugins/feed/img/rss-white.png
Binary file not shown.
Binary file removed fp-plugins/feed/img/rss.png
Binary file not shown.
9 changes: 4 additions & 5 deletions fp-plugins/feed/plugin.feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Plugin Name: RSS and Atom Feed
* Version: 1.0.0
* Version: 1.0.1
* Plugin URI: https://www.flatpress.org
* Author: FlatPress
* Author URI: https://www.flatpress.org
Expand All @@ -15,7 +15,7 @@ function plugin_feed_head() { // stytesheet-file

echo '
<!-- BOF Feed-Button Stylesheet -->
<link rel="stylesheet" type="text/css" href="' . $pdir . 'res/feed.css">
<link rel="stylesheet" type="text/css" href="' . $pdir . 'res/feed.css.php">
<!-- EOF Feed Stylesheet -->
';
}
Expand All @@ -24,7 +24,6 @@ function plugin_feed_widget() {

$lang = lang_load('plugin:feed');
$baseurl = BLOG_BASEURL;
$imgdir = plugin_geturl('feed');

$widget ['subject'] = $lang ['plugin'] ['feed'] ['subject'];

Expand All @@ -35,8 +34,8 @@ function plugin_feed_widget() {
<!-- BOF Feed-Buttons -->
<ul>
<li>
<a href="' . $baseurl . '?x=feed:rss2" title="' . $rss . '" target="_blank"><img class="feed-widget" src="' . $imgdir . 'img/rss.png" alt="RSS"></a>
<a href="' . $baseurl . '?x=feed:atom" title="' . $atom . '" target="_blank"><img class="feed-widget" src="' . $imgdir . 'img/atom.png" alt="Atom"></a>
<a href="' . $baseurl . '?x=feed:rss2" title="' . $rss . '" target="_blank"><span class="icon-rss"></span>RSS</a> | ' . //
'<a href="' . $baseurl . '?x=feed:atom" title="' . $atom . '" target="_blank"><span class="icon-rss"></span>ATOM</a>
</li>
</ul>
<!-- EOF Feed-Buttons -->
Expand Down
4 changes: 0 additions & 4 deletions fp-plugins/feed/res/feed.css

This file was deleted.

73 changes: 73 additions & 0 deletions fp-plugins/feed/res/feed.css.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
header('Content-Type: text/css; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Cache-Control: max-age=31536000');

require_once '../../../defaults.php';
$url = BLOG_BASEURL;
?>

.feed-widget {
margin: 0px;
height: 16px
}

/**
* ===========
* Font Zocial
* ===========
*
* Name: Zocial
* Module: zocial-rss.css
* Designer Name: Sam Collins
* Author URI: https://github.com/smcllns/css-social-buttons
* Description: This file defines the font
* Last change: 08.01.2025 by FKM
* License: The font of Zocial is under MIT-License
*/

@font-face {
font-family: 'zocial';
font-display: swap;
src: local('zocial-rss'),
url('<?php echo $url;?>zocial/zocial-rss.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}

[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "zocial";
font-style: normal;
font-weight: normal;
speak: never;

display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */

/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;

/* fix buttons height, for twitter bootstrap */
line-height: 1em;

/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;

/* you can be more comfortable with increased icons size */
/* font-size: 120%; */

/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}

.icon-rss:before { content: '\e800'; } /* '' */
32 changes: 32 additions & 0 deletions fp-plugins/feed/res/zocial/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
The RSS icon is an icon from the Zocial font library
Zocial Font/ RSS-Icon license info

## Zocial

Copyright (C) 2012 by Sam Collins

Author: Sam Collins
License: MIT (http://opensource.org/licenses/mit-license.php)
Homepage: http://zocial.smcllns.com/
GitHub https://github.com/smcllns/css-social-buttons

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file added fp-plugins/feed/res/zocial/zocial-rss.woff2
Binary file not shown.