This repository was archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsettings-template.php
More file actions
109 lines (97 loc) · 4.18 KB
/
settings-template.php
File metadata and controls
109 lines (97 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<div class="wrap">
<h2><?php _e('Flattr Settings'); ?></h2>
<h3>User account</h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Your Flattr account'); ?></th>
<td>
<?php
$connect_callback = rawurlencode( ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
if (get_option('flattr_uid')) { ?>
Connected as
<?php
if (preg_match('/[A-Za-z-_.]/', get_option('flattr_uid'))) {
?><a href="<?php echo esc_url( 'https://flattr.com/profile/' . get_option('flattr_uid') ); ?>"><?php
esc_html_e(get_option('flattr_uid'));
?></a>.<?php
}
else {
?>user id <?php esc_html_e(get_option('flattr_uid'));?>.<?php
}
?>
(<a href="https://flattr.com/login?idCallback=<?php echo $connect_callback; ?>">Reconnect</a>)
<?php } else { ?>
None - <a href="https://flattr.com/login?idCallback=<?php echo $connect_callback; ?>">Connect with Flattr</a>
<?php } ?>
</td>
</tr>
</table>
<h3>Other settings</h3>
<form method="post" action="options.php">
<?php settings_fields( 'flattr-settings-group' ); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Default category for your posts'); ?></th>
<td>
<select name="flattr_cat">
<?php
foreach (Flattr::getCategories() as $category)
{
printf('<option value="%1$s" %2$s>%1$s</option>',
$category,
($category == get_option('flattr_cat') ? 'selected' : '')
);
}
?>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default language for your posts'); ?></th>
<td>
<select name="flattr_lng">
<?php
foreach (Flattr::getLanguages() as $languageCode => $language)
{
printf('<option value="%s" %s>%s</option>',
$languageCode,
($languageCode == get_option('flattr_lng') ? 'selected' : ''),
$language
);
}
?>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Insert button before the content'); ?></th>
<td><input <?php if (get_option('flattr_top', 'false') == 'true') { echo(' checked="checked"'); } ?> type="checkbox" name="flattr_top" value="true" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Use the compact button'); ?></th>
<td><input <?php if (get_option('flattr_compact', 'false') == 'true') { echo(' checked="checked"'); } ?> type="checkbox" name="flattr_compact" value="true" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Hide my posts from listings on flattr.com'); ?></th>
<td><input <?php if (get_option('flattr_hide', 'false') == 'true') { echo(' checked="checked"'); } ?> type="checkbox" name="flattr_hide" value="true" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Insert Flattr button into posts automagically'); ?></th>
<td><input <?php if (get_option('flattr_aut', 'off') == 'on') { echo(' checked="checked"'); } ?> type="checkbox" name="flattr_aut" value="on" /><br />(uncheck this if you would rather use <code><?php the_flattr_permalink() ?></code>)</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Insert Flattr button into pages automagically'); ?></th>
<td><input <?php if (get_option('flattr_aut_page', 'off') == 'on') { echo(' checked="checked"'); } ?> type="checkbox" name="flattr_aut_page" value="on" /><br />(uncheck this if you would rather use <code><?php the_flattr_permalink() ?></code>)</td>
</tr>
<?php if ( function_exists('st_add_widget') ) { ?>
<tr valign="top">
<th scope="row"><?php _e('Override ShareThis widget'); ?></th>
<td><input <?php if (get_option('flattr_override_sharethis', 'false') == 'true') { echo(' checked="checked"'); } ?> type="checkbox" name="flattr_override_sharethis" value="true" /><br />(will add the Flattr button after the ShareThis buttons)</td>
</tr>
<?php } ?>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>