Plugin Directory

Changeset 686520


Ignore:
Timestamp:
03/24/2013 06:49:30 AM (13 years ago)
Author:
afsalrahim
Message:

Uploading version 2.0 files

Location:
my-wp-login-logo/trunk
Files:
16 added
4 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • my-wp-login-logo/trunk/dc-custom-login-logo.php

    r655775 r686520  
    44Plugin URI: http://digitcodes.com
    55Description: My Wordpress Login Logo lets you to add a custom logo in your wordpress login page instead of the usual wordpress logo.
    6 Version: 1.1
     6Version: 2.0
    77Author: Afsal Rahim
    88Author URI: http://afsalrahim.tk
    99*/
    1010
    11 function DC_MyWP_login_logo() {
    12     $custom_logo_url = get_option('wp_custom_login_logo_url',plugins_url('images/mylogo.png', __FILE__));
    13     $custom_logo_height = get_option('wp_custom_login_logo_height','70');
    14     $custom_logo_width = get_option('wp_custom_login_logo_width','320');
     11if ( !defined( 'DC_MyWP_LoginLogo_URL' ) )
     12    define( 'DC_MyWP_LoginLogo_URL', plugin_dir_url( __FILE__ ) );
     13if ( !defined( 'DC_MyWP_LoginLogo_PATH' ) )
     14    define( 'DC_MyWP_LoginLogo_PATH', plugin_dir_path( __FILE__ ) );
    1515   
    16     echo '<style type="text/css">
    17     .login h1 a { background-image:url('.$custom_logo_url.') !important; background-size:'.$custom_logo_width.'px '.$custom_logo_height .'px; height:'.$custom_logo_height .'px; width:'.$custom_logo_width.'px;}
    18     #login {width:'.$custom_logo_width.'px;}
    19     </style>';
     16class DC_MyWP_LoginLogo {
     17
     18    function __construct() {
     19        add_action('login_head', array( $this, 'DC_MyWP_login_logo'));
     20        add_action('login_head', array( $this, 'DC_MyWP_login_fadein'));
     21        add_action('login_form', array( $this, 'DC_MyWP_login_form_message'));
     22        add_action('admin_menu', array( $this, 'DC_MyWP_login_logo_actions')); 
     23
     24        add_filter('login_headerurl', array( $this, 'DC_MyWP_login_url'));
     25        add_filter("login_headertitle", array( $this, 'DC_MyWP_login_title'));
     26    }
     27
     28    function DC_MyWP_login_logo() {
     29        include_once( DC_MyWP_LoginLogo_PATH . '/core/custom-styles.php' );
     30    }
     31
     32    function DC_MyWP_login_url() {
     33        $custom_login_url = get_option('wp_custom_login_url',home_url());
     34        return $custom_login_url;
     35    }
     36
     37    function DC_MyWP_login_title() {
     38        $custom_login_title = get_option('wp_custom_login_title',get_bloginfo('description'));
     39        return $custom_login_title;
     40    }
     41
     42    function DC_MyWP_login_fadein() {
     43        include_once( DC_MyWP_LoginLogo_PATH . '/core/custom-js.php' );
     44    }
     45   
     46    function DC_MyWP_login_form_message() {
     47        $custom_logo_message = get_option('wp_custom_login_logo_message','');
     48        if($custom_logo_message != '') {
     49        echo '<p>'.$custom_logo_message.'</p><br/>';
     50        }
     51    }
     52
     53    function DC_MyWP_login_logo_options() {
     54        require( DC_MyWP_LoginLogo_PATH . '/views/dashboard.php' );
     55     }
     56
     57    function DC_MyWP_login_logo_actions() { 
     58        add_menu_page( 'My Wordpress Login Logo Options' , 'My Wordpress Login Logo', 'manage_options', 'DC_MyWP_login_logo_dashboard', array( $this, 'DC_MyWP_login_logo_options' ), DC_MyWP_LoginLogo_URL.'images/digitcodes-icon.png' );
     59    }
     60 
    2061}
    21 
    22 function DC_MyWP_login_url() {
    23     $custom_login_url = get_option('wp_custom_login_url',home_url());
    24     return $custom_login_url;
    25 }
    26 
    27 function DC_MyWP_login_title() {
    28     $custom_login_title = get_option('wp_custom_login_title',get_bloginfo('description'));
    29     return $custom_login_title;
    30 }
    31 
    32 add_action('login_head', 'DC_MyWP_login_logo');
    33 add_filter('login_headerurl', 'DC_MyWP_login_url');
    34 add_filter("login_headertitle", 'DC_MyWP_login_title');
    35 
    36 
    37 function DC_MyWP_login_logo_options() {
    38     if (!current_user_can('manage_options')) {
    39         wp_die('You do not have sufficient permissions to access this page.');
    40     }
    41 
    42     wp_register_style( 'DC_MyWP_login_logo_Styles', plugins_url('styles.css', __FILE__) );
    43     wp_enqueue_style( 'DC_MyWP_login_logo_Styles' );
    44    
    45     global $current_user;
    46     get_currentuserinfo();
    47    
    48     if($_POST['update_MyWP_login_logo'] == 'update') {
    49         $custom_logo_url = $_POST['wp_custom_login_logo_url'];
    50         update_option('wp_custom_login_logo_url', $custom_logo_url);
    51         $custom_logo_height = $_POST['wp_custom_login_logo_height'];
    52         update_option('wp_custom_login_logo_height', $custom_logo_height);
    53         $custom_logo_width = $_POST['wp_custom_login_logo_width'];
    54         update_option('wp_custom_login_logo_width', $custom_logo_width);
    55         $custom_login_title = $_POST['wp_custom_login_title'];
    56         update_option('wp_custom_login_title', $custom_login_title);
    57         $custom_login_url = $_POST['wp_custom_login_url'];
    58         update_option('wp_custom_login_url', $custom_login_url);
    59 
     62$MyWordpressLoginLogo = new DC_MyWP_LoginLogo();
    6063?>
    61         <div class="updated"><p><strong><?php _e('Login Page Logo Updated.' ); ?></strong></p></div>
    62 <?php
    63     } else {
    64     $custom_logo_url = get_option('wp_custom_login_logo_url',plugins_url('images/mylogo.png', __FILE__));
    65     $custom_logo_height = get_option('wp_custom_login_logo_height','70');
    66     $custom_logo_width = get_option('wp_custom_login_logo_width','320');
    67     $custom_login_title = get_option('wp_custom_login_title',get_bloginfo('description'));
    68     $custom_login_url = get_option('wp_custom_login_url',home_url());
    69     }
    70 ?>
    71 <div class="wrap columns-2 dd-wrap">
    72     <h2><img src="<?php echo plugins_url('images/plugin_header_logo.png', __FILE__); ?>" alt="My Wordpress Login Logo" /></h2>
    73     <p>by <strong>Afsal Rahim</strong> from <strong><a title="DigitCodes.com" href="http://digitcodes.com">digitcodes.com</a></strong></p>
    74            
    75     <div class="metabox-holder has-right-sidebar" id="poststuff">
    76            
    77         <div class="inner-sidebar" id="side-info-column">
    78                    
    79             <div class="postbox">
    80             <div id="sidebar-subscribe-box"><div class="sidebar-subscribe-box-wrapper"><p>GET MORE FREE WP plugins &amp; wordpress tips &amp; Tricks. Subscribe to our Free newsletter!</p><div class="sidebar-subscribe-box-form">
    81                                 <form action="http://feedburner.google.com/fb/a/mailverify" class="sidebar-subscribe-box-form" method="post" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=digitcodes', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true" target="popupwindow">
    82                                 <input type="hidden" name="uri" value="digitcodes" />
    83                                 <input type="hidden" name="loc" value="en_US" />
    84                                 <input placeholder="<?php echo  $current_user->user_email; ?>" value="<?php echo  $current_user->user_email; ?>" autocomplete="off" name="email" class="sidebar-subscribe-box-email-field" />
    85                                 <input type="submit" class="sidebar-subscribe-box-email-button" style="background:none repeat scroll 0 0 #0099FF;color:#fff;border:1px solid #007FFF;" title="" value="Subscribe Now!" /><br/> <br/>
    86                                 </form>
    87             </div></div></div>
    88             </div>
    89 
    90             <div class="postbox">
    91                 <h3>Plugin Info</h3>
    92                 <div class="inside">
    93                     <p><b>My Wordpress Login Logo</b> lets you to add a custom logo in your wordpress login page instead of the usual wordpress logo.</p><p> It also allows you to specify the height and width of the logo. By adding your custom logo in your login page, you can make your website more proffesional and also impress the guest bloggers and other users who view these pages.</p>
    94                     <p>I hope you enjoyed the plugin. Don't forget to rate us!</p>
    95                     <h4>Please Like & Follow. :)</h4>
    96                         <p><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDigitcodes%2F214280698706689&amp;send=false&amp;layout=button_count&amp;width=180&amp;show_faces=false&amp;font=verdana&amp;colorscheme=light&amp;action=like&amp;height=21&amp;appId=382980691790038" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:21px;" allowTransparency="true"></iframe>
    97                
    98                         <a href="https://twitter.com/afsalrahim" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false">Follow @afsalrahim</a>
    99                         <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    100                         </p>
    101 
    102                 </div>
    103             </div>             
    104            
    105 
    106            
    107             <div class="postbox">
    108                 <div class="inside">
    109                 <p class="description">
    110                 For more help <a href="mailto:[email protected]">email me</a>.
    111                 </p>
    112                 </div>
    113             </div>
    114            
    115         </div> 
    116            
    117            
    118         <div id="post-body">
    119         <div id="post-body-content">
    120        
    121                 <div class="stuffbox">
    122                 <h3>Your Current Login Page Logo</h3>
    123                 <div class="inside">
    124                 <p class="description"><img src="<?php echo $custom_logo_url; ?>" alt="" /></p>
    125                 </div>
    126                 </div>
    127                
    128                
    129                 <div class="stuffbox">
    130                 <h3>Update or Change Logo</h3>
    131                 <div class="inside">
    132                 <form name="DC_MyWP_login_logo_form" method="post" action="">
    133                 <input type="hidden" name="update_MyWP_login_logo" value="update">
    134                 <p>Logo URL : <input type="text" name="wp_custom_login_logo_url" value="<?php echo $custom_logo_url; ?>" size="70"><br/>
    135                 <span class="description">Example: <code>http://yoursite.com/wp-content/uploads/2013/01/logo.png</code></span></p>
    136                 <p>Width: <input type="text" name="wp_custom_login_logo_width" value="<?php echo $custom_logo_width; ?>" size="5">px</p>
    137                 <p>Height: <input type="text" name="wp_custom_login_logo_height" value="<?php echo $custom_logo_height; ?>" size="5">px</p>
    138                 <br/>
    139                 <p>Homepage Logo Link : <input type="text" name="wp_custom_login_url" value="<?php echo $custom_login_url; ?>" size="70"><br/>
    140                 <span class="description">This is the url opened when clicked on the logo in your login page.</p>
    141                 <p>Title : <input type="text" name="wp_custom_login_title" value="<?php echo $custom_login_title; ?>" size="40"></p>
    142                 <input type="submit" class="button-primary" name="Submit" value="Update" />
    143                 </form>
    144                 </div>
    145                 </div>
    146                
    147                
    148             <div class="postbox">
    149                 <h3>Help & FAQ</h3>
    150                 <div class="inside">
    151                     <p><h4>Q1. How does it Works?</h4>
    152                     [-] Upload your desired logo using the WordPress media uploader or  <a href="media-new.php">click here</a><br/>
    153                     [-] Copy the uploaded image's File URL path and input it in the Logo URL field.<br/>
    154                     [-] That's it! You can now logout and check your <code>yousite.com/wp-admin/</code> page to see the changes.
    155                     </p>
    156                     <p><h4>Q2. How to change the logo size?</h4>
    157                     Simply input your desired logo height and width in the given fields to change the displayed logo size.</p>
    158                     <p><h4>Q3. What is the recommened logo size?</h4>
    159                     Less than or equal to 320px width and 70px height is the recommended logo size for your Wordpress Login Page.</p>
    160                 </div>
    161             </div>     
    162            
    163         </div>
    164         </div>
    165 
    166 </div>
    167 <?php
    168  }
    169 
    170 function DC_MyWP_login_logo_actions() { 
    171     add_options_page('My Wordpress Login Logo Options', 'My Wordpress Login Logo', 'manage_options', 'DC_MyWP_login_logo_options', 'DC_MyWP_login_logo_options'); 
    172 
    173 
    174 add_action('admin_menu', 'DC_MyWP_login_logo_actions'); 
    175 ?>
  • my-wp-login-logo/trunk/readme.txt

    r655795 r686520  
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 My Wordpress Login Logo lets you to add a custom logo in your wordpress login page instead of the usual wordpress logo.
     11My Wordpress Login Logo lets you to add a custom logo in your wordpress login page instead of the usual wordpress logo and customize your login page.
    1212
    1313== Description ==
    14 **My Wordpress Login Logo** lets you to add a custom logo in your wordpress login page instead of the usual wordpress logo.
     14**My Wordpress Login Logo** lets you to add a custom logo in your wordpress login page instead of the usual wordpress logo and customize your login page.
    1515
    16 It also allows you to specify the height and width of the logo. By adding your custom logo in your login page, you can make your website more professional and also impress the guest bloggers and other users who view these pages.
     16It also allows you to specify the height and width of the logo. Apart from that you can also customize the login form by adding a custom message below login form and also provide some cool fade in effects for the login form. By adding your custom logo in your login page, you can make your website more professional and also impress the guest bloggers and other users who view these pages.
    1717
    1818
    19 Goto **Settings > My Wordpress Login Logo** to change the logo and its size.
    20 
    21 Read More about: [Why you need to customize the Wordpress Login Scrren](http://digitcodes.com/how-to-add-your-custom-logo-to-wordpress-login-screen/ "How to Add Your Custom Logo to Wordpress Login Screen").
    2219
    2320== Installation ==
     
    27242. Activate the plugin through the 'Plugins' menu in WordPress
    28253. Upload your desired logo using the WordPress media uploader and copy the uploaded image's File URL path.
    29 4. Now goto Settings > My Wordpress Login Logo and paste the uploaded image's File URL path in the Logo URL field.
     264. Click the My Wordpress Login Logo and paste the uploaded image's File URL path in the Logo URL field provided.
    30275. That's it! You can now logout and check your yousite.com/wp-admin/ or yousite.com/wp-login/ page to see the changes.
    3128
     
    4744
    4845== Changelog ==
     46= 2.0 =
     47* Add Custom Message below Login Form feature added.
     48* Customize Login Form using a Fade In effect.
     49* CSS Fix for smaller size logo images. Thanks to Valentins Ivanovs for the css fix.
     50
    4951= 1.1 =
    50 * Implemented the option to edit the logo link
     52* Implemented the option to edit the image link
Note: See TracChangeset for help on using the changeset viewer.