Version Description
- Added the ability to specify URL's for widget 'Dashboard' and 'Profile' links per user role
- Implemented WordPress 2.8 widget control for multiple widget instances
- Fixed a bug regarding the registration complete message
Download this release
Release Info
Developer | jfarthing84 |
Plugin | Theme My Login |
Version | 3.1 |
Comparing to | |
See all releases |
Code changes from version 3.0.3 to 3.1
- includes/admin-page.php +38 -1
- includes/compat.php +13 -0
- includes/widget-control.php +0 -59
- includes/widget-new.php +128 -0
- includes/widget-old.php +138 -0
- includes/wp-login-forms.php +10 -5
- includes/wp-login-functions.php +1 -1
- language/theme-my-login.pot +104 -63
- readme.txt +8 -2
- theme-my-login.php +18 -62
includes/admin-page.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
if ( $_POST ) {
|
4 |
|
5 |
check_admin_referer('theme-my-login');
|
@@ -12,6 +15,12 @@ if ( $_POST ) {
|
|
12 |
$this->SetOption('register_complete', stripslashes($_POST['register_complete']));
|
13 |
$this->SetOption('password_title', stripslashes($_POST['password_title']));
|
14 |
$this->SetOption('password_msg', stripslashes($_POST['password_msg']));
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
$this->SaveOptions();
|
16 |
|
17 |
if (isset($_POST['uninstall']))
|
@@ -20,6 +29,9 @@ if ( $_POST ) {
|
|
20 |
$success =__('Settings saved.', 'theme-my-login');
|
21 |
}
|
22 |
|
|
|
|
|
|
|
23 |
?>
|
24 |
|
25 |
<div class="updated" style="background:aliceblue; border:1px solid lightblue">
|
@@ -95,7 +107,32 @@ if ( $_POST ) {
|
|
95 |
</td>
|
96 |
</tr>
|
97 |
</table>
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'theme-my-login'); ?>" />
|
100 |
</form>
|
101 |
</div>
|
1 |
<?php
|
2 |
|
3 |
+
global $wp_roles;
|
4 |
+
$user_roles = $wp_roles->get_names();
|
5 |
+
|
6 |
if ( $_POST ) {
|
7 |
|
8 |
check_admin_referer('theme-my-login');
|
15 |
$this->SetOption('register_complete', stripslashes($_POST['register_complete']));
|
16 |
$this->SetOption('password_title', stripslashes($_POST['password_title']));
|
17 |
$this->SetOption('password_msg', stripslashes($_POST['password_msg']));
|
18 |
+
foreach ($user_roles as $role => $value) {
|
19 |
+
$dashboard_url[$role] = $_POST['widget_dashboard_url'][$role];
|
20 |
+
$profile_url[$role] = $_POST['widget_profile_url'][$role];
|
21 |
+
}
|
22 |
+
$this->SetOption('widget_dashboard_url', $dashboard_url);
|
23 |
+
$this->SetOption('widget_profile_url', $profile_url);
|
24 |
$this->SaveOptions();
|
25 |
|
26 |
if (isset($_POST['uninstall']))
|
29 |
$success =__('Settings saved.', 'theme-my-login');
|
30 |
}
|
31 |
|
32 |
+
$dashboard_url = $this->GetOption('widget_dashboard_url');
|
33 |
+
$profile_url = $this->GetOption('widget_profile_url');
|
34 |
+
|
35 |
?>
|
36 |
|
37 |
<div class="updated" style="background:aliceblue; border:1px solid lightblue">
|
107 |
</td>
|
108 |
</tr>
|
109 |
</table>
|
110 |
+
|
111 |
+
<h3><?php _e('Widget Settings', 'theme-my-login'); ?></h3>
|
112 |
+
<h4><?php _e('Dashboard URL'); ?></h4>
|
113 |
+
<table class="form-table">
|
114 |
+
<?php foreach ($user_roles as $role => $value) : ?>
|
115 |
+
<tr valign="top">
|
116 |
+
<th scope="row"><?php echo ucwords($role); ?></th>
|
117 |
+
<td>
|
118 |
+
<input name="widget_dashboard_url[<?php echo $role; ?>]" type="text" id="widget_dashboard_url[<?php echo $role; ?>]" value="<?php echo $dashboard_url[$role]; ?>" class="regular-text" />
|
119 |
+
</td>
|
120 |
+
</tr>
|
121 |
+
<?php endforeach; ?>
|
122 |
+
</table>
|
123 |
+
|
124 |
+
<h4><?php _e('Profile URL'); ?></h4>
|
125 |
+
<table class="form-table">
|
126 |
+
<?php foreach ($user_roles as $role => $value) : ?>
|
127 |
+
<tr valign="top">
|
128 |
+
<th scope="row"><?php echo ucwords($role); ?></th>
|
129 |
+
<td>
|
130 |
+
<input name="widget_profile_url[<?php echo $role; ?>]" type="text" id="widget_profile_url[<?php echo $role; ?>]" value="<?php echo $profile_url[$role]; ?>" class="regular-text" />
|
131 |
+
</td>
|
132 |
+
</tr>
|
133 |
+
<?php endforeach; ?>
|
134 |
+
</table>
|
135 |
+
|
136 |
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'theme-my-login'); ?>" />
|
137 |
</form>
|
138 |
</div>
|
includes/compat.php
CHANGED
@@ -86,4 +86,17 @@ function wp_password_change_notification(&$user) {
|
|
86 |
}
|
87 |
}
|
88 |
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
?>
|
86 |
}
|
87 |
}
|
88 |
endif;
|
89 |
+
|
90 |
+
if ( !function_exists('wp_guess_url') ) :
|
91 |
+
function wp_guess_url() {
|
92 |
+
if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
|
93 |
+
$url = WP_SITEURL;
|
94 |
+
} else {
|
95 |
+
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
|
96 |
+
$url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
97 |
+
}
|
98 |
+
return $url;
|
99 |
+
}
|
100 |
+
endif;
|
101 |
+
|
102 |
?>
|
includes/widget-control.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
global $wp_roles;
|
4 |
-
$user_roles = $wp_roles->get_names();
|
5 |
-
|
6 |
-
if ( $_POST['tml_submit'] ) {
|
7 |
-
|
8 |
-
foreach ($user_roles as $role => $value) {
|
9 |
-
$dashboard_link[$role] = isset($_POST['tml_dashboard_link'][$role]) ? true : false;
|
10 |
-
$profile_link[$role] = isset($_POST['tml_profile_link'][$role]) ? true : false;
|
11 |
-
}
|
12 |
-
$this->SetOption('widget_show_logged_in', $_POST['tml_show_widget']);
|
13 |
-
$this->SetOption('widget_show_gravatar', $_POST['tml_show_gravatar']);
|
14 |
-
$this->SetOption('widget_gravatar_size', absint($_POST['tml_gravatar_size']));
|
15 |
-
$this->SetOption('widget_dashboard_link', $dashboard_link);
|
16 |
-
$this->SetOption('widget_profile_link', $profile_link);
|
17 |
-
$this->SaveOptions();
|
18 |
-
|
19 |
-
}
|
20 |
-
|
21 |
-
$show_widget = $this->GetOption('widget_show_logged_in');
|
22 |
-
$show_gravatar = $this->GetOption('widget_show_gravatar');
|
23 |
-
$dashboard_link = $this->GetOption('widget_dashboard_link');
|
24 |
-
$profile_link = $this->GetOption('widget_profile_link');
|
25 |
-
|
26 |
-
?>
|
27 |
-
|
28 |
-
<p>
|
29 |
-
<label for="tml_show_widget">Show Widget When Logged In:</label>
|
30 |
-
<select name="tml_show_widget" id="tml_show_widget"><option value="1" <?php if ($show_widget == true) echo 'selected="selected"'; ?>>Yes</option><option value="0" <?php if ($show_widget == false) echo 'selected="selected"'; ?>>No</option></select>
|
31 |
-
</p>
|
32 |
-
|
33 |
-
<p>
|
34 |
-
<label for="tml_show_gravatar">Show Gravatar:</label>
|
35 |
-
<select name="tml_show_gravatar" id="tml_show_gravatar"><option value="1" <?php if ($show_gravatar == true) echo 'selected="selected"'; ?>>Yes</option><option value="0" <?php if ($show_gravatar == false) echo 'selected="selected"'; ?>>No</option></select>
|
36 |
-
</p>
|
37 |
-
|
38 |
-
<p>
|
39 |
-
<label for="tml_gravatar_size">Gravatar Size:</label>
|
40 |
-
<input name="tml_gravatar_size" type="text" id="tml_gravatar_size" value="<?php echo absint($this->GetOption('widget_gravatar_size')); ?>" size="2" />
|
41 |
-
</p>
|
42 |
-
|
43 |
-
<p>
|
44 |
-
<label for="tml_dashboard_link">Show Dashboard Link For:</label><br />
|
45 |
-
<?php foreach ($user_roles as $role => $value) : ?>
|
46 |
-
<input name="tml_dashboard_link[<?php echo $role; ?>]" type="checkbox" id="tml_dashboard_link[<?php echo $role; ?>]" value="1"<?php if ($dashboard_link[$role] == true) { echo 'checked="checked"'; } ?> /> <?php echo ucwords($role); ?><br />
|
47 |
-
<?php endforeach; ?>
|
48 |
-
</p>
|
49 |
-
|
50 |
-
<p>
|
51 |
-
<label for="tml_profile_link">Show Profile Link For:</label><br />
|
52 |
-
<?php foreach ($user_roles as $role => $value) : ?>
|
53 |
-
<input name="tml_profile_link[<?php echo $role; ?>]" type="checkbox" id="tml_profile_link[<?php echo $role; ?>]" value="1"<?php if ($profile_link[$role] == true) { echo 'checked="checked"'; } ?> /> <?php echo ucwords($role); ?><br />
|
54 |
-
<?php endforeach; ?>
|
55 |
-
</p>
|
56 |
-
|
57 |
-
<p>
|
58 |
-
<input type="hidden" id="tml_submit" name="tml_submit" value="1" />
|
59 |
-
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/widget-new.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ThemeMyLoginWidget extends WP_Widget {
|
4 |
+
|
5 |
+
function ThemeMyLoginWidget(){
|
6 |
+
$widget_ops = array('classname' => 'widget_theme_my_login', 'description' => __('A login form for your blog.') );
|
7 |
+
$this->WP_Widget('theme-my-login', __('Theme My Login'), $widget_ops);
|
8 |
+
}
|
9 |
+
|
10 |
+
function widget($args, $instance){
|
11 |
+
global $ThemeMyLogin, $wp_version, $user_ID, $current_user, $login_errors;
|
12 |
+
|
13 |
+
get_currentuserinfo();
|
14 |
+
|
15 |
+
extract ($args);
|
16 |
+
|
17 |
+
if (!is_page($ThemeMyLogin->GetOption('page_id'))) {
|
18 |
+
if ($user_ID != '' && $instance['show_logged_in']) {
|
19 |
+
$user_role = $current_user->roles[0];
|
20 |
+
$dashboard_url = $ThemeMyLogin->GetOption('widget_dashboard_url');
|
21 |
+
$profile_url = $ThemeMyLogin->GetOption('widget_profile_url');
|
22 |
+
echo $before_widget . $before_title . __('Welcome', 'theme-my-login') . ', ' . $current_user->display_name . $after_title . "\n";
|
23 |
+
if ($instance['show_gravatar']) :
|
24 |
+
echo '<div class="theme-my-login-avatar">' . get_avatar( $user_ID, $size = $instance['gravatar_size'] ) . '</div>' . "\n";
|
25 |
+
endif;
|
26 |
+
do_action('theme_my_login_avatar', $current_user);
|
27 |
+
echo '<ul class="theme-my-login-links">' . "\n";
|
28 |
+
if ($instance['dashboard_link_' . $user_role]) :
|
29 |
+
echo '<li><a href="' . $dashboard_url[$user_role] . '">' . __('Dashboard', 'theme-my-login') . '</a></li>' . "\n";
|
30 |
+
endif;
|
31 |
+
if ($instance['profile_link_' . $user_role]) :
|
32 |
+
echo '<li><a href="' . $profile_url[$user_role] . '">' . __('Profile', 'theme-my-login') . '</a></li>' . "\n";
|
33 |
+
endif;
|
34 |
+
do_action('theme_my_login_links', $user_role);
|
35 |
+
$redirect = wp_guess_url();
|
36 |
+
if (version_compare($wp_version, '2.7', '>='))
|
37 |
+
echo '<li><a href="' . wp_logout_url($redirect) . '">' . __('Logout', 'theme-my-login') . '</a></li>' . "\n";
|
38 |
+
else
|
39 |
+
echo '<li><a href="' . site_url('wp-login.php?action=logout&redirect_to='.$redirect, 'login') . '">' . __('Logout', 'theme-my-login') . '</a></li>' . "\n";
|
40 |
+
echo '</ul>' . "\n";
|
41 |
+
echo $after_widget . "\n";
|
42 |
+
} elseif (empty($user_ID)) {
|
43 |
+
switch ($_GET['action']) {
|
44 |
+
case 'register':
|
45 |
+
$title = $ThemeMyLogin->GetOption('register_title');
|
46 |
+
break;
|
47 |
+
case 'lostpassword':
|
48 |
+
case 'retrievepassword':
|
49 |
+
case 'resetpass':
|
50 |
+
case 'rp':
|
51 |
+
$title = $ThemeMyLogin->GetOption('password_title');
|
52 |
+
break;
|
53 |
+
case 'login':
|
54 |
+
default:
|
55 |
+
$title = $ThemeMyLogin->GetOption('login_title');
|
56 |
+
break;
|
57 |
+
}
|
58 |
+
echo $before_widget . $before_title . $title . $after_title . "\n";
|
59 |
+
$type = 'widget';
|
60 |
+
require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-forms.php');
|
61 |
+
echo $after_widget . "\n";
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
function update($new_instance, $old_instance){
|
67 |
+
global $wp_roles;
|
68 |
+
$user_roles = $wp_roles->get_names();
|
69 |
+
|
70 |
+
$instance = $old_instance;
|
71 |
+
$instance['show_logged_in'] = (empty($new_instance['show_logged_in'])) ? false : true;
|
72 |
+
$instance['show_gravatar'] = (empty($new_instance['show_gravatar'])) ? false : true;
|
73 |
+
$instance['gravatar_size'] = absint($new_instance['gravatar_size']);
|
74 |
+
foreach ($user_roles as $role => $value) {
|
75 |
+
$instance['dashboard_link_' . $role] = (empty($new_instance['dashboard_link_' . $role])) ? false : true;
|
76 |
+
//$instance['dashboard_url_' . $role] = trim($new_instance['dashboard_url_' . $role]);
|
77 |
+
$instance['profile_link_' . $role] = (empty($new_instance['profile_link_' . $role])) ? false : true;
|
78 |
+
//$instance['profile_url_' . $role] = trim($new_instance['profile_url_' . $role]);
|
79 |
+
}
|
80 |
+
|
81 |
+
return $instance;
|
82 |
+
}
|
83 |
+
|
84 |
+
function form($instance){
|
85 |
+
global $wp_roles;
|
86 |
+
$user_roles = $wp_roles->get_names();
|
87 |
+
|
88 |
+
//Defaults
|
89 |
+
$defaults['show_logged_in'] = 1;
|
90 |
+
$defaults['show_gravatar'] = 1;
|
91 |
+
$defaults['gravatar_size'] = 50;
|
92 |
+
foreach ($user_roles as $role => $value) {
|
93 |
+
$defaults['dashboard_link_' . $role] = 1;
|
94 |
+
$defaults['dashboard_url_' . $role] = 'wp-admin/';
|
95 |
+
$defaults['profile_link_' . $role] = 1;
|
96 |
+
$defaults['profile_url_' . $role] = 'wp-admin/profile.php';
|
97 |
+
}
|
98 |
+
$instance = wp_parse_args( (array) $instance, (array) $defaults );
|
99 |
+
|
100 |
+
$is_checked = (empty($instance['show_logged_in'])) ? '' : 'checked="checked" ';
|
101 |
+
echo '<p><input name="' . $this->get_field_name('show_logged_in') . '" type="checkbox" id="' . $this->get_field_id('show_logged_in') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('show_logged_in') . '">' . __('Show When Logged In') . '</label></p>' . "\n";
|
102 |
+
$is_checked = (empty($instance['show_gravatar'])) ? '' : 'checked="checked" ';
|
103 |
+
echo '<p><input name="' . $this->get_field_name('show_gravatar') . '" type="checkbox" id="' . $this->get_field_id('show_gravatar') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('show_gravatar') . '">' . __('Show Gravatar') . '</label></p>' . "\n";
|
104 |
+
echo '<p>' . __('Gravatar Size') . ': <input name="' . $this->get_field_name('gravatar_size') . '" type="text" id="' . $this->get_field_id('gravatar_size') . '" value="' . $instance['gravatar_size'] . '" size="3" /> <label for="' . $this->get_field_id('gravatar_size') . '"></label></p>' . "\n";
|
105 |
+
echo '<p>' . __('Dashboard Link') . ':<br />' . "\n";
|
106 |
+
foreach ($user_roles as $role => $value) {
|
107 |
+
$is_checked = (empty($instance['dashboard_link_' . $role])) ? '' : 'checked="checked" ';
|
108 |
+
echo '<input name="' . $this->get_field_name('dashboard_link_' . $role) . '" type="checkbox" id="' . $this->get_field_id('dashboard_link_' . $role) . '" value="1" ' . $is_checked . '/> ' . ucwords($role) . '<br />' . "\n";
|
109 |
+
//echo '<input name="' . $this->get_field_name('dashboard_url_' . $role) . '" type="text" id="' . $this->get_field_id('dashboard_url_' . $role) . '" value="' . $instance['dashboard_url_' . $role] . '" class="widefat" /><br />' . "\n";
|
110 |
+
}
|
111 |
+
echo '</p>';
|
112 |
+
echo '<p>' . __('Profile Link') . ':<br />' . "\n";
|
113 |
+
foreach ($user_roles as $role => $value) {
|
114 |
+
$is_checked = (empty($instance['profile_link_' . $role])) ? '' : 'checked="checked" ';
|
115 |
+
echo '<input name="' . $this->get_field_name('profile_link_' . $role) . '" type="checkbox" id="' . $this->get_field_id('profile_link_' . $role) . '" value="1" ' . $is_checked . '/> ' . ucwords($role) . '<br />' . "\n";
|
116 |
+
//echo '<input name="' . $this->get_field_name('profile_url_' . $role) . '" type="text" id="' . $this->get_field_id('profile_url_' . $role) . '" value="' . $instance['profile_url_' . $role] . '" class="widefat" /><br />' . "\n";
|
117 |
+
}
|
118 |
+
echo '</p>';
|
119 |
+
}
|
120 |
+
|
121 |
+
}// END class
|
122 |
+
|
123 |
+
function ThemeMyLoginWidgetInit() {
|
124 |
+
register_widget('ThemeMyLoginWidget');
|
125 |
+
}
|
126 |
+
add_action('widgets_init', 'ThemeMyLoginWidgetInit');
|
127 |
+
|
128 |
+
?>
|
includes/widget-old.php
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ThemeMyLoginWidget {
|
4 |
+
|
5 |
+
function ThemeMyLoginWidget() {
|
6 |
+
add_action('plugins_loaded', array(&$this, 'PluginsLoaded'));
|
7 |
+
}
|
8 |
+
|
9 |
+
function PluginsLoaded() {
|
10 |
+
wp_register_sidebar_widget('theme-my-login', 'Theme My Login', array(&$this, 'Widget'), array('description' => 'A login form for your blog'));
|
11 |
+
wp_register_widget_control('theme-my-login', 'Theme My Login', array(&$this, 'WidgetControl'));
|
12 |
+
}
|
13 |
+
|
14 |
+
function Widget($args) {
|
15 |
+
global $ThemeMyLogin, $wp_version, $user_ID, $current_user, $login_errors;
|
16 |
+
|
17 |
+
get_currentuserinfo();
|
18 |
+
|
19 |
+
extract ($args);
|
20 |
+
|
21 |
+
if (!is_page($ThemeMyLogin->GetOption('page_id'))) {
|
22 |
+
if ($user_ID != '' && $ThemeMyLogin->GetOption('widget_show_logged_in')) {
|
23 |
+
$user_role = $current_user->roles[0];
|
24 |
+
$dashboard_link = $ThemeMyLogin->GetOption('widget_dashboard_link');
|
25 |
+
$dashboard_url = $ThemeMyLogin->GetOption('widget_dashboard_url');
|
26 |
+
$profile_link = $ThemeMyLogin->GetOption('widget_profile_link');
|
27 |
+
$profile_url = $ThemeMyLogin->GetOption('widget_profile_url');
|
28 |
+
echo $before_widget . $before_title . __('Welcome', 'theme-my-login') . ', ' . $current_user->display_name . $after_title . "\n";
|
29 |
+
if ($ThemeMyLogin->GetOption('widget_show_gravatar') == true) :
|
30 |
+
echo '<div class="theme-my-login-avatar">' . get_avatar( $user_ID, $size = $ThemeMyLogin->GetOption('widget_gravatar_size') ) . '</div>' . "\n";
|
31 |
+
endif;
|
32 |
+
do_action('theme_my_login_avatar', $current_user);
|
33 |
+
echo '<ul class="theme-my-login-links">' . "\n";
|
34 |
+
if ($dashboard_link[$user_role] == true) :
|
35 |
+
echo '<li><a href="' . $dashboard_url[$user_role] . '">' . __('Dashboard', 'theme-my-login') . '</a></li>' . "\n";
|
36 |
+
endif;
|
37 |
+
if ($profile_link[$user_role] == true) :
|
38 |
+
echo '<li><a href="' . $profile_url[$user_role] . '">' . __('Profile', 'theme-my-login') . '</a></li>' . "\n";
|
39 |
+
endif;
|
40 |
+
do_action('theme_my_login_links', $user_role);
|
41 |
+
$redirect = wp_guess_url();
|
42 |
+
if (version_compare($wp_version, '2.7', '>='))
|
43 |
+
echo '<li><a href="' . wp_logout_url($redirect) . '">' . __('Logout', 'theme-my-login') . '</a></li>' . "\n";
|
44 |
+
else
|
45 |
+
echo '<li><a href="' . site_url('wp-login.php?action=logout&redirect_to='.$redirect, 'login') . '">' . __('Logout', 'theme-my-login') . '</a></li>' . "\n";
|
46 |
+
echo '</ul>' . "\n";
|
47 |
+
} elseif (empty($user_ID)) {
|
48 |
+
switch ($_GET['action']) {
|
49 |
+
case 'register':
|
50 |
+
$title = $ThemeMyLogin->GetOption('register_title');
|
51 |
+
break;
|
52 |
+
case 'lostpassword':
|
53 |
+
case 'retrievepassword':
|
54 |
+
case 'resetpass':
|
55 |
+
case 'rp':
|
56 |
+
$title = $ThemeMyLogin->GetOption('password_title');
|
57 |
+
break;
|
58 |
+
case 'login':
|
59 |
+
default:
|
60 |
+
$title = $ThemeMyLogin->GetOption('login_title');
|
61 |
+
break;
|
62 |
+
}
|
63 |
+
echo $before_widget . $before_title . $title . $after_title . "\n";
|
64 |
+
$type = 'widget';
|
65 |
+
require (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-forms.php');
|
66 |
+
}
|
67 |
+
echo $after_widget . "\n";
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
function WidgetControl() {
|
72 |
+
global $ThemeMyLogin, $wp_roles;
|
73 |
+
$user_roles = $wp_roles->get_names();
|
74 |
+
|
75 |
+
if ( $_POST['tml_submit'] ) {
|
76 |
+
|
77 |
+
foreach ($user_roles as $role => $value) {
|
78 |
+
$dashboard_link[$role] = isset($_POST['tml_dashboard_link'][$role]) ? true : false;
|
79 |
+
$profile_link[$role] = isset($_POST['tml_profile_link'][$role]) ? true : false;
|
80 |
+
}
|
81 |
+
$ThemeMyLogin->SetOption('widget_show_logged_in', $_POST['tml_show_widget']);
|
82 |
+
$ThemeMyLogin->SetOption('widget_show_gravatar', $_POST['tml_show_gravatar']);
|
83 |
+
$ThemeMyLogin->SetOption('widget_gravatar_size', absint($_POST['tml_gravatar_size']));
|
84 |
+
$ThemeMyLogin->SetOption('widget_dashboard_link', $dashboard_link);
|
85 |
+
$ThemeMyLogin->SetOption('widget_profile_link', $profile_link);
|
86 |
+
$ThemeMyLogin->SaveOptions();
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
$show_widget = $ThemeMyLogin->GetOption('widget_show_logged_in');
|
91 |
+
$show_gravatar = $ThemeMyLogin->GetOption('widget_show_gravatar');
|
92 |
+
$dashboard_link = $ThemeMyLogin->GetOption('widget_dashboard_link');
|
93 |
+
$profile_link = $ThemeMyLogin->GetOption('widget_profile_link');
|
94 |
+
|
95 |
+
?>
|
96 |
+
|
97 |
+
<p>
|
98 |
+
<label for="tml_show_widget">Show Widget When Logged In:</label>
|
99 |
+
<select name="tml_show_widget" id="tml_show_widget"><option value="1" <?php if ($show_widget == true) echo 'selected="selected"'; ?>>Yes</option><option value="0" <?php if ($show_widget == false) echo 'selected="selected"'; ?>>No</option></select>
|
100 |
+
</p>
|
101 |
+
|
102 |
+
<p>
|
103 |
+
<label for="tml_show_gravatar">Show Gravatar:</label>
|
104 |
+
<select name="tml_show_gravatar" id="tml_show_gravatar"><option value="1" <?php if ($show_gravatar == true) echo 'selected="selected"'; ?>>Yes</option><option value="0" <?php if ($show_gravatar == false) echo 'selected="selected"'; ?>>No</option></select>
|
105 |
+
</p>
|
106 |
+
|
107 |
+
<p>
|
108 |
+
<label for="tml_gravatar_size">Gravatar Size:</label>
|
109 |
+
<input name="tml_gravatar_size" type="text" id="tml_gravatar_size" value="<?php echo absint($ThemeMyLogin->GetOption('widget_gravatar_size')); ?>" size="2" />
|
110 |
+
</p>
|
111 |
+
|
112 |
+
<p>
|
113 |
+
<label for="tml_dashboard_link">Dashboard Link:</label><br />
|
114 |
+
<?php foreach ($user_roles as $role => $value) : ?>
|
115 |
+
<input name="tml_dashboard_link[<?php echo $role; ?>]" type="checkbox" id="tml_dashboard_link[<?php echo $role; ?>]" value="1"<?php if ($dashboard_link[$role] == true) { echo 'checked="checked"'; } ?> /> <?php echo ucwords($role); ?><br />
|
116 |
+
<?php endforeach; ?>
|
117 |
+
</p>
|
118 |
+
|
119 |
+
<p>
|
120 |
+
<label for="tml_profile_link">Profile Link:</label><br />
|
121 |
+
<?php foreach ($user_roles as $role => $value) : ?>
|
122 |
+
<input name="tml_profile_link[<?php echo $role; ?>]" type="checkbox" id="tml_profile_link[<?php echo $role; ?>]" value="1"<?php if ($profile_link[$role] == true) { echo 'checked="checked"'; } ?> /> <?php echo ucwords($role); ?><br />
|
123 |
+
<?php endforeach; ?>
|
124 |
+
</p>
|
125 |
+
|
126 |
+
<p>
|
127 |
+
<input type="hidden" id="tml_submit" name="tml_submit" value="1" />
|
128 |
+
</p>
|
129 |
+
|
130 |
+
<?php
|
131 |
+
}
|
132 |
+
} // End class
|
133 |
+
|
134 |
+
if (class_exists('ThemeMyLoginWidget')) {
|
135 |
+
$ThemeMyLoginWidget = new ThemeMyLoginWidget();
|
136 |
+
}
|
137 |
+
|
138 |
+
?>
|
includes/wp-login-forms.php
CHANGED
@@ -1,21 +1,26 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
require_once (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
|
4 |
|
5 |
$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
|
6 |
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
|
7 |
|
|
|
|
|
|
|
8 |
switch ($action) :
|
9 |
|
10 |
case 'lostpassword' :
|
11 |
case 'retrievepassword' :
|
12 |
do_action('lost_password');
|
13 |
-
login_header('<p class="message">' . $
|
14 |
|
15 |
$user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';
|
16 |
?>
|
17 |
|
18 |
-
<form name="lostpasswordform" id="lostpasswordform" action="
|
19 |
<p>
|
20 |
<label><?php _e('Username or E-mail:', 'theme-my-login') ?><br />
|
21 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape($user_login); ?>" size="20" tabindex="10" /></label>
|
@@ -38,7 +43,7 @@ case 'register' :
|
|
38 |
login_header('', $login_errors);
|
39 |
?>
|
40 |
|
41 |
-
<form name="registerform" id="registerform" action="
|
42 |
<p>
|
43 |
<label><?php _e('Username', 'theme-my-login') ?><br />
|
44 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label>
|
@@ -48,7 +53,7 @@ case 'register' :
|
|
48 |
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo attribute_escape(stripslashes($user_email)); ?>" size="20" tabindex="20" /></label>
|
49 |
</p>
|
50 |
<?php do_action('register_form'); ?>
|
51 |
-
<p id="reg_passmail"><?php _e($
|
52 |
<p class="submit">
|
53 |
<input type="hidden" name="post-from" id="post-from" value="<?php echo $type; ?>" />
|
54 |
<input type="hidden" name="action" id="action" value="register" />
|
@@ -87,7 +92,7 @@ default :
|
|
87 |
elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $login_errors->add('registerdisabled', __('User registration is currently not allowed.', 'theme-my-login'));
|
88 |
elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $login_errors->add('confirm', __('Check your e-mail for the confirmation link.', 'theme-my-login'), 'message');
|
89 |
elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $login_errors->add('newpass', __('Check your e-mail for your new password.', 'theme-my-login'), 'message');
|
90 |
-
elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $login_errors->add('registered', $
|
91 |
|
92 |
login_header('', $login_errors);
|
93 |
|
1 |
<?php
|
2 |
|
3 |
+
$options = get_option('theme_my_login');
|
4 |
+
|
5 |
require_once (WP_PLUGIN_DIR . '/theme-my-login/includes/wp-login-functions.php');
|
6 |
|
7 |
$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
|
8 |
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
|
9 |
|
10 |
+
if (empty($type))
|
11 |
+
$type = 'page';
|
12 |
+
|
13 |
switch ($action) :
|
14 |
|
15 |
case 'lostpassword' :
|
16 |
case 'retrievepassword' :
|
17 |
do_action('lost_password');
|
18 |
+
login_header('<p class="message">' . $options['password_msg'] . '</p>', $login_errors);
|
19 |
|
20 |
$user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';
|
21 |
?>
|
22 |
|
23 |
+
<form name="lostpasswordform" id="lostpasswordform" action="" method="post">
|
24 |
<p>
|
25 |
<label><?php _e('Username or E-mail:', 'theme-my-login') ?><br />
|
26 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape($user_login); ?>" size="20" tabindex="10" /></label>
|
43 |
login_header('', $login_errors);
|
44 |
?>
|
45 |
|
46 |
+
<form name="registerform" id="registerform" action="" method="post">
|
47 |
<p>
|
48 |
<label><?php _e('Username', 'theme-my-login') ?><br />
|
49 |
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label>
|
53 |
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo attribute_escape(stripslashes($user_email)); ?>" size="20" tabindex="20" /></label>
|
54 |
</p>
|
55 |
<?php do_action('register_form'); ?>
|
56 |
+
<p id="reg_passmail"><?php _e($options['register_msg']) ?></p>
|
57 |
<p class="submit">
|
58 |
<input type="hidden" name="post-from" id="post-from" value="<?php echo $type; ?>" />
|
59 |
<input type="hidden" name="action" id="action" value="register" />
|
92 |
elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $login_errors->add('registerdisabled', __('User registration is currently not allowed.', 'theme-my-login'));
|
93 |
elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $login_errors->add('confirm', __('Check your e-mail for the confirmation link.', 'theme-my-login'), 'message');
|
94 |
elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $login_errors->add('newpass', __('Check your e-mail for your new password.', 'theme-my-login'), 'message');
|
95 |
+
elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $login_errors->add('registered', $options['register_complete'], 'message');
|
96 |
|
97 |
login_header('', $login_errors);
|
98 |
|
includes/wp-login-functions.php
CHANGED
@@ -63,7 +63,7 @@ if (!function_exists('login_footer')) :
|
|
63 |
function login_footer($type = 'page') {
|
64 |
$_GET['action'] = isset($_GET['action']) ? $_GET['action'] : 'login';
|
65 |
echo '<ul class="links">' . "\n";
|
66 |
-
if (in_array($_GET['action'], array('register', 'lostpassword')) || $_GET['action'] == 'login' && isset($_GET['checkemail'])) {
|
67 |
$url = ($type == 'widget') ? add_query_arg('action', 'login', wp_guess_url()) : site_url('wp-login.php', 'login');
|
68 |
echo '<li><a href="' . $url . '">' . __('Log in') . '</a></li>' . "\n";
|
69 |
}
|
63 |
function login_footer($type = 'page') {
|
64 |
$_GET['action'] = isset($_GET['action']) ? $_GET['action'] : 'login';
|
65 |
echo '<ul class="links">' . "\n";
|
66 |
+
if (in_array($_GET['action'], array('register', 'lostpassword')) || $_GET['action'] == 'login' && isset($_GET['checkemail']) && 'registered' != $_GET['checkemail']) {
|
67 |
$url = ($type == 'widget') ? add_query_arg('action', 'login', wp_guess_url()) : site_url('wp-login.php', 'login');
|
68 |
echo '<li><a href="' . $url . '">' . __('Log in') . '</a></li>' . "\n";
|
69 |
}
|
language/theme-my-login.pot
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR
|
3 |
# This file is distributed under the same license as the PACKAGE package.
|
4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
#
|
@@ -8,7 +8,7 @@ msgid ""
|
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/theme-my-login\n"
|
11 |
-
"POT-Creation-Date: 2009-07-
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -16,75 +16,87 @@ msgstr ""
|
|
16 |
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
18 |
|
19 |
-
#: includes/admin-page.php:
|
20 |
msgid ""
|
21 |
"To complete uninstall, deactivate this plugin. If you do not wish to "
|
22 |
"uninstall, please uncheck the \"Complete Uninstall\" checkbox."
|
23 |
msgstr ""
|
24 |
|
25 |
-
#: includes/admin-page.php:
|
26 |
msgid "Settings saved."
|
27 |
msgstr ""
|
28 |
|
29 |
-
#: includes/admin-page.php:
|
30 |
msgid ""
|
31 |
"If you like this plugin, please help keep it up to date by <a href=\"http://"
|
32 |
"www.jfarthing.com/donate\">donating through PayPal</a>!"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: includes/admin-page.php:
|
36 |
msgid "Theme My Login Settings"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: includes/admin-page.php:
|
40 |
msgid "General Settings"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: includes/admin-page.php:
|
44 |
msgid "Plugin"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: includes/admin-page.php:
|
48 |
msgid "Uninstall"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: includes/admin-page.php:
|
52 |
msgid "Page List"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: includes/admin-page.php:
|
56 |
msgid "Show Login Page"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: includes/admin-page.php:
|
60 |
msgid "Template Settings"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: includes/admin-page.php:
|
64 |
msgid "Register Title"
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: includes/admin-page.php:
|
68 |
msgid "Register Message"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: includes/admin-page.php:
|
72 |
msgid "Registration Complete Message"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: includes/admin-page.php:
|
76 |
msgid "Login Title"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: includes/admin-page.php:
|
80 |
msgid "Lost Password Title"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: includes/admin-page.php:
|
84 |
msgid "Lost Password Message"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: includes/admin-page.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
msgid "Save Changes"
|
89 |
msgstr ""
|
90 |
|
@@ -98,67 +110,114 @@ msgstr ""
|
|
98 |
msgid "[%s] Password Lost/Changed"
|
99 |
msgstr ""
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
#: includes/wp-login-actions.php:63
|
102 |
msgid "Sorry, that key does not appear to be valid."
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: includes/wp-login-forms.php:
|
106 |
msgid "Username or E-mail:"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: includes/wp-login-forms.php:
|
110 |
msgid "Get New Password"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: includes/wp-login-forms.php:
|
114 |
msgid "Username"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: includes/wp-login-forms.php:
|
118 |
msgid "E-mail"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: includes/wp-login-forms.php:
|
122 |
-
|
|
|
|
|
|
|
|
|
123 |
msgid "Register"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: includes/wp-login-forms.php:
|
127 |
msgid ""
|
128 |
"<strong>ERROR</strong>: Cookies are blocked or not supported by your "
|
129 |
"browser. You must <a href='http://www.google.com/cookies.html'>enable "
|
130 |
"cookies</a> to use WordPress."
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: includes/wp-login-forms.php:
|
134 |
msgid "You are now logged out."
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: includes/wp-login-forms.php:
|
138 |
msgid "User registration is currently not allowed."
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: includes/wp-login-forms.php:
|
142 |
msgid "Check your e-mail for the confirmation link."
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: includes/wp-login-forms.php:
|
146 |
msgid "Check your e-mail for your new password."
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: includes/wp-login-forms.php:
|
150 |
-
msgid "Registration complete. Please check your e-mail."
|
151 |
-
msgstr ""
|
152 |
-
|
153 |
-
#: includes/wp-login-forms.php:104
|
154 |
msgid "Password"
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: includes/wp-login-forms.php:
|
158 |
msgid "Remember Me"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: includes/wp-login-forms.php:
|
162 |
msgid "Log In"
|
163 |
msgstr ""
|
164 |
|
@@ -271,42 +330,24 @@ msgid ""
|
|
271 |
"href=\"mailto:%s\">webmaster</a> !"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: theme-my-login.php:
|
275 |
msgid "A password will be e-mailed to you."
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: theme-my-login.php:
|
|
|
|
|
|
|
|
|
279 |
msgid "Lost Password"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: theme-my-login.php:
|
283 |
msgid ""
|
284 |
"Please enter your username or e-mail address. You will receive a new "
|
285 |
"password via e-mail."
|
286 |
msgstr ""
|
287 |
|
288 |
-
#. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
|
289 |
-
#. Plugin Name of an extension
|
290 |
-
#: theme-my-login.php:135
|
291 |
-
msgid "Theme My Login"
|
292 |
-
msgstr ""
|
293 |
-
|
294 |
-
#: theme-my-login.php:275
|
295 |
-
msgid "Welcome"
|
296 |
-
msgstr ""
|
297 |
-
|
298 |
-
#: theme-my-login.php:282
|
299 |
-
msgid "Dashboard"
|
300 |
-
msgstr ""
|
301 |
-
|
302 |
-
#: theme-my-login.php:285
|
303 |
-
msgid "Profile"
|
304 |
-
msgstr ""
|
305 |
-
|
306 |
-
#: theme-my-login.php:288
|
307 |
-
msgid "Logout"
|
308 |
-
msgstr ""
|
309 |
-
|
310 |
#. Plugin URI of an extension
|
311 |
msgid "http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin"
|
312 |
msgstr ""
|
@@ -318,7 +359,7 @@ msgid ""
|
|
318 |
msgstr ""
|
319 |
|
320 |
#. Author of an extension
|
321 |
-
msgid "
|
322 |
msgstr ""
|
323 |
|
324 |
#. Author URI of an extension
|
1 |
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR Jeff Farthing
|
3 |
# This file is distributed under the same license as the PACKAGE package.
|
4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
#
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/theme-my-login\n"
|
11 |
+
"POT-Creation-Date: 2009-07-21 18:47+0000\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16 |
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
18 |
|
19 |
+
#: includes/admin-page.php:27
|
20 |
msgid ""
|
21 |
"To complete uninstall, deactivate this plugin. If you do not wish to "
|
22 |
"uninstall, please uncheck the \"Complete Uninstall\" checkbox."
|
23 |
msgstr ""
|
24 |
|
25 |
+
#: includes/admin-page.php:29
|
26 |
msgid "Settings saved."
|
27 |
msgstr ""
|
28 |
|
29 |
+
#: includes/admin-page.php:38
|
30 |
msgid ""
|
31 |
"If you like this plugin, please help keep it up to date by <a href=\"http://"
|
32 |
"www.jfarthing.com/donate\">donating through PayPal</a>!"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: includes/admin-page.php:48
|
36 |
msgid "Theme My Login Settings"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: includes/admin-page.php:53
|
40 |
msgid "General Settings"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: includes/admin-page.php:56
|
44 |
msgid "Plugin"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: includes/admin-page.php:59
|
48 |
msgid "Uninstall"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: includes/admin-page.php:63
|
52 |
msgid "Page List"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: includes/admin-page.php:66
|
56 |
msgid "Show Login Page"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: includes/admin-page.php:71
|
60 |
msgid "Template Settings"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: includes/admin-page.php:74
|
64 |
msgid "Register Title"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: includes/admin-page.php:80
|
68 |
msgid "Register Message"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: includes/admin-page.php:86
|
72 |
msgid "Registration Complete Message"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: includes/admin-page.php:92
|
76 |
msgid "Login Title"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: includes/admin-page.php:98
|
80 |
msgid "Lost Password Title"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: includes/admin-page.php:104
|
84 |
msgid "Lost Password Message"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: includes/admin-page.php:111
|
88 |
+
msgid "Widget Settings"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: includes/admin-page.php:112
|
92 |
+
msgid "Dashboard URL"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: includes/admin-page.php:124
|
96 |
+
msgid "Profile URL"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: includes/admin-page.php:136
|
100 |
msgid "Save Changes"
|
101 |
msgstr ""
|
102 |
|
110 |
msgid "[%s] Password Lost/Changed"
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: includes/widget-new.php:6
|
114 |
+
msgid "A login form for your blog."
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
|
118 |
+
#. Plugin Name of an extension
|
119 |
+
#: includes/widget-new.php:7 theme-my-login.php:142
|
120 |
+
msgid "Theme My Login"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: includes/widget-new.php:22 includes/widget-old.php:28
|
124 |
+
msgid "Welcome"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: includes/widget-new.php:29 includes/widget-old.php:35
|
128 |
+
msgid "Dashboard"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: includes/widget-new.php:32 includes/widget-old.php:38
|
132 |
+
msgid "Profile"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: includes/widget-new.php:37 includes/widget-new.php:39
|
136 |
+
#: includes/widget-old.php:43 includes/widget-old.php:45
|
137 |
+
msgid "Logout"
|
138 |
+
msgstr ""
|
139 |
+
|
140 |
+
#: includes/widget-new.php:101
|
141 |
+
msgid "Show When Logged In"
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: includes/widget-new.php:103
|
145 |
+
msgid "Show Gravatar"
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
#: includes/widget-new.php:104
|
149 |
+
msgid "Gravatar Size"
|
150 |
+
msgstr ""
|
151 |
+
|
152 |
+
#: includes/widget-new.php:105
|
153 |
+
msgid "Dashboard Link"
|
154 |
+
msgstr ""
|
155 |
+
|
156 |
+
#: includes/widget-new.php:112
|
157 |
+
msgid "Profile Link"
|
158 |
+
msgstr ""
|
159 |
+
|
160 |
#: includes/wp-login-actions.php:63
|
161 |
msgid "Sorry, that key does not appear to be valid."
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: includes/wp-login-forms.php:25
|
165 |
msgid "Username or E-mail:"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: includes/wp-login-forms.php:32
|
169 |
msgid "Get New Password"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: includes/wp-login-forms.php:48 includes/wp-login-forms.php:105
|
173 |
msgid "Username"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: includes/wp-login-forms.php:52
|
177 |
msgid "E-mail"
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: includes/wp-login-forms.php:56
|
181 |
+
msgid "register_msg"
|
182 |
+
msgstr ""
|
183 |
+
|
184 |
+
#: includes/wp-login-forms.php:60 includes/wp-login-functions.php:72
|
185 |
+
#: theme-my-login.php:90
|
186 |
msgid "Register"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: includes/wp-login-forms.php:88
|
190 |
msgid ""
|
191 |
"<strong>ERROR</strong>: Cookies are blocked or not supported by your "
|
192 |
"browser. You must <a href='http://www.google.com/cookies.html'>enable "
|
193 |
"cookies</a> to use WordPress."
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: includes/wp-login-forms.php:91
|
197 |
msgid "You are now logged out."
|
198 |
msgstr ""
|
199 |
|
200 |
+
#: includes/wp-login-forms.php:92
|
201 |
msgid "User registration is currently not allowed."
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: includes/wp-login-forms.php:93
|
205 |
msgid "Check your e-mail for the confirmation link."
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: includes/wp-login-forms.php:94
|
209 |
msgid "Check your e-mail for your new password."
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: includes/wp-login-forms.php:109
|
|
|
|
|
|
|
|
|
213 |
msgid "Password"
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: includes/wp-login-forms.php:113
|
217 |
msgid "Remember Me"
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: includes/wp-login-forms.php:117 theme-my-login.php:89
|
221 |
msgid "Log In"
|
222 |
msgstr ""
|
223 |
|
330 |
"href=\"mailto:%s\">webmaster</a> !"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: theme-my-login.php:91
|
334 |
msgid "A password will be e-mailed to you."
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: theme-my-login.php:92
|
338 |
+
msgid "Registration complete. Please check your e-mail."
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: theme-my-login.php:93
|
342 |
msgid "Lost Password"
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: theme-my-login.php:94
|
346 |
msgid ""
|
347 |
"Please enter your username or e-mail address. You will receive a new "
|
348 |
"password via e-mail."
|
349 |
msgstr ""
|
350 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
#. Plugin URI of an extension
|
352 |
msgid "http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin"
|
353 |
msgstr ""
|
359 |
msgstr ""
|
360 |
|
361 |
#. Author of an extension
|
362 |
+
msgid "Jeff Farthing"
|
363 |
msgstr ""
|
364 |
|
365 |
#. Author URI of an extension
|
readme.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
=== Theme My Login ===
|
2 |
Contributors: jfarthing84
|
3 |
Donate link: http://www.jfarthing.com/donate
|
4 |
-
Tags: widget, login, registration, theme, custom, log in, register, sidebar
|
5 |
Requires at least: 2.5
|
6 |
Tested up to: 2.8.1
|
7 |
Stable tag: trunk
|
@@ -16,7 +16,8 @@ This plugin themes the WordPress login, registration and forgot password pages a
|
|
16 |
|
17 |
== Installation ==
|
18 |
|
19 |
-
Upload the
|
|
|
20 |
|
21 |
|
22 |
== Frequently Asked Questions ==
|
@@ -26,6 +27,11 @@ None yet. Please visit http://www.jfarthing.com/forum for any support!
|
|
26 |
|
27 |
== Changelog ==
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
= 3.0.3 =
|
30 |
* Fixed a bug with the widget links
|
31 |
|
1 |
=== Theme My Login ===
|
2 |
Contributors: jfarthing84
|
3 |
Donate link: http://www.jfarthing.com/donate
|
4 |
+
Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar
|
5 |
Requires at least: 2.5
|
6 |
Tested up to: 2.8.1
|
7 |
Stable tag: trunk
|
16 |
|
17 |
== Installation ==
|
18 |
|
19 |
+
1. Upload the plugin to your 'wp-content/plugins' directory
|
20 |
+
1. Activate the plugin
|
21 |
|
22 |
|
23 |
== Frequently Asked Questions ==
|
27 |
|
28 |
== Changelog ==
|
29 |
|
30 |
+
= 3.1 =
|
31 |
+
* Added the ability to specify URL's for widget 'Dashboard' and 'Profile' links per user role
|
32 |
+
* Implemented WordPress 2.8 widget control for multiple widget instances
|
33 |
+
* Fixed a bug regarding the registration complete message
|
34 |
+
|
35 |
= 3.0.3 =
|
36 |
* Fixed a bug with the widget links
|
37 |
|
theme-my-login.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Theme My Login
|
4 |
Plugin URI: http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin
|
5 |
Description: Themes the WordPress login, registration and forgot password pages according to your theme.
|
6 |
-
Version: 3.
|
7 |
Author: Jeff Farthing
|
8 |
Author URI: http://www.jfarthing.com
|
9 |
*/
|
@@ -26,7 +26,7 @@ if ($wp_version < '2.7') {
|
|
26 |
if (!class_exists('ThemeMyLogin')) {
|
27 |
class ThemeMyLogin {
|
28 |
|
29 |
-
var $version = '3.
|
30 |
var $options = array();
|
31 |
var $permalink = '';
|
32 |
|
@@ -44,7 +44,6 @@ if (!class_exists('ThemeMyLogin')) {
|
|
44 |
add_action('admin_menu', array(&$this, 'AddAdminPage'));
|
45 |
add_action('init', array(&$this, 'Init'));
|
46 |
add_action('parse_request', array(&$this, 'ParseRequest'));
|
47 |
-
add_action('plugins_loaded', array(&$this, 'PluginsLoaded'));
|
48 |
|
49 |
add_filter('wp_head', array(&$this, 'WPHead'));
|
50 |
add_filter('wp_title', array(&$this, 'WPTitle'));
|
@@ -100,6 +99,14 @@ if (!class_exists('ThemeMyLogin')) {
|
|
100 |
$this->options['widget_gravatar_size'] = 50;
|
101 |
$this->options['widget_dashboard_link'] = array('subscriber' => 1, 'contributor' => 1, 'author' => 1, 'editor' => 1, 'administrator' => 1);
|
102 |
$this->options['widget_profile_link'] = array('subscriber' => 1, 'contributor' => 1, 'author' => 1, 'editor' => 1, 'administrator' => 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
}
|
104 |
|
105 |
function LoadOptions() {
|
@@ -254,71 +261,20 @@ if (!class_exists('ThemeMyLogin')) {
|
|
254 |
}
|
255 |
return $url;
|
256 |
}
|
257 |
-
|
258 |
-
function PluginsLoaded() {
|
259 |
-
wp_register_sidebar_widget('theme-my-login', 'Theme My Login', array(&$this, 'Widget'), array('description' => 'A login form for your blog'));
|
260 |
-
wp_register_widget_control('theme-my-login', 'Theme My Login', array(&$this, 'WidgetControl'));
|
261 |
-
}
|
262 |
-
|
263 |
-
function Widget($args) {
|
264 |
-
global $user_ID, $current_user, $login_errors;
|
265 |
-
|
266 |
-
get_currentuserinfo();
|
267 |
-
|
268 |
-
extract ($args);
|
269 |
-
|
270 |
-
if (!is_page($this->GetOption('page_id'))) :
|
271 |
-
if ($user_ID != '' && $this->GetOption('widget_show_logged_in')) {
|
272 |
-
$user_role = $current_user->roles[0];
|
273 |
-
$dashboard_link = $this->GetOption('widget_dashboard_link');
|
274 |
-
$profile_link = $this->GetOption('widget_profile_link');
|
275 |
-
echo $before_widget . $before_title . __('Welcome', 'theme-my-login') . ', ' . $current_user->display_name . $after_title . "\n";
|
276 |
-
if ($this->GetOption('widget_show_gravatar') == true) :
|
277 |
-
echo '<div class="theme-my-login-avatar">' . get_avatar( $user_ID, $size = $this->GetOption('widget_gravatar_size') ) . '</div>' . "\n";
|
278 |
-
endif;
|
279 |
-
do_action('theme_my_login_avatar', $current_user);
|
280 |
-
echo '<ul class="theme-my-login-links">' . "\n";
|
281 |
-
if ($dashboard_link[$user_role] == true) :
|
282 |
-
echo '<li><a href="' . site_url('wp-admin/', 'admin') . '">' . __('Dashboard', 'theme-my-login') . '</a></li>' . "\n";
|
283 |
-
endif;
|
284 |
-
if ($profile_link[$user_role] == true) :
|
285 |
-
echo '<li><a href="' . site_url('wp-admin/profile.php', 'admin') . '">' . __('Profile', 'theme-my-login') . '</a></li>' . "\n";
|
286 |
-
endif;
|
287 |
-
do_action('theme_my_login_links', $user_role);
|
288 |
-
echo '<li><a href="' . wp_logout_url(wp_guess_url()) . '">' . __('Logout', 'theme-my-login') . '</a></li>' . "\n";
|
289 |
-
echo '</ul>' . "\n";
|
290 |
-
} elseif (empty($user_ID)) {
|
291 |
-
switch ($_GET['action']) {
|
292 |
-
case 'register':
|
293 |
-
$title = $this->GetOption('register_title');
|
294 |
-
break;
|
295 |
-
case 'lostpassword':
|
296 |
-
case 'retrievepassword':
|
297 |
-
case 'resetpass':
|
298 |
-
case 'rp':
|
299 |
-
$title = $this->GetOption('password_title');
|
300 |
-
break;
|
301 |
-
case 'login':
|
302 |
-
default:
|
303 |
-
$title = $this->GetOption('login_title');
|
304 |
-
break;
|
305 |
-
}
|
306 |
-
echo $before_widget . $before_title . $title . $after_title . "\n";
|
307 |
-
$this->DisplayLogin('widget');
|
308 |
-
}
|
309 |
-
echo $after_widget;
|
310 |
-
endif;
|
311 |
-
}
|
312 |
-
|
313 |
-
function WidgetControl() {
|
314 |
-
require (WP_PLUGIN_DIR . '/theme-my-login/includes/widget-control.php');
|
315 |
-
}
|
316 |
}
|
317 |
}
|
318 |
|
319 |
//instantiate the class
|
320 |
if (class_exists('ThemeMyLogin')) {
|
|
|
|
|
321 |
$ThemeMyLogin = new ThemeMyLogin();
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
}
|
323 |
|
324 |
?>
|
3 |
Plugin Name: Theme My Login
|
4 |
Plugin URI: http://www.jfarthing.com/wordpress-plugins/theme-my-login-plugin
|
5 |
Description: Themes the WordPress login, registration and forgot password pages according to your theme.
|
6 |
+
Version: 3.1
|
7 |
Author: Jeff Farthing
|
8 |
Author URI: http://www.jfarthing.com
|
9 |
*/
|
26 |
if (!class_exists('ThemeMyLogin')) {
|
27 |
class ThemeMyLogin {
|
28 |
|
29 |
+
var $version = '3.1';
|
30 |
var $options = array();
|
31 |
var $permalink = '';
|
32 |
|
44 |
add_action('admin_menu', array(&$this, 'AddAdminPage'));
|
45 |
add_action('init', array(&$this, 'Init'));
|
46 |
add_action('parse_request', array(&$this, 'ParseRequest'));
|
|
|
47 |
|
48 |
add_filter('wp_head', array(&$this, 'WPHead'));
|
49 |
add_filter('wp_title', array(&$this, 'WPTitle'));
|
99 |
$this->options['widget_gravatar_size'] = 50;
|
100 |
$this->options['widget_dashboard_link'] = array('subscriber' => 1, 'contributor' => 1, 'author' => 1, 'editor' => 1, 'administrator' => 1);
|
101 |
$this->options['widget_profile_link'] = array('subscriber' => 1, 'contributor' => 1, 'author' => 1, 'editor' => 1, 'administrator' => 1);
|
102 |
+
|
103 |
+
$user_roles = array('subscriber', 'contributor', 'author', 'editor', 'administrator');
|
104 |
+
foreach ($user_roles as $role) {
|
105 |
+
$dashboard_url[$role] = site_url('wp-admin', 'admin');
|
106 |
+
$profile_url[$role] = site_url('wp-admin/profile.php', 'admin');
|
107 |
+
}
|
108 |
+
$this->options['widget_dashboard_url'] = $dashboard_url;
|
109 |
+
$this->options['widget_profile_url'] = $profile_url;
|
110 |
}
|
111 |
|
112 |
function LoadOptions() {
|
261 |
}
|
262 |
return $url;
|
263 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
}
|
265 |
}
|
266 |
|
267 |
//instantiate the class
|
268 |
if (class_exists('ThemeMyLogin')) {
|
269 |
+
global $wp_version;
|
270 |
+
|
271 |
$ThemeMyLogin = new ThemeMyLogin();
|
272 |
+
|
273 |
+
if (version_compare($wp_version, '2.8', '>=')) {
|
274 |
+
require (WP_PLUGIN_DIR . '/theme-my-login/includes/widget-new.php');
|
275 |
+
} else {
|
276 |
+
require (WP_PLUGIN_DIR . '/theme-my-login/includes/widget-old.php');
|
277 |
+
}
|
278 |
}
|
279 |
|
280 |
?>
|