more cleaning, filter do not process dates

This commit is contained in:
toyomoyo
2006-03-15 02:02:25 +00:00
parent 9ca0187e16
commit f99fee6c71
2 changed files with 6 additions and 21 deletions
+4 -17
View File
@@ -64,7 +64,7 @@ class BlogFilter {
* @param int $courseid = if needed the entries can be restricted to those associated with a given course.
* @param int $postid = a specific blog entry that is being sought
*/
function BlogFilter($userid='', $postid='', $courseid='', $groupid='', $fetchlimit='', $fetchstart='', $startmonth='', $startday='', $startyear='', $endmonth='', $endday='', $endyear='', $filtertype='', $filterselect='', $tagid='', $tag ='', $sort='lastmodified DESC') {
function BlogFilter($userid='', $postid='', $fetchlimit='', $fetchstart='', $filtertype='', $filterselect='', $tagid='', $tag ='', $sort='lastmodified DESC') {
global $CFG; //filter settings to be pass in for baseurl
@@ -83,11 +83,6 @@ class BlogFilter {
$this->blogtagline = &$this->blogInfo->blogtagline;
}
if (!is_numeric($courseid) || $courseid == 0 || $courseid == 1) {
$this->courseid = '';
} else {
$this->courseid = $courseid;
}
if (! is_numeric($userid) ) {
$this->userid = 0;
} else {
@@ -98,24 +93,15 @@ class BlogFilter {
} else {
$this->fetchstart = $fetchstart;
}
if (!is_numeric($fetchlimit) ) {
$this->fetchlimit = $CFG->blog_default_fetch_num_entries;
} else {
$this->fetchlimit = $fetchlimit;
}
$this->postid = $postid;
$this->groupid = $groupid;
$this->startmonth = $startmonth;
$this->startday = $startday;
$this->startyear = $startyear;
$this->endmonth = $endmonth;
$this->endday = $endday;
$this->endyear = $endyear;
$this->tstart = blog_get_month_time($startyear, $startmonth, $startday);
$this->tend = blog_get_month_time($endyear, $endmonth, $endday);
$this->postid = $postid;
$this->sort = $sort;
$this->filtertype = $filtertype;
@@ -214,6 +200,7 @@ class BlogFilter {
*/
function fetch_entries($limit=true) {
global $CFG, $USER;
/*
echo "<br />filter trying to do its job";
echo "<br />filtertype = $this->filtertype";
+2 -4
View File
@@ -167,18 +167,16 @@ if ( empty($d) && !empty($m) && !empty($y) ) {
if ($limit == 'none') {
$limit = get_user_preferences('blogpagesize',8);
}
if ($formstart == 'none' || $formstart < 0) {
$start = 0;
} else {
$start = $formstart;
}
$blogFilter =& new BlogFilter($userid, '', $courseid, $groupid, $limit, $start, $m, $startday, $y, $m, $endday, $y,$filtertype, $filterselect, $tagid, $tag);
$blogFilter =& new BlogFilter($userid, '', $limit, $start,$filtertype, $filterselect, $tagid, $tag);
//print_object($blogFilter); //debug
$pageNavigation = '';
include($CFG->dirroot .'/blog/header.php');
//prints the tabs