// you can use variable names directly to access properties.
//ie. $blogFilter->month
- var $startmonth;
- var $startday;
- var $startyear;
- var $endmonth;
- var $endday;
- var $endyear;
- var $tstart; //start time, calculated from the values of startmonth, startday and startyear
- var $tend; //end time, calculated from the values of endmonth, endday and endyear
var $fetchlimit; //max # of entries to read from database
var $fetchstart; //entry # to start reading from database at
var $max_entries; //maximum number of matching entries available in database
var $courseid;
var $userid; // moodle userid to specify a specific user's blog
var $postid; //id of a single blog entry
- var $categoryid;
- var $groupid;
- var $blogtitle;
- var $blogtagline;
- var $blogtheme;
var $blogInfo;
var $memberlist; //do not access directly - use getter get_member_list()
var $filtered_entries = array();
global $CFG; //filter settings to be pass in for baseurl
- if (!empty($userid) && $userid != 0 && $userid != '') {
+ if (!empty($userid)) {
// print "creating blogInfo object for user with id '$userid'<br />"; //debug
$this->blogInfo =& new BlogInfo($userid);
}
if ( empty($this->blogInfo) || empty($this->blogInfo->userid)) {
unset($this->blogInfo);
- $this->blogtitle = '';
- $this->blogtagline = '';
- $this->blogtheme = '';
- } else {
-
- $this->blogtitle = &$this->blogInfo->blogtitle;
- $this->blogtagline = &$this->blogInfo->blogtagline;
- }
+ }
if (! is_numeric($userid) ) {
$this->userid = 0;
function fetch_entries($limit=true) {
global $CFG, $USER;
-/*
- echo "<br />filter trying to do its job";
- echo "<br />filtertype = $this->filtertype";
- echo "<br />filterselect = $this->filterselect";
- */
if (!isset($USER->id)) {
$USER->id = 0; //hack, for guests
}
}
- if ($this->fetchstart !== '' && $limit) { //this can be changed to use mysql_paging_limit
+ if ($this->fetchstart !== '' && $limit) {
$limit = sql_paging_limit($this->fetchstart, $this->fetchlimit);
} else {
$limit = '';
//argument is not an array, hopefully it's a string. wrap it in an array for comparisons below.
$unused = array($unused);
}
- if (!in_array('startmonth', $unused)) {
- $getargs .= '&m=' . $this->startmonth;
- }
- if (!in_array('startday', $unused)) {
- $getargs .= '&d=' . $this->startday;
- }
- if (!in_array('startyear', $unused)) {
- $getargs .= '&y=' . $this->startyear;
- }
if (!in_array('limit', $unused)) {
$getargs .= '&limit=' . $this->fetchlimit;
}
- if (!in_array('formstart', $unused)) {
- $getargs .= '&formstart=' . $this->fetchstart;
- }
if (!in_array('courseid', $unused)) {
$getargs .= '&courseid=' . $this->courseid;
}
if (!in_array('userid', $unused)) {
$getargs .= '&userid=' . $this->userid;
}
- if (!in_array('categoryid', $unused)) {
- $getargs .= '&categoryid=' . $this->categoryid;
- }
- if (!in_array('groupid', $unused)) {
- $getargs .= '&groupid=' . $this->groupid;
- }
return $getargs;
}
$post->error = get_string('nomessagebodyerror', 'blog');
} else {
- //initialize courseid and groupid if specified
- if (isset($post->courseid)) {
- $courseid = $post->courseid;
- } else {
- $courseid = 1;
- }
- if (isset($post->groupid)) {
- $groupid = $post->groupid;
- } else {
- $groupid = '';
- }
-
-/*
- //group pseudocode
- if ($groupid != '') {
- if (! ismember($post->groupid) ) {
- error('You are not a member of the specified group. Group with id#('.$groupid.')'); //Daryl Hawes note: LOCALIZATION NEEDED FOR THIS LINE
- }
- }*/
-
// Insert the new blog entry.
$entryID = $bloginfo_arg->insert_blog_entry($post->etitle, $post->body, $USER->id, $post->format, $post->publishstate, $courseid, $groupid);
$otags = optional_param('otags','', PARAM_INT);
$ptags = optional_param('ptags','', PARAM_INT);
- // Add tags information
+ /// Add tags information
foreach ($otags as $otag) {
$tag->entryid = $entryID;
$tag->tagid = $otag;
global $CFG, $USER;
- //initialize courseid and groupid if specified
- if (isset($post->courseid)) {
- $courseid = $post->courseid;
- } else {
- $courseid = 1;
- }
- if (isset($post->groupid)) {
- $groupid = $post->groupid;
- } else {
- $groupid = '';
- }
-
-/*
- //pseudocode for handling groups
- if ($groupid != '') {
- if (! ismember($groupid) ) {
- error('You are not a member of the specified group. Group with id#('. $groupid .')'); //Daryl Hawes note: LOCALIZATION NEEDED FOR THIS LINE
- }
- }*/
-
$blogentry = $bloginfo->get_blog_entry_by_id($post->postid);
echo "id id ".$post->postid;
// print_object($blogentry); //debug
$otags = optional_param('otags','', PARAM_INT);
$ptags = optional_param('ptags','', PARAM_INT);
- // Add tags information
+ /// Add tags information
foreach ($otags as $otag) {
$tag->entryid = $blogentry->entryId;
$tag->tagid = $otag;