Plugin Directory

Changeset 2782053


Ignore:
Timestamp:
09/08/2022 03:09:25 PM (4 years ago)
Author:
nocksoft
Message:

Upload version 1.1.0

Location:
author-box-by-nocksoft
Files:
19 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • author-box-by-nocksoft/trunk/author-box-by-nocksoft.php

    r2653204 r2782053  
    33/*
    44    Plugin Name: Author Box by Nocksoft
    5     Version: 1.0.5
     5    Version: 1.1.0
    66    Author: Rafael Nockmann @ Nocksoft
    77    Author URI: https://nocksoft.de
    88    Plugin URI: https://github.com/Nocksoft/Author-Box-by-Nocksoft
    9     Description: Adds a modern customizable author info box at the end of your posts and implements support for local avatars.
     9    Description: Adds a modern customizable author info box at the end of your posts and pages with some information about the author.
    1010    Text Domain: author-box-by-nocksoft
    1111    License: GNU General Public License v2 or later
     
    3131    require_once plugin_dir_path(__FILE__) . "/php/settings-user.php";
    3232   
    33     add_action("admin_enqueue_scripts", "nstab_loadcolorpicker");
    34     function nstab_loadcolorpicker() {
     33    add_action("admin_enqueue_scripts", "nstab_loadadminscripts");
     34    function nstab_loadadminscripts() {
     35        /* --- Color picker --- */
    3536        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        wp_enqueue_script("nstab_colorpicker", plugin_dir_url(__FILE__) . "js/colorpicker.js", array("wp-color-picker"), false, true);
    3738    }
    3839   
     
    4647
    4748/* --- Load scripts --- */
    48 require_once plugin_dir_path(__FILE__) . "/php/avatars.php";
    4949require_once plugin_dir_path(__FILE__) . "/php/authorbox.php";
    5050require_once plugin_dir_path(__FILE__) . "/php/settings.php";
    5151
    5252
    53 /* --- Load styles --- */
    54 wp_register_style("author-box-by-nocksoft-style", plugin_dir_url(__FILE__) . "css/style.css");
    55 wp_enqueue_style("author-box-by-nocksoft-style");
     53add_action("wp_enqueue_scripts", "nstab_loadstyles");
     54function nstab_loadstyles() {
     55    /* --- Load styles --- */
     56    wp_register_style("author-box-by-nocksoft-style", plugin_dir_url(__FILE__) . "css/style.css");
     57    wp_enqueue_style("author-box-by-nocksoft-style");
    5658
    57 if ($nstab_setting_hidewordpressauthorbox == true) {
    58     wp_register_style("author-box-by-nocksoft-hidewordpressauthorbox", plugin_dir_url(__FILE__) . "css/hidewordpressauthorbox.css");
    59     wp_enqueue_style("author-box-by-nocksoft-hidewordpressauthorbox");
     59    global $nstab_setting_hidewordpressauthorbox;
     60    if ($nstab_setting_hidewordpressauthorbox == true) {
     61        wp_register_style("author-box-by-nocksoft-hidewordpressauthorbox", plugin_dir_url(__FILE__) . "css/hidewordpressauthorbox.css");
     62        wp_enqueue_style("author-box-by-nocksoft-hidewordpressauthorbox");
     63    }
    6064}
    6165
  • author-box-by-nocksoft/trunk/css/style.css

    r2653204 r2782053  
    3636}
    3737
    38 #author-box-by-nocksoft #nstab_wrapper #nstab_authorbio p {
     38#author-box-by-nocksoft #nstab_wrapper #nstab_authorbio div {
    3939    margin: 0;
    4040    padding-top: 0.5em;
    4141}
    4242
    43 #author-box-by-nocksoft #nstab_wrapper #nstab_authorbio p#nstab_description {
     43#author-box-by-nocksoft #nstab_wrapper #nstab_authorbio div#nstab_description {
    4444    line-height: 1.3;
    4545}
    4646
    47 #author-box-by-nocksoft #nstab_wrapper #nstab_authorbio p#nstab_links {
     47#author-box-by-nocksoft #nstab_wrapper #nstab_authorbio div#nstab_links {
    4848    padding-top: 0.5em;
    4949    font-style: italic;
  • author-box-by-nocksoft/trunk/languages/author-box-by-nocksoft-de_DE.po

    r2653204 r2782053  
    11#. Description of the plugin/theme
    2 msgid "Adds a modern customizable author info box at the end of your posts and implements support for local avatars."
    3 msgstr "Fügt eine moderne anpassbare Autoren Info Box am Ende deines Beitrages ein und bringt Support für lokale Avatare."
     2msgid "Adds a modern customizable author info box at the end of your posts and pages with some information about the author."
     3msgstr "Fügt eine moderne anpassbare Autoren Info Box am Ende deines Beitrages oder Seite mit einigen Informationen über den Autor ein."
    44
    55#: author-box-by-nocksoft.php:22
     
    1111msgstr "Archiv anzeigen"
    1212
    13 #: authorbox.php:62
     13#: authorbox.php:61
    1414msgid "View Archive"
    1515msgstr "Archiv anzeigen"
     
    156156
    157157#: settings-user.php:15
    158 msgid "Local avatars"
    159 msgstr "Lokale Avatare"
     158msgid "Local Avatar"
     159msgstr "Lokaler Avatar"
    160160
    161 #: settings-user.php:18
    162 msgid "Use local avatars instead of Gravatar (Enter the URL to your avatar in the input field below)"
    163 msgstr "Verwende lokale Avatare an Stelle von Gravatar (Trage die URL zu deinem Profilbild in das untere Eingabefeld ein)"
     161#: settings-user.php:16
     162msgid "The local avatars feature was moved to a separate plugin. Please install <a href='https://wordpress.org/plugins/local-avatars-by-nocksoft/' target='_blank'>Local Avatars by Nocksoft</a>."
     163msgstr "Die Funktion f&uuml;r lokale Avatare wurde in ein separates Plugin ausgelagert. Bitte installiere <a href='https://wordpress.org/plugins/local-avatars-by-nocksoft/' target='_blank'>Local Avatars by Nocksoft</a>."
    164164
    165 #: settings-user.php:23
    166 msgid "Avatar (URL)"
    167 msgstr "Avatar (URL)"
    168 
    169 #: settings-user.php:26
    170 msgid "Avatar URL (e.g. https://yoursite.com/avatar.jpg)"
    171 msgstr "Avatar URL (z.B. https://deineseite.de/avatar.jpg)"
    172 
    173 #: settings-user.php:27
    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."
    175 msgstr "Gebe bitte eine g&uuml;ltige URL zu deinem Avatar an, damit dieses in der Author Box angezeigt werden kann. Das beste Ergebnis erh&auml;ltst du, wenn dein Profilbild die gleiche H&ouml;he und Breite aufweist."
    176 
    177 #: settings-user.php:32
     165#: settings-user.php:20
    178166msgid "Your Position"
    179167msgstr "Deine Position"
    180168
    181 #: settings-user.php:35
     169#: settings-user.php:23
    182170msgid "Position (e.g. Founder or Author of YourSite)"
    183171msgstr "Position (z.B. Gr&uuml;nder oder Autor von DeineSeite)"
    184172
    185 #: settings-user.php:36
     173#: settings-user.php:24
    186174msgid "Here you can enter your position. The position is shown below your name in the Author Box."
    187175msgstr "Hier kannst du deine Position angeben. Die Position wird unterhalb deines Namens in der Author Box angezeigt."
    188176
    189 #: settings-user.php:41
     177#: settings-user.php:29
    190178msgid "Homepage / About Me Page"
    191179msgstr "Homepage / &Uuml;ber Mich Seite"
    192180
    193 #: settings-user.php:45
     181#: settings-user.php:33
    194182msgid "Link Text (e.g. Homepage or About Me)"
    195183msgstr "Link Text (z.B. Homepage oder &Uuml;ber mich)"
    196184
    197 #: settings-user.php:46
     185#: settings-user.php:34
    198186msgid "Link URL (e.g. https://yoursite.com)"
    199187msgstr "Link URL (z.B. https://deineseite.de)"
    200188
    201 #: settings-user.php:47
     189#: settings-user.php:35
    202190msgid "This URL will be displayed below your biography in the Author Box."
    203191msgstr "Diese URL wird unterhalb deiner Biografie in der Author Box angezeigt."
  • author-box-by-nocksoft/trunk/php/authorbox.php

    r2653204 r2782053  
    5151    $authorlinkurl = get_the_author_meta("nstab_setting_homepage_linkurl");
    5252    if ($authorlinktext != null && $authorlinkurl != null) {
    53         $homepagehref = "<p id='nstab_links' style='font-size: " . $nstab_setting_fontsizelinks . "em;'><a href='" . $authorlinkurl . "'>" . $authorlinktext . "</a>";
     53        $homepagehref = "<a href='" . $authorlinkurl . "'>" . $authorlinktext . "</a>";
    5454        if ($nstab_setting_displayauthorsarchive == true) {
    5555            $homepagehref .= " | <a href='" . get_author_posts_url($author_id) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a>";
    5656        }
    57         $homepagehref .= "</p>";
    5857    }
    5958    else {
    6059        $homepagehref = "";
    6160        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>";
     61            $homepagehref .= "<a href='" . get_author_posts_url($author_id) . "'>" . __("View Archive", "author-box-by-nocksoft") . "</a>";
    6362        }
    6463    }
     
    6766    $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;
    6867    $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."'>";
    7068   
    71     $url = nstab_get_local_avatarurl($author_id);
    72     if (empty($url)) $url = get_avatar_url($author_id);
     69    $url = get_avatar_url($author_id);
    7370   
    74     $authorbox = $authorboxcontainer .= "
     71    $authorbox = "
     72        <div id='author-box-by-nocksoft' style='".$font.$shadow.$border."'>
    7573            <div id='nstab_wrapper'>
    7674                <div id='nstab_authoravatar' " . $circleavatar . " style='background-image: url(\"".$url."\"); height: ".$nstab_setting_avatarsize."px; width: ".$nstab_setting_avatarsize."px;'></div>
    7775                <div id='nstab_authorbio' style='height: ".$nstab_setting_avatarsize."px;'>
    78                 <div id='header'>
    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>
    81                 </div>
    82                     <p id='nstab_description' style='font-size: " . $nstab_setting_fontsizebio . "em;'>" . get_the_author_meta("description") . "</p>
    83                     " . $homepagehref . "
    84                 </div>
     76                    <div id='header'>
     77                        <span id='headline' style='font-size: " . $nstab_setting_fontsizeheadline . "em;'>" . $nstab_setting_headline . " " . get_the_author_meta("display_name") . "</span>
     78                        <span id='position' style='font-size: " . $nstab_setting_fontsizeposition . "em;'>" . get_the_author_meta("nstab_setting_authorposition") . "</span>
     79                    </div>
     80                    <div id='nstab_description' style='font-size: " . $nstab_setting_fontsizebio . "em;'>" . get_the_author_meta("description") . "</div>
     81                    <div id='nstab_links' style='font-size: " . $nstab_setting_fontsizelinks . "em;'>" . $homepagehref . "</div>
     82                </div>
    8583            </div>
    8684        </div>
  • author-box-by-nocksoft/trunk/php/settings-global.php

    r2653204 r2782053  
    1515
    1616add_action("admin_init", function() {
    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");
     17    register_setting("nstab_settings_general", "nstab_setting_displayauthorboxonposts", "boolval");
     18    register_setting("nstab_settings_general", "nstab_setting_displayauthorboxonpages", "boolval");
     19    register_setting("nstab_settings_general", "nstab_setting_hidewordpressauthorbox", "boolval");
    2020   
    2121    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");
     22    register_setting("nstab_settings_layout", "nstab_setting_showshadow", "boolval");
     23    register_setting("nstab_settings_layout", "nstab_setting_showborder", "boolval");
    2424    register_setting("nstab_settings_layout", "nstab_setting_bordercolor");
    2525    register_setting("nstab_settings_layout", "nstab_setting_bordersize");
    2626    register_setting("nstab_settings_layout", "nstab_setting_avatarsize");
    27     register_setting("nstab_settings_layout", "nstab_setting_circleavatar");
     27    register_setting("nstab_settings_layout", "nstab_setting_circleavatar", "boolval");
    2828    register_setting("nstab_settings_layout", "nstab_setting_headline");
    2929    register_setting("nstab_settings_layout", "nstab_setting_fontsizeheadline");
     
    3131    register_setting("nstab_settings_layout", "nstab_setting_fontsizebio");
    3232    register_setting("nstab_settings_layout", "nstab_setting_fontsizelinks");
    33     register_setting("nstab_settings_layout", "nstab_setting_displayauthorsarchive");
     33    register_setting("nstab_settings_layout", "nstab_setting_displayauthorsarchive", "boolval");
    3434});
    3535
     
    5858    global $nstab_setting_displayauthorsarchive;
    5959   
    60     $tab = isset($_GET["tab"]) ? $_GET["tab"] : null;
     60    $tab = isset($_GET["tab"]) ? sanitize_text_field($_GET["tab"]) : null;
    6161    ?>
    6262    <div class="wrap">
    63         <h1><?= esc_html(get_admin_page_title()); ?></h1>
     63        <h1><?php esc_html(get_admin_page_title()); ?></h1>
    6464       
    6565        <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>
     
    8888                        <th scope="row"><?php echo __("Author Box display options", "author-box-by-nocksoft"); ?></th>
    8989                        <td>
    90                             <input type="checkbox" id="nstab_setting_displayauthorboxonposts" name="nstab_setting_displayauthorboxonposts" <?php if ($nstab_setting_displayauthorboxonposts == true) echo "checked"; ?> />
     90                            <input type="checkbox" id="nstab_setting_displayauthorboxonposts" name="nstab_setting_displayauthorboxonposts" <?php checked($nstab_setting_displayauthorboxonposts); ?> />
    9191                            <label for="nstab_setting_displayauthorboxonposts"><?php echo __("Display Author Box at the end of each post automatically", "author-box-by-nocksoft"); ?></label>
    9292                            <br>
    93                             <input type="checkbox" id="nstab_setting_displayauthorboxonpages" name="nstab_setting_displayauthorboxonpages" <?php if ($nstab_setting_displayauthorboxonpages == true) echo "checked"; ?> />
     93                            <input type="checkbox" id="nstab_setting_displayauthorboxonpages" name="nstab_setting_displayauthorboxonpages" <?php checked($nstab_setting_displayauthorboxonpages); ?> />
    9494                            <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>
    9595                        </td>
     
    9999                        <th scope="row"><?php echo __("Other options", "author-box-by-nocksoft"); ?></th>
    100100                        <td>
    101                             <input type="checkbox" id="nstab_setting_hidewordpressauthorbox" name="nstab_setting_hidewordpressauthorbox" <?php if ($nstab_setting_hidewordpressauthorbox == true) echo "checked"; ?> />
     101                            <input type="checkbox" id="nstab_setting_hidewordpressauthorbox" name="nstab_setting_hidewordpressauthorbox" <?php checked($nstab_setting_hidewordpressauthorbox); ?> />
    102102                            <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>
    103103                            <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>
     
    120120                            <p class="description"><?php echo __("Inherit from website means that the fonts of the WordPress theme are used.", "author-box-by-nocksoft"); ?></p>
    121121                            <p>
    122                             <input type="checkbox" id="nstab_setting_showshadow" name="nstab_setting_showshadow" <?php if ($nstab_setting_showshadow == true) echo "checked"; ?> />
     122                            <input type="checkbox" id="nstab_setting_showshadow" name="nstab_setting_showshadow" <?php checked($nstab_setting_showshadow); ?> />
    123123                            <label for="nstab_setting_showshadow"><?php echo __("Show Shadow of Author Box", "author-box-by-nocksoft"); ?></label>
    124124                            </p>
     
    129129                        <th scope="row"><?php echo __("Border", "author-box-by-nocksoft"); ?></th>
    130130                        <td>
    131                             <input type="checkbox" id="nstab_setting_showborder" name="nstab_setting_showborder" <?php if ($nstab_setting_showborder == true) echo "checked"; ?> />
     131                            <input type="checkbox" id="nstab_setting_showborder" name="nstab_setting_showborder" <?php checked($nstab_setting_showborder); ?> />
    132132                            <label for="nstab_setting_showborder"><?php echo __("Show Border of Author Box", "author-box-by-nocksoft"); ?></label>
    133133                            <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; ?>" />
     134                            <input type="text" id="nstab_setting_bordercolor" name="nstab_setting_bordercolor" class="nstab_colorpicker" value="<?php echo esc_textarea($nstab_setting_bordercolor); ?>" data-default-color="<?php echo esc_textarea($nstab_setting_default_bordercolor); ?>" />
    135135                            <label for="nstab_setting_bordercolor"><?php echo __("Color of border", "author-box-by-nocksoft"); ?></label>
    136136                            </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; ?>" />
     137                            <input type="number" id="nstab_setting_bordersize" name="nstab_setting_bordersize" min="1" max="5" step="1" value="<?php echo esc_textarea($nstab_setting_bordersize); ?>" />
    138138                            <label for="nstab_setting_bordersize"><?php echo __("Size of border", "author-box-by-nocksoft"); ?></label>
    139139                        </td>
     
    143143                        <th scope="row"><?php echo __("Avatar", "author-box-by-nocksoft"); ?></th>
    144144                        <td>
    145                             <input type="number" id="nstab_setting_avatarsize" name="nstab_setting_avatarsize" min="96" max="200" value="<?php echo $nstab_setting_avatarsize; ?>" />
     145                            <input type="number" id="nstab_setting_avatarsize" name="nstab_setting_avatarsize" min="96" max="200" value="<?php echo esc_textarea($nstab_setting_avatarsize); ?>" />
    146146                            <label for="nstab_setting_avatarsize"><?php echo __("Size of Avatar (Pixel)", "author-box-by-nocksoft"); ?></label>
    147147                            <p>
    148                             <input type="checkbox" id="nstab_setting_circleavatar" name="nstab_setting_circleavatar" <?php if ($nstab_setting_circleavatar == true) echo "checked"; ?> />
     148                            <input type="checkbox" id="nstab_setting_circleavatar" name="nstab_setting_circleavatar" <?php checked($nstab_setting_circleavatar); ?> />
    149149                            <label for="nstab_setting_circleavatar"><?php echo __("Use a circle avatar instead of a square", "author-box-by-nocksoft"); ?></label>
    150150                            </p>
     
    155155                        <th scope="row"><?php echo __("Header", "author-box-by-nocksoft"); ?></th>
    156156                        <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; ?>" />
     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 esc_textarea($nstab_setting_headline); ?>" />
    158158                            <label for="nstab_setting_headline"><?php echo __("Headline", "author-box-by-nocksoft"); ?></label>
    159159                            <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; ?>" />
     160                            <input type="number" id="nstab_setting_fontsizeheadline" name="nstab_setting_fontsizeheadline" min="0.5" max="2" step="0.1" value="<?php echo esc_textarea($nstab_setting_fontsizeheadline); ?>" />
    161161                            <label for="nstab_setting_fontsizeheadline"><?php echo __("Fontsize of Headline (em)", "author-box-by-nocksoft"); ?></label>
    162162                            </p>
    163163                            <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; ?>" />
     164                            <input type="number" id="nstab_setting_fontsizeposition" name="nstab_setting_fontsizeposition" min="0.4" max="0.9" step="0.1" value="<?php echo esc_textarea($nstab_setting_fontsizeposition); ?>" />
    165165                            <label for="nstab_setting_fontsizeposition"><?php echo __("Fontsize of author's Position (em)", "author-box-by-nocksoft"); ?></label>
    166166                            </p>
     
    171171                        <th scope="row"><?php echo __("Biography", "author-box-by-nocksoft"); ?></th>
    172172                        <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; ?>" />
     173                            <input type="number" id="nstab_setting_fontsizebio" name="nstab_setting_fontsizebio" min="0.4" max="1.5" step="0.1" value="<?php echo esc_textarea($nstab_setting_fontsizebio); ?>" />
    174174                            <label for="nstab_setting_fontsizebio"><?php echo __("Fontsize of Biography (em)", "author-box-by-nocksoft"); ?></label>
    175175                        </td>
     
    179179                        <th scope="row"><?php echo __("Footer", "author-box-by-nocksoft"); ?></th>
    180180                        <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; ?>" />
     181                            <input type="number" id="nstab_setting_fontsizelinks" name="nstab_setting_fontsizelinks" min="0.3" max="1" step="0.1" value="<?php echo esc_textarea($nstab_setting_fontsizelinks); ?>" />
    182182                            <label for="nstab_setting_fontsizelinks"><?php echo __("Fontsize of Links (em)", "author-box-by-nocksoft"); ?></label>
    183183                            <p>
    184                             <input type="checkbox" id="nstab_setting_displayauthorsarchive" name="nstab_setting_displayauthorsarchive" <?php if ($nstab_setting_displayauthorsarchive == true) echo "checked"; ?> />
     184                            <input type="checkbox" id="nstab_setting_displayauthorsarchive" name="nstab_setting_displayauthorsarchive" <?php checked($nstab_setting_displayauthorsarchive); ?> />
    185185                            <label for="nstab_setting_displayauthorsarchive"><?php echo __("Display a link to the author's archive", "author-box-by-nocksoft"); ?></label>
    186186                            </p>
  • author-box-by-nocksoft/trunk/php/settings-user.php

    r2653204 r2782053  
    1313    <table class="form-table">
    1414        <tr>
    15             <th><label for="nstab_setting_localavatar"><?php echo __("Local avatars", "author-box-by-nocksoft"); ?></label></th>
    16             <td>
    17                 <input type="checkbox" id="nstab_setting_localavatar" name="nstab_setting_localavatar" <?php if (get_the_author_meta("nstab_setting_localavatar", $user->ID) == "on") echo "checked"; ?>>
    18                 <label for="nstab_setting_localavatar"><?php echo __("Use local avatars instead of Gravatar (Enter the URL to your avatar in the input field below)", "author-box-by-nocksoft"); ?></label>
    19             </td>
    20         </tr>
    21 
    22         <tr>
    23             <th><label for="nstab_setting_avatarurl"><?php echo __("Avatar (URL)", "author-box-by-nocksoft"); ?></label></th>
    24             <td>
    25                 <?php $avatarurl = get_the_author_meta("nstab_setting_avatarurl", $user->ID); ?>
    26                 <input type="text" id="nstab_setting_avatarurl" name="nstab_setting_avatarurl" class="regular-text" placeholder="<?php echo __("Avatar URL (e.g. https://yoursite.com/avatar.jpg)", "author-box-by-nocksoft"); ?>" value="<?php echo $avatarurl; ?>" />
    27                 <p class="description"><?php echo __("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.", "author-box-by-nocksoft"); ?></p>
    28             </td>
     15            <th><label for="nstab_setting_localavatar"><?php echo __("Local Avatar", "author-box-by-nocksoft"); ?></label></th>
     16            <td><p><?php echo __("The local avatars feature was moved to a separate plugin. Please install <a href='https://wordpress.org/plugins/local-avatars-by-nocksoft/' target='_blank'>Local Avatars by Nocksoft</a>.", "author-box-by-nocksoft"); ?></p></td>
    2917        </tr>
    3018
     
    3321            <td>
    3422                <?php $authorposition = get_the_author_meta("nstab_setting_authorposition", $user->ID); ?>
    35                 <input type="text" id="nstab_setting_authorposition" name="nstab_setting_authorposition" class="regular-text" placeholder="<?php echo __("Position (e.g. Founder or Author of YourSite)", "author-box-by-nocksoft"); ?>" value="<?php echo $authorposition; ?>" />
     23                <input type="text" id="nstab_setting_authorposition" name="nstab_setting_authorposition" class="regular-text" placeholder="<?php echo __("Position (e.g. Founder or Author of YourSite)", "author-box-by-nocksoft"); ?>" value="<?php echo esc_textarea($authorposition); ?>" />
    3624                <p class="description"><?php echo __("Here you can enter your position. The position is shown below your name in the Author Box.", "author-box-by-nocksoft"); ?></p>
    3725            </td>
     
    4331                <?php $linktext = get_the_author_meta("nstab_setting_homepage_linktext", $user->ID); ?>
    4432                <?php $linkurl = get_the_author_meta("nstab_setting_homepage_linkurl", $user->ID); ?>
    45                 <input type="text" id="nstab_setting_homepage_linktext" name="nstab_setting_homepage_linktext" class="regular-text" placeholder="<?php echo __("Link Text (e.g. Homepage or About Me)", "author-box-by-nocksoft"); ?>" value="<?php echo $linktext; ?>" />
    46                 <input type="text" id="nstab_setting_homepage_linkurl" name="nstab_setting_homepage_linkurl" class="regular-text" placeholder="<?php echo __("Link URL (e.g. https://yoursite.com)", "author-box-by-nocksoft"); ?>" value="<?php echo $linkurl; ?>" />
     33                <input type="text" id="nstab_setting_homepage_linktext" name="nstab_setting_homepage_linktext" class="regular-text" placeholder="<?php echo __("Link Text (e.g. Homepage or About Me)", "author-box-by-nocksoft"); ?>" value="<?php echo esc_textarea($linktext); ?>" />
     34                <input type="text" id="nstab_setting_homepage_linkurl" name="nstab_setting_homepage_linkurl" class="regular-text" placeholder="<?php echo __("Link URL (e.g. https://yoursite.com)", "author-box-by-nocksoft"); ?>" value="<?php echo esc_url($linkurl); ?>" />
    4735                <p class="description"><?php echo __("This URL will be displayed below your biography in the Author Box.", "author-box-by-nocksoft"); ?></p>
    4836            </td>
     
    6149    }
    6250    else {
    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);
    65         update_usermeta($user_id, "nstab_setting_avatarurl", trim($_POST["nstab_setting_avatarurl"]));
    66         update_usermeta($user_id, "nstab_setting_authorposition", trim($_POST["nstab_setting_authorposition"]));
    67         update_usermeta($user_id, "nstab_setting_homepage_linktext", trim($_POST["nstab_setting_homepage_linktext"]));
    68         update_usermeta($user_id, "nstab_setting_homepage_linkurl", trim($_POST["nstab_setting_homepage_linkurl"]));
     51        update_usermeta($user_id, "nstab_setting_authorposition", sanitize_text_field($_POST["nstab_setting_authorposition"]));
     52        update_usermeta($user_id, "nstab_setting_homepage_linktext", sanitize_text_field($_POST["nstab_setting_homepage_linktext"]));
     53        update_usermeta($user_id, "nstab_setting_homepage_linkurl", sanitize_url($_POST["nstab_setting_homepage_linkurl"]));
    6954    }
    7055}
  • author-box-by-nocksoft/trunk/php/setup.php

    r2653204 r2782053  
    5151    foreach ($users as $user) {
    5252        $id = $user->ID;
    53         delete_user_meta($id, "nstab_setting_localavatar");
    54         delete_user_meta($id, "nstab_setting_avatarurl");
    5553        delete_user_meta($id, "nstab_setting_authorposition");
    5654        delete_user_meta($id, "nstab_setting_homepage_linktext");
  • author-box-by-nocksoft/trunk/readme.txt

    r2653204 r2782053  
    11=== Author Box by Nocksoft ===
    22Contributors: nocksoft
    3 Tags: author box, author bio, author description, local avatars, about author, about me, author profile, author
    4 Stable tag: trunk
     3Tags: author box, author bio, author description, about author, about me, author profile, author
     4Stable tag: 1.1.0
    55Requires at least: 5.3
    6 Tested up to: 5.9
     6Tested up to: 6.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1212
    1313== Description ==
    14 Adds a modern customizable author info box at the end of your posts and implements support for local avatars. You can display a simple author bio box in your posts and pages to show your readers and followers who you are.
    15 Your blog will become even more personal and authentic. This plugin is available in German and English language.
     14Adds a modern customizable author info box at the end of your posts and pages with a short description about the author. You can display a simple author bio box in your posts and pages to show your readers and followers who you are.
     15Your blog will become even more personal and authentic. This plugin is available in German and English language and is fully compatible with the plugin "Local Avatars by Nocksoft".
    1616
    1717== Features ==
    1818* Adds a simple lightweight Author Box at the end of your posts and/or pages with a short description about the author
    19 * Adds support for local avatars for authors so that you dont need to use an Gravatar account
    2019* Option for displaying a link to an own "About Me Page" in Author Box for post authors
    2120* Adds shortcode for Author Box so that you can insert a Author Box anywhere you want
    2221* Allows to hide the author box of default WordPress theme
     22* Fully compatible with the plugin "Local Avatars by Nocksoft"
    2323
    2424== Setup ==
     
    2626* (optional) Go to "Settings" -> "Author Box" to setup global settings like font sizes or other settings like look of avatars.
    2727* Go to user profiles to enter biographical info.
    28 * (optional) Go to user profiles to tick local avatars and enter a URL to you personal avatar.
    29 * (optional) Go to user profiles to enter other informations about the author.
     28* (optional) Go to user profiles to enter some informations about the author.
     29* (optional) Go to Plugins and install the recommended plugin "Local Avatars by Nocksoft" to use local avatars.
    3030
    3131== Shortcode ==
     
    3434== Frequently Asked Questions ==
    3535 
    36 = How can I change the avatar for my user? =
     36= How can I change the avatar for my author box? =
    3737
    38 You have two options. Either through Gravatar, or you can specify a URL to a previously uploaded local image in your user profile settings. This setting can be made separately for each user.
     38You have two options. Either through Gravatar, or you can use a local image in your user profile settings. This setting can be made separately for each user. But for this, you need to install the additional plugin "Local Avatars by Nocksoft" first.
    3939
    4040= How can I change the biography about me? =
     
    6161= What if my theme also shows an author box? =
    6262
    63 You have two options. Either you choose the setting that this plugins author box is hidden (you can still take advantage of the local avatars) or you choose the setting that the author box of your theme is no longer displayed. For the WordPress default themes you will find a suitable setting in this plugins settings.
     63You have to disable the author box of your theme. How to do this depends on your theme. But for the WordPress default themes you will find a suitable setting in this plugins settings.
    6464
    6565== Installation ==
     
    7272
    7373== Changelog ==
     74
     75= 1.1.0 =
     76* Fixed PHP warnings "wp_register_style was called incorrectly" and "wp_enqueue_style was called incorrectly"
     77* Fixed a bug that may caused font family do not work properly in some cases
     78* Moved local avatars feature to a separate plugin "Local Avatars by Nocksoft" (https://wordpress.org/plugins/local-avatars-by-nocksoft/)
    7479
    7580= 1.0.5 =
Note: See TracChangeset for help on using the changeset viewer.