Blogs: NEW BLOCK Last updates Blogs

Blogs: NEW BLOCK Last updates Blogs

by Ludo (Marc Alier) -
Number of replies: 17
Hi there!
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!! guiño
Ludo
ps. sorry for double post, I wanted to place it here but it ended up in blocks forum (where is also relevant)
Average of ratings: -
In reply to Ludo (Marc Alier)

Re: Blogs: NEW BLOCK Last updates Blogs

by Ludo (Marc Alier) -
Take a glipse of the block!
Attachment image.png
In reply to Ludo (Marc Alier)

Re: Blogs: NEW BLOCK Last updates Blogs

by Markus Knierim -
Hi Ludo,

Thanks for developing this block smile 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
In reply to Markus Knierim

Re: Blogs: NEW BLOCK Last updates Blogs

by Ludo (Marc Alier) -
Hi 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
In reply to Ludo (Marc Alier)

Re: Blogs: NEW BLOCK Last updates Blogs

by Charlene Barina -
I've noticed that the permalink doesn't work when it's a guest login - but when I or someone else is logged in, it's fine. Any idea why that may be the case?
In reply to Charlene Barina

Re: Blogs: NEW BLOCK Last updates Blogs

by C R -
anyway to remove the link to a help file (help) ?
In reply to C R

Re: Blogs: NEW BLOCK Last updates Blogs

by Roger Emery -
In the file block_updated_blogs.php add a semi-colon to the end of line 10 and a double slash to the start of line 11 to comment out the help icon code (in red below):-

$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 smile
In reply to Roger Emery

Re: Blogs: NEW BLOCK Last updates Blogs

by Charlene Barina -
I tried this once, but remembered this issue: it seems to ignore permissions for blog entry types - it'll show draft, site only, and world. Has this changed?
In reply to Ludo (Marc Alier)

Re: Blogs: NEW BLOCK Last updates Blogs

by Martin Samuelsson -
Is there any updated version of this block available? It provides a very nice functionality, but it doesn't seem to have been developed at all since it was announced, is this correct?

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.


In reply to Martin Samuelsson

Re: Blogs: NEW BLOCK Last updates Blogs

by Ludo (Marc Alier) -
Thank you Martin.
I'm applying your patch to the downlodable file..
Ciao wink
Ludo
In reply to Ludo (Marc Alier)

Re: Blogs: NEW BLOCK Last updates Blogs

by Martin Samuelsson -
(To both Ludo and Jordi)

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?

In reply to Martin Samuelsson

Re: Blogs: NEW BLOCK Last updates Blogs

by Fernando Oliveira -
Picture of Plugin developers

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

In reply to Fernando Oliveira

Svar: Re: NEW BLOCK Last updates Blogs

by Daniel Håkansson -

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

In reply to Fernando Oliveira

Re: Blogs: NEW BLOCK Last updates Blogs

by Tatsuya Shirai -

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!!)

In reply to Ludo (Marc Alier)

Re: Blogs: NEW BLOCK Last updates Blogs

by Tatsuya Shirai -

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.

In reply to Tatsuya Shirai

Re: Blogs: NEW BLOCK Last updates Blogs

by Qun Dai -
Tatsuya,

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

Display mode(This course) : Toggle
Monday, 20 July 2009, 08:00 AM
Tuesday, 16 June 2009, 01:44 PM

Thanks.
In reply to Qun Dai

Re: Blogs: NEW BLOCK Last updates Blogs

by Tatsuya Shirai -

First of all, updated_blogs block is developed and distributed by Ludo, I just only rewrote it. smile

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 .= ')';
        }