cog News Features 
FAQs

This is the cog FAQ, it is currently work under development, if you want to help, correct spelling/grammatical errors etc, please email me.

Installing

How do I install cog?
There is a script in the tarball to do the installation for you provided you answer some simple questions.
Firstly untar the distribution and change directory to the distribution then type ./install.pl you will need write access to the http directories on your system (/home/httpd on Red Hat linux). The defaults will work with the default Install of apache on Red Hat linux. The base directory is the directory containing the html and cgi-bin directories but no files are placed here by the install script it is only used to work out sensible locations for the directories. If you do want to put the cog data directory somewhere other than is specificed at the end of the install script then change ../cog part of the line at the top of cog.pl, config.pl and doc.pl which reads something like $dir{base}="../cog"; for cog.pl or chdir("../cog"); for the other scripts to the path of your cog data directory. Once you have it installed you should be able to access it as http://YOURSERVER/cgi-bin/cog.pl

Help, it won't let me login
Check your web user (httpd or nobody) has read and write access to the BASEDIR/cog/users directory (so it can save the ids on login).

How do I disable passwords?
There is a main configuration file for cog located in the cog data directory (cog/config). Open this in your favorite text editor and change the line that reads passwords=1 to passwords=0. You will then get a list of all the avalible users when you load cog

How do I change my (user) theme
Click on the Edit Modules link on the wms control, then click on the wms section, and select the name of the theme you want on the select box

How do I change the default theme
There is a main configuration file for cog located in the cog data directory (cog/config). Open this in your favorite text editor and change the line that reads theme=thin-atom to the name of your favorite theme. This will affect the login page and error messages before login

How do I change the directory location of ...
If you want to put the applets, themes or the users configuration in a different directory from the default then you can change the configuration file (cog/config) to point to this. The directorys are near the top in the format of dir=location just change the location to point to the correct place.

Programming

How do I make an applet
Almost any piece of perl code will go into an applet, the configration hash of the applet is referenced by the reference $$current.
There are several varibles that you can use $dir{data} is the directory for the users storage, $name is the modules title, $base_url is the url that will call cog, $user is the username and $id is the current id (may be needed for forms).
To add the configration to the configuration options there is a file called config.in, the format is very basic - *APPLET_NAME starts a new section and each varible that can be configured is set by a line seperated by colons the format is varible_name:type(select or input):default value:perl code to set the options for the select (put into the array @options)

How do I make a theme
A theme consists of several subroutines called by the main cog code, they all start with theme_ and then either html,section,module followed by _on or _off so in the freshmeat theme for example html starts the html and table, section is for each column and module contains the actual box around the applet. If you want to display differnet modules for different sections there are two varibles $layout_section which contains the section number (it starts at 1) and $layout_numwhich contains the number the module is down on that section (also starting at 1).
The title for a module is refernced by the varible $name and the title for the whole page is in $title. There are also some varibles that can be used to good effect, the total number of sections in a page can be worked out with $layout[0] and the total number of modules in a section can be found out by doing $layout[$layout_section][0]. ($layout is a 2d array, [0] always refeces the number of modules or sections in that part).
I would recommend reading a theme file from cog (cog/themes) as this will show you how to link it all together and several tricks!

Other

Have a question not covered here? Either email it to me or ask it on the cog help forum (requires a sourceforge login).

Download
Latest release is 0.07
Download (tar/gz)
Release Notes

CVS
cog cvsweb
cvs info
nightly cvs tarball

SourceForge
Project Page
Forums
Task Manager
Submit a bug
Hosted by SourceForge

Links
Try cog

Similar Programs
Portaloo
My Portal
Start
SlashCode