| 1 |
<?php |
| 2 |
/** |
| 3 |
* Copyright 2009-2022 Hans Matzen (email : support at tuxlog.de) |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2 of the License, or |
| 8 |
* (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 |
* |
| 19 |
* @package tlsupp |
| 20 |
* @since 21.12.2009 |
| 21 |
*/ |
| 22 |
|
| 23 |
// donation meta box. |
| 24 |
if ( ! function_exists( 'tl_add_donation_box' ) ) { |
| 25 |
/** |
| 26 |
* Create the support message including links. |
| 27 |
*/ |
| 28 |
function tl_add_donation_box() { |
| 29 |
$wpl = get_option( 'WPLANG', 'en_US' ); |
| 30 |
if ( 'de_DE' === $wpl ) { |
| 31 |
$lc = 'de'; |
| 32 |
$teaser = 'Macht Ihnen das Plugin Freude?'; |
| 33 |
} elseif ( 'fr_FR' === $wpl ) { |
| 34 |
$lc = 'fr'; |
| 35 |
$teaser = "voulez-vous de m'inviter à prendre un café?"; |
| 36 |
} else { |
| 37 |
$lc = 'en'; |
| 38 |
$teaser = 'Wanna buy me a coffee?'; |
| 39 |
} |
| 40 |
|
| 41 |
$img = "btn_donate_SM_$lc.gif"; |
| 42 |
$imgurl = plugins_url( $img, __FILE__ ); |
| 43 |
|
| 44 |
$donateurl = 'https://www.tuxlog.de/unterstuetze-meine-projekte-support-my-projects-soutenir-mes-projets/'; |
| 45 |
$ret = ''; |
| 46 |
$ret .= '<div style="display:inline;">' . esc_attr( $teaser ) . ' '; |
| 47 |
$ret .= '<a target="_blank" href="' . esc_attr( $donateurl ) . '">'; |
| 48 |
$ret .= '<img style="vertical-align: middle;margin:10px;" src="' . esc_attr( $imgurl ) . '" alt="' . esc_attr( $teaser ) . '"/></a> '; |
| 49 |
$ret .= '</div>'; |
| 50 |
|
| 51 |
return $ret; |
| 52 |
} |
| 53 |
} |
| 54 |
// end of meta box. |
| 55 |
|