11
Xerelo
Re: ExtCal - Changing date order of events
  • 2007/1/18 18:24

  • Xerelo

  • Just popping in

  • Posts: 7

  • Since: 2006/12/15


I`m proving the 0.90 RC2, and in admin panel> event, events are ordered chronologicaly.

I have other problems, the random block doesn´t work, when i set it visible when i go to index page appears a blank page.

When i set not for show end event, the current date are shown like end event.

The minical that selects the end event goes out the screen because the box is located too down. I have to change the template to select the end event day in the minical.

12
Will_H
Re: ExtCal - Changing date order of events
  • 2007/1/18 22:44

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


Been playing with it for weeks... so stuck.

13
tzvook
Re: ExtCal - Changing date order of events
  • 2007/1/19 1:14

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

Biteronboard wrote:
I am running the latest version of this module.

I have scoured every possible knowledgebase on this subject.

Yet I am having a somewhat similar problem.

Via admin Panel, when looking at Events.

The events are not chronological, instead they are sorted by last modification.

Does anyone know of a method to force the events to sort chronologically here?

Also, Does anyone know where to find the hack to sort the category's alphabetically?

Zoullou's site has 0 usable info.


Took me some time to see how I did it (long ago)
fixes the user-side yearly sorting for by-date-sorting
open /class/event.php
around line 165 look for:

}

        return 
$this->getObjects($criteriaCompo);
    }
    function 
getEventMonth($month$year$user$cats=0)
    {
        
$userStartTime mktime(0,0,0,$month,1,$year);
        
$userEndTime mktime(23,59,59,$month+1,0,$year);
        
$monthStart userTimeToServerTime($userStartTime$this->_extcalTime->_getUserTimeZone($user));
        
$monthEnd userTimeToServerTime($userEndTime$this->_extcalTime->_getUserTimeZone($user));
        
$criteriaCompo = new CriteriaCompo();
        
$authorizedAccessCats $this->_extcalPerm->getAuthorizedCat($user'extcal_cat_view');
        
$criteriaCompo->add(new Criteria('event_start'$monthEnd'<='));
        
$criteriaCompo->add(new Criteria('event_end'$monthStart'>='));
        
$criteriaCompo->add(new Criteria('event_approved'1));
        if(!
is_array($cats) && $cats 0) {
            
$criteriaCompo->add(new Criteria('cat_id'$cats));
        }
        if(
is_array($cats)) {
            if(
array_search(0$cats) === false) {
                
$in '('.current($cats);
                
array_shift($cats);
                foreach(
$cats as $cat) {
                    
$in .= ','.$cat;
                }
                
$in .= ')';
                
$criteriaCompo->add(new Criteria('cat_id'$in'IN'));
            }
        }
        
$count count($authorizedAccessCats);
        if(
$count 0) {
            
$in '('.$authorizedAccessCats[0];
            
array_shift($authorizedAccessCats);
            foreach(
$authorizedAccessCats as $authorizedAccessCat) {
                
$in .= ','.$authorizedAccessCat;
            }
            
$in .= ')';
            
$criteriaCompo->add(new Criteria('cat_id'$in'IN'));
        } else {
            
$criteriaCompo->add(new Criteria('cat_id''(0)''IN'));
        }


        return 
$this->getObjects($criteriaCompo);
    }

    function 
getEventYear($year$user$cat=0)
    {
        
$userStartTime mktime(0,0,0,1,1,$year);
        
$userEndTime mktime(23,59,59,12,31,$year);
        
$yearStart userTimeToServerTime($userStartTime$this->_extcalTime->_getUserTimeZone($user));
        
$yearEnd userTimeToServerTime($userEndTime$this->_extcalTime->_getUserTimeZone($user));
        
$criteriaCompo = new CriteriaCompo();
        
$authorizedAccessCats $this->_extcalPerm->getAuthorizedCat($user'extcal_cat_view');
        
$criteriaCompo->add(new Criteria('event_start'$yearEnd'<='));
        
$criteriaCompo->add(new Criteria('event_end'$yearStart'>='));
        
$criteriaCompo->add(new Criteria('event_approved'1));
        if(
$cat 0) {
            
$criteriaCompo->add(new Criteria('cat_id'$cat));
        }
        
$count count($authorizedAccessCats);
        if(
$count 0) {
            
$in '('.$authorizedAccessCats[0];
            
array_shift($authorizedAccessCats);
            foreach(
$authorizedAccessCats as $authorizedAccessCat) {
                
$in .= ','.$authorizedAccessCat;
            }
            
$in .= ')';
            
$criteriaCompo->add(new Criteria('cat_id'$in'IN'));
        } else {
            
$criteriaCompo->add(new Criteria('cat_id''(0)''IN'));
        }


        return 
$this->getObjects($criteriaCompo);
    }


replace with
}
        
$criteriaCompo->setSort('event_start');
        return 
$this->getObjects($criteriaCompo);
    }
    
    function 
getEventThisDay($user$limit$cats)
    {
        
$time mktime(0,0,0,date("n"),date("j"),date("Y"));
        
$dayStart userTimeToServerTime($time$this->_extcalTime->_getUserTimeZone($user));
        
$dayEnd userTimeToServerTime($time+86399$this->_extcalTime->_getUserTimeZone($user));
        
$criteriaCompo = new CriteriaCompo();
        
$authorizedAccessCats $this->_extcalPerm->getAuthorizedCat($user'extcal_cat_view');
        
$criteriaCompo->add(new Criteria('event_start'$dayEnd'<='));
        
$criteriaCompo->add(new Criteria('event_end'$dayStart'>='));
        
$criteriaCompo->add(new Criteria('event_approved'1));
        if(!
is_array($cats) && $cats 0) {
            
$criteriaCompo->add(new Criteria('cat_id'$cats));
        }
        if(
is_array($cats)) {
            if(
array_search(0$cats) === false) {
                
$in '('.current($cats);
                
array_shift($cats);
                foreach(
$cats as $cat) {
                    
$in .= ','.$cat;
                }
                
$in .= ')';
                
$criteriaCompo->add(new Criteria('cat_id'$in'IN'));
            }
        }
        
$criteriaCompo->setSort('event_start');
        return 
$this->getObjects($criteriaCompo);
    }
    
    function 
getEventMonth($month$year$user$cats=0)
    {
        
$userStartTime mktime(0,0,0,$month,1,$year);
        
$userEndTime mktime(23,59,59,$month+1,0,$year);
        
$monthStart userTimeToServerTime($userStartTime$this->_extcalTime->_getUserTimeZone($user));
        
$monthEnd userTimeToServerTime($userEndTime$this->_extcalTime->_getUserTimeZone($user));
        
$criteriaCompo = new CriteriaCompo();
        
$authorizedAccessCats $this->_extcalPerm->getAuthorizedCat($user'extcal_cat_view');
        
$criteriaCompo->add(new Criteria('event_start'$monthEnd'<='));
        
$criteriaCompo->add(new Criteria('event_end'$monthStart'>='));
        
$criteriaCompo->add(new Criteria('event_approved'1));
        if(!
is_array($cats) && $cats 0) {
            
$criteriaCompo->add(new Criteria('cat_id'$cats));
        }
        if(
is_array($cats)) {
            if(
array_search(0$cats) === false) {
                
$in '('.current($cats);
                
array_shift($cats);
                foreach(
$cats as $cat) {
                    
$in .= ','.$cat;
                }
                
$in .= ')';
                
$criteriaCompo->add(new Criteria('cat_id'$in'IN'));
            }
        }
        
$count count($authorizedAccessCats);
        if(
$count 0) {
            
$in '('.$authorizedAccessCats[0];
            
array_shift($authorizedAccessCats);
            foreach(
$authorizedAccessCats as $authorizedAccessCat) {
                
$in .= ','.$authorizedAccessCat;
            }
            
$in .= ')';
            
$criteriaCompo->add(new Criteria('cat_id'$in'IN'));
        } else {
            
$criteriaCompo->add(new Criteria('cat_id''(0)''IN'));
        }
        
$criteriaCompo->setSort('event_start');
        
$criteriaCompo->setOrder('DESC');
        return 
$this->getObjects($criteriaCompo);
    }

    function 
getEventYear($year$user$cat=0)
    {
        
$userStartTime mktime(0,0,0,1,1,$year);
        
$userEndTime mktime(23,59,59,12,31,$year);
        
$yearStart userTimeToServerTime($userStartTime$this->_extcalTime->_getUserTimeZone($user));
        
$yearEnd userTimeToServerTime($userEndTime$this->_extcalTime->_getUserTimeZone($user));
        
$criteriaCompo = new CriteriaCompo();
        
$authorizedAccessCats $this->_extcalPerm->getAuthorizedCat($user'extcal_cat_view');
        
$criteriaCompo->add(new Criteria('event_start'$yearEnd'<='));
        
$criteriaCompo->add(new Criteria('event_end'$yearStart'>='));
        
$criteriaCompo->add(new Criteria('event_approved'1));
        if(
$cat 0) {
            
$criteriaCompo->add(new Criteria('cat_id'$cat));
        }
        
$count count($authorizedAccessCats);
        if(
$count 0) {
            
$in '('.$authorizedAccessCats[0];
            
array_shift($authorizedAccessCats);
            foreach(
$authorizedAccessCats as $authorizedAccessCat) {
                
$in .= ','.$authorizedAccessCat;
            }
            
$in .= ')';
            
$criteriaCompo->add(new Criteria('cat_id'$in'IN'));
        } else {
            
$criteriaCompo->add(new Criteria('cat_id''(0)''IN'));
        }
        
$criteriaCompo->setSort('event_start');
        
$criteriaCompo->setOrder('DESC');
        return 
$this->getObjects($criteriaCompo);
    }


I'm using version 2 with XOOPS 2.2.x

Login

Who's Online

77 user(s) are online (45 user(s) are browsing Support Forums)


Members: 0


Guests: 77


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits