"Netpublish" - demo

"Netpublish" - demo

by Janne Mikkonen -
Number of replies: 23
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...


Average of ratings: -
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Tom Murdock -
When you wake, I'll have some questions. 

But in the meanwhile, thanks!
In reply to Tom Murdock

Re: "Netpublish" - demo

by Janne Mikkonen -
Please, do ask wink
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Tom Murdock -
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&section=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
In reply to Tom Murdock

Re: "Netpublish" - demo

by Janne Mikkonen -
The second one is defenetly my typing mistake sad 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...
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Tom Murdock -
Thanks! Both problems went away!
In reply to Tom Murdock

Re: "Netpublish" - demo

by Janne Mikkonen -
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?
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Tom Murdock -
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?


In reply to Tom Murdock

Re: "Netpublish" - demo

by Janne Mikkonen -
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?
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Tom Murdock -
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.
In reply to Tom Murdock

Re: "Netpublish" - demo

by Janne Mikkonen -
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 -
Average of ratings: Useful (1)
In reply to Tom Murdock

Re: "Netpublish" - demo

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
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.
In reply to Jon Bolton

Re: "Netpublish" - demo

by Janne Mikkonen -
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???
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by W Page -
Hi Janne!

Is this for v1.4.x or v1.5dev??

WP1

In reply to W Page

Re: "Netpublish" - demo

by Janne Mikkonen -
Hi WP1

It should work on both versions smile
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Genner Cerna -
Do you have screenshot or demo site?
In reply to Genner Cerna

Re: "Netpublish" - demo

by Janne Mikkonen -
Unfortunately I don't have a public access demo site sad

But those who dare, download the attachment and try it on your own test sites...
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Janne Mikkonen -
And here is already first fixed version http://julmajanne.com/stuff/netpublish.zip

In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Janne Mikkonen -
Fixed version available at the upper location... (The hole was so big that even m$ could've gone through big grin)
In reply to Janne Mikkonen

Re: "Netpublish" - demo

by Luuk CARNEL -
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 ???



In reply to Luuk CARNEL

Re: "Netpublish" - demo

by Janne Mikkonen -
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).
In reply to Janne Mikkonen

Svar: Re: "Netpublish" - demo

by Anders Berggren -
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

Attachment orsa_Viikkolehti.jpg
In reply to Anders Berggren

Re: Svar: Re: "Netpublish" - demo

by Janne Mikkonen -
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
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...

In reply to Janne Mikkonen

Re: Svar: Re: "Netpublish" - demo

by Janne Mikkonen -
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 -