using CMSimple for teaching

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
fabien
Posts: 6
Joined: Sat Mar 28, 2009 4:58 pm

using CMSimple for teaching

Post by fabien » Sat Mar 28, 2009 9:44 pm

Hi all
I'm a computer science teacher and I have a course to learn to 14 years old pupils how to make a web site. I am using Dreamweaver this year, but the software is too complex for young pupils and doesn't give pretty results. More than that, it doesn't respect the web standards and it's not a free software.
I was looking for a good CMS for next year, and I think that CMSimple is what I need. But I have several requests to adapt this wonderful software to my exact needs.

1) Adding/Deleting a page is too complex. I need something faster and simpler. The MenuManager plugin is to heavy for what I need : I just want new page/new subpage/delete page buttons in the WYSIWYG editor. I wrote the code for this directly in adm.php (I just copied and modified the code that save the page). Can somebody tell me if this is the right way to proceed ? Can I add this type of functionality via a addon or a plugin to integrate it in a cleaner way ?

2) Multiuser. The configuration is the following : CMSimple is installed on the server, client computers access it via their browser (for content edition and media upload) and via the local network (for template edition). I want one content file and one configuration file per user. I also want a private image and download space for each user. Regarding the templates, I have a collection of downloaded template in a locked folder. At the beginning the user can apply every template to choose the one that best fit. Then he can choose one template that will be copied on its private user space so that he can edit it (I mean change images and colors). The best thing would be to add a locking feature so that if to pupils are connected under the same user name, there will be no conflict.
Again, I managed to implement this multiuser feature but I don't know how to integrate it properly. Can I submit the code somewhere on SVN so that the improvement will be included in the next CMSimple version ?

3) Save-Restore : pupils should be able to save their work, continue to add content and change template at home and bring back their modifications on the school server. So everything that needs to be saved shall be located in one folder (this is done by the mutiuser feature) and this folder should be saved/restored easily and securely. Also, as children will use CMSimple at home, the complete installation process have to be easy.

4) The cherry on the cake would be to have an "export" feature, so that when the website is finished I can export the pages in html format and publish the site on a server without php.

To sum-up, the aim of this post is to know if somebody else is interested by theses features and what is the best way for me to integrate it into CMSimple.

Fabien

PatrikGC
Posts: 117
Joined: Wed Jun 18, 2008 9:34 am

Re: using CMSimple for teaching

Post by PatrikGC » Tue Apr 28, 2009 12:31 pm

1/ Yes, you can use Menumanager for creating and deleting pages. It's easy and good. The only problem is the 3 levels (H1 H2 H3).
2/ Multiuser is possible with a pluging, but, at the begining, CMSimple is a CMS for ONE administrator.
3/ Same answer : CMSimple = ONE administrator. But with a pluging or modify the functions.php file...
4/ In the Parameters menu, you can export a html file, you click on the content page and you save it in the web navigator, or you open it for modify and after : copy and past. Same thing with the archives pages.

Finally, the good question is : is CMSimple the good Cms for you ? :)

CMSimple-Styles.com
Posts: 342
Joined: Thu Jun 26, 2008 8:19 pm
Location: Germany
Contact:

Re: using CMSimple for teaching

Post by CMSimple-Styles.com » Tue Apr 28, 2009 5:25 pm

Dreamweaver does not respect web standards? I think there is no software that respects web standards more than Dreamweaver. How did you come to that conclusion? Or are you working with a very old version?

@PatrikGC
The latest free menumanager supports more then 3 levels!!

fabien
Posts: 6
Joined: Sat Mar 28, 2009 4:58 pm

Re: using CMSimple for teaching

Post by fabien » Wed Apr 29, 2009 10:25 am

Thanks for your replies.
Patrik, I think you did not understand my question, perhaps I was not clear enought. For 1),2), and 3), I succeded in programming the features I describe. The problem I have is : "what is the best way to integrate those features in CMSimple" ?
For exemple, take the feature n°2. The code I have today is not clean because is it included directly in cms.php file. My idea is very simple : I added a 'users' folder to the root, and each subfolder is representing a separate user and is containing it's own copy of content, template and images files. In the each user folder, an index.php files includes the cmsimple core script :

Code: Select all

<?php include('./../../cmsimple/cms.php'); ?>
Then I simply replaced the begining of cms.php file by

Code: Select all

