Remove Display name

How can to remove Display name field from Registration form How can to remove Display name field from Registration form

 

For Elgg registration action
Open the file

elgg\actions\register.php

And change this code

$name = get_input('name');

With this

$name = get_input('username');

 

Open the file

elgg\views\default\forms\register.php

And change this code

$name = get_input('n');

With this

$name = get_input('u');

And delete this code

<div class="mtm">
<label><?php echo elgg_echo('name'); ?></label><br />
<?php
echo elgg_view('input/text', array(
'name' => 'name',
'value' => $name,
'class' => 'elgg-autofocus',
));
?>
</div>

 

For adding new user action
Open the file

elgg\actions\useradd.php

And change this code

$name = get_input('name');

With this

$name = get_input('username');

 

Open the file

elgg\views\default\forms\useradd.php

And delete this code

<div>
<label><?php echo elgg_echo('name');?></label><br />
<?php
echo elgg_view('input/text', array(
'name' => 'name',
'value' => $name,
));
?>
</div>

 

Remove Display name field from Registration form

Share on Facebook
Share on Twitter




24 Responses to “Remove Display name”

  1. suro says:

    hi

    how to remove " write a blog post " in menu blog and "upload a file" in menu file
    elgg v 1.7.11

    thank's for your help

    • pianist says:

      For Elgg 1.7.x

      Remove write a blog post

      Open the file
      elgg\mod\blog\start.php
      And delete this code
      add_submenu_item(elgg_echo('blog:addpost'),$CONFIG->wwwroot."pg/blog/new/{$page_owner->username}/");

      Remove upload a file

      Open the file
      elgg\mod\file\start.php
      And delete this code
      add_submenu_item(elgg_echo('file:upload'), $CONFIG->wwwroot . "pg/file/new/". $page_owner->username);

      • suro says:

        "write a blog post" has removed but the member stil can write/update/upload their blog artikel.why ?

        thank's

        • pianist says:

          Ahh…
          U need to remove action&case for 'new' page also…

          This full solution for Remove write a blog post for Elgg 1.7.x

          Open the file
          elgg\mod\blog\start.php

          And delete this code
          register_notification_object('object', 'blog', elgg_echo('blog:newpost'));

          Delete this code
          if (can_write_to_container(0, page_owner()) && isloggedin()) add_submenu_item(elgg_echo('blog:addpost'),$CONFIG->wwwroot."pg/blog/new/{$page_owner->username}/");

          Delete this code
          case "new":
          set_input('username', $page[1]);
          include(dirname(__FILE__) . "/add.php");
          break;
          case "edit":
          set_input('blogpost', $page[1]);
          include(dirname(__FILE__) . "/edit.php");
          break;

          And delete this code
          case "new":
          $url = "{$CONFIG->wwwroot}pg/blog/new/{$page[0]}/";
          break;

          Also you need to delete some linka as 'Edit' and 'Delete':

          Open the file
          elgg\mod\blog\views\default\object\blog.php

          And delete this code
          <p class="options">
          <?php
          if ($canedit) {
          ?>
          <a href="<?php echo $vars['url']; ?>pg/blog/edit/<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("edit"); ?></a>  
          <?php
          echo elgg_view("output/confirmlink", array(
          'href' => $vars['url'] . "action/blog/delete?blogpost=" . $vars['entity']->getGUID(),
          'text' => elgg_echo('delete'),
          'confirm' => elgg_echo('deleteconfirm'),
          ));
          // Allow the menu to be extended
          echo elgg_view("editmenu",array('entity' => $vars['entity']));
          ?>
          <?php
          }
          ?>
          </p>

          ————
          Now all OK ;)

  2. suro says:

    thank,s
    for remove upload a file not work.if i remove that code,in my web site show..

    Parse error: syntax error, unexpected '}' in ………../public_html/mod/file/start.php on line 104

    • pianist says:

      As in the previous post, you need a little more code changes ;)

      Open the file
      elgg\mod\file\start.php

      And delete this code
      if (can_write_to_container($_SESSION['guid'], page_owner()) && isloggedin())
      add_submenu_item(elgg_echo('file:upload'), $CONFIG->wwwroot . "pg/file/new/". $page_owner->username);

      Delete this code
      case "new":
      set_input('username', $page[1]);
      require($CONFIG->pluginspath . "file/upload.php");
      break;

      Delete this code
      case "new":
      $url = "{$CONFIG->wwwroot}pg/file/new/{$page[0]}/";
      break;

      And delete this code
      register_action("file/upload", false, $CONFIG->pluginspath . "file/actions/upload.php");

      Read also about 'How can to disallow notification about file uploading': http://elgghacks.com/disallow-notification-about-file-uploading

      And 'How to remove the message about file uploading from Riverdashboard': http://elgghacks.com/remove-the-message-about-file-uploading/

      —————-
      Remember! If you'll to disable files uploading, you must to disable Embed plugin also. There may be problems!

  3. David says:

    How can i add user's "black list"???

  4. David says:

    can i remove Subject from messages

  5. ura soul says:

    so these changes can stop elgg asking for a display name on registration..
    what effect does this have on the way the site functions?
    does the display name get replaced with username in every way possible? e.g. on the right click – hover menu for each member?
    thanks

    • pianist says:

      In first, need to restrict the creating/editing 'Display name' for users

      Open the file
      elgg\views\default\forms\profile\edit.php

      And delete this code
      <div>
      <label><?php echo elgg_echo('user:name:label'); ?></label>
      <?php echo elgg_view('input/text', array('name' => 'name', 'value' => $vars['entity']->name)); ?>
      </div>

      Next, need to replace $name with $username in user_hover_menu

      Open the file
      elgg\views\default\navigation\menu\user_hover.php

      And edit this code
      $name_link = elgg_view('output/url', array(
      'href' => $user->getURL(),
      'text' => "<span class=\"elgg-heading-basic\">$user->name</span>@$user->username",
      'is_trusted' => true,
      ));

      With this code
      $name_link = elgg_view('output/url', array(
      'href' => $user->getURL(),
      'text' => "<span class=\"elgg-heading-basic\">@$user->username</span>",
      'is_trusted' => true,
      ));

Leave a Reply



Similar Elgg Hacks