- Feature: Short code to not display the 'love me' slug on specific pages ( short code = [[no footnotes: love]] )

- Update: Setting where the reference container appears on public pages can also be set to the widget area

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@919367 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-05-22 12:47:54 +00:00
parent 8fa83b117b
commit 72c239feb1
5 changed files with 38 additions and 9 deletions

View file

@ -403,7 +403,8 @@ class Class_FootnotesSettings
*/ */
$l_arr_Options = array( $l_arr_Options = array(
"footer" => __("in the footer", FOOTNOTES_PLUGIN_NAME), "footer" => __("in the footer", FOOTNOTES_PLUGIN_NAME),
"post_end" => __("at the end of the post", FOOTNOTES_PLUGIN_NAME) "post_end" => __("at the end of the post", FOOTNOTES_PLUGIN_NAME),
"widget" => __("in the widget area", FOOTNOTES_PLUGIN_NAME)
); );
$this->AddLabel(FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE, __("Where shall the reference container appear:", FOOTNOTES_PLUGIN_NAME)); $this->AddLabel(FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE, __("Where shall the reference container appear:", FOOTNOTES_PLUGIN_NAME));
$this->AddSelectbox(FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE, $l_arr_Options, "footnote_plugin_50"); $this->AddSelectbox(FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE, $l_arr_Options, "footnote_plugin_50");

View file

@ -46,4 +46,10 @@ define("FOOTNOTE_REFERENCES_CONTAINER_ID", "footnote_references_container"); /*
/* PLUGIN DIRECTORIES */ /* PLUGIN DIRECTORIES */
define("FOOTNOTES_PLUGIN_DIR_NAME", "footnotes"); define("FOOTNOTES_PLUGIN_DIR_NAME", "footnotes");
define("FOOTNOTES_LANGUAGE_DIR", dirname(__FILE__) . "/../languages/"); define("FOOTNOTES_LANGUAGE_DIR", dirname(__FILE__) . "/../languages/");
define("FOOTNOTES_TEMPLATES_DIR", dirname(__FILE__) . "/../templates/"); define("FOOTNOTES_TEMPLATES_DIR", dirname(__FILE__) . "/../templates/");
/*
* PLUGIN PLACEHOLDER TO NOT DISPLAY THE 'LOVE ME' SLUG
* @since 1.1.1
*/
define("FOOTNOTES_NO_SLUGME_PLUG", "[[no footnotes: love]]");

View file