if (@is_dir('./../../users/')){
	$pth['folder']['base'] = './../../';
	$pth['folder']['user'] = './';
	$user=true;
}else if (@is_dir('./cmsimple/')){
	$pth['folder']['base'] = './';
	$pth['folder']['user'] = $pth['folder']['base'];
	$user=false;
}else {
	$pth['folder']['base'] = './../';
	$pth['folder']['user'] = $pth['folder']['base'];
	$user=false;
}
and a bit after

Code: Select all

$pth['folder']['cmsimple'] = $pth['folder']['base'].'cmsimple/';
$pth['file']['image'] = $pth['folder']['cmsimple'].'image.php';
$pth['file']['log'] = ($user ? $pth['folder']['user'].'log.txt' : $pth['folder']['cmsimple'].'log.txt');
$pth['file']['cms'] = $pth['folder']['cmsimple'].'cms.php';
$pth['file']['config'] = ($user ? $pth['folder']['user'].'config.php' : $pth['folder']['cmsimple'].'config.php');
To access to user toto's site, you just have to go to the address :

Code: Select all

http://myCMSimpleSite/users/toto
Then all data concerning this user will be contained in users/toto folder :

Code: Select all

/cmsimple/
 content
 images
 templates
 users
     toto
         content
             content.htm
         downloads
         images
         templates
         config.php
         index.php
Then I added some extra code to easily create a new user, and that's it !
How can I turn this into a plugin or function or whatever ? CMSimple is an open source software, so I expect to be able to modify the code for my needs and then redistribute it. Can you help me to achieve this ? If I succeed, I have plenty of ideas to enhance this wonderful program, such as a WYSIWYG interface to modify the stylesheet and widgets to add jQuery power.

Concerning Menumanager, I think it is useful for complex operations such as moving pages and restructuring the entire site. But for simple "insert page" operation, it's too heavy. The initial technique of setting the title to H1 or H2 is good, but people that have no idea about HTML and even less idea about the internal structure of CMSimple will not understand it. Si I added a button that link to a code located in adm.php, just after the save code :

Code: Select all

if ($adm && $f == 'newpage') {

	if ($fh = @fopen($pth['file']['content'], "w")) {
		fwrite($fh, '<html><head>'.head().'</head><body>'."\n");
		$insert=$cl;
		
		//for each header
		foreach($c as $j => $i) {
			fwrite($fh, rmnl($i."\n"));
			
			//if it's the current page, calculate where to insert the new page
			if($j == $s){
				$insert=$j;
				// skip all subpages if any
				while(($insert < $cl) and ($l[$insert+1] > $l[$s]))	$insert++;
			}
			if($j == $insert) fwrite($fh,"<h".$l[$s].">Titre".$l[$s]."</h".$l[$s].">\n");
		}
		fwrite($fh, '</body></html>');
		fclose($fh);
		rfc();
	}
	//display newly inserted page
	$s=$insert+1;
}
For the question 4), what I need is not to have a html file containing the text content, but a buch of htlm files that will look exactly like the site but without php server computation. I want to be able to publish my work on a server that will not have php engine. But I think this is a little too complex for now.

Finally, to answer your last question
is CMSimple the good Cms for you ?
Yes, it is ! I did not find any other database-less CMS that is so simple, that fullfil my point 3), and that have a good user community which propose lots of templates.

Thanks again to help me to solve my problems.

fabien
Posts: 6
Joined: Sat Mar 28, 2009 4:58 pm

Re: using CMSimple for teaching

Post by fabien » Wed Apr 29, 2009 11:13 am

To answer to the moderator of CMSimple Style, Yes, I am working on the old 8 version of Dreamweaver. Perhaps the latest version is better, I did not test it.
But the fact that there is no other WYSIWYG software that respect more web standards than Dreamweaver does not make Dreamweaver a good web standard compliant software. It just means that other software are worse ...

majke
Posts: 6
Joined: Thu Apr 02, 2009 8:22 am

the locking feature

Post by majke » Wed May 27, 2009 1:32 pm

Hi, I'm interested in the locking feature,
I don't need CMSimple to be multiuser, I would just like to avoid that two users edit the same content.
Is there a simple way of doing it in php or some plugin that would help by showing if someone is connected ?
Thanks for your replies.

fabien
Posts: 6
Joined: Sat Mar 28, 2009 4:58 pm

Re: the locking feature

Post by fabien » Thu May 28, 2009 8:40 am

