mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Tweaking output and layout
This commit is contained in:
parent
4b87fbe7ad
commit
d7dfcee179
2 changed files with 26 additions and 14 deletions
|
@ -179,10 +179,31 @@ class BlogFilter {
|
||||||
function fetch_entries($limit=true) {
|
function fetch_entries($limit=true) {
|
||||||
global $CFG, $USER;
|
global $CFG, $USER;
|
||||||
|
|
||||||
|
|
||||||
if (!isset($USER->id)) {
|
if (!isset($USER->id)) {
|
||||||
$USER->id = 0; //hack, for guests
|
$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) {
|
if ($this->tag) {
|
||||||
$tagtablesql = $CFG->prefix.'blog_tag_instance bt, ';
|
$tagtablesql = $CFG->prefix.'blog_tag_instance bt, ';
|
||||||
$tagquerysql = ' AND bt.entryid = p.id AND bt.tagid = '.$this->tag.' ';
|
$tagquerysql = ' AND bt.entryid = p.id AND bt.tagid = '.$this->tag.' ';
|
||||||
|
@ -191,17 +212,6 @@ class BlogFilter {
|
||||||
$tagquerysql = '';
|
$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 *
|
* 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) {
|
function blog_print_html_formatted_entries(&$blogFilter, $filtertype, $filterselect) {
|
||||||
global $CFG, $USER;
|
global $CFG, $USER;
|
||||||
|
|
||||||
$blogpage = optional_param('blogpage', 0, PARAM_INT);
|
$blogpage = optional_param('blogpage', 0, PARAM_INT);
|
||||||
$bloglimit = get_user_preferences('blogpagesize',8); // expose as user pref when MyMoodle comes around
|
$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 />';
|
echo '<p />';
|
||||||
print_string('tags');
|
print_string('tags');
|
||||||
echo ': ';
|
echo ': ';
|
||||||
foreach ($blogtags as $blogtag) {
|
foreach ($blogtags as $key => $blogtag) {
|
||||||
echo '<a href="index.php?courseid='.$course->id.'&filtertype='.$filtertype.'&filterselect='.$filterselect.'&tagid='.$blogtag->id.'">'.$blogtag->text.'</a>, ';
|
$taglist[] = '<a href="index.php?courseid='.$course->id.'&filtertype='.$filtertype.'&filterselect='.$filterselect.'&tagid='.$blogtag->id.'">'.$blogtag->text.'</a>';
|
||||||
}
|
}
|
||||||
|
echo implode(', ', $taglist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Commands
|
/// Commands
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue