Simplog Discussion

Simplog Discussion

by Daryl Hawes -
Number of replies: 44
** Installing the simplog moodle module: **

-- Get the source --
Download moodle 1.3 beta - you can find it on the download page: http://moodle.org/mod/resource/view.php?id=8

Use cvs to checkout the contrib/simplog folder
cvs details:
http://moodle.org/doc/?frame=cvs.html

The line you want to checkout the contrib respository is:
cvs -z3 -d:ext:myusername@cvs.sourceforge.net:/cvsroot/moodle co contrib

In the new contrib folder that is created on your local hard drive you will find a simplog folder. That's the prize. Now you'll need to move all of the components in the correct spot.

-- Upload to your server --
First upload the moodle 1.3 beta to the server. I renamed the moodle folder "moodle1.3b" so I could have a test area on my server, you may want to do the same. Edit the config.php file as usual. If you are planning on using a second installation on your primary server as I am be sure to USE A DIFFERENT $CFG->prefix setting so you do not cause issues with your primary installation!

Now upload the simplog components.

Localization file: In the simplog folder find "lang-en". In there you'll find "simplog.php". Put this file in the moodle1.3b/lang/en folder.

Localilzed help files: In the simplog folder find "lang-en/help/simplog/". Put this folder in the moodle1.3b/lang/en/help folder.

Now upload the remaining files and folders in the simplog directory to the moodle1.3b/mod/ folder on your server.

-- Admin your server --
Now that the simplog components are in place you'll want to update your database to support it. Visit yoursite.com/moodle1.3b/admin/ to run the updater.
When the updater has been run click the continue link to continue on to the admin page. In the configuration area choose "modules". Now click the settings link for the simplog module and customize your settings as per the fields available.

-- Access simplog --
As discussed here:
http://moodle.org/mod/forum/discuss.php?d=7766&parent=37590
simplog does not yet integrate with courses. In order to get started with it you'll want to stop by its index page. Visit yoursite.com/moodle1.3b/mod/simplog/ and experiment.


Example installations:
http://www.cocoaobjects.com/moodle1.3b/
http://www.cocoaobjects.com/moodle1.3b/mod/simplog/
and
http://jmurdock.org/demo/
http://jmurdock.org/demo/mod/simplog/

Daryl
Average of ratings: -
In reply to Daryl Hawes

Re: Simplog Discussion

by Daryl Hawes -
You can also take a peek at the file "simplogToDo.txt" for a poorly organized list of things I know still need to be done on simplog. I thought it would be better to post it in its "alpha" form and let folks help me hone it than try to complete the ever mounting list of todo items behond closed doors.
In reply to Daryl Hawes

Re: Simplog Discussion

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks for all your work, Daryl.  approve

I have a question: can you please help me understand why incoming RSS feeds are necessary within a blog module?
In reply to Martin Dougiamas

Re: Simplog Discussion

by Daryl Hawes -
Actually there are quite a few reasons. One is behavior - blogging has taken off for a reason - it's addictive. People who blog tend to interact with other people who blog, it's one of the powers of the system. So, it's fitting that a blogger would want to display the most recent post title from their buddies on their own personal blog page.
Something like:
Interested in my posts? Then you'll love Steve's, and Jen's and Martin's and.....

The number of feeds from simplog can be staggering when fully realized. I plan to add more criteria but for now the user's id and the category that they are posting their entry to are arguments. So, you can get a feed which represents the last 'n' posts to the site from any user in any category. Or you can get a feed which represents the last 'n' posts to the "I love moodle" category by any member on the site, and so on... Now start multiplying out the number of members on your site with the number of personal and site wide categories they're likely to be able to post to.

So, on my personal blog page I might have a vested interest in posts to my own site by any member in the "Progress" category. There is a need for a reader.

The list goes on, but you probably get the point by now smile
In reply to Daryl Hawes

Re: Simplog Discussion

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
OK, sure. This description would fit what blogger.com does, for example, as a provider of a generic and public blogging space and has a similar set of assumptions to what the original Simplog has, I guess.

But there are three issues still in my mind:

  1. These are educational blogs by students and teachers which are meant to be reflective accounts based around the course goals. These people are already interacting with each other in the many Moodle activities. In most cases their blog should be describing a personal journey of transformative learning (and not always publically either). They should also be putting a personal spin on content (not simply linking to a list of links).

  2. Replicating content everywhere is possible, but is it desirable? If a student can identify an external news feed from somewhere else, even if it is related to the course goals, should it be displayed as part of their own blog? Or should it perhaps be combined with other feeds in a single place within the course? My point here is the potential of information overload rather than simpler and more focussed learning activities.

  3. On a technical level, I'm sure the blocks system will grow to allow both user preferences and placement on any page in Moodle (via the templates system), so I'm wondering how specific the block needs of a blogging module really are.

Do you think Simplog can move in these directions? If not, it might not be the Blog module I was looking for. mixed
In reply to Martin Dougiamas

Re: Simplog Discussion

by Daryl Hawes -
Martin,
When choosing a blog project to start from I had some criteria in mind.
First I had your blog bug to go on: http://moodle.org/bugs/bug.php?op=show&bugid=285

Second I wanted something relatively small. MoveableType and other very popular packages are VERY full features, but I would have a huge learning curve myself and I felt it would be tough for me to find a means of meeting moodle's needs.

Third I wanted something that was designed with multiple users in mind. A huge number of smaller blogging packages I came across were designed strictly as personal software. These were packages designed to be posted on a home page, not hosted on a web site.

Lastly I wanted something with seeminlgy approachable code. I did no PHP programming prior to moodle and hacking moodle has assisted tremendously with my learning curve. Whatever gets integrated should try to emulate that.

I chose simplog becuase it was one of the smallest project I found. It's to the point, a blogging system with just enough 'extras' - like a calendar and blocks - to make it usable. Also, it was designed for multiple user support. I stripped a great deal of that code out, actually, but the way that the code interacted with the tables provided me a guide in modifying it to match my vision for the module.

1. These are educational blogs by students and teachers which are meant to be reflective accounts based around the course goals. These people are already interacting with each other in the many Moodle activities. In most cases their blog should be describing a personal journey of transformative learning (and not always publically either). They should also be putting a personal spin on content (not simply linking to a list of links).
I think I'm missing something. I've rewritten my response to this three times now. Can I simply say that this has been my understanding since the beginning and that I think there is a fit here? I'm interested if folks who have used blogs in their class coursework, or encouraged students keeping blogs, have seen them as just "lists of links".
To see how I am using simplog on my site visit:
http://www.cocoaobjects.com/moodle/mod/simplog/index.php
Brett has done an excellent job of meeting my vision for blogs as an enhancement to the content on my site:
http://www.cocoaobjects.com/moodle/mod/simplog/index.php?blogid=8


Replicating content everywhere is possible, but is it desirable? If a student can identify an external news feed from somewhere else, even if it is related to the course goals, should it be displayed as part of their own blog? Or should it perhaps be combined with other feeds in a single place within the course? My point here is the potential of information overload rather than simpler and more focussed learning activities.
Perhaps there is a disconnect on what "their own blog is". The link to Brett's page above is an example of a blog. It's just the blog module index page with different arguments - do not show me all entires, show me all entries from this user. Since entries specifically from that user are being requested display personalization is allowed (which side blcoks do you want visitors to see, what visual template do you want your entries wrapped in? etc)

On a technical level, I'm sure the blocks system will grow to allow both user preferences and placement on any page in Moodle (via the templates system), so I'm wondering how specific the block needs of a blogging module really are.
My feeling, as per the lpoint above, is that a student should have access to add/remove/reorganize blocks for their "personal page". Simplog's block system should be dismantled and the best features of it should be incorporated into the moodle block system. Like course pages where the instructor can define block settings, a user's personal blog page should allow the user to define their block settings.

Do you think Simplog can move in these directions?
I have no doubt. It's small enough that it can be stretched in whatever direction we want to take it.
In reply to Daryl Hawes

Re: Simplog Discussion

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks very much for that! smile Particularly useful to see how it's being used on your site, so I feel I'm slowly seeing it more from your point of view.

I'm now thinking this should be a central site-wide feature like the calendar (rather than an activity module), in moodle/blog, with basically one common area that shows different things to different people depending on roles and options and context. You could get into it via a "Latest Blog entries" block on the course page, or perhaps as another entry on the "People" block (as well as a link from each user's profile page). Adding a blog in any particular week or topic doesn't make sense.

Hmm, yes, sounding much better.
In reply to Daryl Hawes

New blocks proof of concept.

by Daryl Hawes -
New blocks proof of concept.

-- REASON --
In an earlier post I said:

"a student should have access to add/remove/reorganize blocks for their "personal page". Simplog's block system should be dismantled and the best features of it should be incorporated into the moodle block system. Like course pages where the instructor can define block settings, a user's personal blog page should allow the user to define their block settings."

I decided that the best way to demonstrate an integrated block module was to just write it. I downloaded the moodle 1.3b release as a starting point. I examined the ways that blocks currently work. I then started coding smile

-- WHERE TO FIND CODE / WARNINGS--
I've posted this update to the existing blocks module to the contrib cvs area. I put it in the simplog area in a folder 'blocks2'.
Caveats:
-The database changes must be manually performed to test this code (see note at the end of this post).
-This code is posted as a 'proof of concept', so please be careful.
-This code is not complete, but it's enough to demonstrate the direction.