Hi Majke
Perhaps what you are looking can be achieved by the MemberPage plugin : http://www.cmsimplewiki.com/doku.php/pl ... emberpages.
But if you have only one user (one password), there is no way for the server to know that more than one people is connected. To achieve that, you should implement session and it's not a "simple way of doing it in php". So I think the first thing you should do is enabling multiuser support.

The implementation I have done for multiuser doesn't work like this. Basically, it's exactly like if you had several cmsimple instances installed : each user has its own content page, template and configuration file. I've added this feature because I want to use it in a classroom and I don't want to have one CMSimple instance for each pupil.

majke
Posts: 6
Joined: Thu Apr 02, 2009 8:22 am

Re: the locking feature

Post by majke » Thu May 28, 2009 9:53 am

fabien wrote: But if you have only one user (one password), there is no way for the server to know that more than one people is connected. To achieve that, you should implement session and it's not a "simple way of doing it in php".
Thanks for your help, I tried MemberPage plugin but it is not what I'm looking for.
If sessions are complicated in php maybe we can just write some boolean in one file, check it at every login, and write the message "Someone is editing this website right now!" if it is true. Is it possible?

Tata
Posts: 3588
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: using CMSimple for teaching

Post by Tata » Thu May 28, 2009 1:57 pm

A basic installation of CMSimple is only a couple of kB each. With some plugins it may rise up to 2-3 MB. This is really not that much. In this case the multi-instance installation seems to be the easiest way to have one installation for each pupil.
I have this way built a portal for our local government. There is one main installation for mayor and town hall (with a simple HTML switchboard leading to all other instances) and 15 installations in their own subdirectories (each with its own administrator). Averything works fine. The plugins' structure is the same in all instances (8 plugins in each + pluginloader). The whole portal (incl. all uploaded documents - minutes, protocols etc.) is about 30 MB after 1 year of function.
If whatever goes wrong in a prticular instance, there is only need to check one installation). IMHO this can be done very fast and without any further complications. Usually I only need to re-copy the basic files.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

fabien
Posts: 6
Joined: Sat Mar 28, 2009 4:58 pm

Re: using CMSimple for teaching

Post by fabien » Thu May 28, 2009 6:52 pm

Hi Tata, thanks for your advice.
In my case, it's not 15 instances that I need, but ... more than 50 ! And it's not a matter of disk occupation, but a question of easy deployment. Here is the scenario : For each class, I will have approximately 8 groups of 4 students each. When a group will choose its thema, I will have to create a CMSimple instance and change the login information (it means copy files, edit config.php, ...). Then the group will have to browse among all the templates to choose one. It means that I will have to copy all the templates for each group, but they will finally use only one.
With my solution, all this is done in one click, via the user interface. When the main administrator creates a new user, the folder with all needed files is created automatically, and password is set to the user name. Then the new user can browse among the templates that are available for the main user. Once the user has chosen a template, another command in the web interface can copy this template to the user private directory so that it can modify it without disturbing the others. The main advantage is that you do not need to know how it works to use it and create a new user.

What about the easy way to create and delete pages, using a button right in the edit window ? Do you think it's useful ?

But I still haven't found how to integrate all this in a plugin. Can anybody help me on this issue ? I tried to find djots famous tutorial with its example_plugin, but I could not manage to find it in the official documentation. How this can be ? I found one zip file with this exemple-plugin here :http://www.cmsimpleforum.com/viewtopic. ... =164&p=909 that has been posted by you I think, but it's incomplete (admin.php is missing) and not working on my configuration. I use pluginloader v 2.0 beta 9. When I use djot's example_plugin v3.0 beta1, the plugin doesn't appear in the list (because admin.php is missing) and when I add the scripting code is my page, the result is just a blue rectangle. The example_plugin v1.0 works fine, but I can't understand how I can call it from the edit window (with a tinymce custom button for example).

Could you tell me :
1/ if this example_plugin is still up-to-date ?
2/ Do you think the code I've written in one of the previous posts can be put in a plugin ? Specifically, how can I change the template and config file path ? Can I just add a call to one of my plugin functions at the beginning of cms.php ? Is ther something cleaner ?
3/ Do you think it's useful to create this plugin ? If this is not useful, I can leave the code like that and share my modified version of CMSimple on SourceForge.

Thanks again for your help.

To majke : I have to think a little more about it. But the file you mention already exists : it's /cmsimple/log.txt. But what if the admin forget to logout ? Are we stuck forever ? Keep in touch !
Last edited by fabien on Fri May 29, 2009 7:27 am, edited 1 time in total.

Post Reply