how to post on frontpage

Hi guys and girls,

Is there anyway that i can post a list of events that are public, on the frontpage of my site.

peter

  • i wonder the same thing.

    Just insalled but no idea how to show eevent on front page.

  • i still would love this to know

  • This is how I did it :

    <?php
        /**
         * Elgg custom_dash_not_logged_in plugin
         * This plugin substitutes the frontpage with a custom one
         *
         */
     ?>
     <div id="calendar">
     <h2>Upcoming events</h2>
     </div>

             <?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().'"></a></p>';

    foreach($events as $event) {
    echo elgg_view("object/event_calendar",array('entity' => $event));
    }
    echo "</div>";
    }
    ?>

    <div class="clearfloat"/></div>
     <!-- end of upcoming events-->

  • You can use this plugin to display events widget on the main page. It can save you some time if you're not a programmer.

  • I found some interesting the post, Im a programmer I don't undestad elgg's structure, I make some code lines to improve my file search modules.

    I need to restict results of my file search, I just need to make a list with .doc and .pdf file extentions,

    How can I perform this change? How can I integrate my code in elgg?

    I make this change just with php code ( external access) How can I integrate this to the defaul file search module.

    This is my implementation. http://community.elgg.org/pg/pages/view/478810/

    SQL: I need to include in the file search:

    SELECT a1.id as idarchivo, a1.string ,a2.*, a3.username, a4.*   FROM elggmetastrings as a1, elggmetadata as a2, elggusers_entity as a3, elggobjects_entity as a4  WHERE( a1.string LIKE '%.doc%' OR   a1.string LIKE '%.pdf%' OR a1.string LIKE '%.ppt%' OR a1.string LIKE '%.xls%' OR a1.string LIKE '%.zip%')  AND a1.string LIKE '%file/%' ";

    Tks 4 yours answers