Add link to Profile

How can to add link to Owner block menu of User's Profile for Elgg 1.8 

How can to add link to Owner block menu of User's Profile for Elgg 1.8

For Photos  (TidyPics Elgg 1.8 plugin)
Open the file

elgg\mod\tidypics\start.php

And add this code

elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'tidypics_owner_block_menu');
function tidypics_owner_block_menu($hook, $type, $return, $params) {
if (elgg_instanceof($params['entity'], 'user')) {
$url = "photos/owner/{$params['entity']->username}";
$item = new ElggMenuItem('tidypics', elgg_echo('photos'), $url);
$return[] = $item;
} else {
if ($params['entity']->tidypics_enable != 'no') {
$url = "photos/group/{$params['entity']->guid}/all";
$item = new ElggMenuItem('tidypics', elgg_echo('album:group'), $url);
$return[] = $item;
}
}

return $return;
}

Link to Owner block menu of User's Profile for Elgg 1.8

Share on Facebook
Share on Twitter




14 Responses to “Add link to Profile”

  1. OliverMD says:

    There is a bug in it

    $url = "photos/owned/{$params['entity']->username}";

    right is

    $url = "photos/owner/{$params['entity']->username}";

    best regards from germany

  2. Nudeler says:

    Hi,

    does this work in elgg 1.8.1, too?

  3. Nudeler says:

    It refuses to work :)

    Where have I to place it in the start.php?

  4. Nudeler says:

    Sorry, it works well!

  5. Nudeler says:

    THANKS!

  6. devil says:

    its help full

  7. Enrique says:

    Hi, how can i get that this link redirect to an action?

    • pianist says:

      Need to set and\or extract 'action' section from 'user_hover_menu'

      Here example for Upload a file

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

      After this code
      elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'file_owner_block_menu');

      Add this code
      elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'file_user_hover_menu');

      And add a new code in the end of this file
      function file_user_hover_menu($hook, $type, $return, $params) {
      $entity = $params['entity'];
      $url = "file/add/$entity->guid";
      if (elgg_is_logged_in()) {
      $item = new ElggMenuItem(
      'file',
      elgg_echo('file:upload'),
      $url);
      $item->setSection('action');
      $return[] = $item;
      }

      return $return;
      }

  8. David says:

    please help me to find any plugin or way to zoom user profile icon from "large" to "master" (when clicked)

    • pianist says:

      just JS hook.

      This js zoom-code:
      function() {
      if ($("a[class^='zoom']").length) {
      $("a[class^='zoom']").fancybox({'type': 'image'});
      }
      }
      Now need provide this init. Then register and load js\css files.
      Next step is an adding a link_class to the users' profile img_url.

      Just few hours with HaPPy ElGg CoDiNg ;)

      BTW,
      Simple plugin 'How-to AJAXify Elgg' is a Custom PopUp by Alex Falk (download here: http://weborganizm.org/sfera/v/65/elgg-customizations).
      Example mod with JS\Elgg tutorial.

Leave a Reply



Similar Elgg Hacks