Changeset 1078628
- Timestamp:
- 01/29/2015 11:30:14 PM (11 years ago)
- Location:
- oi-frontend-profile
- Files:
-
- 12 added
- 6 edited
-
tags/1.2 (added)
-
tags/1.2/css (added)
-
tags/1.2/css/style.css (added)
-
tags/1.2/lang (added)
-
tags/1.2/lang/oifrontendprofile-ru_RU.mo (added)
-
tags/1.2/lang/oifrontendprofile-ru_RU.po (added)
-
tags/1.2/oi-frontend-profile.php (added)
-
tags/1.2/oi-nput.php (added)
-
tags/1.2/readme.txt (added)
-
tags/1.2/screenshot-1.png (added)
-
trunk/css/style.css (modified) (1 diff)
-
trunk/inc (added)
-
trunk/inc/options.php (added)
-
trunk/lang/oifrontendprofile-ru_RU.mo (modified) (previous)
-
trunk/lang/oifrontendprofile-ru_RU.po (modified) (2 diffs)
-
trunk/oi-frontend-profile.php (modified) (8 diffs)
-
trunk/oi-nput.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
oi-frontend-profile/trunk/css/style.css
r995265 r1078628 72 72 width: 100%; 73 73 } 74 74 @media screen and ( min-width: 400px ) 75 { 76 .oifrontendprofile input[name=pass1], .oifrontendprofile input[name=pass2] { 77 width: 250px; 78 } 79 } 75 80 .oifrontendprofile .alert { 76 81 padding: 5px; -
oi-frontend-profile/trunk/lang/oifrontendprofile-ru_RU.po
r995265 r1078628 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: Oi Frontend Profile v1. 0\n"3 "Project-Id-Version: Oi Frontend Profile v1.3\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: \n" 6 "PO-Revision-Date: 201 4-09-17 13:52:50+0000\n"6 "PO-Revision-Date: 2015-01-29 23:24:57+0000\n" 7 7 "Last-Translator: admin <a@a.aa>\n" 8 8 "Language-Team: \n" … … 21 21 "X-Textdomain-Support: yes" 22 22 23 #: oi-frontend-profile.php:1 2823 #: oi-frontend-profile.php:164 24 24 #@ oifrontendprofile 25 25 msgid "Your profile has been updated successfully." 26 26 msgstr "Ваш профиль успешно обновлен." 27 27 28 #: oi-frontend-profile.php:1 6129 #@ default28 #: oi-frontend-profile.php:197 29 #@ oifrontendprofile 30 30 msgid "Username" 31 msgstr " "31 msgstr "Имя пользователя" 32 32 33 #: oi-frontend-profile.php:1 6133 #: oi-frontend-profile.php:197 34 34 #@ oifrontendprofile 35 35 msgid "Usernames cannot be changed." 36 36 msgstr "Имена пользователей не могут быть изменены." 37 37 38 #: oi-frontend-profile.php: 16738 #: oi-frontend-profile.php:203 39 39 #@ oifrontendprofile 40 40 msgid "First Name" 41 41 msgstr "Имя" 42 42 43 #: oi-frontend-profile.php: 17143 #: oi-frontend-profile.php:207 44 44 #@ oifrontendprofile 45 45 msgid "Last Name" 46 46 msgstr "Фамилия" 47 47 48 #: oi-frontend-profile.php: 17748 #: oi-frontend-profile.php:213 49 49 #@ oifrontendprofile 50 50 msgid "Nickname" 51 51 msgstr "Ник" 52 52 53 #: oi-frontend-profile.php: 18253 #: oi-frontend-profile.php:222 54 54 #@ oifrontendprofile 55 55 msgid "Display name publicly as" 56 56 msgstr "Отображать как" 57 57 58 #: oi-frontend-profile.php: 18758 #: oi-frontend-profile.php:228 59 59 #@ oifrontendprofile 60 60 msgid "Contact Info" 61 61 msgstr "Контактная информация" 62 62 63 #: oi-frontend-profile.php: 18963 #: oi-frontend-profile.php:233 64 64 #@ oifrontendprofile 65 65 msgid "E-mail" 66 66 msgstr "" 67 67 68 #: oi-frontend-profile.php: 19368 #: oi-frontend-profile.php:237 69 69 #@ oifrontendprofile 70 70 msgid "Website" 71 71 msgstr "Сайт" 72 72 73 #: oi-frontend-profile.php: 19973 #: oi-frontend-profile.php:243 74 74 #@ oifrontendprofile 75 75 msgid "About Yourself" 76 76 msgstr "О вас" 77 77 78 #: oi-frontend-profile.php:2 0078 #: oi-frontend-profile.php:244 79 79 #@ oifrontendprofile 80 80 msgid "Biographical Info" 81 81 msgstr "Краткая биография" 82 82 83 #: oi-frontend-profile.php:2 1383 #: oi-frontend-profile.php:257 84 84 #@ oifrontendprofile 85 85 msgid "New Password" 86 86 msgstr "Новый пароль" 87 87 88 #: oi-frontend-profile.php:2 1688 #: oi-frontend-profile.php:260 89 89 #@ oifrontendprofile 90 90 msgid "Type your new password again." 91 91 msgstr "Введите новый пароль еще раз." 92 92 93 #: oi-frontend-profile.php:2 2693 #: oi-frontend-profile.php:270 94 94 #@ oifrontendprofile 95 95 msgid "Update Profile" 96 96 msgstr "Обновить" 97 97 98 #: oi-frontend-profile.php:2 0098 #: oi-frontend-profile.php:244 99 99 #@ oifrontendprofile 100 100 msgid "Share a little biographical information to fill out your profile. This may be shown publicly." 101 101 msgstr "Поделитесь краткой информацией о себе. Эта информация может быть доступна публично." 102 102 103 #: oi-frontend-profile.php:2 13103 #: oi-frontend-profile.php:257 104 104 #@ oifrontendprofile 105 105 msgid "If you would like to change the password type a new one. Otherwise leave this blank." 106 106 msgstr "Если вы хотите сменить пароль введите новый пароль ниже. Либо оставьте поле пароля пустым." 107 107 108 #: oi-frontend-profile.php: 31108 #: oi-frontend-profile.php:47 109 109 #@ oifrontendprofile 110 110 msgid "Profile" 111 111 msgstr "Профиль" 112 112 113 #: inc/options.php:1 114 #@ oifrontendprofile 115 msgid "Profile page" 116 msgstr "Страница профиля" 117 118 #: inc/options.php:1 119 #@ oifrontendprofile 120 msgid "This page will be displayed when editing a profile" 121 msgstr "Эта страница будет отображаться во время редактирования профиля" 122 123 #: inc/options.php:1 124 #@ oifrontendprofile 125 msgid "This page MUST contain <b>[oi_frontend_profile]</b> shortcode" 126 msgstr "Эта страница ДОЛЖНА содержать шорткод - <b>[oi_frontend_profile]</b>" 127 128 #: inc/options.php:1 129 #@ oifrontendprofile 130 msgid "CSS" 131 msgstr "" 132 133 #: inc/options.php:1 134 #@ oifrontendprofile 135 msgid "Turn off plugin styles" 136 msgstr "Отключить стили плагина" 137 138 #: inc/options.php:1 139 #@ oifrontendprofile 140 msgid "If you want to use your own CSS or use Bootstrap(should be installed) CSS - check this option." 141 msgstr "Если вы хотите использовать свои CSS или Botstrap(должен быть подключен) - поставьте галку" 142 143 #: inc/options.php:1 144 #@ oifrontendprofile 145 msgid "Admin bar" 146 msgstr "Панель администратора" 147 148 #: inc/options.php:1 149 #@ oifrontendprofile 150 msgid "Hide" 151 msgstr "Скрыть" 152 153 #: inc/options.php:1 154 #@ oifrontendprofile 155 msgid "Hide the Admin bar from a frontend." 156 msgstr "Скрыть панель администратора с фасада." 157 158 #: inc/options.php:1 159 #@ oifrontendprofile 160 msgid "Settings saved" 161 msgstr "Настройки сохранены" 162 163 #: inc/options.php:1 164 #@ oifrontendprofile 165 msgid "Oi Frontend Profile" 166 msgstr "" 167 168 #: inc/options.php:1 169 #@ oifrontendprofile 170 msgid "Settings" 171 msgstr "Настройки" 172 173 #: inc/options.php:1 174 #@ default 175 msgid "Save Changes" 176 msgstr "" 177 178 #: inc/options.php:1 179 #@ oifrontendprofile 180 msgid "Backend" 181 msgstr "Админка" 182 183 #: inc/options.php:1 184 #@ oifrontendprofile 185 msgid "Redirect out of backend" 186 msgstr "Перенаправлять из админки" 187 188 #: inc/options.php:1 189 #@ oifrontendprofile 190 msgid "Disallow users to go to the backend." 191 msgstr "Запретить пользователям заходить в админку и консоль" 192 -
oi-frontend-profile/trunk/oi-frontend-profile.php
r995265 r1078628 4 4 Plugin URI: http://www.easywebsite.ru/shop/plugins-wordpress/oi-frontend-profile 5 5 Description: Plugin creates frontend profile page and redirects users from wp-admin/profile.php to this page. Form looks in Bootstrap style. 6 Version: 1. 06 Version: 1.3 7 7 Author: Alexei Isaenko 8 8 Author URI: http://sh14.ru … … 10 10 */ 11 11 require_once 'oi-nput.php'; 12 include 'inc/options.php'; 13 12 14 // localization 13 15 function oifep_localization() … … 23 25 24 26 register_activation_hook( __FILE__, 'create_profile_page' ); // õóê ïðè àêòèâàöèè ïëàãèíà 25 function create_profile_page() // ñîçäàíèå ñòðàíèöû ïðîôèëÿ 26 { 27 $post_id = get_option( 'oifrontendprofile_page' ); 27 28 $options = get_oifrontendprofile(); // ïðß÷åì àäìèíáàð 29 if( $options[ 'admin_bar_front_off' ] == 1 ){add_filter( 'show_admin_bar' , 'oifrontendprofile_admin_bar');} 30 31 function get_oifrontendprofile() 32 { 33 return json_decode( get_option( 'oifrontendprofile' ), true ); 34 } 35 function oifrontendprofile_admin_bar( $content ) 36 { 37 return ( current_user_can( 'administrator' ) ) ? $content : false; 38 } 39 40 function create_profile_page() // ñîçäàíèå ñòðàíèöû ïðîôèëß 41 { 42 $options = get_oifrontendprofile(); 43 $post_id = $options[ 'post_id' ]; 28 44 if( $post_id == false || get_post_status( $post_id ) <> 'publish' ) // åñëè ñòðàíèöà åùå íå ñîçäàíà èëè íå îïóáëèêîâàíà... 29 45 { … … 40 56 41 57 $post_id = wp_insert_post($page); // ñîçäàåì åå 42 update_option( 'oifrontendprofile_page', $post_id ); // ñîõðàíÿåì â íàñòðîéêàõ id ñòðàíèöû 58 $options[ 'post_id' ] = $post_id; 59 update_option( 'oifrontendprofile', json_encode( $options ) ); // ñîõðàíßåì â íàñòðîéêàõ id ñòðàíèöû 43 60 } 44 61 } … … 46 63 function oifep_styles() 47 64 { 48 wp_enqueue_style('oifep', oifep_path().'/css/style.css'); 65 // åñëè â íàñòðîéêàõ íå âûêëþ÷åí css, ïîäãðóæàåì ñòèëè 66 $options = get_oifrontendprofile(); 67 $turn_off_css = $options[ 'turn_off_css' ]; 68 if( $turn_off_css <> 1 ){wp_enqueue_style('oifep', oifep_path().'/css/style.css');} 49 69 } 50 70 add_action('wp_enqueue_scripts', 'oifep_styles'); 51 71 52 add_action ('init' , 'prevent_profile_access'); // èíèöèàëèçàöè ÿ ôóíêöèè ïåðåíàïðàâëåíèÿ72 add_action ('init' , 'prevent_profile_access'); // èíèöèàëèçàöèß ôóíêöèè ïåðåíàïðàâëåíèß 53 73 54 function prevent_profile_access() // ôóíêöèÿ ïåðåíàïðàâëåíèÿ 55 { 56 if (current_user_can('manage_options')) return ''; // åñëè ïîëüçîâàòåëü ìîæåò ìåíÿòü íàñòðîéêè ñèñòåìû - íè÷åãî íå äåëàåì, èíà÷å... 57 if (strpos ($_SERVER ['REQUEST_URI'] , 'wp-admin/profile.php' )) // ïåðåõâàòûâàåì ïåðåõõîä â ïðîôèëü 58 { 59 $id = get_option( 'oifrontendprofile_page' ); // ïîëó÷àåì id ñòðàíèöû ïðîôèëÿ èç íàñòðîåê 60 if( get_post_status( $id ) == 'publish' ) // åñëè îíà ñóùåñòâóåò è îïóáëèêîâàíà... 61 { 62 $id = '/?p=' . $id; // ôîðìèðóåì àäðåñ ðåäèðåêòà íà ýòó ñòðàíèöó 74 function prevent_profile_access() // ôóíêöèß ïåðåíàïðàâëåíèß 75 { 76 if (current_user_can('manage_options')) return ''; // åñëè ïîëüçîâàòåëü ìîæåò ìåíßòü íàñòðîéêè ñèñòåìû - íè÷åãî íå äåëàåì, èíà÷å... 77 78 if( strpos ( $_SERVER ['REQUEST_URI'] , 'wp-admin/' ) ) // ïåðåõâàòûâàåì ïåðåõõîä â ïðîôèëü 79 { 80 $options = get_oifrontendprofile(); 81 $backend_hide = $options[ 'backend_hide' ]; // ïîëó÷àåì id ñòðàíèöû ïðîôèëß èç íàñòðîåê 82 $post_id = $options[ 'post_id' ]; 83 if( $backend_hide == 1 ){$backend_hide = strpos ($_SERVER ['REQUEST_URI'] , 'wp-admin/' );} 84 } 85 if (strpos ($_SERVER ['REQUEST_URI'] , 'wp-admin/profile.php' ) || $backend_hide ) // ïåðåõâàòûâàåì ïåðåõõîä â ïðîôèëü 86 { 87 88 if( get_post_status( $post_id ) == 'publish' ) // åñëè îíà ñóùåñòâóåò è îïóáëèêîâàíà... 89 { 90 $post_id = '/?p=' . $post_id; // ôîðìèðóåì àäðåñ ðåäèðåêòà íà ýòó ñòðàíèöó 63 91 }else 64 92 { 65 $ id = ''; // èíà÷å ðåäèðåêò áóäåò áåç ïàðàìåòðîâ(íà ãëàâíóþ)66 } 67 wp_redirect ( get_bloginfo( 'url') . $id ); // ðåäèðåêò93 $post_id = ''; // èíà÷å ðåäèðåêò áóäåò áåç ïàðàìåòðîâ(íà ãëàâíóþ) 94 } 95 wp_redirect ( get_bloginfo( 'url' ) . $post_id ); // ðåäèðåêò 68 96 } 69 97 } … … 167 195 <div class="row"> 168 196 <div class="col-xs-6 col-md-6 form-group"> 169 <?=oinput(array('key'=>'user_login','before'=>__('Username' ),'disabled'=>true,'value'=>esc_attr($profileuser->user_login),'hint'=>__('Usernames cannot be changed.','oifrontendprofile'),))?>197 <?=oinput(array('key'=>'user_login','before'=>__('Username', 'oifrontendprofile'),'disabled'=>true,'value'=>esc_attr($profileuser->user_login),'hint'=>__('Usernames cannot be changed.','oifrontendprofile'),))?> 170 198 </div> 171 199 </div> … … 217 245 </div> 218 246 </div> 219 247 220 248 <? do_action( 'show_user_profile', $profileuser ); ?> 221 249 <div class="row"> … … 237 265 <div class="row"> 238 266 <div class="col-xs-12 col-md-12 form-group"> 239 <? //=oinput(array('type'=>'hidden','key'=>'admin_bar_front','value'=>esc_attr($profileuser->admin_bar_front),))// ïðÿ÷åò àäìèíáàð ïðè ñîõðàíåíèè?>267 <?=oinput(array('type'=>'hidden','key'=>'admin_bar_front','value'=>esc_attr($profileuser->admin_bar_front),))?> 240 268 <input type="hidden" name="action" value="update" /> 241 269 <input type="hidden" name="user_id" id="user_id" value="1"> -
oi-frontend-profile/trunk/oi-nput.php
r995265 r1078628 27 27 if($placeholder){$placeholder = ' placeholder="'.$placeholder.'"';} 28 28 if($after){$after = '<label for="'.$key.'">'.$after.'</label>';} 29 if($hint){$hint = '< span class="help-block description">'.$hint.'</span>';}29 if($hint){$hint = '<p class="help-block description">'.$hint.'</p>';} 30 30 if($class){$class = ' '.$class;} 31 31 if($style){$style = ' style="'.$style.'"';} -
oi-frontend-profile/trunk/readme.txt
r995371 r1078628 1 === Oi Frontend Profile === 2 Contributors: Isaenko Alexei 3 Tags: profile, user, login, page, frontend, front-end 4 Requires at least: 3.2 5 Tested up to: 4.1 6 Stable tag: 1.3 7 License: GPLv2 or later 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 10 This plugin disallow users going to the backend. They can manage theme prifile on the frontend page. 11 12 == Description == 13 14 This plugin will disallow users manage them profile on the admin page. They will have to do that on the frontend page. 15 Activate the plugin and it will create a profile page with a shortcode, and after that users will be redirected to that page if they would like to edit their profile. Also you able to use the shortcode on any page, just insert the shortcode - [oi_frontend_profile]. 16 17 You are able to change profile page and hide Admin bar from a frontend. 18 19 Supported laguages: 20 <ul> 21 <li>English</li> 22 <li>Russian</li> 23 </ul> 24 25 == Installation == 26 27 1. Upload `oi-frontend-profile` folder to the `/wp-content/plugins/` directory. 28 2. Activate the plugin through the 'Plugins' menu in WordPress. 29 30 == Screenshots == 31 32 1. Profile page on a frontend, TwentyTwelve theme. 33 34 == Changelog == 35 36 = 1.3 = 37 * new: Option page added 38 * new: Disabling CSS function added 39 * new: Disabling Admin bar function added 40 * new: Choosing Profile page function added 41 * new: Redirecting from backend added 42 * fix: Localisation missing removed 43 = 1.2 = 44 * new: Redirecting added 45 * new: Profile page creating added 46 * new: Russian language added 47 = 1.1 = 48 * new: Language support added. 49 = 1.0 = 50 * Initial release 51 52 == Upgrade Notice == 53 54 = 1.2 = 55 Some functions added.======= 1 56 === Oi Frontend Profile === 2 57 Contributors: Isaenko Alexei … … 46 101 47 102 = 1.2 = 48 Some functions added. 103 Some functions added.>>>>>>> .r1077238
Note: See TracChangeset
for help on using the changeset viewer.