From eccfc1cac00dd6194602679a4430cd59a73702e4 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Mon, 10 Apr 2006 07:27:03 +0000 Subject: [PATCH] small fix and cleaning --- blog/edit.php | 7 ++++++- blog/header.php | 11 ++--------- blog/index.php | 7 ++----- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/blog/edit.php b/blog/edit.php index 329fa272617..7b9d40dee03 100755 --- a/blog/edit.php +++ b/blog/edit.php @@ -4,6 +4,11 @@ require_once('../config.php'); include_once('lib.php'); include_once('class.BlogInfo.php'); require_login(); + +$userid = optional_param('userid', 0, PARAM_INT); +$courseid = optional_param('courseid', SITEID, PARAM_INT); +$act = optional_param('act','',PARAM_ALPHA); + // detemine where the user is coming from in case we need to send them back there if (isset($_SERVER['HTTP_REFERER'])) { $referrer = $_SERVER['HTTP_REFERER']; @@ -54,7 +59,7 @@ if ( !blog_user_has_rights($PAGE->bloginfo) ) { //////////// SECURITY AND SETUP COMPLETE - NOW PAGE LOGIC /////////////////// -if (isset($act) && $act == 'del' && confirm_sesskey()) +if (isset($act) && ($act == 'del') && confirm_sesskey()) { $postid = required_param('postid', PARAM_INT); if (optional_param('confirm',0,PARAM_INT)) { diff --git a/blog/header.php b/blog/header.php index f5f84c12e2b..dd2430630ff 100755 --- a/blog/header.php +++ b/blog/header.php @@ -1,5 +1,7 @@ dirroot .'/blog/lib.php'); require_once($CFG->libdir .'/pagelib.php'); require_once($CFG->dirroot .'/blog/blogpage.php'); @@ -9,15 +11,6 @@ require_once($CFG->dirroot .'/course/lib.php'); $blockaction = optional_param('blockaction','', PARAM_ALPHA); $instanceid = optional_param('instanceid', 0, PARAM_INT); $blockid = optional_param('blockid', 0, PARAM_INT); -$groupid = optional_param('groupid', 0, PARAM_INT); - -if (!isset($userid)) { - $userid = optional_param('userid', 0, PARAM_INT); -} - -if (!isset($courseid)) { - $courseid = optional_param('courseid', SITEID, PARAM_INT); -} if (!$site = get_site()) { redirect($CFG->wwwroot.'/index.php'); diff --git a/blog/index.php b/blog/index.php index 2da452f7102..ad3621b53b1 100755 --- a/blog/index.php +++ b/blog/index.php @@ -10,22 +10,19 @@ if (!file_exists('../config.php')) { header('Location: ../install.php'); die; } -require_once('../config.php'); +require_once('../config.php'); require_once($CFG->dirroot .'/blog/lib.php'); require_once($CFG->libdir .'/blocklib.php'); $id = optional_param('id', 0, PARAM_INT); $limit = optional_param('limit', 0, PARAM_INT); $start = optional_param('formstart', 0, PARAM_INT); - $userid = optional_param('userid',0,PARAM_INT); -$groupid = optional_param('groupid',0,PARAM_INT); $courseid = optional_param('courseid',0,PARAM_INT); $tag = s(urldecode(optional_param('tag', '', PARAM_NOTAGS))); $tagid = optional_param('tagid', 0, PARAM_INT); $postid = optional_param('postid',0,PARAM_INT); - $filtertype = optional_param('filtertype', '', PARAM_ALPHA); $filterselect = optional_param('filterselect', 0, PARAM_INT); @@ -135,7 +132,7 @@ switch ($filtertype) { //first set the start and end day equal to the day argument passed in from the get vars if ($limit == 'none') { - $limit = get_user_preferences('blogpagesize',8); + $limit = get_user_preferences('blogpagesize',10); } $blogFilter =& new BlogFilter($userid, $postid, $limit, $start,$filtertype, $filterselect, $tagid, $tag); -- 2.43.0