small fix and cleaning

This commit is contained in:
toyomoyo 2006-04-10 07:27:03 +00:00
parent 71470b3bf1
commit eccfc1cac0
3 changed files with 10 additions and 15 deletions

View File

@ -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)) {

View File

@ -1,5 +1,7 @@
<?php //$Id$
/// Sets up blocks and navigation for index.php, edit.php
require_once($CFG->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');

View File

@ -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);