Hey Guys,
I wrote my own custom index plugin to display my own html/php homepage. And I wanted to add an avatar listing on my index page but am having a little issue. Below is the snippet of code that appears in the body of my index page. It is code based on the <a href="http://community.elgg.org/pg/plugins/project/384692/developer/jdalsem/avatar-wall"> Avatar Wall</a> plugin that I modified. Would you be so kind as to give it a look and see why nothing appears. I did echo Count($users); and it was the correct number of users, so I am getting all the users, but do you know why don't they display when I echo them?
<?php
// Start engine from original plug, don't need it
/* require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); */
$users_max = 1000;
$onlyWithAvatar = "no";
if(empty($onlyWithAvatar) || $onlyWithAvatar == "no")
{$users = get_entities('user','',null,null,$users_max,0);}
else
{$users = get_entities_from_metadata('icontime', '', 'user', '', 0, $users_max);}
$wallIconSize = "small";
shuffle($users);
foreach($vars['users'] as $user){
echo "<a href='" . $user->getURL() . "'><img class='avatars' alt='" . $user->name . "' src='". $user->getIcon($vars['wallIconSize']) . "'></a>";
}
?>
Thanks for the help guys!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
I want to create a specific frontpage. I don't think (or i can't see) how this plugins can help me.
Here is the code for the grid of the members:
I want to replace the name and the skill by those of the members.
@Stéphane Caillaud
Early, we've used this code for our wallZ:
But you can try also:
Last code from widget manager
The widget manager plugin has a widget that can be displayed on the front page that shows new members. You could change the view to show what you need. If you do not yet have the profile fields you need you can use profile manager to add them.
The widget can be changed to look how you want it by using css.
@RvR: Thanks for nice guide.
Thx. I will try to use it.
Ok. It's working. I don't yet change the css. Now I would like to get each user name and each skill (or a specific metadata).
I look to Wallz. How did you do to write the name for each avatar ?
I want this kind of design:
We're not using this look on our website now but I have the archive image of it before:
Yes. It is what i want to list: user's avatar and some metadata like name and specific profile fileds.
With your script i can't see how to extract and to display the metadata ? I display only the user's avatar.
elgg_list_entities(); linked with view of ElggEntity (ElggUser) : 'full' or 'summary'
See file views\default\user\default.php (lines 45-51) and code
Override this code's part and try to play with the bolded arrays
- Previous
- 1
- 2
- 3
- 4
- 5
- Next
You must log in to post replies.