@ -4,7 +4,7 @@
* User: Stefan * User: Stefan
* Date: 15.05.14 * Date: 15.05.14
* Time: 16:21 * Time: 16:21
* Version: 1.0.7 * Version: 1.1.1
* Since: 1.0 * Since: 1.0
*/ */
@ -26,6 +26,12 @@ $g_arr_FootnotesSettings = array();
*/ */
$g_bool_FootnotesReplacementStarted = false; $g_bool_FootnotesReplacementStarted = false;
/*
* flag to know íf the user wants to have NO 'love me' slug on the current page
* @since 1.1.1
*/
$g_bool_NoLoveMeSlugOnCurrentPage = false;
/** /**
* register all functions needed for the replacement in the wordpress core * register all functions needed for the replacement in the wordpress core
* @since 1.0-gamma * @since 1.0-gamma
@ -49,7 +55,7 @@ function footnotes_RegisterReplacementFunctions()
add_filter('widget_text', 'footnotes_Replacer_WidgetText'); add_filter('widget_text', 'footnotes_Replacer_WidgetText');
/* adds the love and share me slug to the footer */ /* adds the love and share me slug to the footer */
add_filter('wp_footer', 'footnotes_LoveAndShareMe'); add_action('wp_footer', 'footnotes_LoveAndShareMe');
} }
@ -162,6 +168,7 @@ function footnotes_LoveAndShareMe()
{ {
/* access to the global settings collection */ /* access to the global settings collection */
global $g_arr_FootnotesSettings; global $g_arr_FootnotesSettings;
global $g_bool_NoLoveMeSlugOnCurrentPage;
/* /*
* updated url to wordpress.org plugin page instead of the github page * updated url to wordpress.org plugin page instead of the github page
* also updated the font-style and translation the string "footnotes" * also updated the font-style and translation the string "footnotes"
@ -174,7 +181,7 @@ function footnotes_LoveAndShareMe()
/* get setting for love and share this plugin and convert it to boolean */ /* get setting for love and share this plugin and convert it to boolean */
$l_bool_LoveMe = footnotes_ConvertToBool($g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_LOVE]); $l_bool_LoveMe = footnotes_ConvertToBool($g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_LOVE]);
/* check if the admin allows to add a link to the footer */ /* check if the admin allows to add a link to the footer */
if ($l_bool_LoveMe) { if ($l_bool_LoveMe && !$g_bool_NoLoveMeSlugOnCurrentPage) {
echo ' echo '
<div style="text-align:center; color:#acacac;">' . <div style="text-align:center; color:#acacac;">' .
sprintf(__("Hey there, I'm using the awesome WordPress Plugin called %s", FOOTNOTES_PLUGIN_NAME), '<a href="http://wordpress.org/plugins/footnotes/" target="_blank" style="text-decoration: none;">' . FOOTNOTES_PLUGIN_PUBLIC_NAME . '</a>') . sprintf(__("Hey there, I'm using the awesome WordPress Plugin called %s", FOOTNOTES_PLUGIN_NAME), '<a href="http://wordpress.org/plugins/footnotes/" target="_blank" style="text-decoration: none;">' . FOOTNOTES_PLUGIN_PUBLIC_NAME . '</a>') .
@ -208,6 +215,17 @@ function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = t
/* free all found footnotes if reference container will be displayed */ /* free all found footnotes if reference container will be displayed */
$g_arr_Footnotes = array(); $g_arr_Footnotes = array();
} }
/*
* checks if the user doesn't want to have a 'love me' on current page
* @since 1.1.1
*/
if (strpos($p_str_Content, FOOTNOTES_NO_SLUGME_PLUG) !== false) {
global $g_bool_NoLoveMeSlugOnCurrentPage;
$g_bool_NoLoveMeSlugOnCurrentPage = true;
$p_str_Content = str_replace(FOOTNOTES_NO_SLUGME_PLUG, "", $p_str_Content);
}
/* return the replaced content */ /* return the replaced content */
return $p_str_Content; return $p_str_Content;
} }

View file

@ -4,7 +4,7 @@
Plugin URI: https://github.com/media-competence-institute/footnotes Plugin URI: https://github.com/media-competence-institute/footnotes
Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine. Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
Author: media competence institute Author: media competence institute
Version: 1.1.0 Version: 1.1.1
Author URI: http://cheret.co.uk/mci Author URI: http://cheret.co.uk/mci
Text Domain: footnotes Text Domain: footnotes
Domain Path: /languages Domain Path: /languages
@ -31,7 +31,7 @@
* User: Stefan * User: Stefan
* Date: 15.05.14 * Date: 15.05.14
* Time: 16:21 * Time: 16:21
* Version: 1.0.5 * Version: 1.1.1
* Since: 1.0 * Since: 1.0
*/ */

View file

@ -38,13 +38,17 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho
== Changelog == == Changelog ==
= 1.1.1 =
- Feature: Short code to not display the 'love me' slug on specific pages ( short code = [[no footnotes: love]] )
- Update: Setting where the reference container appears on public pages can also be set to the widget area
= 1.1.0 = = 1.1.0 =
- Update: Global styling for the public plugin name - Update: Global styling for the public plugin name
- Update: Easier usage of the public plugin name in translations - Update: Easier usage of the public plugin name in translations
- Update: New Layout for the settings page to group similar settings to get a better overview - Update: New Layout for the settings page to group similar settings to get a better overview
- Update: Display settings submit button only if there is at least 1 editable setting in the current tab - Update: Display settings submit button only if there is at least 1 editable setting in the current tab
- Add: setting where the reference container appears on public pages (needs some corrections!) - Add: Setting where the reference container appears on public pages (needs some corrections!)
- Bugfix: displays only one reference container in front of the footer on category pages - Bugfix: Displays only one reference container in front of the footer on category pages
= 1.0.6 = = 1.0.6 =
- Bugfix: Uninstall function to delete all plugin settings - Bugfix: Uninstall function to delete all plugin settings