Events Code Snippet Frontpage_main

Anyone using the Events module and wants to have a events sidebar like used to be on the OcenBlue or OcenaBluev2

Here is the code that I had to use to fix it. The links were going back to a empty event table. Now with this code, it pulls the right info as it is supposed to.

Not sure if it is right, please use at own risk.

<?php
// Events Module from simpilotgroup.com
// Front page event list by Cory Wienckowski

$events = EventsData::get_upcoming_events();

if(!$events)
{
echo "<p>There are no upcoming events.</p>";
}
else
{
$count = 0;

foreach($events as $event)
{
if($count == 10) { break; }
if($event->active == '2') { continue; }

echo "" . date("m/d/Y", strtotime($event->date)) . " &dash; ";
echo '<td><a href="'.SITE_URL.'/index.php/events/get_event?id='.$event->id.'">' . $event->title. '</a></td></tr>';

$count++;
}
}
?>

I have no idea man. I was lucky to get this working when I did. lol I just messed with it for a few minutes after looking at the code in the forum tour calendar which is actually an events calendar.

**EDIT**

Actually, are you referring to the image that you add to the event in the admin panel? You want the image to show up in this code too?

I’d like to know how to get the image to show too - like the post above. ^^

Also, how do I get each one on it’s own line?

Hmm It should just add new lines per event. Ill have to try it out on mine again and see happens. I’m not sure about the image yet as I have had no chance to work with it. I been busy the last couple days.