-- ABOUT / DISCUSSION --
This version of blocks isn't linked to a course, but rather a page defined by a module name and module id - together defining a unique "page". Each unique "page" can have its own set of blocks that can be managed. Multiple instances of blocks are now allowed per page and

To see a simplistic example of the changes visit:
http://www.cocoaobjects.com/moodle1.3b/course/view.php?id=2



-- DATABASE CHANGES --
This version includes changes to the database which I have not included in the source. To test on your non-production site refer to these notes:
renamed mdl_blocks table to mdl_block_type (easier to search for, more descriptive, and matches other mods with multiple tables prefix_modname_tablefunction)

created new table mdl_block_list to hold information on instances of blocks (rather than the blockinfo field in the mdl_course table

#
# Table structure for table `prefix_block_list`
#
# Creation: May 16, 2004 at 05:45 PM
# Last update: May 16, 2004 at 05:45 PM
#

CREATE TABLE `prefix_block_list` (
`id` int(11) NOT NULL auto_increment,
`blk_type_id` int(11) NOT NULL default '0',
`module` varchar(64) default NULL,
`module_id` int(11) NOT NULL default '1',
`title` varchar(64) NOT NULL default '',
`extra_content` longtext,
`rss_id` int(11) NOT NULL default '0',
`block_order` int(11) NOT NULL default '0',
`position` enum('l','r') NOT NULL default 'l',
`enabled` int(11) NOT NULL default '1',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

id = unique ID for this particular instance of block
type_id = the type of block we're creating an instance of
module = the name of the module that we're creating this block for, together with module_id defines the page that this instance will display on
module_id = the page identifier for the module (course_id, blog_id, etc), together with module defines the page that this instance will display on
title = the text to be displayed in the block header.
extra_content = supportive text information for customized block contents
rss_id = if block type is rss feed then this is the id for the feed in the rss table
block_order = the verticle order that this block instance appears in on the specified page
position = either "l" or "r" depending on which side of the page this block is configured for
enabled = hide/show blocks of this type on this page


and finally a new field was added to the newly renamed block_type table: 
`allows_multiple` int(11) NOT NULL default '0',
allows_multiple = can more than one instance of this block type be created per page?
In reply to Daryl Hawes

Re: Simplog Discussion

by Daryl Hawes -
I've uploaded more changes to cvs today. Simplog's pages now display moodle blocks and their positions per page are editable as they are in courses.
In reply to Daryl Hawes

Re: Simplog Discussion

by Jacob Romeyn -

I get the following error when I install it. Any sugestions?

Parse error: parse error, unexpected T_LNUMBER in /var/www/html/moodle/mod/simplog/mod.html on line 70

I installed it on two different servers with the same result

In reply to Jacob Romeyn

Re: Simplog Discussion

by Daryl Hawes -
I find it interesting that mod.html is being called at all. I had been meaning to remove it as config.html does the same thing I had though mod.html was supposed to. Could you remove the mod.html file from the server and see if that eliminates the error (and perhaps if a new one arises)?
Thanks
In reply to Daryl Hawes

Re: Simplog Discussion

by Jacob Romeyn -

Hi Daryl

Now it says:

This module cannot be added to this course yet! (No file found at: ../mod/simplog/mod.html)

Average of ratings: Useful (1)
In reply to Jacob Romeyn

Re: Simplog Discussion

by Daryl Hawes -
I see. I now understand the issue AND I believe I now understand what in the world mod.html is.
To answer your question:
The first post in this discussion goes over how to install the moodle module.

What you are doing is going into one of your courses and choosing to add a simplog as a course activity.

What you need to do is first visit the admin page to ensure simplog is setup properly and then second directly visit the simplog index page.


-- Admin your server --
Now that the simplog components are in place you'll want to update your database to support it. Visit yoursite.com/moodle1.3b/admin/ to run the updater.
When the updater has been run click the continue link to continue on to the admin page. In the configuration area choose "modules". Now click the settings link for the simplog module and customize your settings as per the fields available.

-- Access simplog --
As discussed here:
http://moodle.org/mod/forum/discuss.php?d=7766&parent=37590
simplog does not yet integrate with courses. In order to get started with it you'll want to stop by its index page. Visit yoursite.com/moodle1.3b/mod/simplog/ and experiment.


No wonder I have not previously seen the error in the mod.html file smile


Further information:
config.html allows a module to show a configuration page in the administration section of moodle.
mod.html is what the course interfaces with when adding a course activity instance.

Simplog does not comply as a course module in that regard. Martin was surely right in an earlier post here when he said:

"I'm now thinking this should be a central site-wide feature like the calendar (rather than an activity module), in moodle/blog,"
In reply to Daryl Hawes

Re: Simplog Discussion

by Jacob Romeyn -

Still a problem:

The database updated fine, without errors.  I checked the setting in the Module setup.

 I then go to:

http://fortlangley.net/moodle/mod/simplog/    and than get:

Fatal error: Call to undefined function: block_blocks_on_page() in /var/www/html/moodle/mod/simplog/header.php on line 92


In reply to Jacob Romeyn

Re: Simplog Discussion

by Daryl Hawes -
First reassure me that you are testing this on a test server. This is not ready for prime time (as you're noticing) so it should not be on a production server.

I've been working on some changes to moodle blocks. My hope is to use moodle blocks instead of simplog blocks on my pages.
The header and footer checked in refer to these new files.

You have two options. Check out version 1.1 of simplog/header.php and simplog/footer.php to try using the older configuration or put the files in the simplog/blocks2 folder in the appropriate places within your moodle installation to test the changes to the blocks.

Thanks for testing and for your patience.
In reply to Jacob Romeyn

Re: Simplog Discussion

by Daryl Hawes -
Jacob,
I have just uploaded a new header and footer into cvs. These check to see if the blocks2 stuff is in place before trying to use it, and if it fails to find the new blocks it uses the existing simplog block system.
Thanks again.
In reply to Daryl Hawes

Re: Simplog Discussion

by Jacob Romeyn -

Daryl

Yes I'm using it on a test server.  I got a lot further with the latest cvs. The page come up, I can edit the module page. But, I still get an error when I try to add  entries to the  block:

Fatal error: Call to a member function on a non-object in /var/www/html/moodle/mod/simplog/edit.php on line 55

In reply to Jacob Romeyn

Re: Simplog Discussion

by Daryl Hawes -
Jacob,
I have uploaded a new version of edit.php for you, please check it out of cvs. The commit message: "another fix for Jacob Romeyn. Jacob is using the 'older' simplog blocks on his test site. The index.php page is showing an 'add entries to your blog' link when it should not be since he has not yet enabled his blog. This edit.php change checks before attempting to edit a blog that exists - if no blog exists then the user is given a message to enable their blog first"
The default simplog blocks may not correctly include the administration block. If the administration block is present on the right side of the index page you'll notice a link to 'enable your blog' - that's the link you want to start with.
This fix to edit.php checks to ensure that your blog exists before attempting to edit it - if you have no blog you are given an error page instucting you to enable your blog complete with a link.
This particular development pointed out two 'bugs'. One is that the index page should not have had an 'Add entries to your blog' link when you haven't setup your blog yet and the other is the above edit.php discussion.
Keep me posted and thanks for your efforts!
In reply to Daryl Hawes

Re: Simplog Discussion

by Jacob Romeyn -
The latest edit.php Wed May 26 21:06:00 2004  and it is the same as before.
In reply to Daryl Hawes

Re: Simplog Discussion

by Jacob Romeyn -

Hi Daryl

Thank you much, it,s all working now. I will spend some time playing with it.

Thank you again for all your support.

In reply to Jacob Romeyn

Re: Simplog Discussion

by Ger Tielemans -

On a windows2000/apache machine I get:

Warning: mktime(): Windows does not support negative values for this function in c:\easyphp17\www\moodle13final\mod\simplog\lib.php on line 1299
In reply to Ger Tielemans

Re: Simplog Discussion

by Daryl Hawes -
Ger, I'm curious when you downloaded your test code.
Is it in the structure contrib/blog/blog/lib.php
or contrib/simplog/lib.php?

The function it's having trouble with MAY be
function blog_mk_getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday
In reply to Daryl Hawes

Re: Simplog Discussion

by Russ Abbott -

I'd love to have a blog capability in Moodle.

I came to Moodle after evaluating a large number of CMS/Blogging/Wiki systems for one that provided a good intuitive blogging/wiki capability.  (See, for example, http://russabbott.blogspot.com/2004/07/cms-bliki-requirements.html for what I was looking for and http://russabbott.blogspot.com/2004/07/candidate-bliki-cmss.html for a list of candidates).

Of all of them, I think Moodle is by far the best--even though my primary area of application is not course development.

What I don't understand is why you don't see Moodle as already having the basics of Blogging.  Apparently one can subscribe to a forum through an RSS feed.  It would seem that all one needs for a blog is (1) the ability to restrict a forum to a single poster (with others allowed to comment) and (2) a revised formatting style so that each entry in the forum/blog is presented as text directly on the forum/blog page rather than as a link. 

Why isn't that basically it?

-- Russ

In reply to Russ Abbott

Re: Simplog Discussion

by W Page -
Hi Russ,

You can download MoodleBlog from the following link and try it out.
http://moodle.org/download.php/modules/blog.zip

WP1

In reply to W Page

Re: Simplog Discussion

by Russ Abbott -

Ok.  I downloaded MoodleBlog as suggested and extracted it to a Blog directory.  Then I copied all the files as instructed in the README. Now what do I have to do? 

I was hoping (naive me) that Blog (or MoodleBlog or Simplog) would just show up in the pull-down list of things I could add to the Main Menu.  But to my distress it didn't.  (I also logged out of Moodle, closed the browser, and started again. But that didn't help either.)

I seems to be all thumbs when it comes to System Administration, so I apologize if I missed something obvious.

Thanks for your help.

-- Russ

In reply to Russ Abbott

Re: Simplog Discussion

by W Page -
Hi Russ,

The MoodleBlog is not for a production system as of yet.

  1. Create a Course
  2. On Course page you will see a block "on the right" which is titled "Blocks".  It has a dropdown form in it. 
  3. Choose "Blog Menu" from the dropdown list.
  4. Take it from there.

Hope this helps.


WP1
In reply to Russ Abbott

Re: Simplog Discussion

by Daryl Hawes -
Russ,
I have added information on what you might want to do once you have installed the files to the README_MOODLE.txt file in cvs.
Thanks for the note.
Daryl
In reply to Russ Abbott

Re: Simplog Discussion

by Daryl Hawes -
Russ,
When I started porting simplog over to become the moodle blog feature that it is becoming we did not have RSS feeds. We did not have a calendar either. These are relatively new features to moodle and my work is cut out for me in integrating the blog module with what is now available.

Requirements from http://russabbott.blogspot.com/2004/07/cms-bliki-requirements.html with my comments inline.


1. Wiki or otherwise easily user-editable pages
-- moodle's html editor will be available once Jon helps me find that javascript error smile

1.d. Flip back and forth between HTML and "preview" views.
-- the blog module has entry preview

1.e. Pages with different owners and protections.
-- Each user is allowed one blog. Admins can modify any blog. Teachers can modify entries associated with courses they teach for any student.

1.g. Page creation (as in wikis) simply by referring to a page that doesn't yet exist.
-- Interesting. I don't see why this could not be added, but it's beyond me at the moment.


2.a. Multiple separate blogs for multiple users.
-- Each user is allowed one blog. However, within a blog the user can create their own personal categories and post to that category.

2.b. Cumulative blog that combines all blogs in one feed.
-- Yes.

2.c. Blog(s) and wiki integrated. A blog entry also can be a wiki page.
-- Sounds like something cool for the future.

2.d. Wiki page changes syndicated as a blog feed.
-- Sounds like something cool for the future.

3. File (document, image, etc.) upload capability.
-- There is no file management for blogs yet.

4. Elegant look and feel
-- I hope to simply use Moodle Themes as much as possible in the blog. I've been trying to remove any hard coded fonts/colors/etc.

5. Site navigation
5.a. Text search capability
-- I'm looking forward to using whatever system comes from Petr for plugging into global search capabilities.

5.b. Traditional tree structure
-- ?

5.c. Category structure
-- Each user can add their own categories, admins can add categories that become available to all users and teachers can add categories that become available to all students of a given course. Site visitors can view entries based on category.

5.d. Date structured archive for blog entries
-- Entries are dated. Site visitors can view entries based on date. I do not yet have calendat integration working since the moodle calendar is so very course centric.

5.e. Site map perspectives both as text and as clickable expandable structure.
-- I'd be interested in hearing more about this. Could you detail the idea or mock up some screen shots?

Thanks,
Daryl
In reply to Daryl Hawes

Re: Simplog Discussion - RSS

by Daryl Hawes -
This post is an attempt to explain/document how simplog's RSS feeds work. It is in response to Jon Papaioannou's call for an rsslib.php posted as:
Let's get organized: rsslib.php - http://moodle.org/mod/forum/discuss.php?d=7896

-- What is RSS? -- Let's start with some discussion on what "news feeds" are (At least I will - some of you will skip ahead I'm sure smile ). Note that there are many, many terms used somewhat interchangeably in this space: news feeds, news syndication, RSS, RDF, Atom. There are different techniques and file formats, but the intent is pretty much the same.

Mark Pilgrim has done some great work in the "news feed" or "news synidication" space. Here is a nice article from him titled "What is RSS?": http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html

Of interest to developers of news feeds is Mark's feed validator:
http://feeds.archive.org/validator/
My humble opinion: as a community we must constantly run our site feeds through the validator and report any problems here. Invalid feeds can cause news readers to crash and other crazy behavior that will frustrate end users and site admins alike.

Also, for more info one should visit the link that Eloy recently posted.
Jordi Adell has sent this link in the "Moodle en Español" course. As a reference only:

RSS: A Learning Technology Eva Kaplan-Leiserson Learning circuits, May 2004 http://www.learningcircuits.org/2004/may2004/0405_trends.htm

-- Simplog's role as a news feed publisher-- Simplog is a blogging tool. As such it's important that it be capable of publishing "news feeds". There are several different file formats for publishing news feeds. The authors of simplog (see http://www.simplog.net) saw fit to support RSS v 0.9, RSS v 2.0 and the new Atom file format.
After getting moodle's login accounts working and other basic integration tasks (which were anything but basic to me) I started working on the news feed publishing system. It turns out that simplog uses three files for this, one for each feed type - rss, rss2, and atom.

You can review these files in cvs:

Each of these files outputs a single xml document.
It serves an http header defining the file as such:

// need to set the output content type to text/xml
header("Content-type: text/xml");

The xml is built on the fly using data retrieved from the database relevant to the requested user's blog or other arguments.

There was an existing file caching mechanism. I modified it to store the cache files in moodle's dataroot folder.

$xmlDir = $CFG->dataroot.'/simplog';
check_dir_exists($xmlDir,true); //this is a function in lib.php that creates the folder if missing
$file = $xmlDir.'/rss_'.$blogid.'_'.$categoryid.'.xml';

The frequency for refreshing the cache is handled differently than the current rss moodle block, which I believe grew from this discussion: http://moodle.org/mod/forum/discuss.php?d=5070.
In the current rss code a cron job is used to refresh the cache files. I didn't look into the cron code that deeply, but at a guess I'll assume that all feeds for the site are refreshed at the same interval whether they have been active or not. Simplog attempts to be as nice as possible to the file system. When a feed is requested a check is performed. If there is no cache file for that feed yet it's created on the spot and served up, so feeds that have not been requested are not being created on the file system for no reason. If the file exists then I check an admin configurable timeout period to see if the file is too old. If it's not too old the file is served, if it is too old then the file is recreated and the new one is served.
$secs = $CFG->simplog_timeout * 60; # number of seconds in timeout value

These file formats are only subtly differnet. I can certainly see rsslib functions serveRSS0.9(), serveRSS2(), and serveAtom() as being possible.

Once I had the three news feed publishing files working again I took advantage of the rss discussion at http://moodle.org/mod/forum/discuss.php?d=5070 to create some extra feeds.
Having found example code to publish moodle's news I went ahead and created three new files for that, one for each format as well. I used the simplog files as a base and simply replaced the data being shared with data from moodle's news.

One thing you may notice is that I do not use the library file that was supplied with the original sample code. To be frank I found it to be overly confusing. Perhaps I'm missing something but the majority of the functions create tags that could just as easily be in a string, and much more readable by a novice programmer in that string. One of the things that attracted me to moodle was its clean coding. I mean no harm by this assessment, so I hope this doesn't spark any controversy. I just wanted to note why I chose to stick closer to the original simplog format.

-- Simplog's role as a news feed aggregator/reader-- OK, this is a bit more complex so I'll save the detailed explanation for later.
An overview:
Users are allowed to add news URLs for remote news feeds.
Simplog uses the xmlrpc.inc files from usefulinc.com to download and cache the remote news feed. The cache files are now stored in the moodle dataroot.
A simplog user can create a custom side block for their personal blog page. In that block they can place an RSS feed. A user can place multiple feeds, even multiple instances of the same feed in their side blocks.
When displaying the feed another trip is made to the xmlrpc.inc files to read from the cache files and format the information for side blocks.

In reply to Daryl Hawes

Re: Simplog Discussion

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Just installed simplog. It looks like the mysql file doesn't create the main table (simplog). What is the structure of this table?

mike

In reply to Mike Churchward

Re: Simplog Discussion

by Daryl Hawes -
Mike - there is no prefix_simplog table. I'll soon move simplog from moodle/mod to the moodle/ root folder. Once you have the simplog pieces installed just visit http://yoursite.edu/moodle/mod/simplog/
I'll post new instructions here soon once I have the latest date handling changes tested and then uploaded.
Thanks for testing.
In reply to Daryl Hawes

Re: Simplog Discussion

by Daryl Hawes -
I have added some more changes to cvs.

An addendum to the installation notes at the top of this page:
In the simplog folder you will find a folder "blocks2". Copy the files in there to the appropriate folder locations in your test moodle installation ie. blocks2/admin/block.php to moodle/admin/block.php etc etc


I've recently made some changes to the way that simplog works with dates. This change includes database schema changes. Testers should start fresh to see these changes and not get errors.

Is there an adventurous alpha tester willing to do a clean install and report php errors/warnings/notices that might appear. Tom Murdock was nice enough to install clean recently and he's having a problem, so I could use some more data to find the culprit.
Attachment screenshot.jpg
In reply to Daryl Hawes

More changes in cvs

by Daryl Hawes -
I've uploaded some more changes into cvs just now. It should be available by tomorrow in anonymous checkout.

Simplog now lives in moodle/blog instead of moodle/mod/simplog. Also added are publish states - draft, site members, public. These changes did require database changes.

Here are some quick new instructions on getting the cvs version installed as of today:

-- Get the source --
Download moodle 1.3.1 release (not tested with 1.4dev) - you can find it on the download page: http://moodle.org/mod/resource/view.php?id=8

Use cvs to checkout the contrib/simplog folder
cvs details:
http://moodle.org/doc/?frame=cvs.html

The line you want to checkout the contrib respository is:
cvs -z3 -d:ext:myusername@cvs.sourceforge.net:/cvsroot/moodle co contrib

In the new contrib folder that is created on your local hard drive you will find a simplog folder. Next you'll need to move all of the components in the correct spot.

-- Upload to your server --
First upload the moodle files to your demo server normally. I'd recommend uploading the .tar.gz file and extracting it on the server using ssh if you can. Edit the config.php file as usual. If you are planning on using a second installation on your primary server as I am be sure to use a different database or a different $CFG->prefix setting so you do not cause issues with your primary installation!

Now upload the simplog components.

Localization file: In the simplog folder find "lang-en". In there you'll find "simplog.php". Put this file in the moodle1.3b/lang/en folder.

Localized help files: In the simplog folder find "lang-en/help/simplog/". Put this folder in the moodle1.3b/lang/en/help folder.

Blocks: I've been working on a change to moodle blocks that requires its own databse settings, etc. In the simplog folder find "blocks2" and upload the components to the appropriate directories (ie. simplog/blocks2/admin/index.php to moodle/admin/index.php etc)

Next create a new folder on your server - moodle/blog. Upload the remaining files and folders in the simplog directory to this new moodle/blog folder on your server.

Now that the simplog components are in place you'll want to update your database to support it. Visit yoursite.com/moodle/admin/ to run the update scripts.
When the update is done click the continue link to continue on to the admin page. In the configuration area choose "Blog Admin". Customize your settings.

Finally visit yoursite.com/moodle/blog/ and experiment.

Thanks,
Daryl
In reply to Daryl Hawes

Latest Tester Instructions

by Daryl Hawes -
Installation just got easier.
With Martin's help the folder structure has been reorganized.

Use cvs to checkout contrib/blog (not a type-o - simplog has been renamed to blog) Note that the wholesale find + replace of simplog to blog means another database change.

To install the blog module:
Put the contents of the folders in contrib/blog in their matching places in your test server's moodle root. contrib/admin/index.php -> moodle/admin/index.php, etc.
Copy the blog folder to your moodle root.
Visit the admin page.


Easier, no? smile
In reply to Daryl Hawes

Re: Simplog Discussion

by Daryl Hawes -
A quick note that the latest version of the blog module for testing can be downloaded directly from
http://moodle.org/download.php/modules/blog.zip
In reply to Daryl Hawes

Re: Simplog Discussion

by W Page -
Hi Daryl!

I really want to try this mod but when I unzipped it I could not find a "ReadMe" or "Installation" file so I would know how to install it properly.  After I reviewed the thread, it was still unclear to me what to do coming in at this point of the mod's development.  I took a chance and just uploaded the "blog" folder with all its contents into the "mod" directory.  I got back an error message when I went to the Admin page which indicated  something like the following,

Module blog: /homepages/22/d12345999/htdocs/moodle/mod/blog/version.php was not readable

Two questions,

  • Should I have installed the module differently?  If so what is the proper installation for the blog mod?
  • How do I get rid of the error message?
Thanks in advance for your help with this.

WP1
In reply to W Page

Re: Simplog Discussion

by Daryl Hawes -
An excellent point!
A readme at the root level would be quite useful.

I am adding a new README_MOODLE.txt file to the base folder now.
Installation directions from that new file:

=================================================
Installation
=================================================

First download the blog module at:
http://moodle.org/download.php/modules/blog.zip
(since you're reading this readme file you probably have that part
taken care of)

Next decompress the zip file. You should have a new folder called blog
with various folders and this readme inside.

The contents should be similar to:
blog/README_MOODLE.txt
blog/user
blog/theme
blog/pix
blog/lib
blog/lang
blog/course
blog/blog
blog/blocks
blog/admin

Now you'll want to copy the contents of these folders into the appropriate
folders in your test moodle install server.

As of 20040624:

Copy all of the files in the admin folder to the moodle admin folder
blog/admin/* -> moodle/admin/

Remove the moodle blocks folder and replace it with the blog blocks folder.
blog/blocks/ -> moodle/

Copy the blog/blog folder into the moodle folder. This goes at the same
level as blocks, calendar, admin, etc. - it does not go in the mod subfolder.
blog/blog/ -> moodle/

Copy all of the files and the entire format folder from the blog course
folder to moodle course.
blog/course/* -> moodle/course/

Copy the blog.php file from lang to moodle lang en.
blog/lang/en/blog.php -> moodle/lang/en/blog.php

Copy the blog help folder to the moodle english help folder.
blog/lang/en/help/blog/ -> moodle/lang/en/help/

Copy the blocklib file in the blog lib folder to moodle lib.
blog/lib/blocklib.php -> moodle/lib/

Copy the blog folder in pix to the moodle pix folder.
blog/pix/blog/ -> moodle/pix/

Copy the view.php file to the moodle user folder.
blog/user/view.php -> moodle/user/
In reply to Daryl Hawes

Re: Simplog Discussion

by W Page -
Hi Daryl,

Thank you so very much for this detailed "ReadMe" installation file.

I will let you know how it goes.

WP1

In reply to Daryl Hawes

Re: Simplog Discussion

by W Page -
Hello Daryl,

This is some follow up.

Believed I followed the instructions in the "README_MOODLE.txt" file. During the process to update the database, the following two things happened,

  • Some code was displayed in the upper left of the page (see purple arrow).
  • Received the following messag >> "activity_modules block could not be added to the block list!". (see yellow arrow).

This occurred on a v1.3.1+ install and a v1.4DEV install.

What can I do to correct this situation?

WP1
Attachment post_blog_01.gif
In reply to W Page

Re: Simplog Discussion

by Daryl Hawes -
Ger had this same problem on his test installation.

The array printout that your purple arrow points to is just a little debug information for me. I realize it's a little disconcerting when there is no debug content, so I will add a little extra code to suppress the display unless there is a problem to report smile

The activity_modules block problem is something that I cannot reproduce after several 1.3.1+ installations. My server host is on a linux system.
I'm not sure what steps I might be doing differently than what I have documented.
I believe that the problem MAY be that the blocks version is mixed up between the one in cvs and the 1.3.1 version.

Can you perhaps check that the lib/blocklib.php file and that the blocks folders have indeed been completely replaced?

I would appreciate any help you can offer in getting to the bottom of this problem smile

Thanks
In reply to Daryl Hawes

Re: Simplog Discussion

by W Page -
Hi Daryl!

I deleted the "lib/blocklib.php" file from both the v1.3.1+ and v1.4DEV installations. Then I uploaded a fresh one from the "blog" folder. Got the same results.

Also, when I clicked on continue from that page (noted in the image above), I got an error message like the following.

Fatal error
: Call to undefined function: blocks_used() in /homepages/22/d12345999/htdocs/moodle/index.php on line 110

Line 110 in "moodle/index.php" is just "}". I noted its location below.

if (iscreator()) {
if (!$firstcolumn) {
echo "<td width=\"$side\" valign=top nowrap>";
$firstcolumn=true;
}
print_admin_links($site->id, $side);
}

if ($firstcolumn) {
echo "</td>";
}
if ($lastcolumn) {
echo "<td width=\"70%\" valign=\"top\">";
} else {
echo "<td width=\"100%\" valign=\"top\">";
}

If I visit a course page I see "Image 1" below. If I put "editing on" I see something like "Image 2" below with the error message,

Warning: Invalid argument supplied for foreach() in /homepages/22/d12345999/htdocs/moodle/lib/blocklib.php on line 919

Line 919 in "lib/blocklib.php" is "foreach($blocks as $val) {". It is noted in context below.

// This is used to register the blocks that are displayed in the course page.
// Set in course/view.php, and read from any other place.
function blocks_used($blocks = NULL, $records = NULL) {
static $used = NULL;

if(!empty($blocks) && !empty($records)) {
$used = array();
foreach($blocks as $val) {
if($val > 0 && isset($records[$val])) {
$used[] = $records[$val]->name;
}
}
}

return $used;
}

I hope this information is helpful in resolving the
activity_modules block problem.

WP1



 
Attachment post_blog_02.gif
In reply to W Page

Re: Simplog Discussion

by Daryl Hawes -
One of the errors you are seeing will help me add some extra checks, but for the most part the errors on the course pages are due to the failed admin install.
May I send you a few debug files and instructions on how to tweak your database a bit in order to get more debug output from your admin pages?
Daryl
In reply to Daryl Hawes

Re: Simplog Discussion

by W Page -
Sure Daryl,

Just also include instructions as to how to install the "debug" scripts.

WP1
In reply to W Page

Re: Simplog Discussion

by Daryl Hawes -
W Page,
Thank you very much for your patience and your assistance.
It appears that you have helped me track down the install bugs. Testers should be able to follow the instructions in the README_MOODLE.txt file with relative ease. I hope. smile
If you come across any more problems please send the reports my way.
Daryl