Exemple #1
0
function myprofile_bundles()
{
    /* if you create a new bundle, register it in here, so it receives the plugin's routines */
    return array("essence" => MyProfileEssence::get_instance(), "comments" => MyProfileComments::get_instance(), "buddylist" => MyProfileBuddyList::get_instance(), "referredby" => MyProfileReferredBy::get_instance(), "visitors" => MyProfileVisitors::get_instance(), "permissions" => MyProfilePermissions::get_instance());
}
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE. 
 */
// Disallow direct access to this file for security reasons
if (!defined("IN_MYBB")) {
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
/* cache template */
if (defined('THIS_SCRIPT') && THIS_SCRIPT == "member.php") {
    global $templatelist;
    $templatelist .= ",myprofile_referredby";
}
/* load template */
$plugins->add_hook("member_profile_end", array(MyProfileReferredBy::get_instance(), "member_profile_end"));
class MyProfileReferredBy
{
    private static $instance = null;
    public function install()
    {
        global $db, $lang;
        MyProfileUtils::lang_load_config_myprofile();
        $gid = MyProfileUtils::insert_settinggroups(array("name" => "myprofilereferredby", "title" => $lang->mp_myprofile_referredby, "description" => $lang->mp_myprofile_referredby_desc, "isdefault" => 0));
        MyProfileUtils::insert_settings(array(array("name" => "mpreferredbyenabled", "title" => $lang->mp_myprofile_referredby_enabled, "description" => $lang->mp_myprofile_referredby_enabled_desc, "optionscode" => "yesno", "value" => 1, "gid" => $gid)));
    }
    public function is_installed()
    {
        global $settings;
        return isset($settings['mpreferredbyenabled']);
    }