Hi all,
I've designed netpublish module for publising online newspaper in a course (at the moment, there will be other interface for publishing outside the course someday...).
It's really really at its early stages but I've managed to (and hopefully working) make a demo version of it so it might not work every possible platform yet... (mine is fedora core 2 with apache 1.3.33 + php 4.3.10 as static module, mysql + postgresql).
There are still a lot of things missing (at the code level, logic level and the big thing: there are no help files available), but it should give some sort of information about what this module is.
Short help:
After unzipping and copying module into mod folder, copy netpublish.php file from /mod/netpublish/lang into your /lang/en directory. Visit admin page (installs the module). Go to your course and add new activity netpublish.
After giving name and short description to netpublish instance you'll be forwarded (this will happen every time when there are no sections found) to section managent interface (lacy mans work, will be re-arranged) where you create sections to your online magazine.
First there is only one section called "Frontpage". This is a pseudo section, it really doesn't exist, so you really need to create sections.
To create new section you just write section name into section name field and press "save changes". If you wish to create sub section, select parent section from sections dropdown menu, write new section name and press "save changes".
When your done with sections, you can start to write articles.
Articles doens't appear into your publication until you publish them.
Short help for user permissions:
Write permission in active only when article isn't publish. When article is published, every student in a course can read it. Write permission is sticky.
Permissions are still incomplete there might be some strange behavior. But basically stronger permission overrides weaker one (write is stronger permission than read, and when this permission is active user have also read permission).
Blah... Me sleep long time now...
When you wake, I'll have some questions.
But in the meanwhile, thanks!
But in the meanwhile, thanks!
Please, do ask
Okay. Early checks:
This one is probably easy for you. I get this warning on this page when viewing a published story: netpublish/view.php?id=276§ion=0&article=8
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
SELECT id, firstname, lastname FROM user WHERE id IN ()
When I save articles as drafts, I get this error and am unable to view pending articles.
Table 'moodle_database.mdl_user' doesn't exist
SELECT a.id, a.publishid, a.title, a.timecreated, a.statusid, a.timemodified, a.userid, a.authors, a.rights, u.firstname, u.lastname, s.name AS status FROM netpublish_status AS s, netpublish_articles AS a INNER JOIN mdl_user AS u ON a.userid = u.id AND statusid != 4 AND a.statusid = s.id ORDER BY a.timecreated DESC
When creating a second instance of netpublish in a course, it should probably route to the netpublish/view.php?id= page rather than the netpublish/sections.php?id= page.
Janne, this is such a useful tool already. Thanks for your work!
I love how additional authors are added to the credit line when they edit the page!
btw, I'm running redhat 9 with mysql
This one is probably easy for you. I get this warning on this page when viewing a published story: netpublish/view.php?id=276§ion=0&article=8
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
SELECT id, firstname, lastname FROM user WHERE id IN ()
When I save articles as drafts, I get this error and am unable to view pending articles.
Table 'moodle_database.mdl_user' doesn't exist
SELECT a.id, a.publishid, a.title, a.timecreated, a.statusid, a.timemodified, a.userid, a.authors, a.rights, u.firstname, u.lastname, s.name AS status FROM netpublish_status AS s, netpublish_articles AS a INNER JOIN mdl_user AS u ON a.userid = u.id AND statusid != 4 AND a.statusid = s.id ORDER BY a.timecreated DESC
When creating a second instance of netpublish in a course, it should probably route to the netpublish/view.php?id= page rather than the netpublish/sections.php?id= page.
Janne, this is such a useful tool already. Thanks for your work!
I love how additional authors are added to the credit line when they edit the page!
btw, I'm running redhat 9 with mysql
The second one is defenetly my typing mistake It should say INNER JOIN {$CFG->prefix}user and not INNER JOIN mdl_user.
I've attached new lib.php. Replace the old lib.php in /mod/netpublish/lib.php with this new one.
- Janne -
ps. or download that fixed version below...
I've attached new lib.php. Replace the old lib.php in /mod/netpublish/lib.php with this new one.
- Janne -
ps. or download that fixed version below...
Thanks! Both problems went away!
For that second question: When creating a
second instance of netpublish in a course, it should probably route to
the netpublish/view.php?id= page rather than the netpublish/sections.php?id= page.
This is because every instance of netpublish have its own sections. Should there be default sections and what would they be?
This is because every instance of netpublish have its own sections. Should there be default sections and what would they be?
Tell me more about your sense of "sections"? Are they like categories of articles that help us define the content?
Newspaper
Literary Magazine
Third Quarter Portfolio
Or are they ways to limit the kind of article that are managed in a given instance of the activity?
Newspaper
Literary Magazine
Third Quarter Portfolio
Or are they ways to limit the kind of article that are managed in a given instance of the activity?
They are like categories. Like in newpaper you'll propably find different kind of sections that group the news in that category. You hardly find sports news among business section.
Every netpublish instance in a course have its own sections or categories. Which would be most describing?
Every netpublish instance in a course have its own sections or categories. Which would be most describing?
I think the term sections is clearer. Thanks.
When I made two instances, the second instance inherited the sections from the first. That was the reason I became confused.
Thanks again.
When I made two instances, the second instance inherited the sections from the first. That was the reason I became confused.
Thanks again.
Well there is HUGE hole in this system, so I'll need to fix it first then it'll work as it should... I'll notify when fixed version is downloadable.
- Janne -
- Janne -
This is really nice work Janne. Is there any chance that articles could be published to more than one category at the same time? For example, a story could be about UK Politics, so could appear in BOTH UK Category AND Politics category.
Well I don't say no since you have a point there. Just have to figure out how to add this in the interface so it doesn't confuse end users... Alternative section prehaps???
Hi Janne!
Is this for v1.4.x or v1.5dev??
WP1
Is this for v1.4.x or v1.5dev??
WP1
Hi WP1
It should work on both versions
It should work on both versions
Do you have screenshot or demo site?
Unfortunately I don't have a public access demo site
But those who dare, download the attachment and try it on your own test sites...
But those who dare, download the attachment and try it on your own test sites...
Fixed version available at the upper location... (The hole was so big that even m$ could've gone through )
I installed your netpublish-module on a 1.5dev Moodle.
database tabels were made succesfully and the module seems te be installed correctly.
When I try to add a new category, i get the "session error" - message....
What is going wrong ???
database tabels were made succesfully and the module seems te be installed correctly.
When I try to add a new category, i get the "session error" - message....
What is going wrong ???
The first double quote was missing from sesskey value. This has been fixed now. If you download the new version and unpack it over your existing one, you'll get rid of this. Or open sections.html and add that missing double qoute in:
value="<?php p($USER->sesskey) ?>" />
- Janne -
ps. I've been busy on another module, but I try to get back on this one in this week and add some new stuff and functionalities in it (its still lacks quite a lot of them).
value="<?php p($USER->sesskey) ?>" />
- Janne -
ps. I've been busy on another module, but I try to get back on this one in this week and add some new stuff and functionalities in it (its still lacks quite a lot of them).
Hei Janne,
You've done it again. A metaphor that most people
are familiar with. A good way of structuring information.
Everything seems to work fine, I am using Win XP, EasyPHP1.7,
and Moodle 1.4.3+. This image bank stuff I don't quite understand
though. Is it an image repository for netpublish creations only?
I tried to upload an image and got this error message:
Coding error: isteacher() should not be used without a valid course id as argument. Please notify a developer.
I managed to uppload images though and now the world is
about to be enriched with Orsa Moodle Viikkolehti that
I, thanks to you, now can be the proud producer of.
Cheers, Anders
This is an interesting error since isteacher function is called only once in imagebank.php script and it allways has proper courseid value as an argument (from database).
So I tested it like this:
Added line in isteacher function in moodlelib.php just after global $USER; call -
notify ('Course id: '. $courseid);
This notify message should appear in imagebank.php's heading only once but after fileupload it appears twice, first with proper course id value and second time course id value is turned to zero???
I'll keep diggin' it...
ps. Almost forgot...
"This image bank stuff I don't quite understand
So I tested it like this:
Added line in isteacher function in moodlelib.php just after global $USER; call -
notify ('Course id: '. $courseid);
This notify message should appear in imagebank.php's heading only once but after fileupload it appears twice, first with proper course id value and second time course id value is turned to zero???
I'll keep diggin' it...
ps. Almost forgot...
"This image bank stuff I don't quite understand
though. Is it an image repository for netpublish creations only?"
Image banks are for netpublishes only. You can access these images through database only and if you look under your <datarootdir>/netpublish you can see why...
Image banks are for netpublishes only. You can access these images through database only and if you look under your <datarootdir>/netpublish you can see why...
After long longish search I found what is causing this error message. But it's not the netpublish what makes it but uploadlib's calm_log_upload function wich calls add_to_log function. And calm_log_upload set courseid value to zero.
- Janne -
- Janne -