Tweaking output and layout

This commit is contained in:
moodler 2006-03-21 01:35:42 +00:00
parent 4b87fbe7ad
commit d7dfcee179
2 changed files with 26 additions and 14 deletions

View File

@ -178,10 +178,31 @@ class BlogFilter {
*/
function fetch_entries($limit=true) {
global $CFG, $USER;
if (!isset($USER->id)) {
$USER->id = 0; //hack, for guests
}
// if we have specified an ID
if ($this->postid) {
if ($post = get_record('post', 'id', $this->postid)) {
if ($user = get_record('user', 'id', $post->userid)) {
$post->email = $user->email;
$post->firstname = $user->firstname;
$post->lastname = $user->lastname;
}
$blogEntry = new BlogEntry($post);
$blogEntries[] = $blogEntry;
$this->filtered_entries = $blogEntries;
return $this->filtered_entries;
}
}
if ($this->tag) {
$tagtablesql = $CFG->prefix.'blog_tag_instance bt, ';
@ -191,17 +212,6 @@ class BlogFilter {
$tagquerysql = '';
}
// if we have specified an ID
if ($this->postid) {
if ($post = get_record('post', 'id', $this->postid)) {
$blogEntry = new BlogEntry($post);
$blogEntries[] = $blogEntry;
$this->filtered_entries = $blogEntries;
return $this->filtered_entries;
}
}
/****************************************
* depending on the type, there are 4 *

View File

@ -146,6 +146,7 @@ function blog_user_bloginfo($userid='') {
*/
function blog_print_html_formatted_entries(&$blogFilter, $filtertype, $filterselect) {
global $CFG, $USER;
$blogpage = optional_param('blogpage', 0, PARAM_INT);
$bloglimit = get_user_preferences('blogpagesize',8); // expose as user pref when MyMoodle comes around
@ -294,9 +295,10 @@ function blog_print_entry_content ($template, $entryid, $filtertype='', $filters
echo '<p />';
print_string('tags');
echo ': ';
foreach ($blogtags as $blogtag) {
echo '<a href="index.php?courseid='.$course->id.'&amp;filtertype='.$filtertype.'&amp;filterselect='.$filterselect.'&amp;tagid='.$blogtag->id.'">'.$blogtag->text.'</a>, ';
foreach ($blogtags as $key => $blogtag) {
$taglist[] = '<a href="index.php?courseid='.$course->id.'&amp;filtertype='.$filtertype.'&amp;filterselect='.$filterselect.'&amp;tagid='.$blogtag->id.'">'.$blogtag->text.'</a>';
}
echo implode(', ', $taglist);
}
/// Commands