This is not a major update, so there are no changes to the database or new functions added. I am still interested in adding new features to Course Blog, including support for tags and groups. I also want to figure out how to get Course Blogs to work with the Moodle back-up function. Some of these are really complex, but if you know how to make that work, feel free to post the code or send it to me. I also want to add a 'save as draft' option. Any other ideas or contributions are gladly accepted. Just PM with what you are doing so I don't duplicate your efforts. I think that the db files need to be changed over to the newer upgrade method.
Also - a Swedish language file (courtesy of Tobias Wallenqvist - thanks!) was added. I think I've added all of the stuff that has been submitted so far, but if I forgot something - let me know and I will add it.
Hi Matt
Tried 0.7.3 this morning and this is what I got. Looks like problem creating the tables, I will try to get a SQL guru friend of mine to have a look.
Thanks for you efforts.
This script generated 3 warnings - Scroll to the first warning
simpleblog
--------------------------------------------------------------------------------
(mssql): CREATE TABLE mdl_simpleblog ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0', intro text NOT NULL, name varchar(255) NOT NULL default '', menuvisible int(2) NOT NULL default '0', commentforum int(10) NOT NULL default '0', bloglevel int(2) NOT NULL default '1', teacher1 char(3) NOT NULL default '0', teacher1edit char(1) NOT NULL default 'y', teacher1others char(1) NOT NULL default 'y', teacher2 char(3) NOT NULL default '0', teacher2edit char(1) NOT NULL default 'y', teacher2others char(1) NOT NULL default 'y', student1 char(3) NOT NULL default '0', student1edit char(1) NOT NULL default 'y', student2 char(3) NOT NULL default '0', student2edit char(1) NOT NULL default 'y', PRIMARY KEY (id), KEY course (course)) TYPE=MyISAM COMMENT='Defines simpleblog'
--------------------------------------------------------------------------------
170: Line 1: Incorrect syntax near 'unsigned'.
ADOConnection._Execute(CREATE TABLE mdl_simpleblog ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0', intr..., false) % line 891, file: adodb.inc.php ADOConnection.Execute(CREATE TABLE mdl_simpleblog ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0', intr...) % line 89, file: dmllib.php execute_sql(CREATE TABLE mdl_simpleblog ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0', intr...) % line 235, file: dmllib.php modify_database(/var/www/html/moodle/mod/simpleblog/db/mssql.sql) % line 389, file: adminlib.php upgrade_activity_modules(https://imaze.hillsgrammar.nsw.edu.au:9003/moodle/admin/index.php) % line 422, file: index.php
ErrorScroll to next warning
--------------------------------------------------------------------------------
(mssql): CREATE TABLE mdl_simpleblog_archives ( id int(10) NOT NULL auto_increment, cmid int(10) NOT NULL default '0', userid int(10) NOT NULL default '0', searchString varchar(6) NOT NULL default '', archiveDate varchar(50) NOT NULL default '', PRIMARY KEY (id)) TYPE=MyISAM COMMENT='Holds simpleblog archives'
--------------------------------------------------------------------------------
170: Line 1: Incorrect syntax near 'auto_increment'.
ADOConnection._Execute(CREATE TABLE mdl_simpleblog_archives ( id int(10) NOT NULL auto_increment, cmid int(10) NOT NULL default '0', userid int(10) ..., false) % line 891, file: adodb.inc.php ADOConnection.Execute(CREATE TABLE mdl_simpleblog_archives ( id int(10) NOT NULL auto_increment, cmid int(10) NOT NULL default '0', userid int(10) ...) % line 89, file: dmllib.php execute_sql(CREATE TABLE mdl_simpleblog_archives ( id int(10) NOT NULL auto_increment, cmid int(10) NOT NULL default '0', userid int(10) ...) % line 235, file: dmllib.php modify_database(/var/www/html/moodle/mod/simpleblog/db/mssql.sql) % line 389, file: adminlib.php upgrade_activity_modules(https://imaze.hillsgrammar.nsw.edu.au:9003/moodle/admin/index.php) % line 422, file: index.php
Scroll to previous warningErrorScroll to next warning
--------------------------------------------------------------------------------
(mssql): CREATE TABLE mdl_simpleblog_entries ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0', cmid int(10) NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', title varchar(255) NOT NULL default '', entry text NOT NULL, date varchar(50) NOT NULL default '', searchString varchar(6) NOT NULL default '', discussionPost int(10) NOT NULL default '0', timemodified bigint(10) NOT NULL default '0', usermodified bigint(10) NOT NULL, note text NOT NULL, notemodified bigint(10) NOT NULL default '0', noteid bigint(10) NOT NULL, imported varchar(1) NOT NULL default 'n', PRIMARY KEY (id), KEY course (course)) TYPE=MyISAM COMMENT='Holds simpleblog entries'
--------------------------------------------------------------------------------
170: Line 1: Incorrect syntax near 'unsigned'.
ADOConnection._Execute(CREATE TABLE mdl_simpleblog_entries ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0..., false) % line 891, file: adodb.inc.php ADOConnection.Execute(CREATE TABLE mdl_simpleblog_entries ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0...) % line 89, file: dmllib.php execute_sql(CREATE TABLE mdl_simpleblog_entries ( id int(10) unsigned NOT NULL auto_increment, course int(10) unsigned NOT NULL default '0...) % line 235, file: dmllib.php modify_database(/var/www/html/moodle/mod/simpleblog/db/mssql.sql) % line 389, file: adminlib.php upgrade_activity_modules(https://imaze.hillsgrammar.nsw.edu.au:9003/moodle/admin/index.php) % line 422, file: index.php
Scroll to previous warningErrorScroll to continue button
Cheers,
Andrew
I am having an issue with the Students only blog type.
Teachers cannot see the students blogs as it is creating a teacher blog as well (see screenshot) which it shouldn't be. In the attached image I am logged in as a teacher of the course but dont get to see the student blog list like I should.
Before you ask, yes I have assigned the Teacher and student blog roles in the setup but this has made no difference.
The other blog types all work as they should.
Any ideas?
I am having the same problem as Julian although it seems more extensive Whatever role I am logged in as (admin, teacher, student) I am unable to add entries. With a couple of combinations of blog type and user type I may get an 'Add blog post" link but get thrown to the "You are not allowed to add ..." warning. Running 1.9 on postgres.
Nigel
Nigel,
We had the same problem. I have attached the blogpost.php file. I think we only modified the blogpost file, but could send the post.php if this does not work. We found we had to give a field value to all fields in the post command and then it worked. The code is below, the files are attached. We are running 1.9, but do not have Matt's most recent (5/28) update (ours was in place on 5/1).
/// Set variables for blog post and create entry
$timenow = time();
$entryDate=date("F j, Y (g:i a)");
$searchString=date("Ym");
$archiveDate=date("F Y");
if ($entry) {
$newentry->course = $course->id;
$newentry->cmid = $cm->id;
$newentry->userid = $USER->id;
$newentry->title = $form->title;
$newentry->entry = $form->entry;
$newentry->date = $entryDate;
$newentry->searchString = $searchString;
$newentry->discussionPost = $discussions->id;
//We added the following
$newentry->timemodified = 0;
$newentry->usermodified = $USER->id;
$newentry->note = '';
$newentry->notemodified = 0;
$newentry->noteid = 0;
$newentry->imported = 0;
//print_r($newentry);
//exit;
if (! $newentry->cmid = insert_record("simpleblog_entries", $newentry)) {
error("Could not insert a new blog entry!!");
}
Thanks for the file but still no change
Reading through post.php it appears that for blog types 3 & 4, my set-up is failing to recognise the role of the logged in user. For blog types 1 & 2, I just don't get any option to add a blog entry at all so not sure where that is failing. I'll try your post.php if it has also been changed but think this may be something more fundamental.
Nigel
The only version that I have is v0.7.3 that is attached to the initial post in this thread. I've just pulled a clean version of 1.91 into my development environment (was on 1.9), reinstalled course blog and have exactly the same problems. With teacher only and community blogs, there are no 'add entry' links. With teacher and student individ blogs, and also student only blogs, instances of blogs for participants on the course are created with "add entry' links. However, clicking on a link brings the message that 'You are not allowed to add entries'
Nigel
I also noticed that you are running yours on postgresql. If there is a problem there somewhere, I may not be able to find out what it is - I am on MySQL.
Had to leave this for a couple of days. Still no joy though. Have tried Chris's blogpost.php as well (but don't have a changed post.php).
Had a close look at the error messages. Problem seems to be that courseblog is not recognising the roles; so whatever role I have, c/b thinks it doesn't have permission to either see the 'post new entry' link, or to post if it appears. Have tried all sorts of roles and combinations!
Cheers
Nigel
teacher cannot see students
no edit available
Has anyone found a solution?
Jeff
I've attached a screenshot of a broken blog. I'll have a look through the code later on and see if I can see anything obvious that is causing it to break.
Are you by any chance using custom student and teacher roles (other than the ones that are standard with Moodle install)? Theoretically, course blog should still work with those - but I haven't had a chance to test it to make sure.
Are the blogs meant to work if these roles aren't set? If they do need to be set then there needs to be a warning in the form.
Anyway, once again many thanks for creating this module - it really is fantastic.
Will this version of simpleblog also work with Moodle 1.7?
Regards,
John
I installed it on our 1.7.1+ version and I can setup a course blog. However I am running into the same issue as others, there is no 'add post' link. The roles are set ok (I think) and I've tried the blogpost.php and post.php workaround to no avail.
Any help is much appreciated.
Regards,
John
I think you may be on to something. When I manually change the bloglevel to 4 in the MySql table I get the exact same behavior the Nigel describes in his
Friday the 13th of June 2008, 12:44 PM post.
That is, I do get the blog option block, but when I select 'Add a blog entry', the
'you are not allowed to add blog entries to this blog' message appears.
Regards,
John
Regards,
John
Thank you for this module. I am using it on my high school class page so that students can reflect, journal, and communicate with me privately. As such I have it set to "Students Only" so that only they and I can see their entries. This seems to work fine except for thing: one of my brighter students discovered that if he changed the "bloguser" number in the browsers address bar that he could access and read another students private blog. Yikes! To illustrate, suppose the address bar contained:
"http://www.mydomain.com/moodle/mod/simpleblog/viewStudent.php?id=21&bloguser=45".
If you changed the "bloguser-45" in the to "bloguser=46", keeping everything else the same, you could view the other students blog.
This is a real problem. I am uncomfortable telling students that no one can read their posts when in fact they can.
Is there a fix for this?
<%php
$url_id = $_GET['id'];
$session_id = $_SESSION['user?']['id'];
if($url_id = $session_id)
{
//grant access and view blog entry's.
}
else
{
echo "you don't have the permissions to view this blog";
}
%>
Re: Svar: Re: Course Blog v0.7.3 for Moodle 1.9
The student only page was designed to let anyone that is designated as a teacher in the settings see blog posts, so the first thing I need to ask is if this student that is seeing other posts is maybe a designated TA or something else that is set up as a teacher in the settings. If so, then they will be able to see posts by design. If not, then there is a bug in there somewhere. The code is already present to stop this from happening, so the bug would be in there somewhere.
../mod/simpleblog/viewStudent.php?id=21&bloguser=45
Only teachers should. In my install, when a student logs in and then clicks on a blog that is set up as a "students only" level, they get a link that looks like this:
../mod/simpleblog/view.php?id=21
And they only see their blog. If I then change the link to the first one above, I just get a blank screen. I'll probably need to know the settings for your blog set-up and to be able to look in to this one further.
Is there something else I should set?
Hi,
Just insalled your blog and it looks good. However I've got a few problems:
1. I want to use it for community access but when I create the blog or edit the settings, it doesn't appear to save any changes. I want to change the 'Blog teacher roles' to Teacher, so the teacher of the coure can add posts other than myself as administrator.
2. The 'Last edited' date always defaults to 1 January 1970!
I could delete all the database tables of the course blog and do a fresh install but I am worried I would lose any blog posts I have from an old Simpleblog install.
I am running v 1.9.1+ of Moodle.
Thanks,
Mike
For the second one - I just checked my installation and the dates are working (see below). Has anyone else run in to this? I'm sure what to do unless I get more information.
Has anyone found a solution to the add post problems. I receive the links to add blog post but fails when you try to save the post. Also when using Teacher and Students blogs all users are listed under Teachers and there are no students in the blog list. This is very frustrating as 0.7.3 works great on my development box but no on my production server.
For the add post problems, these are the solutions that I discovered worked on mine:
"Also check to make sure that you did set teacher and student roles and didn't leave those as just "(blank)" - some people here found that was causing some problems. Also, there is something wrong with the way course blog interacts with Moodle. Even if you choose a level, those settings may not stick on initial set-up. You may need to edit the blog and re-submit them to get them in there. I don't know if that is a bug with Moodle or something I need to fix on the course blog in - I am still checking in to that."
Both sites run 1.9.3+ lastest weekly,
mySQL
-
Production=5.0.45
-
development=5.0.51
php
-
production=5.2.0
-
development=5.2.5
However the the production server runs on W2K3 IIS and the development runs on a XAMP stack under WinXP.
I have ensured the roles are not blank and have edited the course blog settings many times to stick the level settings.
Here is the Blog record from the DB
1, 152, '', 'Test Blog', 10, 197, 3, '3', 'y', 'y', '0', 'y', 'y', '5', 'y', '0', 'y'
Hi Matt,
I have discovered the problem. For some reason on my mysql install when the tables get created, some of the fields are supposed to have a null default value. In my case they did not. I corrected these fields and I also discovered problems in other tables not related to simpleblog that resolved a lot of issues I have been having with moodle in general.
Also in regards to some folks having issues with "role" detection for "Student only blogs" where the teacher is detected as a student I found in my instance the Teacher was assigned both the teacher and student role for the course context. You may want to look into having your module detect the highest role a user has for the course context instead of just the first one found in the database.
Patrick