Skip to content

Commit cffa72f

Browse files
committed
version 1.0.2
- possibility to hide Shariff on a cirtain page - own settings page
1 parent 2475942 commit cffa72f

File tree

5 files changed

+69
-32
lines changed

5 files changed

+69
-32
lines changed

src/locale/shariff-de_DE.mo

60 Bytes
Binary file not shown.

src/locale/shariff-de_DE.po

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: shariff\n"
4-
"POT-Creation-Date: 2014-11-30 11:55+0100\n"
5-
"PO-Revision-Date: 2014-11-30 12:47+0100\n"
4+
"POT-Creation-Date: 2014-11-30 21:39+0100\n"
5+
"PO-Revision-Date: 2014-11-30 21:40+0100\n"
66
"Last-Translator: Yannik Ehlert <kontakt@yanniks.de>\n"
77
"Language-Team: Yannik Ehlert <kontakt@yanniks.de>\n"
88
"Language: de\n"
@@ -64,14 +64,18 @@ msgstr "Horizontal"
6464
msgid "Vertical"
6565
msgstr "Vertikal"
6666

67-
#: shariff-wp.php:148
67+
#: shariff-wp.php:143
6868
msgid "Colored"
6969
msgstr "Farbig"
7070

71-
#: shariff-wp.php:151
71+
#: shariff-wp.php:146
7272
msgid "Grey"
7373
msgstr "Grau"
7474

75-
#: shariff-wp.php:154
75+
#: shariff-wp.php:149
7676
msgid "White"
7777
msgstr "Weiß"
78+
79+
#: shariff-wp.php:158
80+
msgid "Shariff configuration"
81+
msgstr "Shariff-Konfiguration"

src/readme.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: yanniks
33
Tags: sharing, social, networks, network, privacy, facebook, twitter, google, whatsapp, heise
44
Requires at least: 3.0
55
Tested up to: 4.0.1
6-
Stable tag: 1.0.0
6+
Stable tag: 1.0.2
77
License: MIT
88
License URI: http://opensource.org/licenses/MIT
99

@@ -34,8 +34,18 @@ Select which color you want, set the button location, select the orientation fit
3434
2. `/assets/screenshot-2.png`
3535
3. `/assets/screenshot-3.png`
3636

37+
== Frequently Asked Questions ==
38+
39+
= How do I hide Shariff on a page? =
40+
41+
Just include `hideshariff` in the article. The word will be removed automatically and Shariff will not be shown. If you want to write hidesharrif in an article without removing Shariff, just write `/hideshariff`.
42+
3743
== Changelog ==
3844

45+
= 1.0.2 =
46+
* Own settings page
47+
* Possibility to hide Shariff on a certain page
48+
3949
= 1.0.1 =
4050
* Fixes a PHP warning
4151

