WordPress.org

Plugin Directory

Changeset 344317


Ignore:
Timestamp:
02/11/11 21:01:44 (3 years ago)
Author:
MrWiblog
Message:

Made the plugin compatible with standard WordPress (which can be used by BuddyPress)

Location:
personal-welcome/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • personal-welcome/trunk/personal_welcome.php

    r262476 r344317  
    33Plugin Name: Personal Welcome 
    44Plugin URI: http://www.stillbreathing.co.uk/wordpress/personal-welcome/ 
    5 Description: A plugin for Wordpress MU/MultiSite/BuddyPress which allows you to create and send personal welcome messages to new users 
    6 Version: 0.3.3 
     5Description: A plugin for Wordpress/MultiSite/BuddyPress which allows you to create and send personal welcome messages to new users 
     6Version: 0.3.4 
    77Author: Chris Taylor 
    88Author URI: http://www.stillbreathing.co.uk 
     
    3636{ 
    3737    if (version_compare(get_bloginfo('version'), "3") >= 0) { 
    38         if ( is_super_admin() ) { 
     38        if ( defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE && is_super_admin() ) { 
    3939            add_submenu_page('ms-admin.php', __("Personal Welcomes"), __("Personal Welcomes"), 'edit_users', 'personalwelcome', 'personalwelcome'); 
     40        } else { 
     41            if ( current_user_can( 'edit_users' ) ) { 
     42                add_submenu_page('users.php', __("Personal Welcomes"), __("Personal Welcomes"), 'edit_users', 'personalwelcome', 'personalwelcome'); 
     43            } 
    4044        } 
    4145    } else { 
    4246        if ( is_site_admin() ) { 
    4347            add_submenu_page('wpmu-admin.php', __("Personal Welcomes"), __("Personal Welcomes"), 'edit_users', 'personalwelcome', 'personalwelcome'); 
     48        } 
     49    } 
     50} 
     51 
     52// get the host page  
     53function personalwelcome_host_page() { 
     54    if (version_compare(get_bloginfo('version'), "3") >= 0) { 
     55        if ( defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE && is_super_admin() ) { 
     56            return 'ms-admin.php'; 
     57        } else { 
     58            if ( current_user_can( 'edit_users' ) ) { 
     59                return 'ms-admin.php'; 
     60            } 
     61        } 
     62    } else { 
     63        if ( is_site_admin() ) { 
     64            return 'users.php'; 
    4465        } 
    4566    } 
     
    81102    } 
    82103     
    83     $wpmums = "wpmu"; 
    84     if (version_compare(get_bloginfo('version'), "3") >= 0) { 
    85         $wpmums = "ms"; 
    86     } 
    87      
    88104    if (!isset($_GET["send"]) || $_GET["send"] == "") 
    89105    { 
     
    92108        <h2>' . __("Personal welcomes") . '</h2> 
    93109         
    94             <form action="' . $wpmums . '-admin.php?page=personalwelcome" method="post"> 
     110            <form action="' . personalwelcome_host_page() . '?page=personalwelcome" method="post"> 
    95111            <p><label for="personalwelcome_q">' . __("Search for a user") . '</label> 
    96112            <input type="text" name="personalwelcome_q" id="personalwelcome_q" /></p> 
     
    150166             
    151167                echo ' 
    152                 <form action="' . $wpmums . '-admin.php?page=personalwelcome" method="post"> 
     168                <form action="' . personalwelcome_host_page() . '?page=personalwelcome" method="post"> 
    153169                <p><label for="bulkset">' . __("Set all users as personally welcomed") . '</label> 
    154170                <input type="submit" name="bulkset" id="bulkset" class="button" value="' . __("Bulk set users") . '" /></p> 
     
    187203                echo ' 
    188204                <tr> 
    189                     <td><a href="' . $wpmums . '-admin.php?page=personalwelcome&amp;send=' . $user->id . '">' . $user->user_login . '</a></td> 
     205                    <td><a href="' . personalwelcome_host_page() . '?page=personalwelcome&amp;send=' . $user->id . '">' . $user->user_login . '</a></td> 
    190206                    <td>' . $user->user_nicename . '</td> 
    191207                    <td>' . $user->display_name . '</td> 
     
    225241                    <td> 
    226242                        <ul> 
    227                             <li><a href="' . $wpmums . '-admin.php?page=personalwelcome&amp;spamuser=' . urlencode($user->user_email) . '" class="button">'.__("Spam user").'</a></li> 
    228                             <li><a href="' . $wpmums . '-admin.php?page=personalwelcome&amp;spamuser=' . urlencode($user->user_email) . '&amp;spamblogs='.$blogids.'" class="button">'.__("Spam user and blogs").'</a></li> 
     243                            <li><a href="' . personalwelcome_host_page() . '?page=personalwelcome&amp;spamuser=' . urlencode($user->user_email) . '" class="button">'.__("Spam user").'</a></li> 
     244                            <li><a href="' . personalwelcome_host_page() . '?page=personalwelcome&amp;spamuser=' . urlencode($user->user_email) . '&amp;spamblogs='.$blogids.'" class="button">'.__("Spam user and blogs").'</a></li> 
    229245                        </ul> 
    230246                    </td> 
     
    314330             
    315331            echo ' 
    316             <form action="' . $wpmums . '-admin.php?page=personalwelcome#templates" method="post"> 
     332            <form action="' . personalwelcome_host_page() . '?page=personalwelcome#templates" method="post"> 
    317333            '; 
    318334         
     
    354370        echo ' 
    355371            <h3>' . __("Add a new template") . '</h3> 
    356             <form action="' . $wpmums . '-admin.php?page=personalwelcome#templates" method="post"> 
     372            <form action="' . personalwelcome_host_page() . '?page=personalwelcome#templates" method="post"> 
    357373            <p><label for="subject">' . __("Subject") . '</label> 
    358374            <input type="text" name="subject" id="subject" value="" class="text" /></p> 
     
    388404                 
    389405                    echo ' 
    390                     <form action="' . $wpmums . '-admin.php?page=personalwelcome&amp;send=' . $user->id . '" method="post"> 
     406                    <form action="' . personalwelcome_host_page() . '?page=personalwelcome&amp;send=' . $user->id . '" method="post"> 
    391407                    <p>' . __("Choose a template to use") . ':</p> 
    392408                    <p><label for="templatenumber">' . __("Template") . '</label> 
     
    415431                 
    416432                    echo ' 
    417                     <div class="error"><p>' . __("You do not have any templates") . '. <a href="' . $wpmums . '-admin.php?page=personalwelcome">' . __("Please add one here") . '</a>.</p></div> 
     433                    <div class="error"><p>' . __("You do not have any templates") . '. <a href="' . personalwelcome_host_page() . '?page=personalwelcome">' . __("Please add one here") . '</a>.</p></div> 
    418434                    '; 
    419435                 
     
    436452                echo ' 
    437453                <h3>Send a message</h3> 
    438                 <form action="' . $wpmums . '-admin.php?page=personalwelcome&amp;send=' . $user->id . '" method="post"> 
     454                <form action="' . personalwelcome_host_page() . '?page=personalwelcome&amp;send=' . $user->id . '" method="post"> 
    439455                <p><label for="subject">' . __("Subject") . '</label> 
    440456                <input type="text" name="subject" id="subject" value="' . personalinvite_prepare($user, stripslashes($template["subject"])) . '" class="text" /></p> 
  • personal-welcome/trunk/readme.txt

    r262476 r344317  
    55Requires at least: 2.7 
    66Tested up to: 3.0 
    7 Stable tag: 0.3.3 
     7Stable tag: 0.3.4 
    88 
    9 Personal Welcome is a Wordpress MU plugin that allows site administrators to create and send personalised welcome messages to new users. 
     9Personal Welcome is a Wordpress plugin that allows site administrators to create and send personalised welcome messages to new users. 
    1010 
    1111== Description == 
    1212 
    13 Personal welcome is a Wordpress MU/MultiSite/BuddyPress plugin that lists newly registered users, and allows site administrators to send them a personalised welcome message. The welcome messages are based on templates which you can write yourself (as many templates as you like). Once a message is sent that user won't appear again. 
     13Personal welcome is a Wordpress/MultiSite/BuddyPress plugin that lists newly registered users, and allows site administrators to send them a personalised welcome message. The welcome messages are based on templates which you can write yourself (as many templates as you like). Once a message is sent that user won't appear again. 
    1414 
    1515There are four extra management features: 
     
    2626== Installation == 
    2727 
    28 The plugin should be placed in your /wp-content/mu-plugins/ directory (*not* /wp-content/plugins/) and requires no activation. 
     28The plugin hould be installed from the WordPress plugin repository and activated. The menu item will then appear under "Super Admin" menu when using MultiSite, and under the "Users" menu when uing standard WordPress. 
    2929 
    3030== Frequently Asked Questions == 
     
    3232= Why did you write this plugin? = 
    3333 
    34 To scratch my own itch when developing [BeatsBase.com](http://beatsbase.com "Free mix hosting for DJs") and [Wibsite.com](http://wibsite.com "The worlds most popular Wibsite"). Hopefully this plugin helps other developers too. 
     34To scratch my own itch when developing [BeatsBase.co.uk](http://beatsbase.co.uk "Free mix hosting for DJs") and [Wibsite.com](http://wibsite.com "The worlds most popular Wibsite"). Hopefully this plugin helps other developers too. 
    3535 
    3636== Screenshots == 
     
    4040 
    4141== Changelog == 
     42 
     43= 0.3.4 (2011/02/11) = 
     44 
     45Made the plugin compatible with standard WordPress (which can be used by BuddyPress) 
    4246 
    4347= 0.3.3 = 
Note: See TracChangeset for help on using the changeset viewer.