Members: 16,996
Threads: 38,862
Posts: 159,462
Online: 58

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 10.08.2005, 23:51   #1 (permalink)
Baby Mamber
 
Join Date: Jul 2005
Posts: 5
Longkong is on a distinguished road
Default Events Component - Show only upcoming events

Hi

I installed the events component and I use the "by Year" Mode to display my events. But I only want to display upcoming events there. I tried several things, but nothing worked. This is the code which prints out the events, I hope someone has a suggestion to realise this.

PHP Code:
function showEventsByYear ($year,$limit,$limitstart) {
    global 
$database$option$Itemid$gid$mosConfig_list_limit;    
    
$sql "SELECT * FROM #__categories as b, #__events WHERE AND #__events.catid = b.id  AND b.access <= $gid AND #__events.access <= $gid AND publish_up LIKE '$year%' AND (publish_down >= '$year%' OR publish_down = '0000-00-00 00:00:00') AND #__events.state = '1'";
 
    
$database->setQuery($sql);
    
$counter $database->loadObjectList();
    
$total count$counter );
    
    
// MLr: discuss replacing _CAL_CONF_EVENT_LIST_ROWS_PPG with $mosConfig_list_limit
    
$limit $limit $limit _CAL_CONF_EVENT_LIST_ROWS_PPG;

    if ( 
$total <= $limit ) {
    
$limitstart 0;
    }
    
    
$rows listEventsByYear ($year,$limitstart,$limit);          
    
$num_events count($rows); 
       
    
$chdate "";       
    echo 
"<fieldset><legend class='ev_fieldset'>"._CAL_LANG_ARCHIVE."</legend><br />\n"
    echo 
"<table align='center' width='90%' cellspacing='0' cellpadding='5' class='ev_table'>\n";       
    if (
$num_events>0){
        for (
$r 0$r count($rows); $r++) {
            
$row $rows[$r];            
            
            
$event_up = new mosEventDate$row->publish_up );            
        
$event_up->day sprintf"%02d"$event_up->day);
            
$event_up->month sprintf"%02d"$event_up->month);
            
$event_up->year sprintf"%4d"$event_up->year);       
            
$event_month_year $event_up->month $event_up->year;
        
$contactlink mosEventsHTML::getUserMailtoLink($row->id$row->created_by);   
            
            
$catid $row->catid;
        
$catname mosEventsHTML::getCategoryName($row->catid);
            
            if ((
$event_month_year <> $chdate) && $chdate<>""){                               
                echo 
"</td>\n";             
            }
            if (
$event_month_year <> $chdate){             
                echo 
"<tr><td width='50' class='ev_td_left'>".mosEventsHTML::getDateFormat($event_up->year,$event_up->month,'',3)."</td>\n";
                echo 
"<td class='ev_td_right'><ul class='ev_ul'>\n ";
            }                              
            
HTML_events::viewEventRow ($row->id,$row->title,'view_detail',$event_up->year,$event_up->month,$event_up->day,$contactlink$option$Itemid);                         
            echo 
"&nbsp;::&nbsp;";
            
HTML_events::viewEventDate ($row->id,$row->title,'view_detail',$event_up->year,$event_up->month,$event_up->day,$contactlink$option$Itemid);        
            
$chdate $event_month_year;
            if (
$event_month_year <> $chdate){             
                echo 
"</ul>\n ";
            }
        }
        
    } else {
        echo 
"<tr>";
        echo 
"<td align='left' valign='top' class='ev_td_right'>\n";
        echo 
_CAL_LANG_NO_EVENTFOR."&nbsp;<b>".$year."</b></td>";
    }   
    echo 
"</tr></table><br />\n";
    echo 
"</fieldset><br />\n";
    
showNavTableText($year$total$limitstart$limit'view_year');

Longkong is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
neede component to show 'n frontpage! kash Component 'How Do I' Questions 4 31.10.2005 19:50
Latest Events Component cma01 Component 'How Do I' Questions 1 11.09.2004 20:22
Events component help HIKARI Mambo 4.5 General Talk 3 23.06.2004 21:44
Give admin permisision to manager to edit events component in backend malavision Component 'How Do I' Questions 1 19.06.2004 13:20
Events component blues. J-Van Mambo 4.5 Bugs 3 29.04.2004 23:50


All times are GMT +2. The time now is 20:22.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.