Changeset 2653204
- Timestamp:
- 01/05/2022 04:12:35 PM (4 years ago)
- Location:
- author-box-by-nocksoft
- Files:
-
- 12 added
- 2 deleted
- 20 edited
- 1 copied
-
tags/1.0.5 (copied) (copied from author-box-by-nocksoft/trunk)
-
tags/1.0.5/assets (deleted)
-
tags/1.0.5/author-box-by-nocksoft.php (modified) (3 diffs)
-
tags/1.0.5/css (added)
-
tags/1.0.5/css/hidewordpressauthorbox.css (added)
-
tags/1.0.5/css/style.css (added)
-
tags/1.0.5/js (added)
-
tags/1.0.5/js/colorpicker.js (added)
-
tags/1.0.5/languages/author-box-by-nocksoft-de_DE.mo (modified) (previous)
-
tags/1.0.5/languages/author-box-by-nocksoft-de_DE.po (modified) (1 diff)
-
tags/1.0.5/php/authorbox.php (modified) (3 diffs)
-
tags/1.0.5/php/avatars.php (modified) (1 diff)
-
tags/1.0.5/php/settings-defaults.php (modified) (1 diff)
-
tags/1.0.5/php/settings-global.php (modified) (3 diffs)
-
tags/1.0.5/php/settings-user.php (modified) (3 diffs)
-
tags/1.0.5/php/settings.php (added)
-
tags/1.0.5/php/setup.php (modified) (2 diffs)
-
tags/1.0.5/readme.txt (modified) (3 diffs)
-
trunk/assets (deleted)
-
trunk/author-box-by-nocksoft.php (modified) (3 diffs)
-
trunk/css (added)
-
trunk/css/hidewordpressauthorbox.css (added)
-
trunk/css/style.css (added)
-
trunk/js (added)
-
trunk/js/colorpicker.js (added)
-
trunk/languages/author-box-by-nocksoft-de_DE.mo (modified) (previous)
-
trunk/languages/author-box-by-nocksoft-de_DE.po (modified) (1 diff)
-
trunk/php/authorbox.php (modified) (3 diffs)
-
trunk/php/avatars.php (modified) (1 diff)
-
trunk/php/settings-defaults.php (modified) (1 diff)
-
trunk/php/settings-global.php (modified) (3 diffs)
-
trunk/php/settings-user.php (modified) (3 diffs)
-
trunk/php/settings.php (added)
-
trunk/php/setup.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
author-box-by-nocksoft/tags/1.0.5/author-box-by-nocksoft.php
r2464444 r2653204 3 3 /* 4 4 Plugin Name: Author Box by Nocksoft 5 Version: 1.0. 45 Version: 1.0.5 6 6 Author: Rafael Nockmann @ Nocksoft 7 7 Author URI: https://nocksoft.de … … 15 15 16 16 17 /* --- Settings link in plugin overview --- */ 18 add_filter("plugin_action_links_" . plugin_basename(__FILE__), "nstab_pluginsettingslink"); 19 function nstab_pluginsettingslink($links) { 20 $settingslink = "<a href='options-general.php?page=nstab'>" . __("Settings", "author-box-by-nocksoft") . "</a>"; 21 array_unshift($links, $settingslink); 22 return $links; 17 if (is_admin()) { 18 19 /* --- Settings link in plugin overview --- */ 20 add_filter("plugin_action_links_" . plugin_basename(__FILE__), "nstab_pluginsettingslink"); 21 function nstab_pluginsettingslink($links) { 22 $settingslink = "<a href='options-general.php?page=nstab'>" . __("Settings", "author-box-by-nocksoft") . "</a>"; 23 array_push($links, $settingslink); 24 return $links; 25 } 26 27 28 /* --- Load scripts --- */ 29 require_once plugin_dir_path(__FILE__) . "/php/setup.php"; 30 require_once plugin_dir_path(__FILE__) . "/php/settings-global.php"; 31 require_once plugin_dir_path(__FILE__) . "/php/settings-user.php"; 32 33 add_action("admin_enqueue_scripts", "nstab_loadcolorpicker"); 34 function nstab_loadcolorpicker() { 35 wp_enqueue_style("wp-color-picker"); 36 wp_enqueue_script("custom-script-handle", plugin_dir_url(__FILE__) . "js/colorpicker.js", array("wp-color-picker"), false, true); 37 } 38 39 40 /* --- Plugin setup --- */ 41 register_activation_hook(__FILE__, "nstab_activate_plugin"); 42 register_uninstall_hook(__FILE__, "nstab_uninstall_plugin"); 43 23 44 } 24 45 25 46 26 47 /* --- Load scripts --- */ 27 require_once plugin_dir_path(__FILE__) . "/php/setup.php";28 48 require_once plugin_dir_path(__FILE__) . "/php/avatars.php"; 29 49 require_once plugin_dir_path(__FILE__) . "/php/authorbox.php"; 30 require_once plugin_dir_path(__FILE__) . "/php/settings-global.php"; 31 require_once plugin_dir_path(__FILE__) . "/php/settings-user.php"; 32 33 34 /* --- Plugin setup --- */ 35 register_activation_hook(__FILE__, "nstab_activate_plugin"); 36 register_uninstall_hook(__FILE__, "nstab_uninstall_plugin"); 50 require_once plugin_dir_path(__FILE__) . "/php/settings.php"; 37 51 38 52 39 53 /* --- Load styles --- */ 40 wp_register_style("author-box-by-nocksoft-style", plugin_dir_url(__FILE__) . " assets/style.css");54 wp_register_style("author-box-by-nocksoft-style", plugin_dir_url(__FILE__) . "css/style.css"); 41 55 wp_enqueue_style("author-box-by-nocksoft-style"); 42 56 43 if ( get_option("nstab_setting_hidewordpressauthorbox")== true) {44 wp_register_style("author-box-by-nocksoft-hidewordpressauthorbox", plugin_dir_url(__FILE__) . " assets/hidewordpressauthorbox.css");57 if ($nstab_setting_hidewordpressauthorbox == true) { 58 wp_register_style("author-box-by-nocksoft-hidewordpressauthorbox", plugin_dir_url(__FILE__) . "css/hidewordpressauthorbox.css"); 45 59 wp_enqueue_style("author-box-by-nocksoft-hidewordpressauthorbox"); 46 60 } … … 48 62 49 63 /* --- Languages --- */ 64 add_action("plugins_loaded", "nstab_load_plugin_textdomain"); 50 65 function nstab_load_plugin_textdomain() { 51 66 load_plugin_textdomain("author-box-by-nocksoft", FALSE, basename(dirname(__FILE__)) . "/languages/"); 52 67 } 53 add_action("plugins_loaded", "nstab_load_plugin_textdomain");54 55 68 56 69 ?> -
author-box-by-nocksoft/tags/1.0.5/languages/author-box-by-nocksoft-de_DE.po
r2464444 r2653204 3 3 msgstr "Fügt eine moderne anpassbare Autoren Info Box am Ende deines Beitrages ein und bringt Support für lokale Avatare." 4 4 5 #: author-box-by-nocksoft.php: 195 #: author-box-by-nocksoft.php:22 6 6 msgid "Settings" 7 7 msgstr "Einstellungen" 8 8 9 #: setup.php:8 9 #: authorbox.php:55 10 msgid "View Archive" 11 msgstr "Archiv anzeigen" 12 13 #: authorbox.php:62 14 msgid "View Archive" 15 msgstr "Archiv anzeigen" 16 17 #: settings-defaults.php:16 10 18 msgid "A Post by" 11 19 msgstr "Ein Beitrag von" 12 20 13 #: settings-global.php:45 14 msgid "User-specific settings are made in your author profile in WordPress (Users -> Your Profile). General settings can be made here." 15 msgstr "Benutzerspezifische Einstellungen werden in deinem Benutzerprofil getätigt (Benutzer -> Dein Profil). Allgemeine Einstellungen können hier vorgenommen werden." 16 17 #: settings-global.php:49 21 #: settings-global.php:65 22 msgid "User-specific settings are made in your user profile in WordPress (Users -> Your Profile -> Edit). General settings can be made here." 23 msgstr "Benutzerspezifische Einstellungen werden in deinem Benutzerprofil getätigt (Benutzer -> Dein Profil -> Bearbeiten). Allgemeine Einstellungen können hier vorgenommen werden." 24 25 #: settings-global.php:68 26 msgid "General" 27 msgstr "Allgemein" 28 29 #: settings-global.php:69 30 msgid "Layout" 31 msgstr "Aussehen" 32 33 #: settings-global.php:88 34 msgid "Author Box display options" 35 msgstr "Author Box Anzeigeeinstellungen" 36 37 #: settings-global.php:91 38 msgid "Display Author Box at the end of each post automatically" 39 msgstr "Füge die Author Box am Ende von Beiträgen automatisch hinzu" 40 41 #: settings-global.php:94 42 msgid "Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)" 43 msgstr "Füge die Author Box am Ende von Seiten automatisch hinzu (nicht auf Startseite, Beitragsseite und Datenschutzerklärung)" 44 45 #: settings-global.php:99 46 msgid "Other options" 47 msgstr "Weitere Einstellungen" 48 49 #: settings-global.php:102 50 msgid "Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)" 51 msgstr "Verstecke die Autor-Biografie (Author Box) vom WordPress Standard-Theme (Getestet von Twenty Nineteen bis Twenty Twenty-One)" 52 53 #: settings-global.php:103 54 msgid "If your theme offers you an option to hide the author box of your theme, you should use your theme's setting for this." 55 msgstr "Wenn dein Theme dir eine Option anbietet, die Autor-Biografie (Author Box) deines Themes auszublenden, solltest du die Einstellung deines Themes dafür verwenden." 56 57 #: settings-global.php:113 58 msgid "Basic" 59 msgstr "Grundlegend" 60 61 #: settings-global.php:116 62 msgid "Arial" 63 msgstr "Arial" 64 65 #: settings-global.php:117 66 msgid "Inherit from website" 67 msgstr "Von Webseite erben" 68 69 #: settings-global.php:119 70 msgid "Font of Author Box" 71 msgstr "Schriftart der Author Box" 72 73 #: settings-global.php:120 74 msgid "Inherit from website means that the fonts of the WordPress theme are used." 75 msgstr "Von Webseite erben bedeutet, dass die Schriftart des WordPress Themes verwendet wird." 76 77 #: settings-global.php:123 78 msgid "Show Shadow of Author Box" 79 msgstr "Stelle einen Schatten um die Author Box dar" 80 81 #: settings-global.php:129 82 msgid "Border" 83 msgstr "Rahmen" 84 85 #: settings-global.php:132 18 86 msgid "Show Border of Author Box" 19 msgstr "Stelle den Rand der Author Box dar" 20 21 #: settings-global.php:54 87 msgstr "Stelle den Rahmen der Author Box dar" 88 89 #: settings-global.php:135 90 msgid "Color of border" 91 msgstr "Farbe des Rahmens" 92 93 #: settings-global.php:138 94 msgid "Size of border" 95 msgstr "Breite des Rahmens" 96 97 #: settings-global.php:143 98 msgid "Avatar" 99 msgstr "Avatar" 100 101 #: settings-global.php:146 22 102 msgid "Size of Avatar (Pixel)" 23 103 msgstr "Größe Avatar (Pixel)" 24 104 25 #: settings-global.php: 59105 #: settings-global.php:149 26 106 msgid "Use a circle avatar instead of a square" 27 107 msgstr "Verwende ein rundes statt ein eckiges Profilbild" 28 108 29 #: settings-global.php:64 109 #: settings-global.php:155 110 msgid "Header" 111 msgstr "Header" 112 113 #: settings-global.php:157 114 msgid "e.g. A Post by" 115 msgstr "z.B. Ein Beitrag von" 116 117 #: settings-global.php:158 30 118 msgid "Headline" 31 119 msgstr "Text der Überschrift" 32 120 33 #: settings-global.php:65 34 msgid "e.g. A Post by" 35 msgstr "z.B. Ein Beitrag von" 36 37 #: settings-global.php:69 121 #: settings-global.php:161 38 122 msgid "Fontsize of Headline (em)" 39 123 msgstr "Schriftgröße der Überschrift (em)" 40 124 41 #: settings-global.php: 74125 #: settings-global.php:165 42 126 msgid "Fontsize of author's Position (em)" 43 msgstr "Schriftgröße der Position vom Autor (em)" 44 45 #: settings-global.php:79 127 msgstr "Schriftgröße der Position des Autors (em)" 128 129 #: settings-global.php:171 130 msgid "Biography" 131 msgstr "Biografie" 132 133 #: settings-global.php:174 46 134 msgid "Fontsize of Biography (em)" 47 135 msgstr "Schriftgröße der Biografie (em)" 48 136 49 #: settings-global.php:84 137 #: settings-global.php:179 138 msgid "Footer" 139 msgstr "Footer" 140 141 #: settings-global.php:182 50 142 msgid "Fontsize of Links (em)" 51 143 msgstr "Schriftgröße der Links (em)" 52 144 53 #: settings-global.php: 89145 #: settings-global.php:185 54 146 msgid "Display a link to the author's archive" 55 147 msgstr "Zeige einen Link zum Archiv des Autors an" 56 148 57 #: settings-global.php:94 58 msgid "Display Author Box at the end of each post automatically" 59 msgstr "Füge die Author Box am Ende von Beiträgen automatisch hinzu" 60 61 #: settings-global.php:100 62 msgid "Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)" 63 msgstr "Füge die Author Box am Ende von Seiten automatisch hinzu (nicht auf Startseite, Beitragsseite und Datenschutzerklärung)" 64 65 #: settings-global.php:105 66 msgid "Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)" 67 msgstr "Verstecke die Autor-Biografie (Author Box) vom WordPress Standard-Theme (Getestet von Twenty Nineteen bis Twenty Twenty-One)" 68 69 #: settings-global.php:105 149 #: settings-global.php:196 70 150 msgid "Save Settings" 71 151 msgstr "Einstellungen speichern" 72 152 73 #: settings-user.php:1 2153 #: settings-user.php:11 74 154 msgid "Here you can make further settings for your avatar or other personal settings. The WordPress administrator can adjust global settings under Settings -> Author Box." 75 msgstr "Hier kannst du weitere Einstellungen in Bezug auf deinen Avatar oder weitere n persönlichenEinstellungen vornehmen. Globale Einstellungen kann der WordPress-Administrator unter Einstellungen -> Author Box vornehmen."76 77 #: settings-user.php:1 6155 msgstr "Hier kannst du weitere Einstellungen in Bezug auf deinen Avatar oder weitere persönliche Einstellungen vornehmen. Globale Einstellungen kann der WordPress-Administrator unter Einstellungen -> Author Box vornehmen." 156 157 #: settings-user.php:15 78 158 msgid "Local avatars" 79 159 msgstr "Lokale Avatare" 80 160 81 #: settings-user.php:1 9161 #: settings-user.php:18 82 162 msgid "Use local avatars instead of Gravatar (Enter the URL to your avatar in the input field below)" 83 163 msgstr "Verwende lokale Avatare an Stelle von Gravatar (Trage die URL zu deinem Profilbild in das untere Eingabefeld ein)" 84 164 85 #: settings-user.php:2 4165 #: settings-user.php:23 86 166 msgid "Avatar (URL)" 87 167 msgstr "Avatar (URL)" 88 168 89 #: settings-user.php:2 7169 #: settings-user.php:26 90 170 msgid "Avatar URL (e.g. https://yoursite.com/avatar.jpg)" 91 171 msgstr "Avatar URL (z.B. https://deineseite.de/avatar.jpg)" 92 172 93 #: settings-user.php:2 8173 #: settings-user.php:27 94 174 msgid "Please enter a valid URL to your avatar, so that it can be displayed in the author box. You will get the best results if your avatar has the same width and height dimensions." 95 175 msgstr "Gebe bitte eine gültige URL zu deinem Avatar an, damit dieses in der Author Box angezeigt werden kann. Das beste Ergebnis erhältst du, wenn dein Profilbild die gleiche Höhe und Breite aufweist." 96 176 97 #: settings-user.php:3 3177 #: settings-user.php:32 98 178 msgid "Your Position" 99 179 msgstr "Deine Position" 100 180 101 #: settings-user.php:3 6181 #: settings-user.php:35 102 182 msgid "Position (e.g. Founder or Author of YourSite)" 103 183 msgstr "Position (z.B. Gründer oder Autor von DeineSeite)" 104 184 105 #: settings-user.php:3 7185 #: settings-user.php:36 106 186 msgid "Here you can enter your position. The position is shown below your name in the Author Box." 107 187 msgstr "Hier kannst du deine Position angeben. Die Position wird unterhalb deines Namens in der Author Box angezeigt." 108 188 109 #: settings-user.php:4 2189 #: settings-user.php:41 110 190 msgid "Homepage / About Me Page" 111 191 msgstr "Homepage / Über Mich Seite" 112 192 113 #: settings-user.php:4 6193 #: settings-user.php:45 114 194 msgid "Link Text (e.g. Homepage or About Me)" 115 195 msgstr "Link Text (z.B. Homepage oder Über mich)" 116 196 117 #: settings-user.php:4 7197 #: settings-user.php:46 118 198 msgid "Link URL (e.g. https://yoursite.com)" 119 199 msgstr "Link URL (z.B. https://deineseite.de)" 120 200 121 #: settings-user.php:4 8201 #: settings-user.php:47 122 202 msgid "This URL will be displayed below your biography in the Author Box." 123 203 msgstr "Diese URL wird unterhalb deiner Biografie in der Author Box angezeigt." 124 125 #: authorbox.php:41126 msgid "View Archive"127 msgstr "Archiv anzeigen"128 129 #: authorbox.php:48130 msgid "View Archive"131 msgstr "Archiv anzeigen" -
author-box-by-nocksoft/tags/1.0.5/php/authorbox.php
r2464444 r2653204 2 2 3 3 /* Author Box Shortcode. */ 4 add_shortcode("authorbox", "nstab_shortcode_authorbox"); 4 5 function nstab_shortcode_authorbox() { 5 6 return nstab_get_authorbox(); 6 7 } 7 add_shortcode("authorbox", "nstab_shortcode_authorbox");8 8 9 9 10 /* Adds Author Box at end of posts */10 /* Adds Author Box at end of posts and pages automatically. */ 11 11 add_filter("the_content", "nstab_add_authorbox"); 12 12 function nstab_add_authorbox($content) { 13 if (is_single() && get_option("nstab_setting_displayauthorboxonposts", true) == true) { 13 global $nstab_setting_displayauthorboxonposts; 14 global $nstab_setting_displayauthorboxonpages; 15 16 if (is_single() && $nstab_setting_displayauthorboxonposts == true) { 14 17 $content .= nstab_get_authorbox(); 15 18 } 16 else if (is_page() && get_option("nstab_setting_displayauthorboxonpages")== true19 else if (is_page() && $nstab_setting_displayauthorboxonpages == true 17 20 && !is_front_page() && !is_home() && !is_privacy_policy()) { 18 21 $content .= nstab_get_authorbox(); … … 22 25 23 26 24 /* --- Drawing of the Author Box --- */ 25 26 /* Adds Author Box */ 27 /* Get Author Box HTML. */ 27 28 function nstab_get_authorbox() { 28 $avatarsize = esc_attr(get_option("nstab_setting_avatarsize")); 29 global $nstab_setting_font; 30 global $nstab_setting_showshadow; 31 global $nstab_setting_showborder; 32 global $nstab_setting_bordercolor; 33 global $nstab_setting_bordersize; 34 global $nstab_setting_avatarsize; 35 global $nstab_setting_circleavatar; 36 global $nstab_setting_headline; 37 global $nstab_setting_fontsizeheadline; 38 global $nstab_setting_fontsizeposition; 39 global $nstab_setting_fontsizebio; 40 global $nstab_setting_fontsizelinks; 41 global $nstab_setting_displayauthorsarchive; 42 43 $author_id = get_the_author_meta("ID"); 44 29 45 $circleavatar = ""; 30 if ( get_option("nstab_setting_circleavatar")== true) {46 if ($nstab_setting_circleavatar == true) { 31 47 $circleavatar = "class='nstab_circle'"; 32 48 } 33 34 require plugin_dir_path(__FILE__) . "settings-defaults.php";35 49 36 50 $authorlinktext = get_the_author_meta("nstab_setting_homepage_linktext"); 37 51 $authorlinkurl = get_the_author_meta("nstab_setting_homepage_linkurl"); 38 52 if ($authorlinktext != null && $authorlinkurl != null) { 39 $homepagehref = "<p id='nstab_links' style='font-size: " . $ fontsizelinks . "em;'><a href='" . $authorlinkurl . "'>" . $authorlinktext . "</a>";40 if ( get_option("nstab_setting_displayauthorsarchive")== true) {41 $homepagehref .= " | <a href='" . get_author_posts_url( get_the_author_meta("ID")) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a>";53 $homepagehref = "<p id='nstab_links' style='font-size: " . $nstab_setting_fontsizelinks . "em;'><a href='" . $authorlinkurl . "'>" . $authorlinktext . "</a>"; 54 if ($nstab_setting_displayauthorsarchive == true) { 55 $homepagehref .= " | <a href='" . get_author_posts_url($author_id) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a>"; 42 56 } 43 57 $homepagehref .= "</p>"; … … 45 59 else { 46 60 $homepagehref = ""; 47 if ( get_option("nstab_setting_displayauthorsarchive")== true) {48 $homepagehref .= "<p id='nstab_links' style='font-size: " . $ fontsizelinks . "em;'><a href='" . get_author_posts_url(get_the_author_meta("ID")) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a></p>";61 if ($nstab_setting_displayauthorsarchive == true) { 62 $homepagehref .= "<p id='nstab_links' style='font-size: " . $nstab_setting_fontsizelinks . "em;'><a href='" . get_author_posts_url($author_id) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a></p>"; 49 63 } 50 64 } 51 65 52 $authorboxcontainer = "<div id='author-box-by-nocksoft'>"; 53 if (get_option("nstab_setting_showborder", true) == true) { 54 $authorboxcontainer = "<div id='author-box-by-nocksoft' style='padding: 0.75em; border: 1px solid #EEEEEE;'>"; 55 } 66 $font = $nstab_setting_font == "arial" ? "font-family: Arial;" : null; 67 $shadow = $nstab_setting_showshadow == true ? "padding: 0.75em; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" : null; 68 $border = $nstab_setting_showborder == true ? "padding: 0.75em; border: ".$nstab_setting_bordersize."px solid ".$nstab_setting_bordercolor.";" : null; 69 $authorboxcontainer = "<div id='author-box-by-nocksoft' style='".$font.$shadow.$border."'>"; 70 71 $url = nstab_get_local_avatarurl($author_id); 72 if (empty($url)) $url = get_avatar_url($author_id); 73 56 74 $authorbox = $authorboxcontainer .= " 57 75 <div id='nstab_wrapper'> 58 <div id='nstab_authoravatar' " . $circleavatar . " style='background-image: url(\"". nstab_get_avatarurl()."\"); height: ".$avatarsize."px; width: ".$avatarsize."px;'></div>59 <div id='nstab_authorbio' style='height: ".$ avatarsize."px;'>76 <div id='nstab_authoravatar' " . $circleavatar . " style='background-image: url(\"".$url."\"); height: ".$nstab_setting_avatarsize."px; width: ".$nstab_setting_avatarsize."px;'></div> 77 <div id='nstab_authorbio' style='height: ".$nstab_setting_avatarsize."px;'> 60 78 <div id='header'> 61 <span id='headline' style='font-size: " . $ fontsizeheadline . "em;'>" . get_option("nstab_setting_headline"). " " . get_the_author_meta("display_name") . "</span>62 <span id='position' style='font-size: " . $ fontsizeposition . "em;'>" . get_the_author_meta("nstab_setting_authorposition") . "</span>79 <span id='headline' style='font-size: " . $nstab_setting_fontsizeheadline . "em;'>" . $nstab_setting_headline . " " . get_the_author_meta("display_name") . "</span> 80 <span id='position' style='font-size: " . $nstab_setting_fontsizeposition . "em;'>" . get_the_author_meta("nstab_setting_authorposition") . "</span> 63 81 </div> 64 <p id='nstab_description' style='font-size: " . $ fontsizebio . "em;'>" . get_the_author_meta("description") . "</p>82 <p id='nstab_description' style='font-size: " . $nstab_setting_fontsizebio . "em;'>" . get_the_author_meta("description") . "</p> 65 83 " . $homepagehref . " 66 84 </div> -
author-box-by-nocksoft/tags/1.0.5/php/avatars.php
r2464444 r2653204 1 1 <?php 2 2 3 /* Returns the avatar URL */ 4 function nstab_get_avatarurl() { 5 if (get_the_author_meta("nstab_setting_localavatar") != "on") return get_avatar_url(get_the_author_meta("ID")); 6 else return get_the_author_meta("nstab_setting_avatarurl"); 3 /* Returns the avatar URL for local avatar, if exists. */ 4 function nstab_get_local_avatarurl($user_id) { 5 if (!get_user_meta($user_id, "nstab_setting_localavatar", true)) return null; 6 7 $url = get_user_meta($user_id, "nstab_setting_avatarurl", true); 8 return $url; 7 9 } 8 10 9 11 12 /** 13 * Overrides the avatar data. 14 * https://developer.wordpress.org/reference/functions/get_avatar_data/ 15 * https://developer.wordpress.org/reference/hooks/get_avatar_data/ 16 */ 17 add_filter("get_avatar_data", "nstab_get_avatar_data", 10, 2); 18 function nstab_get_avatar_data($args, $id_or_email) { 19 $url = nstab_get_local_avatarurl(nstab_get_user_id($id_or_email)); 20 if (!empty($url)) $args["url"] = $url; 21 22 return $args; 23 } 10 24 11 /* Overrides the avatars */12 /* https://codex.wordpress.org/Plugin_API/Filter_Reference/get_avatar */13 add_filter("get_avatar", "nstab_get_avatar", 1 , 5);14 function nstab_get_avatar($avatar, $id_or_email, $size, $default, $alt) {15 $user = false;16 25 17 if (is_numeric($id_or_email)) { 18 $id = (int)$id_or_email; 19 $user = get_user_by("id", $id); 20 } 21 elseif (is_object($id_or_email)) { 22 if (!empty($id_or_email->user_id)) { 23 $id = (int)$id_or_email->user_id; 24 $user = get_user_by("id", $id); 25 } 26 } 27 else { 28 $user = get_user_by("email", $id_or_email); 29 } 26 function nstab_get_user_id($id_or_email) { 27 $user_id = null; 28 29 if (is_numeric($id_or_email)) { 30 $user_id = (int)$id_or_email; 31 } 32 else if (is_string($id_or_email) && ($user = get_user_by("email", $id_or_email))) { 33 $user_id = $user->ID; 34 } 35 else if (is_object($id_or_email) && !empty($id_or_email->user_id)) { 36 $user_id = (int)$id_or_email->user_id; 37 } 30 38 31 if ($user && is_object($user) 32 && get_the_author_meta("nstab_setting_localavatar", $user->ID) == "on") { 33 $avatar = get_the_author_meta("nstab_setting_avatarurl", $user->ID); 34 $avatar = "<img alt='{$alt}' src='{$avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; 35 } 36 37 return $avatar; 39 return $user_id; 38 40 } 39 41 -
author-box-by-nocksoft/tags/1.0.5/php/settings-defaults.php
r2394668 r2653204 1 1 <?php 2 2 3 /* --- Default settings and fallbacks. Only needed, when setting was added after initial release. --- */ 3 /* Global settings: general */ 4 $nstab_setting_default_displayauthorboxonposts = true; 5 $nstab_setting_default_displayauthorboxonpages = false; 6 $nstab_setting_default_hidewordpressauthorbox = false; 4 7 5 /* Headline Size */ 6 if (esc_attr(get_option("nstab_setting_fontsizeheadline")) != false) $fontsizeheadline = esc_attr(get_option("nstab_setting_fontsizeheadline")); 7 else $fontsizeheadline = "1.1"; 8 9 /* Position Size */ 10 if (esc_attr(get_option("nstab_setting_fontsizeposition")) != false) $fontsizeposition = esc_attr(get_option("nstab_setting_fontsizeposition")); 11 else $fontsizeposition = "0.7"; 12 13 /* Bio Size */ 14 if (esc_attr(get_option("nstab_setting_fontsizebio")) != false) $fontsizebio = esc_attr(get_option("nstab_setting_fontsizebio")); 15 else $fontsizebio = "0.9"; 16 17 /* Links Size */ 18 if (esc_attr(get_option("nstab_setting_fontsizelinks")) != false) $fontsizelinks = esc_attr(get_option("nstab_setting_fontsizelinks")); 19 else $fontsizelinks = "0.8"; 8 /* Global settings: layout */ 9 $nstab_setting_default_font = "arial"; 10 $nstab_setting_default_showshadow = false; 11 $nstab_setting_default_showborder = true; 12 $nstab_setting_default_bordercolor = "#EEEEEE"; 13 $nstab_setting_default_bordersize = "1"; 14 $nstab_setting_default_avatarsize = "100"; 15 $nstab_setting_default_circleavatar = false; 16 $nstab_setting_default_headline = __("A Post by", "author-box-by-nocksoft"); 17 $nstab_setting_default_fontsizeheadline = "1.1"; 18 $nstab_setting_default_fontsizeposition = "0.7"; 19 $nstab_setting_default_fontsizebio = "0.9"; 20 $nstab_setting_default_fontsizelinks = "0.8"; 21 $nstab_setting_default_displayauthorsarchive = false; 20 22 21 23 ?> -
author-box-by-nocksoft/tags/1.0.5/php/settings-global.php
r2464444 r2653204 1 1 <?php 2 2 3 add_action("admin_menu", "nstab_settings_page"); 3 4 function nstab_settings_page() { 4 5 add_submenu_page( … … 11 12 ); 12 13 } 13 add_action("admin_menu", "nstab_settings_page");14 14 15 15 16 16 add_action("admin_init", function() { 17 register_setting("nstab_settings", "nstab_setting_showborder"); 18 register_setting("nstab_settings", "nstab_setting_avatarsize"); 19 register_setting("nstab_settings", "nstab_setting_circleavatar"); 20 register_setting("nstab_settings", "nstab_setting_headline"); 21 register_setting("nstab_settings", "nstab_setting_fontsizeheadline"); 22 register_setting("nstab_settings", "nstab_setting_fontsizeposition"); 23 register_setting("nstab_settings", "nstab_setting_fontsizebio"); 24 register_setting("nstab_settings", "nstab_setting_fontsizelinks"); 25 register_setting("nstab_settings", "nstab_setting_displayauthorsarchive"); 26 register_setting("nstab_settings", "nstab_setting_displayauthorboxonposts"); 27 register_setting("nstab_settings", "nstab_setting_displayauthorboxonpages"); 28 register_setting("nstab_settings", "nstab_setting_hidewordpressauthorbox"); 17 register_setting("nstab_settings_general", "nstab_setting_displayauthorboxonposts"); 18 register_setting("nstab_settings_general", "nstab_setting_displayauthorboxonpages"); 19 register_setting("nstab_settings_general", "nstab_setting_hidewordpressauthorbox"); 20 21 register_setting("nstab_settings_layout", "nstab_setting_font"); 22 register_setting("nstab_settings_layout", "nstab_setting_showshadow"); 23 register_setting("nstab_settings_layout", "nstab_setting_showborder"); 24 register_setting("nstab_settings_layout", "nstab_setting_bordercolor"); 25 register_setting("nstab_settings_layout", "nstab_setting_bordersize"); 26 register_setting("nstab_settings_layout", "nstab_setting_avatarsize"); 27 register_setting("nstab_settings_layout", "nstab_setting_circleavatar"); 28 register_setting("nstab_settings_layout", "nstab_setting_headline"); 29 register_setting("nstab_settings_layout", "nstab_setting_fontsizeheadline"); 30 register_setting("nstab_settings_layout", "nstab_setting_fontsizeposition"); 31 register_setting("nstab_settings_layout", "nstab_setting_fontsizebio"); 32 register_setting("nstab_settings_layout", "nstab_setting_fontsizelinks"); 33 register_setting("nstab_settings_layout", "nstab_setting_displayauthorsarchive"); 29 34 }); 30 35 … … 34 39 if (!current_user_can("manage_options")) return; 35 40 36 require plugin_dir_path(__FILE__) . "settings-defaults.php"; 41 global $nstab_setting_displayauthorboxonposts; 42 global $nstab_setting_displayauthorboxonpages; 43 global $nstab_setting_hidewordpressauthorbox; 44 45 global $nstab_setting_font; 46 global $nstab_setting_showshadow; 47 global $nstab_setting_showborder; 48 global $nstab_setting_default_bordercolor; 49 global $nstab_setting_bordercolor; 50 global $nstab_setting_bordersize; 51 global $nstab_setting_avatarsize; 52 global $nstab_setting_circleavatar; 53 global $nstab_setting_headline; 54 global $nstab_setting_fontsizeheadline; 55 global $nstab_setting_fontsizeposition; 56 global $nstab_setting_fontsizebio; 57 global $nstab_setting_fontsizelinks; 58 global $nstab_setting_displayauthorsarchive; 59 60 $tab = isset($_GET["tab"]) ? $_GET["tab"] : null; 37 61 ?> 38 62 <div class="wrap"> 39 63 <h1><?= esc_html(get_admin_page_title()); ?></h1> 64 65 <p><?php echo __("User-specific settings are made in your user profile in WordPress (Users -> Your Profile -> Edit). General settings can be made here.", "author-box-by-nocksoft"); ?></p> 66 67 <nav class="nav-tab-wrapper"> 68 <a href="?page=nstab" class="nav-tab<?php if ($tab == "general" || $tab == null) echo " nav-tab-active"; ?>"><?php echo __("General", "author-box-by-nocksoft"); ?></a> 69 <a href="?page=nstab&tab=layout" class="nav-tab<?php if ($tab == "layout") echo " nav-tab-active"; ?>"><?php echo __("Layout", "author-box-by-nocksoft"); ?></a> 70 </nav> 71 40 72 <form action="options.php" method="post"> 41 73 <?php 42 settings_fields("nstab_settings"); 74 $option_group = null; 75 if ($tab == "general" || $tab == null) $option_group = "nstab_settings_general"; 76 else if ($tab == "layout") $option_group = "nstab_settings_layout"; 77 else return; 78 settings_fields($option_group); 43 79 do_settings_sections("nstab"); 44 80 ?> 45 81 46 <p><?php echo __("User-specific settings are made in your author profile in WordPress (Users -> Your Profile). General settings can be made here.", "author-box-by-nocksoft"); ?></p> 47 48 <table class="form-table"> 49 <tr valign="top"> 50 <th scope="row"><?php echo __("Show Border of Author Box", "author-box-by-nocksoft"); ?></th> 51 <td><input type="checkbox" name="nstab_setting_showborder" <?php if (get_option("nstab_setting_showborder", true) == true) echo "checked"; ?> /></td> 52 </tr> 53 54 <tr valign="top"> 55 <th scope="row"><?php echo __("Size of Avatar (Pixel)", "author-box-by-nocksoft"); ?></th> 56 <td><input type="number" name="nstab_setting_avatarsize" min="96" max="200" value="<?php echo esc_attr(get_option("nstab_setting_avatarsize")); ?>" /></td> 57 </tr> 58 59 <tr valign="top"> 60 <th scope="row"><?php echo __("Use a circle avatar instead of a square", "author-box-by-nocksoft"); ?></th> 61 <td><input type="checkbox" name="nstab_setting_circleavatar" <?php if (get_option("nstab_setting_circleavatar") == true) echo "checked"; ?> /></td> 62 </tr> 63 64 <tr valign="top"> 65 <th scope="row"><?php echo __("Headline", "author-box-by-nocksoft"); ?></th> 66 <td><input type="text" name="nstab_setting_headline" placeholder="<?php echo __("e.g. A Post by", "author-box-by-nocksoft"); ?>" value="<?php echo get_option("nstab_setting_headline"); ?>" /></td> 67 </tr> 68 69 <tr valign="top"> 70 <th scope="row"><?php echo __("Fontsize of Headline (em)", "author-box-by-nocksoft"); ?></th> 71 <td><input type="number" name="nstab_setting_fontsizeheadline" min="0.5" max="2" step="0.1" value="<?php echo $fontsizeheadline; ?>" /></td> 72 </tr> 73 74 <tr valign="top"> 75 <th scope="row"><?php echo __("Fontsize of author's Position (em)", "author-box-by-nocksoft"); ?></th> 76 <td><input type="number" name="nstab_setting_fontsizeposition" min="0.4" max="0.9" step="0.1" value="<?php echo $fontsizeposition; ?>" /></td> 77 </tr> 78 79 <tr valign="top"> 80 <th scope="row"><?php echo __("Fontsize of Biography (em)", "author-box-by-nocksoft"); ?></th> 81 <td><input type="number" name="nstab_setting_fontsizebio" min="0.4" max="1.5" step="0.1" value="<?php echo $fontsizebio; ?>" /></td> 82 </tr> 83 84 <tr valign="top"> 85 <th scope="row"><?php echo __("Fontsize of Links (em)", "author-box-by-nocksoft"); ?></th> 86 <td><input type="number" name="nstab_setting_fontsizelinks" min="0.3" max="1" step="0.1" value="<?php echo $fontsizelinks; ?>" /></td> 87 </tr> 88 89 <tr valign="top"> 90 <th scope="row"><?php echo __("Display a link to the author's archive", "author-box-by-nocksoft"); ?></th> 91 <td><input type="checkbox" name="nstab_setting_displayauthorsarchive" <?php if (get_option("nstab_setting_displayauthorsarchive") == true) echo "checked"; ?> /></td> 92 </tr> 93 94 <tr valign="top"> 95 <th scope="row"><?php echo __("Display Author Box at the end of each post automatically", "author-box-by-nocksoft"); ?></th> 96 <td><input type="checkbox" name="nstab_setting_displayauthorboxonposts" <?php if (get_option("nstab_setting_displayauthorboxonposts", true) == true) echo "checked"; ?> /></td> 97 </tr> 98 99 <tr valign="top"> 100 <th scope="row"><?php echo __("Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)", "author-box-by-nocksoft"); ?></th> 101 <td><input type="checkbox" name="nstab_setting_displayauthorboxonpages" <?php if (get_option("nstab_setting_displayauthorboxonpages") == true) echo "checked"; ?> /></td> 102 </tr> 103 104 <tr valign="top"> 105 <th scope="row"><?php echo __("Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)", "author-box-by-nocksoft"); ?></th> 106 <td><input type="checkbox" name="nstab_setting_hidewordpressauthorbox" <?php if (get_option("nstab_setting_hidewordpressauthorbox") == true) echo "checked"; ?> /></td> 107 </tr> 108 </table> 82 <div class="tab-content"> 83 <?php 84 if ($tab == "general" || $tab == null) { 85 ?> 86 <table class="form-table"> 87 <tr valign="top"> 88 <th scope="row"><?php echo __("Author Box display options", "author-box-by-nocksoft"); ?></th> 89 <td> 90 <input type="checkbox" id="nstab_setting_displayauthorboxonposts" name="nstab_setting_displayauthorboxonposts" <?php if ($nstab_setting_displayauthorboxonposts == true) echo "checked"; ?> /> 91 <label for="nstab_setting_displayauthorboxonposts"><?php echo __("Display Author Box at the end of each post automatically", "author-box-by-nocksoft"); ?></label> 92 <br> 93 <input type="checkbox" id="nstab_setting_displayauthorboxonpages" name="nstab_setting_displayauthorboxonpages" <?php if ($nstab_setting_displayauthorboxonpages == true) echo "checked"; ?> /> 94 <label for="nstab_setting_displayauthorboxonpages"><?php echo __("Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)", "author-box-by-nocksoft"); ?></label> 95 </td> 96 </tr> 97 98 <tr valign="top"> 99 <th scope="row"><?php echo __("Other options", "author-box-by-nocksoft"); ?></th> 100 <td> 101 <input type="checkbox" id="nstab_setting_hidewordpressauthorbox" name="nstab_setting_hidewordpressauthorbox" <?php if ($nstab_setting_hidewordpressauthorbox == true) echo "checked"; ?> /> 102 <label for="nstab_setting_hidewordpressauthorbox"><?php echo __("Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)", "author-box-by-nocksoft"); ?></label> 103 <p class="description"><?php echo __("If your theme offers you an option to hide the author box of your theme, you should use your theme's setting for this.", "author-box-by-nocksoft"); ?></p> 104 </td> 105 </tr> 106 </table> 107 <?php 108 } 109 else if ($tab == "layout") { 110 ?> 111 <table class="form-table"> 112 <tr valign="top"> 113 <th scope="row"><?php echo __("Basic", "author-box-by-nocksoft"); ?></th> 114 <td> 115 <select id="nstab_setting_font" name="nstab_setting_font"> 116 <option value="arial" <?php if ($nstab_setting_font == "arial") echo "selected"; ?>><?php echo __("Arial", "author-box-by-nocksoft"); ?></option> 117 <option value="inherit" <?php if ($nstab_setting_font == "inherit") echo "selected"; ?>><?php echo __("Inherit from website", "author-box-by-nocksoft"); ?></option> 118 </select> 119 <label for="nstab_setting_font"><?php echo __("Font of Author Box", "author-box-by-nocksoft"); ?></label> 120 <p class="description"><?php echo __("Inherit from website means that the fonts of the WordPress theme are used.", "author-box-by-nocksoft"); ?></p> 121 <p> 122 <input type="checkbox" id="nstab_setting_showshadow" name="nstab_setting_showshadow" <?php if ($nstab_setting_showshadow == true) echo "checked"; ?> /> 123 <label for="nstab_setting_showshadow"><?php echo __("Show Shadow of Author Box", "author-box-by-nocksoft"); ?></label> 124 </p> 125 </td> 126 </tr> 127 128 <tr valign="top"> 129 <th scope="row"><?php echo __("Border", "author-box-by-nocksoft"); ?></th> 130 <td> 131 <input type="checkbox" id="nstab_setting_showborder" name="nstab_setting_showborder" <?php if ($nstab_setting_showborder == true) echo "checked"; ?> /> 132 <label for="nstab_setting_showborder"><?php echo __("Show Border of Author Box", "author-box-by-nocksoft"); ?></label> 133 <p> 134 <input type="text" id="nstab_setting_bordercolor" name="nstab_setting_bordercolor" class="nstab_colorpicker" value="<?php echo $nstab_setting_bordercolor; ?>" data-default-color="<?php echo $nstab_setting_default_bordercolor; ?>" /> 135 <label for="nstab_setting_bordercolor"><?php echo __("Color of border", "author-box-by-nocksoft"); ?></label> 136 </p> 137 <input type="number" id="nstab_setting_bordersize" name="nstab_setting_bordersize" min="1" max="5" step="1" value="<?php echo $nstab_setting_bordersize; ?>" /> 138 <label for="nstab_setting_bordersize"><?php echo __("Size of border", "author-box-by-nocksoft"); ?></label> 139 </td> 140 </tr> 141 142 <tr valign="top"> 143 <th scope="row"><?php echo __("Avatar", "author-box-by-nocksoft"); ?></th> 144 <td> 145 <input type="number" id="nstab_setting_avatarsize" name="nstab_setting_avatarsize" min="96" max="200" value="<?php echo $nstab_setting_avatarsize; ?>" /> 146 <label for="nstab_setting_avatarsize"><?php echo __("Size of Avatar (Pixel)", "author-box-by-nocksoft"); ?></label> 147 <p> 148 <input type="checkbox" id="nstab_setting_circleavatar" name="nstab_setting_circleavatar" <?php if ($nstab_setting_circleavatar == true) echo "checked"; ?> /> 149 <label for="nstab_setting_circleavatar"><?php echo __("Use a circle avatar instead of a square", "author-box-by-nocksoft"); ?></label> 150 </p> 151 </td> 152 </tr> 153 154 <tr valign="top"> 155 <th scope="row"><?php echo __("Header", "author-box-by-nocksoft"); ?></th> 156 <td> 157 <input type="text" id="nstab_setting_headline" name="nstab_setting_headline" placeholder="<?php echo __("e.g. A Post by", "author-box-by-nocksoft"); ?>" value="<?php echo $nstab_setting_headline; ?>" /> 158 <label for="nstab_setting_headline"><?php echo __("Headline", "author-box-by-nocksoft"); ?></label> 159 <p> 160 <input type="number" id="nstab_setting_fontsizeheadline" name="nstab_setting_fontsizeheadline" min="0.5" max="2" step="0.1" value="<?php echo $nstab_setting_fontsizeheadline; ?>" /> 161 <label for="nstab_setting_fontsizeheadline"><?php echo __("Fontsize of Headline (em)", "author-box-by-nocksoft"); ?></label> 162 </p> 163 <p> 164 <input type="number" id="nstab_setting_fontsizeposition" name="nstab_setting_fontsizeposition" min="0.4" max="0.9" step="0.1" value="<?php echo $nstab_setting_fontsizeposition; ?>" /> 165 <label for="nstab_setting_fontsizeposition"><?php echo __("Fontsize of author's Position (em)", "author-box-by-nocksoft"); ?></label> 166 </p> 167 </td> 168 </tr> 169 170 <tr valign="top"> 171 <th scope="row"><?php echo __("Biography", "author-box-by-nocksoft"); ?></th> 172 <td> 173 <input type="number" id="nstab_setting_fontsizebio" name="nstab_setting_fontsizebio" min="0.4" max="1.5" step="0.1" value="<?php echo $nstab_setting_fontsizebio; ?>" /> 174 <label for="nstab_setting_fontsizebio"><?php echo __("Fontsize of Biography (em)", "author-box-by-nocksoft"); ?></label> 175 </td> 176 </tr> 177 178 <tr valign="top"> 179 <th scope="row"><?php echo __("Footer", "author-box-by-nocksoft"); ?></th> 180 <td> 181 <input type="number" id="nstab_setting_fontsizelinks" name="nstab_setting_fontsizelinks" min="0.3" max="1" step="0.1" value="<?php echo $nstab_setting_fontsizelinks; ?>" /> 182 <label for="nstab_setting_fontsizelinks"><?php echo __("Fontsize of Links (em)", "author-box-by-nocksoft"); ?></label> 183 <p> 184 <input type="checkbox" id="nstab_setting_displayauthorsarchive" name="nstab_setting_displayauthorsarchive" <?php if ($nstab_setting_displayauthorsarchive == true) echo "checked"; ?> /> 185 <label for="nstab_setting_displayauthorsarchive"><?php echo __("Display a link to the author's archive", "author-box-by-nocksoft"); ?></label> 186 </p> 187 </td> 188 </tr> 189 </table> 190 <?php 191 } 192 ?> 193 </div> 109 194 110 195 -
author-box-by-nocksoft/tags/1.0.5/php/settings-user.php
r2394668 r2653204 5 5 add_action("show_user_profile", "nstab_usersettings"); 6 6 add_action("edit_user_profile", "nstab_usersettings"); 7 8 7 function nstab_usersettings($user) { 9 8 ?> … … 57 56 add_action("personal_options_update", "nstab_save_usersettings"); 58 57 add_action("edit_user_profile_update", "nstab_save_usersettings"); 59 60 58 function nstab_save_usersettings($user_id) { 61 59 if (!current_user_can("edit_user", $user_id)) { … … 63 61 } 64 62 else { 65 update_usermeta($user_id, "nstab_setting_localavatar", $_POST["nstab_setting_localavatar"]); 63 $nstab_setting_localavatar = isset($_POST["nstab_setting_localavatar"]) ? $_POST["nstab_setting_localavatar"] : false; 64 update_usermeta($user_id, "nstab_setting_localavatar", $nstab_setting_localavatar); 66 65 update_usermeta($user_id, "nstab_setting_avatarurl", trim($_POST["nstab_setting_avatarurl"])); 67 66 update_usermeta($user_id, "nstab_setting_authorposition", trim($_POST["nstab_setting_authorposition"])); -
author-box-by-nocksoft/tags/1.0.5/php/setup.php
r2464444 r2653204 2 2 3 3 function nstab_activate_plugin() { 4 /* Default settings */ 5 add_option("nstab_setting_showborder", "on"); 6 add_option("nstab_setting_avatarsize", "100"); 7 add_option("nstab_setting_circleavatar", ""); 8 add_option("nstab_setting_headline", __("A Post by", "author-box-by-nocksoft")); 9 add_option("nstab_setting_fontsizeheadline", "1.1"); 10 add_option("nstab_setting_fontsizeposition", "0.7"); 11 add_option("nstab_setting_fontsizebio", "0.9"); 12 add_option("nstab_setting_fontsizelinks", "0.8"); 13 add_option("nstab_setting_displayauthorsarchive", ""); 14 add_option("nstab_setting_displayauthorboxonposts", "on"); 15 add_option("nstab_setting_displayauthorboxonpages", ""); 16 add_option("nstab_setting_hidewordpressauthorbox", ""); 4 require plugin_dir_path(__FILE__) . "settings-defaults.php"; 5 6 add_option("nstab_setting_displayauthorboxonposts", $nstab_setting_default_displayauthorboxonposts); 7 add_option("nstab_setting_displayauthorboxonpages", $nstab_setting_default_displayauthorboxonpages); 8 add_option("nstab_setting_hidewordpressauthorbox", $nstab_setting_default_hidewordpressauthorbox); 9 10 add_option("nstab_setting_font", $nstab_setting_default_font); 11 add_option("nstab_setting_showshadow", $nstab_setting_default_showshadow); 12 add_option("nstab_setting_showborder", $nstab_setting_default_showborder); 13 add_option("nstab_setting_bordercolor", $nstab_setting_default_bordercolor); 14 add_option("nstab_setting_bordersize", $nstab_setting_default_bordersize); 15 add_option("nstab_setting_avatarsize", $nstab_setting_default_avatarsize); 16 add_option("nstab_setting_circleavatar", $nstab_setting_default_circleavatar); 17 add_option("nstab_setting_headline", $nstab_setting_default_headline); 18 add_option("nstab_setting_fontsizeheadline", $nstab_setting_default_fontsizeheadline); 19 add_option("nstab_setting_fontsizeposition", $nstab_setting_default_fontsizeposition); 20 add_option("nstab_setting_fontsizebio", $nstab_setting_default_fontsizebio); 21 add_option("nstab_setting_fontsizelinks", $nstab_setting_default_fontsizelinks); 22 add_option("nstab_setting_displayauthorsarchive", $nstab_setting_default_displayauthorsarchive); 17 23 } 18 24 25 /* https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/ */ 19 26 function nstab_uninstall_plugin() { 20 /* Clear global settings */ 27 if (!defined("WP_UNINSTALL_PLUGIN")) { 28 die; 29 } 30 31 delete_option("nstab_setting_displayauthorboxonposts"); 32 delete_option("nstab_setting_displayauthorboxonpages"); 33 delete_option("nstab_setting_hidewordpressauthorbox"); 34 35 delete_option("nstab_setting_font"); 36 delete_option("nstab_setting_showshadow"); 21 37 delete_option("nstab_setting_showborder"); 38 delete_option("nstab_setting_bordercolor"); 39 delete_option("nstab_setting_bordersize"); 22 40 delete_option("nstab_setting_avatarsize"); 23 41 delete_option("nstab_setting_circleavatar"); … … 28 46 delete_option("nstab_setting_fontsizelinks"); 29 47 delete_option("nstab_setting_displayauthorsarchive"); 30 delete_option("nstab_setting_displayauthorboxonposts");31 delete_option("nstab_setting_displayauthorboxonpages");32 delete_option("nstab_setting_hidewordpressauthorbox");33 48 34 49 /* Clear user settings */ -
author-box-by-nocksoft/tags/1.0.5/readme.txt
r2464444 r2653204 3 3 Tags: author box, author bio, author description, local avatars, about author, about me, author profile, author 4 4 Stable tag: trunk 5 Requires at least: 4.96 Tested up to: 5. 65 Requires at least: 5.3 6 Tested up to: 5.9 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 16 16 17 17 == Features == 18 * Adds a simple lightweight Author Box at the end of your posts with a short description about the author18 * Adds a simple lightweight Author Box at the end of your posts and/or pages with a short description about the author 19 19 * Adds support for local avatars for authors so that you dont need to use an Gravatar account 20 20 * Option for displaying a link to an own "About Me Page" in Author Box for post authors … … 73 73 == Changelog == 74 74 75 = 1.0.5 = 76 * Fixed a bug that may caused local avatars do not work properly in some cases 77 * Fixed a PHP error while saving user specific settings 78 * General settings page separated in tabs 79 * Added option to inherit font from theme 80 * Added option to display shadow of Author Box 81 * Added option to to adjust border size and border color of Author Box 82 75 83 = 1.0.4 = 76 84 * Fixed PHP warnings for PHP 8 -
author-box-by-nocksoft/trunk/author-box-by-nocksoft.php
r2464444 r2653204 3 3 /* 4 4 Plugin Name: Author Box by Nocksoft 5 Version: 1.0. 45 Version: 1.0.5 6 6 Author: Rafael Nockmann @ Nocksoft 7 7 Author URI: https://nocksoft.de … … 15 15 16 16 17 /* --- Settings link in plugin overview --- */ 18 add_filter("plugin_action_links_" . plugin_basename(__FILE__), "nstab_pluginsettingslink"); 19 function nstab_pluginsettingslink($links) { 20 $settingslink = "<a href='options-general.php?page=nstab'>" . __("Settings", "author-box-by-nocksoft") . "</a>"; 21 array_unshift($links, $settingslink); 22 return $links; 17 if (is_admin()) { 18 19 /* --- Settings link in plugin overview --- */ 20 add_filter("plugin_action_links_" . plugin_basename(__FILE__), "nstab_pluginsettingslink"); 21 function nstab_pluginsettingslink($links) { 22 $settingslink = "<a href='options-general.php?page=nstab'>" . __("Settings", "author-box-by-nocksoft") . "</a>"; 23 array_push($links, $settingslink); 24 return $links; 25 } 26 27 28 /* --- Load scripts --- */ 29 require_once plugin_dir_path(__FILE__) . "/php/setup.php"; 30 require_once plugin_dir_path(__FILE__) . "/php/settings-global.php"; 31 require_once plugin_dir_path(__FILE__) . "/php/settings-user.php"; 32 33 add_action("admin_enqueue_scripts", "nstab_loadcolorpicker"); 34 function nstab_loadcolorpicker() { 35 wp_enqueue_style("wp-color-picker"); 36 wp_enqueue_script("custom-script-handle", plugin_dir_url(__FILE__) . "js/colorpicker.js", array("wp-color-picker"), false, true); 37 } 38 39 40 /* --- Plugin setup --- */ 41 register_activation_hook(__FILE__, "nstab_activate_plugin"); 42 register_uninstall_hook(__FILE__, "nstab_uninstall_plugin"); 43 23 44 } 24 45 25 46 26 47 /* --- Load scripts --- */ 27 require_once plugin_dir_path(__FILE__) . "/php/setup.php";28 48 require_once plugin_dir_path(__FILE__) . "/php/avatars.php"; 29 49 require_once plugin_dir_path(__FILE__) . "/php/authorbox.php"; 30 require_once plugin_dir_path(__FILE__) . "/php/settings-global.php"; 31 require_once plugin_dir_path(__FILE__) . "/php/settings-user.php"; 32 33 34 /* --- Plugin setup --- */ 35 register_activation_hook(__FILE__, "nstab_activate_plugin"); 36 register_uninstall_hook(__FILE__, "nstab_uninstall_plugin"); 50 require_once plugin_dir_path(__FILE__) . "/php/settings.php"; 37 51 38 52 39 53 /* --- Load styles --- */ 40 wp_register_style("author-box-by-nocksoft-style", plugin_dir_url(__FILE__) . " assets/style.css");54 wp_register_style("author-box-by-nocksoft-style", plugin_dir_url(__FILE__) . "css/style.css"); 41 55 wp_enqueue_style("author-box-by-nocksoft-style"); 42 56 43 if ( get_option("nstab_setting_hidewordpressauthorbox")== true) {44 wp_register_style("author-box-by-nocksoft-hidewordpressauthorbox", plugin_dir_url(__FILE__) . " assets/hidewordpressauthorbox.css");57 if ($nstab_setting_hidewordpressauthorbox == true) { 58 wp_register_style("author-box-by-nocksoft-hidewordpressauthorbox", plugin_dir_url(__FILE__) . "css/hidewordpressauthorbox.css"); 45 59 wp_enqueue_style("author-box-by-nocksoft-hidewordpressauthorbox"); 46 60 } … … 48 62 49 63 /* --- Languages --- */ 64 add_action("plugins_loaded", "nstab_load_plugin_textdomain"); 50 65 function nstab_load_plugin_textdomain() { 51 66 load_plugin_textdomain("author-box-by-nocksoft", FALSE, basename(dirname(__FILE__)) . "/languages/"); 52 67 } 53 add_action("plugins_loaded", "nstab_load_plugin_textdomain");54 55 68 56 69 ?> -
author-box-by-nocksoft/trunk/languages/author-box-by-nocksoft-de_DE.po
r2464444 r2653204 3 3 msgstr "Fügt eine moderne anpassbare Autoren Info Box am Ende deines Beitrages ein und bringt Support für lokale Avatare." 4 4 5 #: author-box-by-nocksoft.php: 195 #: author-box-by-nocksoft.php:22 6 6 msgid "Settings" 7 7 msgstr "Einstellungen" 8 8 9 #: setup.php:8 9 #: authorbox.php:55 10 msgid "View Archive" 11 msgstr "Archiv anzeigen" 12 13 #: authorbox.php:62 14 msgid "View Archive" 15 msgstr "Archiv anzeigen" 16 17 #: settings-defaults.php:16 10 18 msgid "A Post by" 11 19 msgstr "Ein Beitrag von" 12 20 13 #: settings-global.php:45 14 msgid "User-specific settings are made in your author profile in WordPress (Users -> Your Profile). General settings can be made here." 15 msgstr "Benutzerspezifische Einstellungen werden in deinem Benutzerprofil getätigt (Benutzer -> Dein Profil). Allgemeine Einstellungen können hier vorgenommen werden." 16 17 #: settings-global.php:49 21 #: settings-global.php:65 22 msgid "User-specific settings are made in your user profile in WordPress (Users -> Your Profile -> Edit). General settings can be made here." 23 msgstr "Benutzerspezifische Einstellungen werden in deinem Benutzerprofil getätigt (Benutzer -> Dein Profil -> Bearbeiten). Allgemeine Einstellungen können hier vorgenommen werden." 24 25 #: settings-global.php:68 26 msgid "General" 27 msgstr "Allgemein" 28 29 #: settings-global.php:69 30 msgid "Layout" 31 msgstr "Aussehen" 32 33 #: settings-global.php:88 34 msgid "Author Box display options" 35 msgstr "Author Box Anzeigeeinstellungen" 36 37 #: settings-global.php:91 38 msgid "Display Author Box at the end of each post automatically" 39 msgstr "Füge die Author Box am Ende von Beiträgen automatisch hinzu" 40 41 #: settings-global.php:94 42 msgid "Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)" 43 msgstr "Füge die Author Box am Ende von Seiten automatisch hinzu (nicht auf Startseite, Beitragsseite und Datenschutzerklärung)" 44 45 #: settings-global.php:99 46 msgid "Other options" 47 msgstr "Weitere Einstellungen" 48 49 #: settings-global.php:102 50 msgid "Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)" 51 msgstr "Verstecke die Autor-Biografie (Author Box) vom WordPress Standard-Theme (Getestet von Twenty Nineteen bis Twenty Twenty-One)" 52 53 #: settings-global.php:103 54 msgid "If your theme offers you an option to hide the author box of your theme, you should use your theme's setting for this." 55 msgstr "Wenn dein Theme dir eine Option anbietet, die Autor-Biografie (Author Box) deines Themes auszublenden, solltest du die Einstellung deines Themes dafür verwenden." 56 57 #: settings-global.php:113 58 msgid "Basic" 59 msgstr "Grundlegend" 60 61 #: settings-global.php:116 62 msgid "Arial" 63 msgstr "Arial" 64 65 #: settings-global.php:117 66 msgid "Inherit from website" 67 msgstr "Von Webseite erben" 68 69 #: settings-global.php:119 70 msgid "Font of Author Box" 71 msgstr "Schriftart der Author Box" 72 73 #: settings-global.php:120 74 msgid "Inherit from website means that the fonts of the WordPress theme are used." 75 msgstr "Von Webseite erben bedeutet, dass die Schriftart des WordPress Themes verwendet wird." 76 77 #: settings-global.php:123 78 msgid "Show Shadow of Author Box" 79 msgstr "Stelle einen Schatten um die Author Box dar" 80 81 #: settings-global.php:129 82 msgid "Border" 83 msgstr "Rahmen" 84 85 #: settings-global.php:132 18 86 msgid "Show Border of Author Box" 19 msgstr "Stelle den Rand der Author Box dar" 20 21 #: settings-global.php:54 87 msgstr "Stelle den Rahmen der Author Box dar" 88 89 #: settings-global.php:135 90 msgid "Color of border" 91 msgstr "Farbe des Rahmens" 92 93 #: settings-global.php:138 94 msgid "Size of border" 95 msgstr "Breite des Rahmens" 96 97 #: settings-global.php:143 98 msgid "Avatar" 99 msgstr "Avatar" 100 101 #: settings-global.php:146 22 102 msgid "Size of Avatar (Pixel)" 23 103 msgstr "Größe Avatar (Pixel)" 24 104 25 #: settings-global.php: 59105 #: settings-global.php:149 26 106 msgid "Use a circle avatar instead of a square" 27 107 msgstr "Verwende ein rundes statt ein eckiges Profilbild" 28 108 29 #: settings-global.php:64 109 #: settings-global.php:155 110 msgid "Header" 111 msgstr "Header" 112 113 #: settings-global.php:157 114 msgid "e.g. A Post by" 115 msgstr "z.B. Ein Beitrag von" 116 117 #: settings-global.php:158 30 118 msgid "Headline" 31 119 msgstr "Text der Überschrift" 32 120 33 #: settings-global.php:65 34 msgid "e.g. A Post by" 35 msgstr "z.B. Ein Beitrag von" 36 37 #: settings-global.php:69 121 #: settings-global.php:161 38 122 msgid "Fontsize of Headline (em)" 39 123 msgstr "Schriftgröße der Überschrift (em)" 40 124 41 #: settings-global.php: 74125 #: settings-global.php:165 42 126 msgid "Fontsize of author's Position (em)" 43 msgstr "Schriftgröße der Position vom Autor (em)" 44 45 #: settings-global.php:79 127 msgstr "Schriftgröße der Position des Autors (em)" 128 129 #: settings-global.php:171 130 msgid "Biography" 131 msgstr "Biografie" 132 133 #: settings-global.php:174 46 134 msgid "Fontsize of Biography (em)" 47 135 msgstr "Schriftgröße der Biografie (em)" 48 136 49 #: settings-global.php:84 137 #: settings-global.php:179 138 msgid "Footer" 139 msgstr "Footer" 140 141 #: settings-global.php:182 50 142 msgid "Fontsize of Links (em)" 51 143 msgstr "Schriftgröße der Links (em)" 52 144 53 #: settings-global.php: 89145 #: settings-global.php:185 54 146 msgid "Display a link to the author's archive" 55 147 msgstr "Zeige einen Link zum Archiv des Autors an" 56 148 57 #: settings-global.php:94 58 msgid "Display Author Box at the end of each post automatically" 59 msgstr "Füge die Author Box am Ende von Beiträgen automatisch hinzu" 60 61 #: settings-global.php:100 62 msgid "Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)" 63 msgstr "Füge die Author Box am Ende von Seiten automatisch hinzu (nicht auf Startseite, Beitragsseite und Datenschutzerklärung)" 64 65 #: settings-global.php:105 66 msgid "Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)" 67 msgstr "Verstecke die Autor-Biografie (Author Box) vom WordPress Standard-Theme (Getestet von Twenty Nineteen bis Twenty Twenty-One)" 68 69 #: settings-global.php:105 149 #: settings-global.php:196 70 150 msgid "Save Settings" 71 151 msgstr "Einstellungen speichern" 72 152 73 #: settings-user.php:1 2153 #: settings-user.php:11 74 154 msgid "Here you can make further settings for your avatar or other personal settings. The WordPress administrator can adjust global settings under Settings -> Author Box." 75 msgstr "Hier kannst du weitere Einstellungen in Bezug auf deinen Avatar oder weitere n persönlichenEinstellungen vornehmen. Globale Einstellungen kann der WordPress-Administrator unter Einstellungen -> Author Box vornehmen."76 77 #: settings-user.php:1 6155 msgstr "Hier kannst du weitere Einstellungen in Bezug auf deinen Avatar oder weitere persönliche Einstellungen vornehmen. Globale Einstellungen kann der WordPress-Administrator unter Einstellungen -> Author Box vornehmen." 156 157 #: settings-user.php:15 78 158 msgid "Local avatars" 79 159 msgstr "Lokale Avatare" 80 160 81 #: settings-user.php:1 9161 #: settings-user.php:18 82 162 msgid "Use local avatars instead of Gravatar (Enter the URL to your avatar in the input field below)" 83 163 msgstr "Verwende lokale Avatare an Stelle von Gravatar (Trage die URL zu deinem Profilbild in das untere Eingabefeld ein)" 84 164 85 #: settings-user.php:2 4165 #: settings-user.php:23 86 166 msgid "Avatar (URL)" 87 167 msgstr "Avatar (URL)" 88 168 89 #: settings-user.php:2 7169 #: settings-user.php:26 90 170 msgid "Avatar URL (e.g. https://yoursite.com/avatar.jpg)" 91 171 msgstr "Avatar URL (z.B. https://deineseite.de/avatar.jpg)" 92 172 93 #: settings-user.php:2 8173 #: settings-user.php:27 94 174 msgid "Please enter a valid URL to your avatar, so that it can be displayed in the author box. You will get the best results if your avatar has the same width and height dimensions." 95 175 msgstr "Gebe bitte eine gültige URL zu deinem Avatar an, damit dieses in der Author Box angezeigt werden kann. Das beste Ergebnis erhältst du, wenn dein Profilbild die gleiche Höhe und Breite aufweist." 96 176 97 #: settings-user.php:3 3177 #: settings-user.php:32 98 178 msgid "Your Position" 99 179 msgstr "Deine Position" 100 180 101 #: settings-user.php:3 6181 #: settings-user.php:35 102 182 msgid "Position (e.g. Founder or Author of YourSite)" 103 183 msgstr "Position (z.B. Gründer oder Autor von DeineSeite)" 104 184 105 #: settings-user.php:3 7185 #: settings-user.php:36 106 186 msgid "Here you can enter your position. The position is shown below your name in the Author Box." 107 187 msgstr "Hier kannst du deine Position angeben. Die Position wird unterhalb deines Namens in der Author Box angezeigt." 108 188 109 #: settings-user.php:4 2189 #: settings-user.php:41 110 190 msgid "Homepage / About Me Page" 111 191 msgstr "Homepage / Über Mich Seite" 112 192 113 #: settings-user.php:4 6193 #: settings-user.php:45 114 194 msgid "Link Text (e.g. Homepage or About Me)" 115 195 msgstr "Link Text (z.B. Homepage oder Über mich)" 116 196 117 #: settings-user.php:4 7197 #: settings-user.php:46 118 198 msgid "Link URL (e.g. https://yoursite.com)" 119 199 msgstr "Link URL (z.B. https://deineseite.de)" 120 200 121 #: settings-user.php:4 8201 #: settings-user.php:47 122 202 msgid "This URL will be displayed below your biography in the Author Box." 123 203 msgstr "Diese URL wird unterhalb deiner Biografie in der Author Box angezeigt." 124 125 #: authorbox.php:41126 msgid "View Archive"127 msgstr "Archiv anzeigen"128 129 #: authorbox.php:48130 msgid "View Archive"131 msgstr "Archiv anzeigen" -
author-box-by-nocksoft/trunk/php/authorbox.php
r2464444 r2653204 2 2 3 3 /* Author Box Shortcode. */ 4 add_shortcode("authorbox", "nstab_shortcode_authorbox"); 4 5 function nstab_shortcode_authorbox() { 5 6 return nstab_get_authorbox(); 6 7 } 7 add_shortcode("authorbox", "nstab_shortcode_authorbox");8 8 9 9 10 /* Adds Author Box at end of posts */10 /* Adds Author Box at end of posts and pages automatically. */ 11 11 add_filter("the_content", "nstab_add_authorbox"); 12 12 function nstab_add_authorbox($content) { 13 if (is_single() && get_option("nstab_setting_displayauthorboxonposts", true) == true) { 13 global $nstab_setting_displayauthorboxonposts; 14 global $nstab_setting_displayauthorboxonpages; 15 16 if (is_single() && $nstab_setting_displayauthorboxonposts == true) { 14 17 $content .= nstab_get_authorbox(); 15 18 } 16 else if (is_page() && get_option("nstab_setting_displayauthorboxonpages")== true19 else if (is_page() && $nstab_setting_displayauthorboxonpages == true 17 20 && !is_front_page() && !is_home() && !is_privacy_policy()) { 18 21 $content .= nstab_get_authorbox(); … … 22 25 23 26 24 /* --- Drawing of the Author Box --- */ 25 26 /* Adds Author Box */ 27 /* Get Author Box HTML. */ 27 28 function nstab_get_authorbox() { 28 $avatarsize = esc_attr(get_option("nstab_setting_avatarsize")); 29 global $nstab_setting_font; 30 global $nstab_setting_showshadow; 31 global $nstab_setting_showborder; 32 global $nstab_setting_bordercolor; 33 global $nstab_setting_bordersize; 34 global $nstab_setting_avatarsize; 35 global $nstab_setting_circleavatar; 36 global $nstab_setting_headline; 37 global $nstab_setting_fontsizeheadline; 38 global $nstab_setting_fontsizeposition; 39 global $nstab_setting_fontsizebio; 40 global $nstab_setting_fontsizelinks; 41 global $nstab_setting_displayauthorsarchive; 42 43 $author_id = get_the_author_meta("ID"); 44 29 45 $circleavatar = ""; 30 if ( get_option("nstab_setting_circleavatar")== true) {46 if ($nstab_setting_circleavatar == true) { 31 47 $circleavatar = "class='nstab_circle'"; 32 48 } 33 34 require plugin_dir_path(__FILE__) . "settings-defaults.php";35 49 36 50 $authorlinktext = get_the_author_meta("nstab_setting_homepage_linktext"); 37 51 $authorlinkurl = get_the_author_meta("nstab_setting_homepage_linkurl"); 38 52 if ($authorlinktext != null && $authorlinkurl != null) { 39 $homepagehref = "<p id='nstab_links' style='font-size: " . $ fontsizelinks . "em;'><a href='" . $authorlinkurl . "'>" . $authorlinktext . "</a>";40 if ( get_option("nstab_setting_displayauthorsarchive")== true) {41 $homepagehref .= " | <a href='" . get_author_posts_url( get_the_author_meta("ID")) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a>";53 $homepagehref = "<p id='nstab_links' style='font-size: " . $nstab_setting_fontsizelinks . "em;'><a href='" . $authorlinkurl . "'>" . $authorlinktext . "</a>"; 54 if ($nstab_setting_displayauthorsarchive == true) { 55 $homepagehref .= " | <a href='" . get_author_posts_url($author_id) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a>"; 42 56 } 43 57 $homepagehref .= "</p>"; … … 45 59 else { 46 60 $homepagehref = ""; 47 if ( get_option("nstab_setting_displayauthorsarchive")== true) {48 $homepagehref .= "<p id='nstab_links' style='font-size: " . $ fontsizelinks . "em;'><a href='" . get_author_posts_url(get_the_author_meta("ID")) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a></p>";61 if ($nstab_setting_displayauthorsarchive == true) { 62 $homepagehref .= "<p id='nstab_links' style='font-size: " . $nstab_setting_fontsizelinks . "em;'><a href='" . get_author_posts_url($author_id) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a></p>"; 49 63 } 50 64 } 51 65 52 $authorboxcontainer = "<div id='author-box-by-nocksoft'>"; 53 if (get_option("nstab_setting_showborder", true) == true) { 54 $authorboxcontainer = "<div id='author-box-by-nocksoft' style='padding: 0.75em; border: 1px solid #EEEEEE;'>"; 55 } 66 $font = $nstab_setting_font == "arial" ? "font-family: Arial;" : null; 67 $shadow = $nstab_setting_showshadow == true ? "padding: 0.75em; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" : null; 68 $border = $nstab_setting_showborder == true ? "padding: 0.75em; border: ".$nstab_setting_bordersize."px solid ".$nstab_setting_bordercolor.";" : null; 69 $authorboxcontainer = "<div id='author-box-by-nocksoft' style='".$font.$shadow.$border."'>"; 70 71 $url = nstab_get_local_avatarurl($author_id); 72 if (empty($url)) $url = get_avatar_url($author_id); 73 56 74 $authorbox = $authorboxcontainer .= " 57 75 <div id='nstab_wrapper'> 58 <div id='nstab_authoravatar' " . $circleavatar . " style='background-image: url(\"". nstab_get_avatarurl()."\"); height: ".$avatarsize."px; width: ".$avatarsize."px;'></div>59 <div id='nstab_authorbio' style='height: ".$ avatarsize."px;'>76 <div id='nstab_authoravatar' " . $circleavatar . " style='background-image: url(\"".$url."\"); height: ".$nstab_setting_avatarsize."px; width: ".$nstab_setting_avatarsize."px;'></div> 77 <div id='nstab_authorbio' style='height: ".$nstab_setting_avatarsize."px;'> 60 78 <div id='header'> 61 <span id='headline' style='font-size: " . $ fontsizeheadline . "em;'>" . get_option("nstab_setting_headline"). " " . get_the_author_meta("display_name") . "</span>62 <span id='position' style='font-size: " . $ fontsizeposition . "em;'>" . get_the_author_meta("nstab_setting_authorposition") . "</span>79 <span id='headline' style='font-size: " . $nstab_setting_fontsizeheadline . "em;'>" . $nstab_setting_headline . " " . get_the_author_meta("display_name") . "</span> 80 <span id='position' style='font-size: " . $nstab_setting_fontsizeposition . "em;'>" . get_the_author_meta("nstab_setting_authorposition") . "</span> 63 81 </div> 64 <p id='nstab_description' style='font-size: " . $ fontsizebio . "em;'>" . get_the_author_meta("description") . "</p>82 <p id='nstab_description' style='font-size: " . $nstab_setting_fontsizebio . "em;'>" . get_the_author_meta("description") . "</p> 65 83 " . $homepagehref . " 66 84 </div> -
author-box-by-nocksoft/trunk/php/avatars.php
r2464444 r2653204 1 1 <?php 2 2 3 /* Returns the avatar URL */ 4 function nstab_get_avatarurl() { 5 if (get_the_author_meta("nstab_setting_localavatar") != "on") return get_avatar_url(get_the_author_meta("ID")); 6 else return get_the_author_meta("nstab_setting_avatarurl"); 3 /* Returns the avatar URL for local avatar, if exists. */ 4 function nstab_get_local_avatarurl($user_id) { 5 if (!get_user_meta($user_id, "nstab_setting_localavatar", true)) return null; 6 7 $url = get_user_meta($user_id, "nstab_setting_avatarurl", true); 8 return $url; 7 9 } 8 10 9 11 12 /** 13 * Overrides the avatar data. 14 * https://developer.wordpress.org/reference/functions/get_avatar_data/ 15 * https://developer.wordpress.org/reference/hooks/get_avatar_data/ 16 */ 17 add_filter("get_avatar_data", "nstab_get_avatar_data", 10, 2); 18 function nstab_get_avatar_data($args, $id_or_email) { 19 $url = nstab_get_local_avatarurl(nstab_get_user_id($id_or_email)); 20 if (!empty($url)) $args["url"] = $url; 21 22 return $args; 23 } 10 24 11 /* Overrides the avatars */12 /* https://codex.wordpress.org/Plugin_API/Filter_Reference/get_avatar */13 add_filter("get_avatar", "nstab_get_avatar", 1 , 5);14 function nstab_get_avatar($avatar, $id_or_email, $size, $default, $alt) {15 $user = false;16 25 17 if (is_numeric($id_or_email)) { 18 $id = (int)$id_or_email; 19 $user = get_user_by("id", $id); 20 } 21 elseif (is_object($id_or_email)) { 22 if (!empty($id_or_email->user_id)) { 23 $id = (int)$id_or_email->user_id; 24 $user = get_user_by("id", $id); 25 } 26 } 27 else { 28 $user = get_user_by("email", $id_or_email); 29 } 26 function nstab_get_user_id($id_or_email) { 27 $user_id = null; 28 29 if (is_numeric($id_or_email)) { 30 $user_id = (int)$id_or_email; 31 } 32 else if (is_string($id_or_email) && ($user = get_user_by("email", $id_or_email))) { 33 $user_id = $user->ID; 34 } 35 else if (is_object($id_or_email) && !empty($id_or_email->user_id)) { 36 $user_id = (int)$id_or_email->user_id; 37 } 30 38 31 if ($user && is_object($user) 32 && get_the_author_meta("nstab_setting_localavatar", $user->ID) == "on") { 33 $avatar = get_the_author_meta("nstab_setting_avatarurl", $user->ID); 34 $avatar = "<img alt='{$alt}' src='{$avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; 35 } 36 37 return $avatar; 39 return $user_id; 38 40 } 39 41 -
author-box-by-nocksoft/trunk/php/settings-defaults.php
r2394668 r2653204 1 1 <?php 2 2 3 /* --- Default settings and fallbacks. Only needed, when setting was added after initial release. --- */ 3 /* Global settings: general */ 4 $nstab_setting_default_displayauthorboxonposts = true; 5 $nstab_setting_default_displayauthorboxonpages = false; 6 $nstab_setting_default_hidewordpressauthorbox = false; 4 7 5 /* Headline Size */ 6 if (esc_attr(get_option("nstab_setting_fontsizeheadline")) != false) $fontsizeheadline = esc_attr(get_option("nstab_setting_fontsizeheadline")); 7 else $fontsizeheadline = "1.1"; 8 9 /* Position Size */ 10 if (esc_attr(get_option("nstab_setting_fontsizeposition")) != false) $fontsizeposition = esc_attr(get_option("nstab_setting_fontsizeposition")); 11 else $fontsizeposition = "0.7"; 12 13 /* Bio Size */ 14 if (esc_attr(get_option("nstab_setting_fontsizebio")) != false) $fontsizebio = esc_attr(get_option("nstab_setting_fontsizebio")); 15 else $fontsizebio = "0.9"; 16 17 /* Links Size */ 18 if (esc_attr(get_option("nstab_setting_fontsizelinks")) != false) $fontsizelinks = esc_attr(get_option("nstab_setting_fontsizelinks")); 19 else $fontsizelinks = "0.8"; 8 /* Global settings: layout */ 9 $nstab_setting_default_font = "arial"; 10 $nstab_setting_default_showshadow = false; 11 $nstab_setting_default_showborder = true; 12 $nstab_setting_default_bordercolor = "#EEEEEE"; 13 $nstab_setting_default_bordersize = "1"; 14 $nstab_setting_default_avatarsize = "100"; 15 $nstab_setting_default_circleavatar = false; 16 $nstab_setting_default_headline = __("A Post by", "author-box-by-nocksoft"); 17 $nstab_setting_default_fontsizeheadline = "1.1"; 18 $nstab_setting_default_fontsizeposition = "0.7"; 19 $nstab_setting_default_fontsizebio = "0.9"; 20 $nstab_setting_default_fontsizelinks = "0.8"; 21 $nstab_setting_default_displayauthorsarchive = false; 20 22 21 23 ?> -
author-box-by-nocksoft/trunk/php/settings-global.php
r2464444 r2653204 1 1 <?php 2 2 3 add_action("admin_menu", "nstab_settings_page"); 3 4 function nstab_settings_page() { 4 5 add_submenu_page( … … 11 12 ); 12 13 } 13 add_action("admin_menu", "nstab_settings_page");14 14 15 15 16 16 add_action("admin_init", function() { 17 register_setting("nstab_settings", "nstab_setting_showborder"); 18 register_setting("nstab_settings", "nstab_setting_avatarsize"); 19 register_setting("nstab_settings", "nstab_setting_circleavatar"); 20 register_setting("nstab_settings", "nstab_setting_headline"); 21 register_setting("nstab_settings", "nstab_setting_fontsizeheadline"); 22 register_setting("nstab_settings", "nstab_setting_fontsizeposition"); 23 register_setting("nstab_settings", "nstab_setting_fontsizebio"); 24 register_setting("nstab_settings", "nstab_setting_fontsizelinks"); 25 register_setting("nstab_settings", "nstab_setting_displayauthorsarchive"); 26 register_setting("nstab_settings", "nstab_setting_displayauthorboxonposts"); 27 register_setting("nstab_settings", "nstab_setting_displayauthorboxonpages"); 28 register_setting("nstab_settings", "nstab_setting_hidewordpressauthorbox"); 17 register_setting("nstab_settings_general", "nstab_setting_displayauthorboxonposts"); 18 register_setting("nstab_settings_general", "nstab_setting_displayauthorboxonpages"); 19 register_setting("nstab_settings_general", "nstab_setting_hidewordpressauthorbox"); 20 21 register_setting("nstab_settings_layout", "nstab_setting_font"); 22 register_setting("nstab_settings_layout", "nstab_setting_showshadow"); 23 register_setting("nstab_settings_layout", "nstab_setting_showborder"); 24 register_setting("nstab_settings_layout", "nstab_setting_bordercolor"); 25 register_setting("nstab_settings_layout", "nstab_setting_bordersize"); 26 register_setting("nstab_settings_layout", "nstab_setting_avatarsize"); 27 register_setting("nstab_settings_layout", "nstab_setting_circleavatar"); 28 register_setting("nstab_settings_layout", "nstab_setting_headline"); 29 register_setting("nstab_settings_layout", "nstab_setting_fontsizeheadline"); 30 register_setting("nstab_settings_layout", "nstab_setting_fontsizeposition"); 31 register_setting("nstab_settings_layout", "nstab_setting_fontsizebio"); 32 register_setting("nstab_settings_layout", "nstab_setting_fontsizelinks"); 33 register_setting("nstab_settings_layout", "nstab_setting_displayauthorsarchive"); 29 34 }); 30 35 … … 34 39 if (!current_user_can("manage_options")) return; 35 40 36 require plugin_dir_path(__FILE__) . "settings-defaults.php"; 41 global $nstab_setting_displayauthorboxonposts; 42 global $nstab_setting_displayauthorboxonpages; 43 global $nstab_setting_hidewordpressauthorbox; 44 45 global $nstab_setting_font; 46 global $nstab_setting_showshadow; 47 global $nstab_setting_showborder; 48 global $nstab_setting_default_bordercolor; 49 global $nstab_setting_bordercolor; 50 global $nstab_setting_bordersize; 51 global $nstab_setting_avatarsize; 52 global $nstab_setting_circleavatar; 53 global $nstab_setting_headline; 54 global $nstab_setting_fontsizeheadline; 55 global $nstab_setting_fontsizeposition; 56 global $nstab_setting_fontsizebio; 57 global $nstab_setting_fontsizelinks; 58 global $nstab_setting_displayauthorsarchive; 59 60 $tab = isset($_GET["tab"]) ? $_GET["tab"] : null; 37 61 ?> 38 62 <div class="wrap"> 39 63 <h1><?= esc_html(get_admin_page_title()); ?></h1> 64 65 <p><?php echo __("User-specific settings are made in your user profile in WordPress (Users -> Your Profile -> Edit). General settings can be made here.", "author-box-by-nocksoft"); ?></p> 66 67 <nav class="nav-tab-wrapper"> 68 <a href="?page=nstab" class="nav-tab<?php if ($tab == "general" || $tab == null) echo " nav-tab-active"; ?>"><?php echo __("General", "author-box-by-nocksoft"); ?></a> 69 <a href="?page=nstab&tab=layout" class="nav-tab<?php if ($tab == "layout") echo " nav-tab-active"; ?>"><?php echo __("Layout", "author-box-by-nocksoft"); ?></a> 70 </nav> 71 40 72 <form action="options.php" method="post"> 41 73 <?php 42 settings_fields("nstab_settings"); 74 $option_group = null; 75 if ($tab == "general" || $tab == null) $option_group = "nstab_settings_general"; 76 else if ($tab == "layout") $option_group = "nstab_settings_layout"; 77 else return; 78 settings_fields($option_group); 43 79 do_settings_sections("nstab"); 44 80 ?> 45 81 46 <p><?php echo __("User-specific settings are made in your author profile in WordPress (Users -> Your Profile). General settings can be made here.", "author-box-by-nocksoft"); ?></p> 47 48 <table class="form-table"> 49 <tr valign="top"> 50 <th scope="row"><?php echo __("Show Border of Author Box", "author-box-by-nocksoft"); ?></th> 51 <td><input type="checkbox" name="nstab_setting_showborder" <?php if (get_option("nstab_setting_showborder", true) == true) echo "checked"; ?> /></td> 52 </tr> 53 54 <tr valign="top"> 55 <th scope="row"><?php echo __("Size of Avatar (Pixel)", "author-box-by-nocksoft"); ?></th> 56 <td><input type="number" name="nstab_setting_avatarsize" min="96" max="200" value="<?php echo esc_attr(get_option("nstab_setting_avatarsize")); ?>" /></td> 57 </tr> 58 59 <tr valign="top"> 60 <th scope="row"><?php echo __("Use a circle avatar instead of a square", "author-box-by-nocksoft"); ?></th> 61 <td><input type="checkbox" name="nstab_setting_circleavatar" <?php if (get_option("nstab_setting_circleavatar") == true) echo "checked"; ?> /></td> 62 </tr> 63 64 <tr valign="top"> 65 <th scope="row"><?php echo __("Headline", "author-box-by-nocksoft"); ?></th> 66 <td><input type="text" name="nstab_setting_headline" placeholder="<?php echo __("e.g. A Post by", "author-box-by-nocksoft"); ?>" value="<?php echo get_option("nstab_setting_headline"); ?>" /></td> 67 </tr> 68 69 <tr valign="top"> 70 <th scope="row"><?php echo __("Fontsize of Headline (em)", "author-box-by-nocksoft"); ?></th> 71 <td><input type="number" name="nstab_setting_fontsizeheadline" min="0.5" max="2" step="0.1" value="<?php echo $fontsizeheadline; ?>" /></td> 72 </tr> 73 74 <tr valign="top"> 75 <th scope="row"><?php echo __("Fontsize of author's Position (em)", "author-box-by-nocksoft"); ?></th> 76 <td><input type="number" name="nstab_setting_fontsizeposition" min="0.4" max="0.9" step="0.1" value="<?php echo $fontsizeposition; ?>" /></td> 77 </tr> 78 79 <tr valign="top"> 80 <th scope="row"><?php echo __("Fontsize of Biography (em)", "author-box-by-nocksoft"); ?></th> 81 <td><input type="number" name="nstab_setting_fontsizebio" min="0.4" max="1.5" step="0.1" value="<?php echo $fontsizebio; ?>" /></td> 82 </tr> 83 84 <tr valign="top"> 85 <th scope="row"><?php echo __("Fontsize of Links (em)", "author-box-by-nocksoft"); ?></th> 86 <td><input type="number" name="nstab_setting_fontsizelinks" min="0.3" max="1" step="0.1" value="<?php echo $fontsizelinks; ?>" /></td> 87 </tr> 88 89 <tr valign="top"> 90 <th scope="row"><?php echo __("Display a link to the author's archive", "author-box-by-nocksoft"); ?></th> 91 <td><input type="checkbox" name="nstab_setting_displayauthorsarchive" <?php if (get_option("nstab_setting_displayauthorsarchive") == true) echo "checked"; ?> /></td> 92 </tr> 93 94 <tr valign="top"> 95 <th scope="row"><?php echo __("Display Author Box at the end of each post automatically", "author-box-by-nocksoft"); ?></th> 96 <td><input type="checkbox" name="nstab_setting_displayauthorboxonposts" <?php if (get_option("nstab_setting_displayauthorboxonposts", true) == true) echo "checked"; ?> /></td> 97 </tr> 98 99 <tr valign="top"> 100 <th scope="row"><?php echo __("Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)", "author-box-by-nocksoft"); ?></th> 101 <td><input type="checkbox" name="nstab_setting_displayauthorboxonpages" <?php if (get_option("nstab_setting_displayauthorboxonpages") == true) echo "checked"; ?> /></td> 102 </tr> 103 104 <tr valign="top"> 105 <th scope="row"><?php echo __("Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)", "author-box-by-nocksoft"); ?></th> 106 <td><input type="checkbox" name="nstab_setting_hidewordpressauthorbox" <?php if (get_option("nstab_setting_hidewordpressauthorbox") == true) echo "checked"; ?> /></td> 107 </tr> 108 </table> 82 <div class="tab-content"> 83 <?php 84 if ($tab == "general" || $tab == null) { 85 ?> 86 <table class="form-table"> 87 <tr valign="top"> 88 <th scope="row"><?php echo __("Author Box display options", "author-box-by-nocksoft"); ?></th> 89 <td> 90 <input type="checkbox" id="nstab_setting_displayauthorboxonposts" name="nstab_setting_displayauthorboxonposts" <?php if ($nstab_setting_displayauthorboxonposts == true) echo "checked"; ?> /> 91 <label for="nstab_setting_displayauthorboxonposts"><?php echo __("Display Author Box at the end of each post automatically", "author-box-by-nocksoft"); ?></label> 92 <br> 93 <input type="checkbox" id="nstab_setting_displayauthorboxonpages" name="nstab_setting_displayauthorboxonpages" <?php if ($nstab_setting_displayauthorboxonpages == true) echo "checked"; ?> /> 94 <label for="nstab_setting_displayauthorboxonpages"><?php echo __("Display Author Box at the end of each page automatically (not on front page, blog homepage and privacy policy)", "author-box-by-nocksoft"); ?></label> 95 </td> 96 </tr> 97 98 <tr valign="top"> 99 <th scope="row"><?php echo __("Other options", "author-box-by-nocksoft"); ?></th> 100 <td> 101 <input type="checkbox" id="nstab_setting_hidewordpressauthorbox" name="nstab_setting_hidewordpressauthorbox" <?php if ($nstab_setting_hidewordpressauthorbox == true) echo "checked"; ?> /> 102 <label for="nstab_setting_hidewordpressauthorbox"><?php echo __("Hide the author box of default WordPress theme (tested from Twenty Nineteen up to Twenty Twenty-One)", "author-box-by-nocksoft"); ?></label> 103 <p class="description"><?php echo __("If your theme offers you an option to hide the author box of your theme, you should use your theme's setting for this.", "author-box-by-nocksoft"); ?></p> 104 </td> 105 </tr> 106 </table> 107 <?php 108 } 109 else if ($tab == "layout") { 110 ?> 111 <table class="form-table"> 112 <tr valign="top"> 113 <th scope="row"><?php echo __("Basic", "author-box-by-nocksoft"); ?></th> 114 <td> 115 <select id="nstab_setting_font" name="nstab_setting_font"> 116 <option value="arial" <?php if ($nstab_setting_font == "arial") echo "selected"; ?>><?php echo __("Arial", "author-box-by-nocksoft"); ?></option> 117 <option value="inherit" <?php if ($nstab_setting_font == "inherit") echo "selected"; ?>><?php echo __("Inherit from website", "author-box-by-nocksoft"); ?></option> 118 </select> 119 <label for="nstab_setting_font"><?php echo __("Font of Author Box", "author-box-by-nocksoft"); ?></label> 120 <p class="description"><?php echo __("Inherit from website means that the fonts of the WordPress theme are used.", "author-box-by-nocksoft"); ?></p> 121 <p> 122 <input type="checkbox" id="nstab_setting_showshadow" name="nstab_setting_showshadow" <?php if ($nstab_setting_showshadow == true) echo "checked"; ?> /> 123 <label for="nstab_setting_showshadow"><?php echo __("Show Shadow of Author Box", "author-box-by-nocksoft"); ?></label> 124 </p> 125 </td> 126 </tr> 127 128 <tr valign="top"> 129 <th scope="row"><?php echo __("Border", "author-box-by-nocksoft"); ?></th> 130 <td> 131 <input type="checkbox" id="nstab_setting_showborder" name="nstab_setting_showborder" <?php if ($nstab_setting_showborder == true) echo "checked"; ?> /> 132 <label for="nstab_setting_showborder"><?php echo __("Show Border of Author Box", "author-box-by-nocksoft"); ?></label> 133 <p> 134 <input type="text" id="nstab_setting_bordercolor" name="nstab_setting_bordercolor" class="nstab_colorpicker" value="<?php echo $nstab_setting_bordercolor; ?>" data-default-color="<?php echo $nstab_setting_default_bordercolor; ?>" /> 135 <label for="nstab_setting_bordercolor"><?php echo __("Color of border", "author-box-by-nocksoft"); ?></label> 136 </p> 137 <input type="number" id="nstab_setting_bordersize" name="nstab_setting_bordersize" min="1" max="5" step="1" value="<?php echo $nstab_setting_bordersize; ?>" /> 138 <label for="nstab_setting_bordersize"><?php echo __("Size of border", "author-box-by-nocksoft"); ?></label> 139 </td> 140 </tr> 141 142 <tr valign="top"> 143 <th scope="row"><?php echo __("Avatar", "author-box-by-nocksoft"); ?></th> 144 <td> 145 <input type="number" id="nstab_setting_avatarsize" name="nstab_setting_avatarsize" min="96" max="200" value="<?php echo $nstab_setting_avatarsize; ?>" /> 146 <label for="nstab_setting_avatarsize"><?php echo __("Size of Avatar (Pixel)", "author-box-by-nocksoft"); ?></label> 147 <p> 148 <input type="checkbox" id="nstab_setting_circleavatar" name="nstab_setting_circleavatar" <?php if ($nstab_setting_circleavatar == true) echo "checked"; ?> /> 149 <label for="nstab_setting_circleavatar"><?php echo __("Use a circle avatar instead of a square", "author-box-by-nocksoft"); ?></label> 150 </p> 151 </td> 152 </tr> 153 154 <tr valign="top"> 155 <th scope="row"><?php echo __("Header", "author-box-by-nocksoft"); ?></th> 156 <td> 157 <input type="text" id="nstab_setting_headline" name="nstab_setting_headline" placeholder="<?php echo __("e.g. A Post by", "author-box-by-nocksoft"); ?>" value="<?php echo $nstab_setting_headline; ?>" /> 158 <label for="nstab_setting_headline"><?php echo __("Headline", "author-box-by-nocksoft"); ?></label> 159 <p> 160 <input type="number" id="nstab_setting_fontsizeheadline" name="nstab_setting_fontsizeheadline" min="0.5" max="2" step="0.1" value="<?php echo $nstab_setting_fontsizeheadline; ?>" /> 161 <label for="nstab_setting_fontsizeheadline"><?php echo __("Fontsize of Headline (em)", "author-box-by-nocksoft"); ?></label> 162 </p> 163 <p> 164 <input type="number" id="nstab_setting_fontsizeposition" name="nstab_setting_fontsizeposition" min="0.4" max="0.9" step="0.1" value="<?php echo $nstab_setting_fontsizeposition; ?>" /> 165 <label for="nstab_setting_fontsizeposition"><?php echo __("Fontsize of author's Position (em)", "author-box-by-nocksoft"); ?></label> 166 </p> 167 </td> 168 </tr> 169 170 <tr valign="top"> 171 <th scope="row"><?php echo __("Biography", "author-box-by-nocksoft"); ?></th> 172 <td> 173 <input type="number" id="nstab_setting_fontsizebio" name="nstab_setting_fontsizebio" min="0.4" max="1.5" step="0.1" value="<?php echo $nstab_setting_fontsizebio; ?>" /> 174 <label for="nstab_setting_fontsizebio"><?php echo __("Fontsize of Biography (em)", "author-box-by-nocksoft"); ?></label> 175 </td> 176 </tr> 177 178 <tr valign="top"> 179 <th scope="row"><?php echo __("Footer", "author-box-by-nocksoft"); ?></th> 180 <td> 181 <input type="number" id="nstab_setting_fontsizelinks" name="nstab_setting_fontsizelinks" min="0.3" max="1" step="0.1" value="<?php echo $nstab_setting_fontsizelinks; ?>" /> 182 <label for="nstab_setting_fontsizelinks"><?php echo __("Fontsize of Links (em)", "author-box-by-nocksoft"); ?></label> 183 <p> 184 <input type="checkbox" id="nstab_setting_displayauthorsarchive" name="nstab_setting_displayauthorsarchive" <?php if ($nstab_setting_displayauthorsarchive == true) echo "checked"; ?> /> 185 <label for="nstab_setting_displayauthorsarchive"><?php echo __("Display a link to the author's archive", "author-box-by-nocksoft"); ?></label> 186 </p> 187 </td> 188 </tr> 189 </table> 190 <?php 191 } 192 ?> 193 </div> 109 194 110 195 -
author-box-by-nocksoft/trunk/php/settings-user.php
r2394668 r2653204 5 5 add_action("show_user_profile", "nstab_usersettings"); 6 6 add_action("edit_user_profile", "nstab_usersettings"); 7 8 7 function nstab_usersettings($user) { 9 8 ?> … … 57 56 add_action("personal_options_update", "nstab_save_usersettings"); 58 57 add_action("edit_user_profile_update", "nstab_save_usersettings"); 59 60 58 function nstab_save_usersettings($user_id) { 61 59 if (!current_user_can("edit_user", $user_id)) { … … 63 61 } 64 62 else { 65 update_usermeta($user_id, "nstab_setting_localavatar", $_POST["nstab_setting_localavatar"]); 63 $nstab_setting_localavatar = isset($_POST["nstab_setting_localavatar"]) ? $_POST["nstab_setting_localavatar"] : false; 64 update_usermeta($user_id, "nstab_setting_localavatar", $nstab_setting_localavatar); 66 65 update_usermeta($user_id, "nstab_setting_avatarurl", trim($_POST["nstab_setting_avatarurl"])); 67 66 update_usermeta($user_id, "nstab_setting_authorposition", trim($_POST["nstab_setting_authorposition"])); -
author-box-by-nocksoft/trunk/php/setup.php
r2464444 r2653204 2 2 3 3 function nstab_activate_plugin() { 4 /* Default settings */ 5 add_option("nstab_setting_showborder", "on"); 6 add_option("nstab_setting_avatarsize", "100"); 7 add_option("nstab_setting_circleavatar", ""); 8 add_option("nstab_setting_headline", __("A Post by", "author-box-by-nocksoft")); 9 add_option("nstab_setting_fontsizeheadline", "1.1"); 10 add_option("nstab_setting_fontsizeposition", "0.7"); 11 add_option("nstab_setting_fontsizebio", "0.9"); 12 add_option("nstab_setting_fontsizelinks", "0.8"); 13 add_option("nstab_setting_displayauthorsarchive", ""); 14 add_option("nstab_setting_displayauthorboxonposts", "on"); 15 add_option("nstab_setting_displayauthorboxonpages", ""); 16 add_option("nstab_setting_hidewordpressauthorbox", ""); 4 require plugin_dir_path(__FILE__) . "settings-defaults.php"; 5 6 add_option("nstab_setting_displayauthorboxonposts", $nstab_setting_default_displayauthorboxonposts); 7 add_option("nstab_setting_displayauthorboxonpages", $nstab_setting_default_displayauthorboxonpages); 8 add_option("nstab_setting_hidewordpressauthorbox", $nstab_setting_default_hidewordpressauthorbox); 9 10 add_option("nstab_setting_font", $nstab_setting_default_font); 11 add_option("nstab_setting_showshadow", $nstab_setting_default_showshadow); 12 add_option("nstab_setting_showborder", $nstab_setting_default_showborder); 13 add_option("nstab_setting_bordercolor", $nstab_setting_default_bordercolor); 14 add_option("nstab_setting_bordersize", $nstab_setting_default_bordersize); 15 add_option("nstab_setting_avatarsize", $nstab_setting_default_avatarsize); 16 add_option("nstab_setting_circleavatar", $nstab_setting_default_circleavatar); 17 add_option("nstab_setting_headline", $nstab_setting_default_headline); 18 add_option("nstab_setting_fontsizeheadline", $nstab_setting_default_fontsizeheadline); 19 add_option("nstab_setting_fontsizeposition", $nstab_setting_default_fontsizeposition); 20 add_option("nstab_setting_fontsizebio", $nstab_setting_default_fontsizebio); 21 add_option("nstab_setting_fontsizelinks", $nstab_setting_default_fontsizelinks); 22 add_option("nstab_setting_displayauthorsarchive", $nstab_setting_default_displayauthorsarchive); 17 23 } 18 24 25 /* https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/ */ 19 26 function nstab_uninstall_plugin() { 20 /* Clear global settings */ 27 if (!defined("WP_UNINSTALL_PLUGIN")) { 28 die; 29 } 30 31 delete_option("nstab_setting_displayauthorboxonposts"); 32 delete_option("nstab_setting_displayauthorboxonpages"); 33 delete_option("nstab_setting_hidewordpressauthorbox"); 34 35 delete_option("nstab_setting_font"); 36 delete_option("nstab_setting_showshadow"); 21 37 delete_option("nstab_setting_showborder"); 38 delete_option("nstab_setting_bordercolor"); 39 delete_option("nstab_setting_bordersize"); 22 40 delete_option("nstab_setting_avatarsize"); 23 41 delete_option("nstab_setting_circleavatar"); … … 28 46 delete_option("nstab_setting_fontsizelinks"); 29 47 delete_option("nstab_setting_displayauthorsarchive"); 30 delete_option("nstab_setting_displayauthorboxonposts");31 delete_option("nstab_setting_displayauthorboxonpages");32 delete_option("nstab_setting_hidewordpressauthorbox");33 48 34 49 /* Clear user settings */ -
author-box-by-nocksoft/trunk/readme.txt
r2464444 r2653204 3 3 Tags: author box, author bio, author description, local avatars, about author, about me, author profile, author 4 4 Stable tag: trunk 5 Requires at least: 4.96 Tested up to: 5. 65 Requires at least: 5.3 6 Tested up to: 5.9 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 16 16 17 17 == Features == 18 * Adds a simple lightweight Author Box at the end of your posts with a short description about the author18 * Adds a simple lightweight Author Box at the end of your posts and/or pages with a short description about the author 19 19 * Adds support for local avatars for authors so that you dont need to use an Gravatar account 20 20 * Option for displaying a link to an own "About Me Page" in Author Box for post authors … … 73 73 == Changelog == 74 74 75 = 1.0.5 = 76 * Fixed a bug that may caused local avatars do not work properly in some cases 77 * Fixed a PHP error while saving user specific settings 78 * General settings page separated in tabs 79 * Added option to inherit font from theme 80 * Added option to display shadow of Author Box 81 * Added option to to adjust border size and border color of Author Box 82 75 83 = 1.0.4 = 76 84 * Fixed PHP warnings for PHP 8
Note: See TracChangeset
for help on using the changeset viewer.