mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Tweaking output and layout
This commit is contained in:
parent
4b87fbe7ad
commit
d7dfcee179
@ -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 *
|
||||
|
@ -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.'&filtertype='.$filtertype.'&filterselect='.$filterselect.'&tagid='.$blogtag->id.'">'.$blogtag->text.'</a>, ';
|
||||
foreach ($blogtags as $key => $blogtag) {
|
||||
$taglist[] = '<a href="index.php?courseid='.$course->id.'&filtertype='.$filtertype.'&filterselect='.$filterselect.'&tagid='.$blogtag->id.'">'.$blogtag->text.'</a>';
|
||||
}
|
||||
echo implode(', ', $taglist);
|
||||
}
|
||||
|
||||
/// Commands
|
||||
|
Loading…
x
Reference in New Issue
Block a user