mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Actually filter where no valid event categories
This commit is contained in:
parent
9697d88c8f
commit
cdd5b95433
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ecal_class.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2007-12-15 14:19:19 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2007-12-15 22:15:30 $
|
||||
| $Author: e107steved $
|
||||
|
|
||||
| Event calendar class:
|
||||
@ -495,11 +495,12 @@ if (!defined("EC_DEFAULT_CATEGORY")) { define('EC_DEFAULT_CATEGORY',"Default");
|
||||
// Read a list of events between start and end dates
|
||||
// If $start_only is TRUE, only searches based on the start date/time
|
||||
// Potential option to hook in other routines later
|
||||
function get_events($start_time, $end_time, $start_only=FALSE, $cat_filter=0, $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
|
||||
function get_events($start_time, $end_time, $start_only=FALSE, $cat_filter='*', $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
|
||||
{
|
||||
global $sql;
|
||||
|
||||
$ret = array();
|
||||
if ($cat_filter === FALSE) return $ret;
|
||||
$cat_lj = '';
|
||||
$category_filter = '';
|
||||
$extra = '';
|
||||
@ -567,11 +568,16 @@ if (!defined("EC_DEFAULT_CATEGORY")) { define('EC_DEFAULT_CATEGORY',"Default");
|
||||
// It always uses the event start date only
|
||||
// It tries to keep the actual number of events in memory to a minimum by discarding when it can.
|
||||
// Once there are $num_events read, it pulls in the $end_time to speed up checks
|
||||
function get_n_events($num_event, $start_time, $end_time, $cat_filter=0, $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
|
||||
// $cat_filter = FALSE is 'no categories' - returns an empty array.
|
||||
// $cat_filter = '*' means 'all categories'
|
||||
// otherwise $cat_filter mst be a comma-separated list of category IDs.
|
||||
function get_n_events($num_event, $start_time, $end_time, $cat_filter='*', $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
|
||||
{
|
||||
global $sql;
|
||||
|
||||
$ret = array();
|
||||
if ($cat_filter === FALSE) return $ret; // Empty category
|
||||
|
||||
$cat_lj = '';
|
||||
$category_filter = '';
|
||||
$extra = '';
|
||||
@ -583,7 +589,7 @@ if (!defined("EC_DEFAULT_CATEGORY")) { define('EC_DEFAULT_CATEGORY',"Default");
|
||||
$cat_lj = ' LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id ';
|
||||
}
|
||||
|
||||
if ($cat_filter) $category_filter = " AND find_in_set(e.event_category, '".$cat_filter."') ";
|
||||
if ($cat_filter != '*') $category_filter = " AND find_in_set(e.event_category, '".$cat_filter."') ";
|
||||
if ($inc_recur) $extra = " OR (e.event_recurring >'0' AND (e.event_start <= ".intval($end_time)." AND e.event_end >= ".intval($start_time).")) ";
|
||||
|
||||
$qry = "SELECT {$event_fields}{$cat_fields} FROM #event as e {$cat_lj}
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/event.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2007-09-04 21:09:47 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2007-12-15 22:15:30 $
|
||||
| $Author: e107steved $
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
@ -53,7 +53,8 @@ require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
|
||||
require_once(e_HANDLER."calendar/calendar_class.php");
|
||||
$cal = new DHTML_Calendar(true);
|
||||
|
||||
$cat_filter = intval(varset($_POST['event_cat_ids'],0));
|
||||
$cat_filter = intval(varset($_POST['event_cat_ids'],-1));
|
||||
if ($cat_filter == -1) $cat_filter = '*';
|
||||
$mult_count = 0;
|
||||
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/next_event_menu.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2007-11-12 19:56:13 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2007-12-15 22:15:30 $
|
||||
| $Author: e107steved $
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
@ -67,7 +67,7 @@ $cal_row = array();
|
||||
global $cal_row, $cal_totev;
|
||||
|
||||
|
||||
$ev_list = $ecal_class->get_n_events($show_count, $start_time, $end_time, varset($pref['eventpost_fe_set'],0), $show_recurring,
|
||||
$ev_list = $ecal_class->get_n_events($show_count, $start_time, $end_time, varset($pref['eventpost_fe_set'],FALSE), $show_recurring,
|
||||
'event_id,event_start, event_thread, event_title, event_recurring, event_allday, event_category', 'event_cat_icon');
|
||||
|
||||
$cal_totev = count($ev_list);
|
||||
|
Loading…
x
Reference in New Issue
Block a user