src/shariff-wp.php

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Shariff for Wordpress
44
* Plugin URI: http://www.heise.de/newsticker/meldung/c-t-entwickelt-datenschutzfreundliche-Social-Media-Buttons-weiter-2466687.html
55
* Description: Shariff enables website users to share their favorite content without compromising their privacy.
6-
* Version: 1.0.1
6+
* Version: 1.0.2
77
* Author: Heise Zeitschriften Verlag / Yannik Ehlert
88
* Author URI: http://www.heise.de
99
* Text Domain: shariff
@@ -58,38 +58,45 @@ function shariffsharing($content) {
5858
if (get_option('shariff_beforeafter','before') != 'before') {
5959
$content2 = $content;
6060
}
61-
$content2 .= '<div class="shariff" data-backend-url="'.plugins_url( 'backend/index.php', __FILE__ ).'" data-ttl="'.get_option('shariff_ttl',"30").'" data-service="'.$serv.'" data-services=\''.$services.'\' data-url="'.get_permalink().'" data-lang="'.__('en', 'shariff').'" data-theme="'.get_option('shariff_color',"colored").'" data-orientation="'.get_option('shariff_orientation',"horizontal").'"></div>';
61+
if (!((strpos($content,'hideshariff') !== false) && (strpos($content,'/hideshariff') == false))) {
62+
$content2 .= '<div class="shariff" data-backend-url="'.plugins_url( 'backend/index.php', __FILE__ ).'" data-ttl="'.get_option('shariff_ttl',"30").'" data-service="'.$serv.'" data-services=\''.$services.'\' data-url="'.get_permalink().'" data-lang="'.__('en', 'shariff').'" data-theme="'.get_option('shariff_color',"colored").'" data-orientation="'.get_option('shariff_orientation',"horizontal").'"></div>';
63+
}
6264
if (get_option('shariff_beforeafter','before') != 'after') {
6365
$content2 .= $content;
6466
}
67+
if ((strpos($content,'/hideshariff') !== false)) {
68+
$content2 = str_replace("/hideshariff","hideshariff",$content2);
69+
} else {
70+
$content2 = str_replace("hideshariff","",$content2);
71+
}
6572
return $content2;
6673

6774
}
6875
function setting_plat_callback() {
6976
}
7077
function init_settings() {
71-
add_settings_section('shariff_platforms',__('Shariff platforms',"shariff"),'setting_plat_callback','general');
72-
add_settings_field('shariff_gplus','Google+','setting_gplus_callback','general','shariff_platforms');
73-
add_settings_field('shariff_fb','Facebook','setting_fb_callback','general','shariff_platforms');
74-
add_settings_field('shariff_twitter','Twitter','setting_twitter_callback','general','shariff_platforms');
75-
add_settings_field('shariff_whatsapp','WhatsApp','setting_whatsapp_callback','general','shariff_platforms');
76-
add_settings_field('shariff_email','E-Mail','setting_email_callback','general','shariff_platforms');
77-
add_settings_section('shariff_other',__('Other Shariff settings',"shariff"),'setting_plat_callback','general');
78-
add_settings_field('shariff_info',__('Privacy information',"shariff"),'setting_info_callback','general','shariff_other');
79-
add_settings_field('shariff_color',__('Color',"shariff"),'setting_color_callback','general','shariff_other');
80-
add_settings_field('shariff_orientation',__('Orientation',"shariff"),'setting_orientation_callback','general','shariff_other');
81-
add_settings_field('shariff_beforeafter',__('Button location',"shariff"),'setting_before_callback','general','shariff_other');
82-
add_settings_field('shariff_ttl','TTL','setting_ttl_callback','general','shariff_other');
83-
register_setting('general','shariff_gplus');
84-
register_setting('general','shariff_fb');
85-
register_setting('general','shariff_twitter');
86-
register_setting('general','shariff_whatsapp');
87-
register_setting('general','shariff_email');
88-
register_setting('general','shariff_info');
89-
register_setting('general','shariff_color');
90-
register_setting('general','shariff_orientation');
91-
register_setting('general','shariff_beforeafter');
92-
register_setting('general','shariff_ttl');
78+
add_settings_section('shariff_platforms',__('Shariff platforms',"shariff"),'setting_plat_callback','shariff');
79+
add_settings_field('shariff_gplus','Google+','setting_gplus_callback','shariff','shariff_platforms');
80+
add_settings_field('shariff_fb','Facebook','setting_fb_callback','shariff','shariff_platforms');
81+
add_settings_field('shariff_twitter','Twitter','setting_twitter_callback','shariff','shariff_platforms');
82+
add_settings_field('shariff_whatsapp','WhatsApp','setting_whatsapp_callback','shariff','shariff_platforms');
83+
add_settings_field('shariff_email','E-Mail','setting_email_callback','shariff','shariff_platforms');
84+
add_settings_section('shariff_other',__('Other Shariff settings',"shariff"),'setting_plat_callback','shariff');
85+
add_settings_field('shariff_info',__('Privacy information',"shariff"),'setting_info_callback','shariff','shariff_other');
86+
add_settings_field('shariff_color',__('Color',"shariff"),'setting_color_callback','shariff','shariff_other');
87+
add_settings_field('shariff_orientation',__('Orientation',"shariff"),'setting_orientation_callback','shariff','shariff_other');
88+
add_settings_field('shariff_beforeafter',__('Button location',"shariff"),'setting_before_callback','shariff','shariff_other');
89+
add_settings_field('shariff_ttl','TTL','setting_ttl_callback','shariff','shariff_other');
90+
register_setting('shariff','shariff_gplus');
91+
register_setting('shariff','shariff_fb');
92+
register_setting('shariff','shariff_twitter');
93+
register_setting('shariff','shariff_whatsapp');
94+
register_setting('shariff','shariff_email');
95+
register_setting('shariff','shariff_info');
96+
register_setting('shariff','shariff_color');
97+
register_setting('shariff','shariff_orientation');
98+
register_setting('shariff','shariff_beforeafter');
99+
register_setting('shariff','shariff_ttl');
93100
}
94101
function setting_before_callback() {
95102
echo '<select name="shariff_beforeafter">
@@ -151,8 +158,24 @@ function setting_color_callback() {
151158
function loadjs() {
152159
echo '<script src="'.plugins_url( 'dep/shariff.min.js', __FILE__ ).'"></script>'."\n";
153160
}
161+
function shariff_options_page() {
162+
?>
163+
<div class="wrap">
164+
<h2><?php echo _e("Shariff configuration","shariff")?></h2>
165+
<form action="options.php" method="POST">
166+
<?php settings_fields( 'shariff' ); ?>
167+
<?php do_settings_sections( 'shariff' ); ?>
168+
<?php submit_button(); ?>
169+
</form>
170+
</div>
171+
<?php
172+
}
173+
function shariffconfigmenu() {
174+
add_options_page('shariff', 'Shariff', 'manage_options', 'shariff', 'shariff_options_page');
175+
}
176+
add_action('admin_menu','shariffconfigmenu');
154177
add_action('admin_init','init_settings');
155178
add_action('init','init_locale');
156179
add_action('wp_enqueue_scripts', 'loadshariff');
157180
add_action('wp_footer','loadjs');
158-
add_filter('the_content','shariffsharing');
181+
add_filter('the_content','shariffsharing');

zip.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=1.0.1
1+
version=1.0.2
22
rm -rf shariff-wp
33
mkdir -p shariff-wp
44
cp -R src/ shariff-wp

0 commit comments

Comments
 (0)