January 11, 2007

EditThisPagePHP offers collaboration without the wiki

Author: Dmitri Popov

If you want to share your knowledge and ideas with others, you set up a blog. If you want to collaboratively edit Web pages and keep track of changes, you use a wiki. If you need a tool that allows you to quickly set up a page that combines blog and wiki features, with some content versioning capabilities thrown in, you need something like EditThisPagePHP, a PHP script that allows you to create Web pages and do some clever things with them.

While ETP won't replace a dedicated blog or wiki, it can come in handy as an ad hoc collaboration solution. For example, if you're running a wiki system that doesn't allow users to add comments, you can create a dedicated ETP-enabled page for exactly that purpose. Similarly, if you need to add some wiki-like pages to your blog, you can quickly do so using ETP.

ETP doesn't require any database back end; all the data is stored in plain text files. Moreover, using ETP, you can control who has access to the ETP-enabled pages by creating user accounts and assigning different roles (i.e. access privileges) to each account.

To install ETP (or rather, to create an ETP-enabled page), copy the install-etp.php script into a folder in the document root on your Web server and make sure that both the script and the folder are writable by the server. Point your browser to the installer script, and an installation wizard guides you through the process of creating an ETP-enabled page and helps you to specify the page's settings, including the following:

  • Guest and user accounts and assign a role to each account.
  • Email notifications. If this option is enabled, ETP will send an email to the specified email address each time the page is modified.
  • The pages' properties, such as name and title.
  • Two RSS feeds: one showing the recent versions of the page, and another showing the modifications made to the page (additions and deletions).

The ETP installer prompts you to enable guest access to the created page, which allows other users to view (but not edit) it. It's a good idea to leave the feature enabled, otherwise visitors won't be able to access pages. In theory, if you disable guest access, visitors would be required to log in in order to view pages. In reality, however, this feature disabling guest access doesn't work properly, throwing a string of error messages, so leave it as it is for the time being.

The ETP installer allows you to set up multiple user accounts. Each account can have one of the three default roles: Guest, Editor, and Super-user. You might want to create generic accounts for each role, which you can then dispense to other users. You can add and modify privileges of the default roles and define new roles, along with other ETP settings, by editing the installation script. This does require some working knowledge of PHP, but the supplied documentation provides some useful pointers.

Once ETP is installed, point your browser to the created page. By default, the page contains just a few elements, such as the page title, links to the RSS feeds specified during the setup, and two buttons: Display Hidden Area and Edit This Page. Pressing the former reveals an area that allows visitors to leave comments, while the latter allows you to switch to the page editing mode.

The editing area is conveniently divided into three sections -- header, body, and footer -- and you can add content and apply formatting to all three of them using good old HTML. If you've created several ETP-enabled pages, you have to edit them separately. This may not be particularly practical, but you have to keep in mind that ETP is designed to manage just a couple of pages, not a full-blown Web site. ETP can also handle images, but you need to upload them first to a separate image folder in the same directory as the ETP-enabled page using the Upload images button. If you want to upload multiple images, you can do so using an FTP client. Upload images into the pagename-images folder (e.g. mypage-images if the name of the page is "mypage"), and they automatically appear in the list of available images when you switch to the editing mode.

You can also add comments to a page and send and manage trackbacks. More importantly, you can delete unwanted comments, which can help you to stop comment spammers. There is no any automatic way to stop comments spam (like, for example, WordPress provides with Akismet). In a blog-like manner, ETP allows you to send notification pings to Technorati and blo.gs to help make your page more visible.

Besides the editing area, the edit page contains editing tools typical in most wikis. The Page History button gives you access to previous versions of a page, and you can compare different editions as well as view and delete selected page versions. Using the Rename button, you can rename the current page, while the Create button allows you to create new ETP-enabled pages. However, you can't "ETP-enable" an existing static page.

ETP does have its limitations. It doesn't include any WYSIWYG editing tools, so you need a workable knowledge of HTML to format the page's content. Adding new roles and specifying privileges is not for the faint-hearted either. And if you're using blogging software, there is no easy way to give the ETP-enabled pages the look and feel of your site. But all things considered, ETP is a useful tool if you need to set up a page that allows you to collaborate with other users here and now.

Dmitri Popov is a freelance writer whose articles have appeared in Russian, British, German, and Danish computer magazines.

Click Here!