A promise is a promise. The great Jordi piguillem and his partners incrime Agatha and Roser just sended me this this kind Block that shows last update Blog entry.
I've placed it to download in dfwiki home page...
The Blogs are gropwing up!!
Ludo
ps. sorry for double post, I wanted to place it here but it ended up in blocks forum (where is also relevant)
Thanks for developing this block I just installed it and noticed that there is no language file -- see also your screenshot in the previous posting ;)
After adding $string['updated_blogs'] = 'Updated Blogs'; to lang/en_utf8/blog.php, everything looks fine now. I'm still wondering, though, whether the block shouldn't have its own language file because this appears to be the standard procedure for custom blocks. That way we wouldn't have to add the above string to a core language file. What do you think?
Markus
this was a quickly and dirty development and you're absolutely rigth about the need for a block lang file. If you send me your own I'll squeeze it into the distribution zip file.
Regards
Ludo
$this->title = get_string('updated_blogs', 'blog');
//helpbutton ('updated_blogs', get_string('updated_blogs', 'blog'), 'blog', true, false, '', true);
$this->version = 2004081200;
That's all
Anyway, I'm attaching a patch that address two of the most asked for modifications in this thread; removal of the help icon, and knowledge about the draft, site and public publish states. With the patch, it will never show drafts, only show site when logged in, and always show public, if any.
I'm looking into some other issues with this block, but if there already is an updated version, that would be wasted work, better spent elsewhere.
I'm applying your patch to the downlodable file..
Ciao
Ludo
Ok, I've tinkered a bit more with this block now. Some parts are left almost intact, but most of it is either replaced or altered now.
What I've done, in short:
Removed the help icon and added support for the draft/site/public system (old news).
I've added language support, english is included.
There are two layout modes; one column based like the original, and one compact, row based. I left the table code in the column mode, while the row mode uses divs.
Both modes show a thin delimiter between blogs, and the row mode displays only one date per day.
There's a site-wide configuration screen, allowing admins to switch between layouts, and choose how many of the latest blogs should be shown.
Users are shown with their full names, instead of username.
I applied a liberal amount of CSS on it.
And a few other tweaks here and there. There's still quirks in it, but it should be much more moodly than before.
General question: I would very much like to see this included in the main Moodle distribution. How should I proceed in order to make this possible?
What's the intended license of this block? There are no notes about that in it, nor in any documentation I've seen. GPL, or something else?
I really like this block. Thanks for your work on this, Martin.
Wondering if someone would be willing to resolve these (non-critical) errors:
<>
Notice: Undefined variable: text in /home/g8/public_html/g8moodle1/blocks/updated_blogs/block_updated_blogs.php on line 87
><>and >
/tr>/tbody>Notice: Undefined property: stdClass::$footer in /home/g8/public_html/g8moodle1/blocks/moodleblock.class.php on line 240
Best,
Fernando
Hi odes this one work on 1.82? and f so how do you install it? i thougt it onle were to copy the files to block and land respectivitly bot that does not seem to work would be glad for a little help because it seems to be a nice block.
kind regards Daniel
Hi! Fernando.
I had got the same Notice messages in Moodle1.9.4+, then I had resolved it.
To adapt for Moodle1.9, you need to add two statements as follows,
in blocks/updated_blogs/block_updated_blogs.php, function get_content()
(1) Line 79
case "rows":
if (empty($text)) $text = '';
$lastlastmodified = "";
foreach ($rows as $row){
$info=get_user_info_from_db('id',$row->userid);
$lastmodified = date("D, d M y" ,$row->lastmodified);
if($lastmodified != $lastlastmodified) {
$lastlastmodified = $lastmodified;
$text.= '<div class="block_updated_blogs block_updated_blogs_modified">'.
(2) the end of the function
} else {
$this->content->text = "";
}$this->content->footer = '';
return $this->content;
}
Furthermore, this is a very important notice that you need to delete empty line at the end of this file!
function specialization() {
// Just to make sure that this method exists.
}
}?>
(Here!!)
I applied your patch.
The new version is a avaliable here:
http://morfeo.upc.es/crom/course/view.php?id=4
Thanks for your help.
DFWikiteam, Pigui
Hi Ludo.
Though this block is very simple, this is a very effective block, thanks! Many students have begun to write blogs after I had added this block to courses on my moodle site.
I improved this block. The improvements are for the improvement of the function and for a performance gain.
(Improvements of function)
- We can change display mode in three patterns.
- Handing the parameter 'course ID' to blog/index.php
- Adding a link to 'view all blogs on the site'
(Performance gain)
SELECT * -> SELECT p.subject,p.userid,p.id,p.lastmodified
Then, I rewrote function get_contents(), style.php and lang/en_utf8/block_updated_blogs.php.
Please check an attached zipfile and try it.
Thanks a lot for this contribution. I just tried it out in my site
carychineseschool.org
It is a great block.
Issues that I see (might be some config I ignored):
The Toggle button doesn't do anything. It just refreshes the page and back to original.
When not logged in, it is supposed to show only blogs visible to the World. In my display I only have one blog visible to the world. The second entry came from nowhere as that user never used blog so far. Might be a query issue and I will see whether it is something wrong with my database or not.
Updated Blogs
Thanks.
First of all, updated_blogs block is developed and distributed by Ludo, I just only rewrote it.
Your notices are right!
(1) Can not toggle display mode when the block is layouted on front page and user is guest
if ($COURSE->id == SITEID) {
$subtext1 = ') : <a href="'.$CFG->wwwroot.'/index.php?blogDisp=';
} else {
$subtext1 = ') : <a href="'.$CFG->wwwroot.'/course/view.php?id='.$COURSE->id.'&blogDisp=';
}
(2) Listing up blog entries which is allowed for site member only although the user is guest
if (isloggedin() && !isguest()) {
$sql .= ' or publishstate = \'site\')';
} else {
$sql .= ')';
}