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 install()
 {
     global $db, $lang;
     MyProfileUtils::lang_load_config_myprofile();
     if (!$db->field_exists("myprofilepermissions", "users")) {
         $definition = $db->type == 'pgsql' ? 'smallint' : 'tinyint(1)';
         $db->add_column("users", "myprofilepermissions", "{$definition} NOT NULL default '0'");
     }
     $gid = MyProfileUtils::insert_settinggroups(array("name" => "myprofilepermissions", "title" => $lang->mp_myprofile_permissions, "description" => $lang->mp_myprofile_permissions_desc, "isdefault" => 0));
     MyProfileUtils::insert_settings(array(array("name" => "mppermissionsenabled", "title" => $lang->mp_myprofile_permissions_enabled, "description" => $lang->mp_myprofile_permissions_enabled_desc, "optionscode" => "yesno", "value" => 1, "gid" => $gid), array("name" => "mppermissionsgroups", "title" => $lang->mp_myprofile_permissions_groups, "description" => $lang->mp_myprofile_permissions_groups_desc, "optionscode" => "groupselect", "value" => -1, "gid" => $gid)));
 }
 public function install()
 {
     global $lang;
     MyProfileUtils::lang_load_config_myprofile();
     $settinggroups = array("name" => "myprofilebuddylist", "title" => $lang->mp_myprofile_buddylist, "description" => $lang->mp_myprofile_buddylist_desc, "isdefault" => 0);
     $gid = MyProfileUtils::insert_settinggroups($settinggroups);
     $settings[] = array("name" => "mpbuddylistenabled", "title" => $lang->mp_myprofile_buddylist_enabled, "description" => $lang->mp_myprofile_buddylist_enabled_desc, "optionscode" => "yesno", "value" => "1", "gid" => $gid);
     $settings[] = array("name" => "mpbuddylistrecord", "title" => $lang->mp_myprofile_buddylist_record, "description" => $lang->mp_myprofile_buddylist_record_desc, "optionscode" => "select\n4=4\n8=8\n12=12\n16=16\n20=20\n24=24\n40=40\n80=80\n100=100", "value" => "4", "gid" => $gid);
     $settings[] = array("name" => "mpbuddylistavatarmaxdimensions", "title" => $lang->mp_myprofile_buddylist_avatar_max_dimensions, "description" => $lang->mp_myprofile_buddylist_avatar_max_dimensions_desc, "optionscode" => "text", "value" => "100x100", "gid" => $gid);
     MyProfileUtils::insert_settings($settings);
 }
 public function install()
 {
     global $db, $lang;
     MyProfileUtils::lang_load_config_myprofile();
     $tables = array();
     $collation = $db->build_create_table_collation();
     if (!$db->table_exists("myprofilevisitors")) {
         $tables[] = "CREATE TABLE " . TABLE_PREFIX . "myprofilevisitors (\n\t\t\t\t`vid` int unsigned NOT NULL auto_increment,\n\t\t\t\t`uid` int unsigned NOT NULL,\n\t\t\t\t`vuid` int unsigned NOT NULL,\n\t\t\t\t`time` varchar(10) NOT NULL,\n\t\t\t\tPRIMARY KEY (`vid`)\n\t\t\t) ENGINE=MyISAM{$collation}";
     }
     foreach ($tables as $table) {
         $db->write_query($table);
     }
     // Modify the users table
     if (!$db->field_exists("viewcount", "users")) {
         $db->add_column("users", "viewcount", "int unsigned DEFAULT 0");
     }
     $settinggroups = array("name" => "myprofilevisitors", "title" => $lang->mp_myprofile_visitors, "description" => $lang->mp_myprofile_visitors_desc, "isdefault" => 0);
     $gid = MyProfileUtils::insert_settinggroups($settinggroups);
     $settings[] = array("name" => "mpvisitorsenabled", "title" => $lang->mp_myprofile_visitors_enabled, "description" => $lang->mp_myprofile_visitors_enabled_desc, "optionscode" => "yesno", "value" => "1", "gid" => $gid);
     $settings[] = array("name" => "mpvisitorsrecord", "title" => $lang->mp_myprofile_visitors_record, "description" => $lang->mp_myprofile_visitors_record_desc, "optionscode" => "select\n5=5\n10=10\n15=15\n20=20\n30=30\n50=50\n100=100", "value" => "10", "gid" => $gid);
     $settings[] = array("name" => "mpprofileviewsenabled", "title" => $lang->mp_myprofile_views_enabled, "description" => $lang->mp_myprofile_views_enabled_desc, "optionscode" => "yesno", "value" => 1, "gid" => $gid);
     MyProfileUtils::insert_settings($settings);
 }
 public function admin_formcontainer_end()
 {
     global $run_module, $form_container, $lang, $form, $mybb, $usergroup;
     if ($run_module == "user" && !empty($form_container->_title) && !empty($lang->users_permissions) && $form_container->_title == $lang->users_permissions) {
         MyProfileUtils::lang_load_config_myprofile();
         $mp_options = array();
         $mp_options[] = $form->generate_check_box("canmanagecomments", 1, $lang->mp_options_can_manage_comments, array('checked' => $mybb->input["canmanagecomments"]));
         $mp_options[] = $form->generate_check_box("cansendcomments", 1, $lang->mp_options_can_send_comments, array('checked' => $mybb->input["cansendcomments"]));
         $mp_options[] = $form->generate_check_box("caneditowncomments", 1, $lang->mp_options_can_edit_own_comments, array('checked' => $mybb->input["caneditowncomments"]));
         $mp_options[] = $form->generate_check_box("candeleteowncomments", 1, $lang->mp_options_can_delete_own_comments, array('checked' => $mybb->input["candeleteowncomments"]));
         $mp_options[] = $lang->mp_options_comments_per_day . "<br />" . $form->generate_text_box("commentsperday", $usergroup['commentsperday']);
         $form_container->output_row($lang->mp_myprofile, '', '<div class="group_settings_bit">' . implode('</div><div class="group_settings_bit">', $mp_options) . '</div>');
     }
 }