Add link to Profile
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;
}





There is a bug in it
$url = "photos/owned/{$params['entity']->username}";
right is
$url = "photos/owner/{$params['entity']->username}";
best regards from germany
Thanks for your debugging
Hi,
does this work in elgg 1.8.1, too?
Sure. For all version Elgg 1.8.x
It refuses to work
Where have I to place it in the start.php?
Sorry, it works well!
THANKS!
okay
its help full
Hi, how can i get that this link redirect to an action?
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;
}
please help me to find any plugin or way to zoom user profile icon from "large" to "master" (when clicked)
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.
please another link
I'm not registerd there