LoginBox
<div id="login">
<h2>Log in</h2>
<?php
$form_body = "<p><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea')) . "</label><br />";
$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea')) . "</label><br />";
$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))) . " <div id=\"persistent_login\"><label><input type=\"checkbox\" name=\"persistent\" value=\"true\" />".elgg_echo('user:persistent')."</label></div></p>";
//$form_body .= "<br />";
$form_body .= "<p><a href=\"". $vars['url'] ."account/register.php\">" . elgg_echo('register') . "</a> | <a href=\"". $vars['url'] ."account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>";
?>
<?php
echo elgg_view('input/form', array('body' => $form_body, 'action' => "". $vars['url'] ."action/login"));
?>
</div><!-- end of login-->
Tags
<div id="tags">
<h2>Tags</h2>
<p>
<?php
$notags = 100;
if ( $vars['entity']->notags ) {
$notags = $vars['entity']->notags;
}
echo display_tagcloud( 1, $notags, "tags" );
?>
</p>
<div class="clearfloat"/></div>
</div> <!-- end of tagcloud_widget_container -->
NewMember
<div id="members">
<h2>Neuste Mitglieder</h2>
<?php
$users = get_entities('user', '', 0, '', 20, 0, false, 0, null);
if($users){
foreach($users as $user){
echo "<div class=\"member_icon\">" . elgg_view("profile/icon",array('entity' => $user, 'size' => 'small')) . "</div>";
}
}
?>
<a href="search/users.php"><span>more members</span></a>
<div class="clearfloat"/></div>
</div><!-- end of neuste mitglieder -->
NewGroups
<div id="newgroups">
<h2>Neuste Gruppen</h2>
<?php
$groups = get_entities('group', '', 0, '', 10, 0, false, 0, null);
if($groups){
foreach($groups as $group){
echo "<div class=\"member_icon\">" . elgg_view("profile/icon",array('entity' => $group, 'size' => 'small')) . "</div>";
}
}
?>
<a href="pg/groups/world/"><span>more groups</span></a>
<div class="clearfloat"/></div>
</div><!-- end of neuste gruppen -->
LatestActivity
<div id="lactivity">
<h2>Latest activity</h2>
<?php set_context('search');
$content = list_registered_entities(0,8,true,false,array('object','group'));
$content = elgg_view_layout('', '', $title . $content);
echo $content;?>
<a href="dashboard/latest.php"><span>more ...</span></a>
<div class="clearfloat"/></div>
</div><!-- end of latest activity -->
LatestDiscussion
<div id="ldiscuss">
<h2><?php echo elgg_echo('groups:latestdiscussion'); ?></h2>
<?php
set_context('search');
$content = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
echo $title . $content;
?>
<a href="mod/groups/discussions.php"><span>more ...</span></a>
<div class="clearfloat"/></div>
</div><!-- end of latest giscussion -->
Calendar Box
<div id="calendar">
<?php
/* Upcoming Events*/
$num = 5;
// Get the upcoming events
$start_date = time(); // now
$end_date = $start_date + 60*60*24*365*2; // maximum is two years from now
$events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,page_owner());
// If there are any events to view, view them
if (is_array($events) && sizeof($events) > 0) {
echo '<div id="group_pages_widget">';
echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>';
echo '<p><a href="'.$vars['url'].'pg/event_calendar/group/'.page_owner().'">'.elgg_echo('event_calendar:view_calendar').'</a></p>';
foreach($events as $event) {
echo elgg_view("object/event_calendar",array('entity' => $event));
}
echo "</div>";
}
?>
<div class="clearfloat"/></div>
</div> <!-- end of upcoming events-->
Thats it so far i think
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.
Thank you
Steven - Thanks for your work effort. Question: if you want to have a custom background:theme_contentback.gif image for the front page, and maintain another for the rest of your website, how would you setup css.php to do so?
i don´t know i was loking around a little but i found no way to accomplish that :-(
Hi Steven,
kannst Du das für den veranstaltungskalender auch posten?
Hast Du auf Deiner testseite schon drauf.
Danke!!
I think you can just use the following snippet for the same effect--same with all mod objects. This will output the last 10 events.
list_entities('object','event_calendar',0,10,false);
Hi Paul,
I think your snippet would output the last 10 events added to the system, but in the order they were added by users.
Usually people want to display events in order of event start time.
Currently Elgg does not let you sort entities by a metadata value without using custom SQL, so I think what Steven has may be the best way to display these items for now.
Hey, thanks for this page! Is there a way to also include a widgets content into the custom dashboard? Could I just copy the code or is there more that needs to be done?
i think it maya works if you copy the code oor parts of the code in the views
hy what about last pages on homepage
thankws
Is possible on elgg 1.5 and events 0.7 to display latest events in order of event start time in custom index page? How can I do this? Thanks.
Can anyone give me directions on integrating the "Upcoming Events" code into the new built in "custom-index" plugin supplied by Dave Tosh. The architecture is different and I don't know enough php to get my head around it.
I'm using list_registered_entities(0,1,false,false,array('object','thewire')), but the output is bookmark entity.
Thanks a lot. I modified the latest events code in here to add it to the main page using the custom_index mod.
How tro replace Newest members (front page) with random members?
Steven can't be thanked enough. A very useful page.
However, the main point is to make these all visivble before logged in as well. A visitor should be able to read blogs, pages, etc on the main page if the Admin decides so. Otherwise, I don't find any sense in spending time on it, since (1) normally you hit the dashboard when you are logged in and then (2) you can acesss anything using the menu.
A visitor's decision to sign up is swayed by the first impression -- simple common sense.
Syntax with detailed parameter expansion/control will be appreciated. As not an Elgg-savvy person, I can't understand what is 0, what is " ", or what is "null" in coding like
Custom_Index has some good examples, such limit => and pagination => (true/false).