Plugin Directory

Changeset 1078628


Ignore:
Timestamp:
01/29/2015 11:30:14 PM (11 years ago)
Author:
Sh14
Message:

version 1.3

Location:
oi-frontend-profile
Files:
12 added
6 edited

Legend:

Unmodified
Added
Removed
  • oi-frontend-profile/trunk/css/style.css

    r995265 r1078628  
    7272    width: 100%;
    7373}
    74 
     74@media screen and ( min-width: 400px )
     75{
     76    .oifrontendprofile input[name=pass1], .oifrontendprofile input[name=pass2] {
     77        width: 250px;
     78    }
     79}
    7580.oifrontendprofile .alert {
    7681    padding: 5px;
  • oi-frontend-profile/trunk/lang/oifrontendprofile-ru_RU.po

    r995265 r1078628  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Oi Frontend Profile v1.0\n"
     3"Project-Id-Version: Oi Frontend Profile v1.3\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: \n"
    6 "PO-Revision-Date: 2014-09-17 13:52:50+0000\n"
     6"PO-Revision-Date: 2015-01-29 23:24:57+0000\n"
    77"Last-Translator: admin <a@a.aa>\n"
    88"Language-Team: \n"
     
    2121"X-Textdomain-Support: yes"
    2222
    23 #: oi-frontend-profile.php:128
     23#: oi-frontend-profile.php:164
    2424#@ oifrontendprofile
    2525msgid "Your profile has been updated successfully."
    2626msgstr "Ваш профиль успешно обновлен."
    2727
    28 #: oi-frontend-profile.php:161
    29 #@ default
     28#: oi-frontend-profile.php:197
     29#@ oifrontendprofile
    3030msgid "Username"
    31 msgstr ""
     31msgstr "Имя пользователя"
    3232
    33 #: oi-frontend-profile.php:161
     33#: oi-frontend-profile.php:197
    3434#@ oifrontendprofile
    3535msgid "Usernames cannot be changed."
    3636msgstr "Имена пользователей не могут быть изменены."
    3737
    38 #: oi-frontend-profile.php:167
     38#: oi-frontend-profile.php:203
    3939#@ oifrontendprofile
    4040msgid "First Name"
    4141msgstr "Имя"
    4242
    43 #: oi-frontend-profile.php:171
     43#: oi-frontend-profile.php:207
    4444#@ oifrontendprofile
    4545msgid "Last Name"
    4646msgstr "Фамилия"
    4747
    48 #: oi-frontend-profile.php:177
     48#: oi-frontend-profile.php:213
    4949#@ oifrontendprofile
    5050msgid "Nickname"
    5151msgstr "Ник"
    5252
    53 #: oi-frontend-profile.php:182
     53#: oi-frontend-profile.php:222
    5454#@ oifrontendprofile
    5555msgid "Display name publicly as"
    5656msgstr "Отображать как"
    5757
    58 #: oi-frontend-profile.php:187
     58#: oi-frontend-profile.php:228
    5959#@ oifrontendprofile
    6060msgid "Contact Info"
    6161msgstr "Контактная информация"
    6262
    63 #: oi-frontend-profile.php:189
     63#: oi-frontend-profile.php:233
    6464#@ oifrontendprofile
    6565msgid "E-mail"
    6666msgstr ""
    6767
    68 #: oi-frontend-profile.php:193
     68#: oi-frontend-profile.php:237
    6969#@ oifrontendprofile
    7070msgid "Website"
    7171msgstr "Сайт"
    7272
    73 #: oi-frontend-profile.php:199
     73#: oi-frontend-profile.php:243
    7474#@ oifrontendprofile
    7575msgid "About Yourself"
    7676msgstr "О вас"
    7777
    78 #: oi-frontend-profile.php:200
     78#: oi-frontend-profile.php:244
    7979#@ oifrontendprofile
    8080msgid "Biographical Info"
    8181msgstr "Краткая биография"
    8282
    83 #: oi-frontend-profile.php:213
     83#: oi-frontend-profile.php:257
    8484#@ oifrontendprofile
    8585msgid "New Password"
    8686msgstr "Новый пароль"
    8787
    88 #: oi-frontend-profile.php:216
     88#: oi-frontend-profile.php:260
    8989#@ oifrontendprofile
    9090msgid "Type your new password again."
    9191msgstr "Введите новый пароль еще раз."
    9292
    93 #: oi-frontend-profile.php:226
     93#: oi-frontend-profile.php:270
    9494#@ oifrontendprofile
    9595msgid "Update Profile"
    9696msgstr "Обновить"
    9797
    98 #: oi-frontend-profile.php:200
     98#: oi-frontend-profile.php:244
    9999#@ oifrontendprofile
    100100msgid "Share a little biographical information to fill out your profile. This may be shown publicly."
    101101msgstr "Поделитесь краткой информацией о себе. Эта информация может быть доступна публично."
    102102
    103 #: oi-frontend-profile.php:213
     103#: oi-frontend-profile.php:257
    104104#@ oifrontendprofile
    105105msgid "If you would like to change the password type a new one. Otherwise leave this blank."
    106106msgstr "Если вы хотите сменить пароль введите новый пароль ниже. Либо оставьте поле пароля пустым."
    107107
    108 #: oi-frontend-profile.php:31
     108#: oi-frontend-profile.php:47
    109109#@ oifrontendprofile
    110110msgid "Profile"
    111111msgstr "Профиль"
    112112
     113#: inc/options.php:1
     114#@ oifrontendprofile
     115msgid "Profile page"
     116msgstr "Страница профиля"
     117
     118#: inc/options.php:1
     119#@ oifrontendprofile
     120msgid "This page will be displayed when editing a profile"
     121msgstr "Эта страница будет отображаться во время редактирования профиля"
     122
     123#: inc/options.php:1
     124#@ oifrontendprofile
     125msgid "This page MUST contain <b>[oi_frontend_profile]</b> shortcode"
     126msgstr "Эта страница ДОЛЖНА содержать шорткод - <b>[oi_frontend_profile]</b>"
     127
     128#: inc/options.php:1
     129#@ oifrontendprofile
     130msgid "CSS"
     131msgstr ""
     132
     133#: inc/options.php:1
     134#@ oifrontendprofile
     135msgid "Turn off plugin styles"
     136msgstr "Отключить стили плагина"
     137
     138#: inc/options.php:1
     139#@ oifrontendprofile
     140msgid "If you want to use your own CSS or use Bootstrap(should be installed) CSS - check this option."
     141msgstr "Если вы хотите использовать свои CSS или Botstrap(должен быть подключен) - поставьте галку"
     142
     143#: inc/options.php:1
     144#@ oifrontendprofile
     145msgid "Admin bar"
     146msgstr "Панель администратора"
     147
     148#: inc/options.php:1
     149#@ oifrontendprofile
     150msgid "Hide"
     151msgstr "Скрыть"
     152
     153#: inc/options.php:1
     154#@ oifrontendprofile
     155msgid "Hide the Admin bar from a frontend."
     156msgstr "Скрыть панель администратора с фасада."
     157
     158#: inc/options.php:1
     159#@ oifrontendprofile
     160msgid "Settings saved"
     161msgstr "Настройки сохранены"
     162
     163#: inc/options.php:1
     164#@ oifrontendprofile
     165msgid "Oi Frontend Profile"
     166msgstr ""
     167
     168#: inc/options.php:1
     169#@ oifrontendprofile
     170msgid "Settings"
     171msgstr "Настройки"
     172
     173#: inc/options.php:1
     174#@ default
     175msgid "Save Changes"
     176msgstr ""
     177
     178#: inc/options.php:1
     179#@ oifrontendprofile
     180msgid "Backend"
     181msgstr "Админка"
     182
     183#: inc/options.php:1
     184#@ oifrontendprofile
     185msgid "Redirect out of backend"
     186msgstr "Перенаправлять из админки"
     187
     188#: inc/options.php:1
     189#@ oifrontendprofile
     190msgid "Disallow users to go to the backend."
     191msgstr "Запретить пользователям заходить в админку и консоль"
     192
  • oi-frontend-profile/trunk/oi-frontend-profile.php

    r995265 r1078628  
    44Plugin URI: http://www.easywebsite.ru/shop/plugins-wordpress/oi-frontend-profile
    55Description: Plugin creates frontend profile page and redirects users from wp-admin/profile.php to this page. Form looks in Bootstrap style.
    6 Version: 1.0
     6Version: 1.3
    77Author: Alexei Isaenko
    88Author URI: http://sh14.ru
     
    1010*/
    1111require_once 'oi-nput.php';
     12include 'inc/options.php';
     13
    1214// localization
    1315function oifep_localization()
     
    2325
    2426register_activation_hook( __FILE__, 'create_profile_page' ); // õóê ïðè àêòèâàöèè ïëàãèíà
    25 function create_profile_page() // ñîçäàíèå ñòðàíèöû ïðîôèëÿ
    26 {
    27     $post_id = get_option( 'oifrontendprofile_page' );
     27
     28$options = get_oifrontendprofile(); // ïðß÷åì àäìèíáàð
     29if( $options[ 'admin_bar_front_off' ] == 1 ){add_filter( 'show_admin_bar' , 'oifrontendprofile_admin_bar');}
     30   
     31function get_oifrontendprofile()
     32{
     33    return json_decode( get_option( 'oifrontendprofile' ), true );
     34}
     35function oifrontendprofile_admin_bar( $content )
     36{
     37    return ( current_user_can( 'administrator' ) ) ? $content : false;
     38}
     39
     40function create_profile_page() // ñîçäàíèå ñòðàíèöû ïðîôèëß
     41{
     42    $options = get_oifrontendprofile();
     43    $post_id = $options[ 'post_id' ];
    2844    if( $post_id == false || get_post_status( $post_id ) <> 'publish' ) // åñëè ñòðàíèöà åùå íå ñîçäàíà èëè íå îïóáëèêîâàíà...
    2945    {
     
    4056
    4157        $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 ñòðàíèöû
    4360    }
    4461}
     
    4663function oifep_styles()
    4764{
    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');}
    4969}
    5070add_action('wp_enqueue_scripts', 'oifep_styles');
    5171
    52 add_action ('init' , 'prevent_profile_access'); // èíèöèàëèçàöèÿ ôóíêöèè ïåðåíàïðàâëåíèÿ
     72add_action ('init' , 'prevent_profile_access'); // èíèöèàëèçàöèß ôóíêöèè ïåðåíàïðàâëåíèß
    5373 
    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; // ôîðìèðóåì àäðåñ ðåäèðåêòà íà ýòó ñòðàíèöó
     74function 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; // ôîðìèðóåì àäðåñ ðåäèðåêòà íà ýòó ñòðàíèöó
    6391        }else
    6492        {
    65             $id = ''; // èíà÷å ðåäèðåêò áóäåò áåç ïàðàìåòðîâ(íà ãëàâíóþ)
    66         }
    67         wp_redirect ( get_bloginfo('url') . $id ); // ðåäèðåêò
     93            $post_id = ''; // èíà÷å ðåäèðåêò áóäåò áåç ïàðàìåòðîâ(íà ãëàâíóþ)
     94        }
     95        wp_redirect ( get_bloginfo( 'url' ) . $post_id ); // ðåäèðåêò
    6896    }
    6997}
     
    167195                    <div class="row">
    168196                        <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'),))?>
    170198                        </div>
    171199                    </div>
     
    217245                        </div>
    218246                    </div>
    219 
     247                   
    220248                    <? do_action( 'show_user_profile', $profileuser ); ?>
    221249                    <div class="row">
     
    237265                    <div class="row">
    238266                        <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),))?>
    240268                            <input type="hidden" name="action" value="update" />
    241269                            <input type="hidden" name="user_id" id="user_id" value="1">
  • oi-frontend-profile/trunk/oi-nput.php

    r995265 r1078628  
    2727        if($placeholder){$placeholder = ' placeholder="'.$placeholder.'"';}
    2828        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>';}
    3030        if($class){$class = ' '.$class;}
    3131        if($style){$style = ' style="'.$style.'"';}
  • oi-frontend-profile/trunk/readme.txt

    r995371 r1078628  
     1=== Oi Frontend Profile ===
     2Contributors: Isaenko Alexei
     3Tags: profile, user, login, page, frontend, front-end
     4Requires at least: 3.2
     5Tested up to: 4.1
     6Stable tag: 1.3
     7License: GPLv2 or later
     8License URI: http://www.gnu.org/licenses/gpl-2.0.html
     9
     10This plugin disallow users going to the backend. They can manage theme prifile on the frontend page.
     11
     12== Description ==
     13
     14This plugin will disallow users manage them  profile on the admin page. They will have to do that on the frontend page.
     15Activate 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
     17You are able to change profile page and hide Admin bar from a frontend.
     18
     19Supported laguages:
     20<ul>
     21<li>English</li>
     22<li>Russian</li>
     23</ul>
     24
     25== Installation ==
     26
     271. Upload `oi-frontend-profile` folder to the `/wp-content/plugins/` directory.
     282. Activate the plugin through the 'Plugins' menu in WordPress.
     29
     30 == Screenshots ==
     31
     321. 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 =
     55Some functions added.=======
    156=== Oi Frontend Profile ===
    257Contributors: Isaenko Alexei
     
    46101
    47102= 1.2 =
    48 Some functions added.
     103Some functions added.>>>>>>> .r1077238
Note: See TracChangeset for help on using the changeset viewer.